/* ─── Theme definitions ─────────────────────────────────────── */
.theme-macos-dark {
  --bg:             #141414;
  --surface:        #1c1c1e;
  --surface-2:      #2c2c2e;
  --border:         #3a3a3c;
  --text:           #e8e8e8;
  --text-secondary: #ababab;
  --muted:          #636366;
  --accent:         #0a84ff;
  --accent-hover:   #0071e3;
  --warning:        #ff9f0a;
  --success:        #30d158;
  --danger:         #ff453a;
}

/* ─── Reset / base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

input[type=range] { cursor: pointer; accent-color: var(--accent); }

/* ─── Top bar ───────────────────────────────────────────────── */
#top-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

#app-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-right: 4px;
  white-space: nowrap;
  user-select: none;
}

.top-bar-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

.top-bar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Top bar buttons ───────────────────────────────────────── */
.menu-btn {
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 11px;
}
.menu-btn:hover { background: var(--surface-2); color: var(--text); }

.top-btn {
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text);
}
.top-btn:hover { background: var(--border); }

.freeze-btn { padding: 5px 12px; font-weight: 500; }
.freeze-live  { background: var(--accent) !important; color: #fff !important; }
.freeze-live:hover  { background: var(--accent-hover) !important; }
.freeze-frozen { background: var(--surface-2) !important; color: var(--text-secondary) !important; }
.freeze-frozen:hover { background: var(--border) !important; }

/* ─── Dropdown menus ────────────────────────────────────────── */
.menu-group { position: relative; }

.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  min-width: 160px;
  z-index: 200;
  padding: 4px;
}

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--text);
}
.dropdown-item:hover { background: var(--surface-2); }

/* ─── Detect panel (wider) ──────────────────────────────────── */
.detect-panel { min-width: 280px; padding: 8px; }

.detect-section { margin-bottom: 10px; }
.detect-section:last-child { margin-bottom: 0; }

.detect-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

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

.detect-label {
  font-size: 10px;
  color: var(--text-secondary);
  width: 72px;
  flex-shrink: 0;
}

.detect-row input[type=range] { flex: 1; }

.detect-val {
  font-size: 10px;
  color: var(--text-secondary);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.detect-actions { display: flex; gap: 4px; margin-top: 6px; }

.detect-btn {
  flex: 1;
  padding: 5px 8px;
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 10px;
  color: var(--text);
}
.detect-btn:hover { background: var(--border); }

/* ─── Camera panel dropdown ─────────────────────────────────── */
.camera-panel { width: 320px; overflow: hidden; }
.camera-panel .detect-val { width: auto; min-width: 55px; text-align: right; font-size: 11px; white-space: nowrap; }
.camera-panel-header { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.camera-select-dropdown { width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 4px; padding: 4px; font-size: 12px; }
.pixel-format-dropdown { background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 3px; padding: 1px 4px; font-size: 11px; }
.camera-info-line { font-size: 11px; color: var(--muted); margin-top: 4px; }
.camera-panel-section { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.camera-panel-buttons { display: flex; gap: 6px; margin-top: 6px; }

/* ─── Main layout ───────────────────────────────────────────── */
#main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ─── Viewer ────────────────────────────────────────────────── */
#viewer {
  flex: 1;
  background: #0a0a0a;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#stream-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

body.no-camera #stream-img {
  width: 100%;
  height: 100%;
}

#overlay-canvas {
  position: absolute;
  top: 0; left: 0;
}

/* ─── Coordinate HUD ────────────────────────────────────────── */
#coord-display {
  position: absolute;
  bottom: 52px;
  left: 12px;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  color: var(--muted);
  pointer-events: none;
}

#zoom-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  z-index: 10;
}
#zoom-badge:hover { background: rgba(0, 0, 0, 0.8); }
#zoom-presets {
  position: absolute;
  bottom: 30px;
  right: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 0;
  z-index: 11;
  min-width: 80px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
#zoom-presets[hidden] { display: none; }
.zoom-preset-btn {
  display: block;
  width: 100%;
  padding: 4px 12px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 11px;
  font-family: ui-monospace, monospace;
  text-align: right;
  cursor: pointer;
}
.zoom-preset-btn:hover { background: var(--surface-3); }

/* ─── Drop overlay ──────────────────────────────────────────── */
#drop-overlay {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(10,132,255,.08);
  border: 2px dashed var(--accent);
  border-radius: 4px;
  pointer-events: none;
}
#drop-overlay.visible  { display: flex; }
#drop-overlay.drag-active {
  background: rgba(10,132,255,.18);
  border-color: var(--accent-hover);
}
.drop-message {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

/* ─── Floating tool strip ───────────────────────────────────── */
#tool-strip {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,30,.96);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 4px 16px rgba(0,0,0,.6);
}

.strip-btn {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 10px;
  color: var(--text-secondary);
}
.strip-btn:hover { background: var(--surface-2); color: var(--text); }
.strip-btn.active { background: var(--accent); color: #fff; font-weight: 500; }
.strip-btn.active:hover { background: var(--accent-hover); }

.overflow-btn { color: var(--muted); padding: 5px 8px; }
.overflow-btn:hover { background: var(--surface-2); color: var(--text-secondary); }

.strip-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}

