/* controls.css — Toolbar, buttons, sidebar detail panel, legend */

/* ===== Toolbar Controls ===== */
.select-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.select-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.select-group select {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 5px;
  padding: 4px 8px;
  font-family: var(--font-main);
  font-size: 12px;
  cursor: pointer;
  max-width: 160px;
  text-overflow: ellipsis;
}

.btn {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

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

.btn-primary:hover {
  background: #5558e6;
}

#pathway-select {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 5px;
  padding: 4px 8px;
  font-family: var(--font-main);
  font-size: 12px;
  max-width: 170px;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* ===== Canvas Bounding Box Overlay ===== */
#canvas-bbox-overlay {
  display: none;
  position: absolute;
  border: 2px dashed var(--primary);
  pointer-events: none;
  z-index: 4;
  box-sizing: border-box;
}

/* ===== Settings Overlay (bottom-right) ===== */
#settings-overlay {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 7;
}

#btn-settings {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.15s;
  line-height: 1;
}

#btn-settings:hover,
#btn-settings.active {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

#settings-popup {
  display: none;
  position: absolute;
  bottom: 42px;
  right: 0;
  background: var(--bg-overlay);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.14);
  padding: 10px 14px;
  min-width: 280px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  flex-direction: column;
  gap: 8px;
}

#settings-popup.open {
  display: flex;
}

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

.settings-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 80px;
}

.settings-val {
  font-size: 10px;
  color: var(--text-secondary);
  min-width: 20px;
  text-align: center;
}

.settings-divider {
  height: 1px;
  background: var(--border-light);
  margin: 2px 0;
}

#settings-popup input[type="range"] {
  flex: 1;
  cursor: pointer;
  min-width: 60px;
}

#settings-popup input[type="number"] {
  width: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 3px 4px;
  font-family: var(--font-main);
  font-size: 11px;
  text-align: center;
}

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

/* ===== Settings Toggle Switch ===== */
.settings-toggle {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.settings-toggle input {
  display: none;
}

.toggle-track {
  width: 30px;
  height: 16px;
  background: var(--border);
  border-radius: 8px;
  position: relative;
  transition: background 0.15s;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
}

.settings-toggle input:checked + .toggle-track {
  background: var(--primary);
}

.settings-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(14px);
}

.btn-sm {
  padding: 3px 10px;
  font-size: 11px;
}

.settings-hint {
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ===== Snap Alignment Guides ===== */
#snap-guide-h, #snap-guide-v {
  display: none;
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

#snap-guide-h {
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed var(--primary);
}

#snap-guide-v {
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed var(--primary);
}

/* ===== Mode Toggle (Highlight / Isolate) ===== */
.mode-toggle-group {
  display: flex;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  overflow: hidden;
}

.mode-toggle {
  display: flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.15s;
  border-right: 1px solid var(--border-light);
  user-select: none;
}

.mode-toggle:last-child {
  border-right: none;
}

.mode-toggle input[type="radio"] {
  display: none;
}

.mode-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
}

.mode-toggle.active {
  background: var(--primary);
  color: #fff;
}

/* ===== Legend ===== */
#legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  font-size: 11px;
  line-height: 1.3;
}

#legend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  cursor: default;
}

#legend.collapsed #legend-header {
  padding-bottom: 8px;
}

#legend-toggle {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 4px;
  border-radius: 3px;
  line-height: 1;
}

#legend-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

#legend-body {
  padding: 0 14px 10px;
}

#legend.collapsed #legend-body {
  display: none;
}

.legend-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-line {
  width: 22px;
  height: 0;
  border-top: 2px solid #555566;
  flex-shrink: 0;
}

.legend-line-dashed {
  width: 22px;
  height: 0;
  border-top: 2px dashed #999aaa;
  flex-shrink: 0;
}

.legend-divider {
  height: 1px;
  background: var(--border-light);
  margin: 5px 0;
}

/* ===== Zoom Controls ===== */
#zoom-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 6;
}

#zoom-controls button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.15s;
  line-height: 1;
}

#zoom-controls button:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

/* (Image toggle, font size, and node size controls are now inside #settings-popup) */

/* ===== Dropdown ===== */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 10;
  min-width: 180px;
  padding: 4px;
  flex-direction: column;
}

.dropdown-menu.open {
  display: flex;
}

.dropdown-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  border: none;
  background: none;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 5px;
  white-space: nowrap;
}

.dropdown-menu button:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
}

/* ===== Meta Evaluation Modal ===== */
#meta-eval-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 50;
  justify-content: center;
  align-items: center;
}

#meta-eval-backdrop.open {
  display: flex;
}

#meta-eval-modal {
  background: var(--bg-card);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  width: 85vw;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#meta-eval-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}

#meta-eval-title {
  font-weight: 600;
  font-size: 15px;
}

