/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fafcfa;
  --bg-secondary: #f0f4f0;
  --bg-hover: #e6ebe6;
  --bg-active: #d4e5d6;
  --text: #1e2b1f;
  --text-secondary: #5a6b5c;
  --text-muted: #8a9a8c;
  --border: #d4ddd5;
  --primary: #3a5a40;
  --primary-hover: #2d4a33;
  --primary-light: #dce8dd;
  --danger: #b5403a;
  --danger-hover: #943430;
  --success: #3a7a42;
  --warning: #c08a20;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(30,43,31,0.08);
  --shadow-lg: 0 6px 20px rgba(30,43,31,0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  --toolbar-height: 48px;
  --status-height: 28px;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  height: 100vh;
}

.hidden { display: none !important; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 2px 6px rgba(58,90,64,0.25); }
.btn-secondary { background: var(--bg-secondary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-small { padding: 3px 10px; font-size: 12px; }
.btn-large { padding: 12px 28px; font-size: 16px; }
.btn-icon { padding: 6px 10px; border: none; background: transparent; font-size: 18px; }
.btn-icon:hover { background: var(--bg-hover); border-radius: var(--radius); }

/* ── Inputs ── */
input[type="text"], input[type="search"], textarea, select {
  padding: 7px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  width: 100%;
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(58,90,64,0.1); }
.search-input { background: var(--bg-secondary); }

/* ── Home View ── */
#home-view {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(145deg, #e8efe5 0%, #d6e4e0 40%, #dce3da 100%);
}
.home-container {
  text-align: center;
  max-width: 440px;
  padding: 48px 40px 40px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}
.home-logo { margin-bottom: 28px; }
.logo-icon {
  width: 160px; height: 160px; display: block; margin: 0 auto 16px; border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}
.logo-small-img { width: 20px; height: 20px; vertical-align: middle; border-radius: 50%; margin-right: 2px; }
.home-logo h1 {
  font-size: 34px; font-weight: 700; margin-bottom: 6px;
  letter-spacing: -0.5px; color: #2c3e2d;
}
.home-subtitle {
  color: #6b7f6c; font-size: 15px; font-weight: 400; letter-spacing: 0.2px;
}
.home-actions {
  display: flex; flex-direction: column; gap: 10px; margin: 28px 0 24px;
}
.home-actions .btn-large {
  padding: 14px 28px; font-size: 15px; font-weight: 500;
  border-radius: 10px; letter-spacing: 0.1px;
}
.home-actions .btn-secondary {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.home-actions .btn-secondary:hover {
  background: rgba(58,90,64,0.07);
}
.user-setup { margin-top: 20px; text-align: left; }
.user-setup label { display: block; font-size: 13px; color: #6b7f6c; font-weight: 500; }
.user-setup input {
  margin-top: 6px; border-radius: 8px; border: 1.5px solid #c5d1c5;
  padding: 8px 12px; width: 100%; font-size: 14px;
  background: rgba(255,255,255,0.8);
  transition: border-color 0.2s;
}
.user-setup input:focus { outline: none; border-color: #3a5a40; }
.recent-projects { text-align: left; }
.recent-projects h3 { font-size: 12px; color: #6b7f6c; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.recent-item {
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}
.recent-item:hover { background: rgba(58,90,64,0.08); }
.warning {
  padding: 12px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius);
  font-size: 13px;
  color: #664d03;
  margin-bottom: 16px;
}
.home-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(58,90,64,0.12);
  font-size: 12px;
  color: #8a9a8c;
  line-height: 1.7;
}
.home-version {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.home-credit .heart { color: #b5403a; }
.home-link {
  color: #3a5a40;
  text-decoration: none;
  font-weight: 500;
}
.home-link:hover { text-decoration: underline; }

/* ── Toolbar ── */
#toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--toolbar-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.toolbar-left { display: flex; align-items: center; gap: 16px; }
.logo-small { font-size: 15px; font-weight: 600; color: var(--primary); letter-spacing: -0.3px; }
.project-name { font-size: 13px; color: var(--text-muted); }
.toolbar-nav { display: flex; gap: 2px; }
.tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.toolbar-right { display: flex; align-items: center; gap: 12px; }
.sync-status { font-size: 12px; color: var(--success); }
.user-display { font-size: 13px; color: var(--text-secondary); }

/* ── Panels ── */
#panels {
  display: flex;
  height: calc(100vh - var(--toolbar-height) - var(--status-height));
}
.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
#panel-left { width: 260px; min-width: 180px; border-right: 1px solid var(--border); }
#panel-center { flex: 1; }
#panel-right { width: 280px; min-width: 200px; border-left: 1px solid var(--border); }
.panel.collapsed { width: 0 !important; min-width: 0 !important; overflow: hidden; border: none; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

/* ── Resizer ── */
.resizer {
  width: 4px;
  cursor: col-resize;
  background: transparent;
  flex-shrink: 0;
  transition: background 0.15s;
}
.resizer:hover, .resizer.active { background: var(--primary); opacity: 0.6; }

/* ── Source List ── */
.source-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: background 0.1s;
}
.source-item:hover { background: var(--bg-hover); }
.source-item.active { background: var(--bg-active); border-left-color: var(--primary); font-weight: 500; }
.source-icon { font-size: 16px; flex-shrink: 0; }
.source-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-group-header {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  cursor: default;
}

/* ── Note List ── */
.note-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}
.note-item:hover { background: var(--bg-hover); }
.note-item.active { background: var(--bg-active); }

/* ── Document Viewer ── */
.doc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}
.doc-toolbar-right { width: 200px; }
.doc-viewer {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  line-height: 1.6;
  background: #fff;
}
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Document content */
.doc-content { position: relative; }
.doc-page {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--border);
}
.doc-page-num {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Transcript */
.transcript-cue {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--bg-secondary);
}
.cue-time {
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
  width: 90px;
}
.cue-speaker {
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cue-text { flex: 1; font-size: 14px; }

/* Highlight (coded segments) */
mark.code-highlight {
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}
.code-highlight:hover { outline: 2px solid rgba(0,0,0,0.15); }

/* Segment popover (uncode) */
.segment-popover {
  position: fixed;
  z-index: 2000;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px 14px;
  min-width: 180px;
  max-width: 300px;
}
.segment-popover-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 13px;
}
.segment-popover-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.3;
}