/* ─── Overflow popup ────────────────────────────────────────── */
#overflow-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.6);
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  min-width: 140px;
}

/* ─── Sidebar ───────────────────────────────────────────────── */
#sidebar {
  width: 200px;
  min-width: 140px;
  max-width: 500px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
}
#sidebar-resize {
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 20;
  overflow: hidden;
  flex-shrink: 0;
}

.template-info {
  padding: 4px 10px;
  font-size: 11px;
  color: var(--accent);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.template-badge { font-weight: 600; white-space: nowrap; }

.sidebar-section {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
}

.measurements-section {
  flex: 1;
  overflow-y: auto;
}

.section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
  user-select: none;
}

.section-toggle {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}
.section-toggle.open { margin-bottom: 8px; }

.chevron { color: var(--border); font-size: 9px; }

/* ─── Measurement list ──────────────────────────────────────── */
#measurement-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.measurement-item {
  background: var(--surface-2);
  border-radius: 7px;
  padding: 5px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  position: relative;
}
.measurement-item:hover { background: var(--border); }
.measurement-item.selected { outline: 1px solid var(--accent); }

.measurement-name {
  font-size: 10px;
  color: var(--text);
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  min-width: 0;
}

.measurement-value {
  font-size: 10px;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  margin-left: 4px;
}

.measurement-delete {
  display: none;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--danger);
  font-size: 13px;
  padding: 0 3px;
  line-height: 1;
}
.measurement-item:hover .measurement-delete { display: block; }

@keyframes copied-flash {
  0%   { background: var(--accent); }
  100% { background: var(--surface-2); }
}
.measurement-item.copied { animation: copied-flash 0.4s ease; }

/* ─── Camera section ────────────────────────────────────────── */
.camera-section { padding: 8px 12px; }

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

.camera-label {
  font-size: 9px;
  color: var(--muted);
  width: 24px;
  flex-shrink: 0;
}

.camera-value {
  font-size: 9px;
  color: var(--text-secondary);
  width: 54px;
  text-align: right;
  flex-shrink: 0;
}

.camera-row input[type=range] { flex: 1; }

.camera-info {
  margin-top: 4px;
  font-size: 9px;
  color: var(--muted);
  line-height: 1.5;
}

/* ─── Sidebar status bar ────────────────────────────────────── */
#sidebar-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  margin-top: auto;
}

#status-text {
  font-size: 10px;
  color: var(--muted);
}

/* ─── Calibration button ────────────────────────────────────── */
.cal-btn {
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.cal-btn.uncalibrated {
  background: rgba(255,159,10,.15);
  border-color: rgba(255,159,10,.4);
  color: var(--warning);
}
.cal-btn.uncalibrated:hover { background: rgba(255,159,10,.25); }

.cal-btn.calibrated {
  background: rgba(48,209,88,.15);
  border-color: rgba(48,209,88,.4);
  color: var(--success);
}
.cal-btn.calibrated:hover { background: rgba(48,209,88,.25); }

/* ─── No-camera mode ────────────────────────────────────────── */
body.no-camera .camera-section { display: none; }

/* ─── Settings dialog ───────────────────────────────────────── */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.dialog-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 360px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.7);
  overflow: hidden;
}

.dialog-content-wide { width: 520px; }

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.dialog-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.dialog-close {
  font-size: 14px;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
}
.dialog-close:hover { background: var(--surface-2); color: var(--text); }