#meta-eval-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0 4px;
}

#meta-eval-close:hover {
  color: var(--text-primary);
}

#meta-eval-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-overlay);
}

.meta-eval-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

#meta-eval-runs {
  display: flex;
  gap: 4px;
}

#meta-eval-runs .run-btn {
  padding: 4px 12px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--bg-overlay);
  font-size: 11px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

#meta-eval-runs .run-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

#meta-eval-runs .run-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

#meta-eval-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
}

#meta-eval-radar {
  text-align: center;
  margin-bottom: 20px;
}

#meta-eval-radar-img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

#meta-eval-content {
  line-height: 1.6;
  font-size: 13px;
}

/* ===== Evaluation Panel ===== */
#eval-panel {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  z-index: 6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  font-size: 11px;
  line-height: 1.4;
  max-width: 360px;
  min-width: 200px;
  display: none;
  transition: all 0.2s ease;
}

#eval-panel.visible {
  display: block;
}

#eval-panel.minimized #eval-panel-body {
  display: none;
}

#eval-panel.minimized {
  min-width: auto;
}

#eval-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  cursor: default;
}

#eval-panel.minimized #eval-panel-header {
  border-bottom: none;
}

#eval-panel-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#eval-panel-toggle {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 4px;
  border-radius: 3px;
  line-height: 1;
}

#eval-panel-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

#eval-panel-body {
  padding: 10px 12px;
  max-height: 400px;
  overflow-y: auto;
}

.eval-score-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  margin-bottom: 4px;
}

.eval-score-label {
  flex: 0 0 auto;
  color: var(--text-muted);
  min-width: 110px;
  font-size: 10px;
}

.eval-score-bar-bg {
  flex: 1;
  height: 4px;
  background: var(--bg-page);
  border-radius: 2px;
  overflow: hidden;
}

.eval-score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

.eval-score-value {
  font-weight: 600;
  min-width: 32px;
  text-align: right;
  font-size: 10px;
}

.eval-badge-approved {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  background: rgba(22,163,74,0.12);
  color: var(--success);
}

.eval-badge-rejected {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  background: rgba(220,38,38,0.12);
  color: var(--danger, #dc2626);
}

.eval-feedback {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 6px;
  word-break: break-word;
}

.eval-suggestions {
  margin-top: 6px;
  padding-left: 14px;
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.eval-suggestions li {
  margin-bottom: 3px;
}

.eval-problematic {
  margin-top: 4px;
  font-size: 10px;
  color: var(--warning);
}

.eval-divider {
  height: 1px;
  background: var(--border-light);
  margin: 6px 0;
}

.eval-section-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 6px 0 4px 0;
}

/* Pathway info within eval panel */
.eval-pathway-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 4px;
}

.eval-pathway-desc {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 6px;
  word-break: break-word;
}

.eval-pathway-seq {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin-bottom: 6px;
}

.eval-seq-step {
  font-size: 9px;
  font-family: var(--font-mono, monospace);
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--text-primary);
  cursor: default;
}

.eval-seq-arrow {
  font-size: 10px;
  color: var(--text-muted);
  margin: 0 1px;
}

.eval-pathway-intermediates {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.eval-intermediate-chip {
  font-size: 9px;
  background: rgba(34,197,94,0.1);
  color: var(--success, #22c55e);
  border-radius: 3px;
  padding: 1px 6px;
  font-weight: 500;
}

/* ===== Sidebar ===== */
#sidebar {
  width: 340px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 8;
  box-shadow: -2px 0 8px rgba(0,0,0,0.06);
}

#sidebar.open {
  transform: translateX(0);
}

#sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#sidebar-header h3 {
  font-size: 13px;
  font-weight: 700;
}

#sidebar-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

#sidebar-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

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

.sidebar-section h4 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.sidebar-section p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.sidebar-kv {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 3px;
  gap: 8px;
}