/* ── Code Panel ── */
.code-search-bar {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.code-tree { padding: 4px 0; }
.code-node {
  user-select: none;
}
.code-node-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 13px;
  border-radius: var(--radius-sm);
  margin: 0 4px;
  transition: background 0.1s;
}
.code-node-row:hover { background: var(--bg-hover); }
.code-node-row.active { background: var(--bg-active); font-weight: 500; }
.code-expander {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.code-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.code-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 0 6px;
  border-radius: 10px;
  flex-shrink: 0;
}
.code-children { padding-left: 16px; }
.code-children.collapsed { display: none; }

/* ── Selection Context ── */
.selection-context {
  border-top: 1px solid var(--border);
  padding: 12px;
  flex-shrink: 0;
  max-height: 250px;
  overflow-y: auto;
}
.selection-header { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.selection-text {
  font-size: 13px;
  color: var(--text);
  background: var(--bg-secondary);
  padding: 8px;
  border-radius: var(--radius-sm);
  max-height: 80px;
  overflow-y: auto;
  margin-bottom: 8px;
  line-height: 1.4;
}
.selection-actions { display: flex; flex-direction: column; gap: 6px; }

#quick-code-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 120px;
  overflow-y: auto;
}
.quick-code-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.quick-code-item:hover, .quick-code-item.quick-code-selected { background: var(--bg-hover); }

/* ── Status Bar ── */
#status-bar {
  display: flex;
  align-items: center;
  height: var(--status-height);
  padding: 0 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  gap: 8px;
}
.status-sep { color: var(--border); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,43,31,0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--bg);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(30,43,31,0.18);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-header h2 { font-size: 17px; font-weight: 600; color: var(--text); }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { margin-bottom: 20px; color: var(--text-secondary); line-height: 1.5; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; }

/* ── Context Menu ── */
.context-menu {
  position: fixed;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(30,43,31,0.15);
  z-index: 2000;
  min-width: 180px;
  padding: 4px 0;
}
.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}
.context-menu-item:hover { background: var(--bg-hover); }
.context-menu-item.danger { color: var(--danger); }
.context-menu-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Tab Content ── */
.tab-content { display: none; height: calc(100vh - var(--toolbar-height) - var(--status-height)); overflow: auto; }
.tab-content.active { display: flex; flex-direction: column; }
#tab-queries, #tab-visualizations, #tab-irr { padding: 24px; }

/* ── Form Groups ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.form-row { display: flex; gap: 12px; align-items: flex-end; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { font-weight: 600; color: var(--text-secondary); font-size: 12px; text-transform: uppercase; background: var(--bg-secondary); }

/* ── Heatmap ── */
.heatmap-cell {
  width: 40px;
  height: 28px;
  text-align: center;
  font-size: 12px;
  line-height: 28px;
}