.dialog-tabs {
  display: flex;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.settings-tab {
  padding: 5px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.settings-panel {
  display: none;
  flex-direction: column;
  padding: 14px 16px;
  overflow-y: auto;
  min-height: 300px;
}
.settings-panel.active { display: flex; }
.settings-panel-spacer { flex: 1; }

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

.settings-label {
  font-size: 11px;
  color: var(--text-secondary);
  width: 90px;
  flex-shrink: 0;
}

.settings-value { font-size: 11px; color: var(--text); }

.settings-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.settings-input:focus { border-color: var(--accent); }

.settings-select {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}

.settings-btn {
  padding: 5px 12px;
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text);
}
.settings-btn:hover { background: var(--border); }

.settings-save-btn {
  padding: 6px 16px;
  background: var(--accent);
  border-radius: 7px;
  font-size: 11px;
  color: #fff;
  font-weight: 500;
  margin-top: 4px;
}
.settings-save-btn:hover { background: var(--accent-hover); }

.swatch-row { display: flex; gap: 5px; }
.swatch {
  width: 20px; height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}
.swatch:hover, .swatch.selected { border-color: var(--text); }

.settings-row input[type=range] { flex: 1; }

.settings-status {
  padding: 6px 16px 10px;
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
  min-height: 26px;
}

/* ─── Help dialog ───────────────────────────────────────────── */
.help-body {
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
}

.help-body table { width: 100%; border-collapse: collapse; font-size: 11px; }
.help-body th {
  text-align: left;
  color: var(--muted);
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.help-body td { padding: 5px 8px; color: var(--text); }
.help-body tr:nth-child(even) td { background: var(--surface-2); }
.help-body kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: ui-monospace, monospace;
  font-size: 10px;
}

/* ─── DXF overlay controls ──────────────────────────────────── */
.dropdown-section-label {
  padding: 4px 12px 2px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dxf-row {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px;
}
.dxf-label { font-size: 10px; color: var(--text-secondary); width: 52px; flex-shrink: 0; }
.dxf-value { font-size: 10px; color: var(--text); width: 40px; text-align: right; }
.dxf-input { width: 72px; font-size: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; color: var(--text); padding: 2px 4px; }
.dxf-unit  { font-size: 9px; color: var(--muted); }
.dxf-nudge { font-size: 9px; padding: 2px 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; color: var(--text); cursor: pointer; }
.dxf-nudge:hover { background: var(--border); }
.dxf-btn   { font-size: 10px; padding: 3px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; color: var(--text); cursor: pointer; }
.dxf-btn:hover { background: var(--border); }
.dxf-btn.danger { color: var(--danger); }
.dxf-btn.danger:hover { background: var(--danger); color: #fff; }
.dxf-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.dxf-status { font-size: 10px; padding: 4px 12px; color: var(--text-secondary); }

/* ─── Inspection result table ──────────────────────────────── */
.inspection-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
}
.inspection-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.inspection-count {
  font-size: 10px;
  color: var(--text-secondary);
  margin-left: auto;
}
.inspection-chevron {
  color: var(--border);
  font-size: 9px;
}
.inspection-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}
.inspection-table th {
  text-align: left;
  padding: 3px 6px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.inspection-table td {
  padding: 3px 6px;
  border-bottom: 1px solid var(--surface-2);
}
.badge-pass  { color: var(--success); font-weight: 600; }
.badge-warn  { color: var(--warning); font-weight: 600; }
.badge-fail  { color: var(--danger);  font-weight: 600; }
.badge-unmatched { color: var(--muted); }
.insp-source {
  color: var(--text-secondary);
  font-size: 8px;
  font-weight: 600;
  margin-left: 4px;
}
/* ─── Measurement group headers ─────────────────────────── */
.meas-group-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.meas-group-header:hover { background: var(--surface-2); }
.meas-group-chevron { font-size: 8px; color: var(--muted); width: 10px; }
.meas-group-label { color: var(--text); }
.meas-group-count { color: var(--muted); font-weight: 400; }
.meas-group-member { padding-left: 12px; }
.elevate-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  padding: 0 4px;
  border-radius: 3px;
  cursor: pointer;
  margin-right: 2px;
}
.elevate-btn:hover { color: var(--text); background: var(--surface-3); }
.meas-group-end {
  height: 2px;
  background: var(--border);
  margin: 2px 8px;
}

/* ─── Inspection group headers ─────────────────────────── */
.insp-group-header td {
  padding: 4px 6px;
  font-weight: 600;
  font-size: 10px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.insp-group-name {
  display: flex;
  align-items: center;
  gap: 4px;
}
.insp-chevron {
  font-size: 8px;
  color: var(--muted);
  width: 10px;
}
.insp-group-count {
  color: var(--muted);
  font-weight: 400;
}
.insp-mode {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}
.mode-punch { background: rgba(251, 146, 60, 0.3); color: #fb923c; }
.mode-die { background: rgba(96, 165, 250, 0.2); color: #60a5fa; }
.insp-num {
  display: inline-block;
  min-width: 14px;
  text-align: center;
  font-size: 8px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 3px;
}
.insp-detail-row td {
  padding-left: 18px;
}
.insp-detail-row:hover {
  background: var(--surface-3);
}
.insp-group-header:hover td {
  background: var(--surface-2);
}

/* ─── Context menu ───────────────────────────────── */
#context-menu {
  position: fixed;
  z-index: 1000;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 0;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
#context-menu[hidden] { display: none; }
.ctx-item {
  display: block;
  width: 100%;
  padding: 6px 14px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.ctx-item:hover { background: var(--surface-3); }
.ctx-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--border);
}

#label-tooltip {
  position: fixed;
  z-index: 1001;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: var(--text);
  line-height: 1.5;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  pointer-events: none;
  white-space: pre-line;
}
#label-tooltip[hidden] { display: none; }

/* ─── SPC Dashboard ────────────────────────────────────────── */
.spc-panel { border-bottom: 1px solid var(--border); }
.spc-controls { padding: 6px 10px; display: flex; gap: 6px; }
.spc-select { flex: 1; background: var(--surface-2); color: var(--fg); border: 1px solid var(--border); border-radius: 4px; padding: 3px; font-size: 11px; }
#spc-chart { width: 100%; height: 180px; display: block; }
#spc-cpk-summary { padding: 6px 10px; font-size: 11px; }
.cpk-good { color: #32d74b; }
.cpk-marginal { color: #ff9f0a; }
.cpk-bad { color: #ff453a; }