.sidebar-kv .kv-key {
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-kv .kv-val {
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

/* Score bar */
.score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 5px;
}

.score-label {
  flex: 0 0 auto;
  color: var(--text-muted);
  min-width: 100px;
}

.score-bar-bg {
  flex: 1;
  height: 5px;
  background: var(--bg-page);
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.score-value {
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.badge-grounded {
  background: rgba(22,163,74,0.12);
  color: var(--success);
}

.badge-speculative {
  background: rgba(217,119,6,0.12);
  color: var(--warning);
}

.badge-env {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}

.badge-Hydrothermal { background: #7c3aed; }
.badge-Surface { background: #92400e; }
.badge-Biochemical { background: #16a34a; }

.badge-role {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}

.badge-starting { background: #3b82f6; }
.badge-intermediate, .badge-hub_intermediate { background: #22c55e; }
.badge-target { background: #f97316; }

/* Citation */
.citation {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
  padding-left: 8px;
  border-left: 2px solid var(--border-light);
}

.citation a {
  color: var(--primary);
  text-decoration: none;
}

.citation a:hover {
  text-decoration: underline;
}

/* ===== ChemOrigins Side Panel ===== */
#chemorigins-panel {
  width: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  transition: width 0.3s ease, min-width 0.3s ease;
  display: flex;
  flex-direction: column;
}

#chemorigins-panel.open {
  width: 45vw;
  min-width: 320px;
}

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

#chemorigins-panel-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#chemorigins-panel-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

#chemorigins-panel-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

#chemorigins-panel-body {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chemorigins-panel-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* ChemOrigins reference */
.chemorigins-ref {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.chemorigins-ref h5 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.ref-key {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.ref-reaction-str {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
  word-break: break-word;
}

/* ===== Markdown Modal ===== */
#md-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 50;
  justify-content: center;
  align-items: center;
}

#md-modal-backdrop.open {
  display: flex;
}

#md-modal {
  background: var(--bg-card);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  width: 70vw;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#md-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

#md-modal-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

#md-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1;
}

#md-modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

#md-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
}

/* Markdown content typography */
#md-modal-body h1 { font-size: 22px; font-weight: 700; margin: 20px 0 10px; }
#md-modal-body h2 { font-size: 18px; font-weight: 700; margin: 18px 0 8px; }
#md-modal-body h3 { font-size: 15px; font-weight: 700; margin: 16px 0 6px; }
#md-modal-body h4 { font-size: 13px; font-weight: 700; margin: 14px 0 4px; }
#md-modal-body h5, #md-modal-body h6 { font-size: 12px; font-weight: 700; margin: 12px 0 4px; }

#md-modal-body p { margin: 0 0 10px; }

#md-modal-body ul, #md-modal-body ol { padding-left: 20px; margin: 0 0 10px; }
#md-modal-body li { margin-bottom: 4px; }

#md-modal-body blockquote {
  border-left: 3px solid var(--primary);
  padding: 6px 14px;
  margin: 10px 0;
  color: var(--text-secondary);
  background: var(--bg-page);
  border-radius: 0 4px 4px 0;
}

#md-modal-body pre {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  margin: 10px 0;
}

#md-modal-body code {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  background: var(--bg-page);
  padding: 1px 5px;
  border-radius: 3px;
}

#md-modal-body pre code {
  background: none;
  padding: 0;
}

#md-modal-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
  font-size: 12px;
}

#md-modal-body th, #md-modal-body td {
  border: 1px solid var(--border-light);
  padding: 6px 10px;
  text-align: left;
}

#md-modal-body th {
  background: var(--bg-page);
  font-weight: 600;
}

#md-modal-body hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 16px 0;
}

#md-modal-body a {
  color: var(--primary);
  text-decoration: none;
}

#md-modal-body a:hover {
  text-decoration: underline;
}

#md-modal-body strong { font-weight: 700; }
#md-modal-body em { font-style: italic; }

/* Meta eval content inherits same markdown typography */
#meta-eval-content h1 { font-size: 22px; font-weight: 700; margin: 20px 0 10px; }
#meta-eval-content h2 { font-size: 18px; font-weight: 700; margin: 18px 0 8px; }
#meta-eval-content h3 { font-size: 15px; font-weight: 700; margin: 16px 0 6px; }
#meta-eval-content h4 { font-size: 13px; font-weight: 700; margin: 14px 0 4px; }
#meta-eval-content h5, #meta-eval-content h6 { font-size: 12px; font-weight: 700; margin: 12px 0 4px; }
#meta-eval-content p { margin: 0 0 10px; }
#meta-eval-content ul, #meta-eval-content ol { padding-left: 20px; margin: 0 0 10px; }
#meta-eval-content li { margin-bottom: 4px; }
#meta-eval-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 6px 14px;
  margin: 10px 0;
  color: var(--text-secondary);
  background: var(--bg-page);
  border-radius: 0 4px 4px 0;
}
#meta-eval-content pre {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  margin: 10px 0;
}
#meta-eval-content code {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  background: var(--bg-page);
  padding: 1px 5px;
  border-radius: 3px;
}
#meta-eval-content pre code { background: none; padding: 0; }
#meta-eval-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
  font-size: 12px;
}
#meta-eval-content th, #meta-eval-content td {
  border: 1px solid var(--border-light);
  padding: 6px 10px;
  text-align: left;
}
#meta-eval-content th {
  background: var(--bg-page);
  font-weight: 600;
}
#meta-eval-content hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 16px 0;
}
#meta-eval-content a { color: var(--primary); text-decoration: none; }
#meta-eval-content a:hover { text-decoration: underline; }
#meta-eval-content strong { font-weight: 700; }
#meta-eval-content em { font-style: italic; }

.md-modal-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 14px;
}