/* ── Color picker ── */
.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 8px;
}
.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}
.color-swatch:hover, .color-swatch.selected { border-color: var(--text); }

/* ── Drag & Drop ── */
.drag-over { outline: 2px dashed var(--primary); outline-offset: -2px; background: var(--primary-light); }
.dragging { opacity: 0.5; }

/* ── Quill overrides ── */
.ql-container { font-family: var(--font); font-size: 14px; }
.ql-editor { min-height: 120px; }

/* ── Theme Badges on Codes ── */
.code-theme-badges { display: flex; gap: 3px; flex-shrink: 0; }
.code-theme-badge {
  font-size: 10px;
  padding: 0 5px;
  border-radius: 8px;
  white-space: nowrap;
  font-weight: 500;
  line-height: 16px;
}

/* ── Themes Panel ── */
#tab-themes { padding: 24px; }
.themes-toolbar { margin-bottom: 20px; }
.themes-list { display: flex; flex-direction: column; gap: 12px; max-width: 700px; }
.theme-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg);
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}
.theme-card:hover { box-shadow: var(--shadow-lg); }
.theme-card.drag-over { outline: 2px dashed var(--primary); }
.theme-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.theme-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}
.theme-name { font-weight: 600; font-size: 15px; flex: 1; }
.theme-stats { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.theme-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}
.theme-codes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.theme-code-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-secondary);
  border-radius: 12px;
  font-size: 12px;
  cursor: default;
}
.theme-code-remove {
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 2px;
  line-height: 1;
}
.theme-code-remove:hover { color: var(--danger); }
.theme-add-code-btn { font-size: 11px !important; }

/* Theme code selector in modal */
.theme-code-selector {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.theme-code-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 13px;
  cursor: pointer;
}
.theme-code-option input[type="checkbox"] { flex-shrink: 0; }

/* ── Charts ── */
.chart-container { max-width: 800px; margin: 0 auto; }
.viz-tabs { display: flex; gap: 8px; margin-bottom: 24px; }

/* ── Code Explorer ── */
.explorer-container {
  display: flex;
  height: 100%;
  overflow: hidden;
}
.explorer-sidebar {
  width: 240px;
  min-width: 200px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.explorer-sidebar-header {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.explorer-code-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.explorer-code-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  transition: background 0.1s;
}
.explorer-code-item:hover { background: var(--bg-hover); }
.explorer-code-item.selected { background: var(--bg-active); font-weight: 600; }
.explorer-code-item .code-color {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}
.explorer-code-item .code-count {
  margin-left: auto; color: var(--text-muted); font-size: 11px; font-weight: 400;
}
.explorer-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.explorer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.explorer-toolbar .mode-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font);
  transition: all 0.15s;
}
.explorer-toolbar .mode-btn:hover { background: var(--bg-hover); }
.explorer-toolbar .mode-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.explorer-toolbar .explorer-sep {
  width: 1px; height: 20px; background: var(--border); margin: 0 4px;
}
.explorer-toolbar .explorer-sort-select {
  font-size: 12px; padding: 3px 6px; border: 1px solid var(--border);
  border-radius: 4px; background: var(--bg); font-family: var(--font);
}
.explorer-toolbar .explorer-search {
  width: 160px; font-size: 12px; padding: 3px 8px;
}
.explorer-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.explorer-segment-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.explorer-segment-card:hover { box-shadow: var(--shadow); }
.explorer-segment-card.focused { border-color: var(--primary); }
.explorer-segment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  align-items: center;
}
.explorer-segment-text {
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--text);
}
.explorer-segment-speaker {
  font-weight: 600;
  color: var(--text-secondary);
}
.explorer-segment-code-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
}
/* Compare mode */
.explorer-compare {
  display: flex;
  gap: 12px;
  height: 100%;
  overflow: hidden;
}
.explorer-compare-column {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.explorer-compare-header {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.explorer-compare-summary {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.explorer-cooccurs-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  background: var(--warning);
  color: white;
  font-weight: 500;
}
/* Group mode */
.explorer-group-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 52px;
  margin-bottom: 12px;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.explorer-group-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.explorer-group-zone-label {
  font-size: 12px;
  color: var(--text-muted);
}
.explorer-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-secondary);
  border-radius: 12px;
  font-size: 12px;
}
.explorer-group-chip .remove {
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1;
}
.explorer-group-chip .remove:hover { color: var(--danger); }
.explorer-stats {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
