@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

:root {
  /* v0.23.0 — tokens follow F13LD.lab (suite UI); --sweep is the tool accent.
     Old names kept as aliases so existing markup follows the new palette. */
  --bg:#06080f; --panel-1:#111118; --panel-2:#0e0e1a; --panel-3:#0a0c14;
  --line:#2a2a3a; --line-2:#3a3a5a; --line-green:#1a2a1a;
  --ink:#e0e0ff; --ink-2:#b8b8d0; --ink-mute:#888; --ink-dim:#555;
  --green:#1D9E75; --neon:#c8f542;
  --sweep:#E39B4A;        /* on-dark accent: tool name, values, active marks */
  --sweep-deep:#633806;   /* brand stroke: Run, selected fills */
  --sweep-tile:#FAEEDA;   /* brand tile: text on --sweep-deep, header icon tile */
  --sweep-soft:rgba(99,56,6,0.30);
  --sweep-ring:rgba(227,155,74,0.45);
  --sweep-tint:rgba(227,155,74,0.06);

  --surface:var(--panel-1); --panel:var(--panel-2);
  --border:var(--line); --border2:var(--line-2);
  --text:var(--ink-2); --muted:var(--ink-mute); --muted2:var(--ink-dim);
  --accent:var(--sweep); --accent2:var(--green); --accent3:#a86c30;
  --warn:#f59e0b; --success:#34d399; --bad:#fb7185;
  --mono:'JetBrains Mono', ui-monospace, monospace;

  /* Rank colors — three distinguishable hues for filter ranks */
  --rank1:#c8f542; --rank2:#1D9E75; --rank3:#b598d4;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Exo 2', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Brand-compliant clean dark surface — no decorative grid or noise overlays.
   Per F13LD Brand Guidelines: background #06080c (or #06080f), tool panels #111118.
   Decorative texture overlays were removed in v0.2 — they conflicted with the
   sidebar surface and clashed with the F13LD palette. */

/* Layout */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
  flex-shrink: 0;
  padding: 0 16px;
  border-bottom: 0.5px solid var(--line-green);
  background: var(--bg);
  position: relative;
  z-index: 10;
}

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

.fh-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.fh-wm {
  font-family: 'Exo 2', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.fh-div {
  width: 0.5px;
  height: 24px;
  background: #1a2a1a;
}

.fh-tool {
  font-family: 'Exo 2', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sweep);
}

.fh-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fh-ver {
  font-family: 'Exo 2', system-ui, sans-serif;
  font-size: 10px;
  color: #2a3a2a;
  letter-spacing: 0.1em;
}

.fh-ico {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FAEEDA;  /* Sweep tile color */
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Sidebar */
.section-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5f9470;
  padding: 0 0 6px;
}

.section-label:first-child { margin-top: 0; }

/* Recipe card — unified drop + loaded state */
.recipe-card {
  margin: 0;
  border: 1.5px dashed var(--border2);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
  min-height: 56px;
}

.recipe-card:hover { border-color: var(--accent); background: rgba(227,155,74,0.03); }
.recipe-card.loaded { border-style: solid; border-color: rgba(227,155,74,0.25); background: rgba(227,155,74,0.04); }

/* Form controls */
.control-group {
  padding: 0 16px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.control-label {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

input[type=number] {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.2s;
}

input[type=number]:focus { border-color: var(--accent); }

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

select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 7px 10px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a6a7a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

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

/* Filter ranks */
.rank-block {
  margin: 0 16px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.rank-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
}

.rank-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rank-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.rank-row select { font-size: 10.5px; }

.direction-toggle {
  display: flex;
  border: 1px solid var(--border2);
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}

.direction-toggle button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.direction-toggle button.active {
  background: var(--panel);
  color: var(--accent);
}

.threshold-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  transition: opacity 0.15s ease;
}

.threshold-row.inactive {
  opacity: 0.35;
  pointer-events: none;
}

.threshold-row.inactive::after {
  content: 'no metric — filter off';
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--warn);
  margin-top: 2px;
  letter-spacing: 0.05em;
}

.threshold-row input[type=number] { font-size: 11px; padding: 5px 8px; }

/* Run button */
/* Preview panel */
.preview-panel {
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  animation: fadeUp 0.4s 0.15s ease both;
  display: flex;
  flex-direction: column;
}

.preview-body {
  position: relative;
  flex: 1;
  min-height: 200px;
  background: #06080f;
  display: flex;
  align-items: center;
  justify-content: center;
}

#previewCanvas {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.3s, filter 0.3s ease;
}

#previewCanvas.visible { opacity: 1; }

/* Sweep-pause state: dimmed + desaturated to communicate that animation is suspended.
   Last-rendered frame stays on screen so the user has visual context. */
#previewCanvas.paused { filter: grayscale(0.5) brightness(0.45); }

.preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
  text-align: center;
}

.preview-empty.hidden { opacity: 0; pointer-events: none; }

.preview-info {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.preview-info.visible { opacity: 1; }

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

.panel-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.panel-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  color: var(--muted);
}

.log-body {
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  min-height: 120px;
  max-height: 200px;
  overflow-y: auto;
}

.log-body::-webkit-scrollbar { width: 3px; }
.log-body::-webkit-scrollbar-thumb { background: var(--border2); }

.log-line { display: flex; gap: 12px; }
.log-time { color: var(--muted2); flex-shrink: 0; }
.log-line.info .log-msg { color: var(--text); }
.log-line.success .log-msg { color: var(--success); }
.log-line.warn .log-msg { color: var(--warn); }
.log-line.accent .log-msg { color: var(--accent); }

/* Results table */
.results-panel {
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: 10px;
  animation: fadeUp 0.4s 0.2s ease both;
  flex: 1;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

.table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}

th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
  padding: 9px 8px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
  background: var(--panel-2);
  position: sticky;
  top: 0;
  z-index: 1;
}

th:hover { color: var(--accent); }

th .sort-indicator {
  display: inline-block;
  margin-left: 5px;
  opacity: 0.3;
  font-size: 10px;
  transition: opacity 0.15s, color 0.15s;
}

th.sort-asc .sort-indicator,
th.sort-desc .sort-indicator {
  opacity: 1;
  color: var(--accent);
}

thead tr {
  border-bottom: 1px solid var(--sweep-ring) !important;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(227,155,74,0.03); }
tbody tr.selected-row { background: rgba(227,155,74,0.07) !important; outline: 1px solid rgba(227,155,74,0.25); outline-offset: -1px; }
tbody tr.hovered-row { background: rgba(227,155,74,0.04) !important; }

td {
  padding: 7px 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

td.muted { color: var(--muted); }

/* Directional stiffness group dividers */
td.td-group-start, th.td-group-start {
  border-left: 1.5px solid var(--border2);
}
td.td-group-end, th.td-group-end {
  border-right: 1.5px solid var(--border2);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid;
}

.rank-badge.r1 { color: var(--rank1); border-color: var(--rank1); background: rgba(200,245,66,0.08); }
.rank-badge.r2 { color: var(--rank2); border-color: var(--rank2); background: rgba(29,158,117,0.08); }
.rank-badge.r3 { color: var(--rank3); border-color: var(--rank3); background: rgba(181,152,212,0.08); }
.ref-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 9px; border: 1px dashed var(--neon-ring, #c8f542); color: var(--neon, #c8f542); font: 600 9.5px var(--mono); letter-spacing: 0.06em; }

/* Mode toggle buttons */
.mode-toggle-group {
  display: flex;
  border: 1px solid var(--border2);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.mode-toggle-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 4px 9px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.mode-toggle-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.mode-toggle-btn.active { background: var(--panel); color: var(--accent); }
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-title {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 12px;
  color: var(--muted2);
}

/* Progress bar */
.progress-wrap {
  margin: 0 16px 12px;
  display: none;
  flex-shrink: 0;
}

.progress-wrap.visible { display: block; }

.progress-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Term toggles */
.terms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 16px;
  margin-bottom: 12px;
}

.term-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  transition: all 0.15s;
  user-select: none;
}

.term-toggle:hover { border-color: var(--border2); color: var(--text); }

.term-toggle input { display: none; }

.term-toggle.checked {
  border-color: rgba(227,155,74,0.3);
  background: rgba(227,155,74,0.06);
  color: var(--accent);
}

.term-check {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border2);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}

.term-toggle.checked .term-check {
  background: var(--accent);
  border-color: var(--accent);
}


@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar global */
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }

/* ── v0.23.0 components (Lab style) ─────────────────────────────── */
.pill-btn {
  font-family: 'Exo 2', system-ui, sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; padding: 4px 12px; border-radius: 20px;
  border: 0.5px solid var(--sweep-ring); background: var(--sweep-soft);
  color: var(--sweep-tile); cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pill-btn:hover:not(:disabled) { background: rgba(99,56,6,0.5); }
.pill-btn.ghost { border-color: var(--line); background: transparent; color: var(--ink-mute); }
.pill-btn.ghost:hover:not(:disabled) { color: var(--sweep); border-color: var(--sweep); }
.pill-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pill-btn:focus-visible, .row-btn:focus-visible, tbody tr:focus-visible, .mode-toggle-btn:focus-visible {
  outline: 1px solid var(--sweep); outline-offset: 1px;
}

/* per-row push buttons: Lab / Mesh */
td.td-actions { text-align: right; padding-right: 10px; overflow: visible; }
th.th-actions { text-align: right; padding-right: 10px; cursor: default; }
.row-btn {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; line-height: 1;
  padding: 3px 7px; border-radius: 4px; cursor: pointer; background: transparent;
  border: 0.5px solid var(--line-2); color: var(--ink-mute); transition: color 0.15s, border-color 0.15s;
}
.row-btn + .row-btn { margin-left: 4px; }
.row-btn:hover { color: var(--sweep); border-color: var(--sweep); }
.row-btn.lab:hover  { color: #E06A6F; border-color: #E06A6F; }
.row-btn.mesh:hover { color: var(--neon); border-color: var(--neon); }
th.th-rank, td.td-rank { width: 40px; text-align: center; }
th.th-actions, td.td-actions { width: 104px; }

/* panel header actions wrap instead of overflowing */
.panel-header { flex-wrap: wrap; gap: 8px; }
.ph-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.ph-note { font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* selected-design detail panel: every metric, no horizontal scroll */
.detail-panel { display: none; border-bottom: 0.5px solid var(--line); background: var(--panel-3); padding: 10px 16px 12px; }
.detail-panel.open { display: block; }
.dp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dp-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.dp-sub { font-family: var(--mono); font-size: 10px; color: var(--ink-dim); flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.dp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 14px; max-height: 128px; overflow-y: auto; }
.dp-sep { grid-column: 1 / -1; font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: #5f9470; margin-top: 6px; }
.dp-item { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 10.5px; border-bottom: 0.5px solid var(--line-soft, #1a1a2a); padding: 2px 0; min-width: 0; }
.dp-item .k { color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-item .v { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dp-item.shown .k { color: var(--sweep); }

/* v0.24.0 — solver line (GPU adapter or CPU) under the Solver label */
.solver-status { font-family: var(--mono); font-size: 9px; color: var(--muted); margin: -2px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.solver-status.gpu { color: var(--green); }
.direction-toggle button:disabled { opacity: 0.35; cursor: not-allowed; }

/* v0.24.0 — stiffness flags: a dot on the rank cell, a dotted underline on a
   modulus the pores' stand-in stiffness props up */
td.td-rank { position: relative; }
.sflag { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn, #E39B4A); }
.sflag-val { border-bottom: 1px dotted var(--warn, #E39B4A); }

/* ════════════════════════════════════════════════════════════════
   v0.25.0 — layout A: design space (hero) + inspector over the
   full-width results table; settings in the Configure drawer above a
   dock (as F13LD.lab). Active controls neon; Sweep's amber stays for the
   tool name, header tile and Run.
   ════════════════════════════════════════════════════════════════ */
:root { --neon-soft: rgba(200,245,66,0.10); --neon-ring: rgba(200,245,66,0.45);
        --s1:#0c0e16; --s2:#12141f; --s3:#181b29; --hair:rgba(255,255,255,0.07); --hair2:rgba(255,255,255,0.13);
        --t1:#e4e6f2; --t2:#9a9fb7; --t3:#5f6582; }

/* header: recipe chip + exports */
.recipe-chip { min-height: 0; height: 30px; display: flex; align-items: center; max-width: 440px; min-width: 150px; flex: 0 1 auto;
  border: 1px solid var(--hair2); border-radius: 8px; background: var(--s1); border-style: solid; cursor: pointer; }
.recipe-chip.loaded { border-color: var(--hair2); background: var(--s1); }
.recipe-chip:hover { border-color: var(--neon-ring); background: var(--s1); }
.recipe-chip #recipeEmpty { flex-direction: row !important; padding: 0 10px !important; gap: 6px !important; }
.recipe-chip #recipeEmpty .empty-icon, .recipe-chip #recipeEmpty > div:first-child { font-size: 12px !important; opacity: 0.6 !important; }
.recipe-chip #recipeLoaded { padding: 0 8px 0 10px !important; display: none; min-width: 0; width: 100%; }
.recipe-chip.loaded #recipeLoaded { display: flex !important; align-items: center; gap: 8px; }
.recipe-chip #recipeLoaded > div:first-child { margin: 0 !important; flex-shrink: 1; min-width: 0; max-width: 46%; }
.recipe-chip #fileName { color: var(--t1) !important; font-weight: 600; }
.recipe-chip #fileMeta { padding: 0 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.fh-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.fh-right { margin-left: 0; }
body.dropping .recipe-chip { border-color: var(--neon); box-shadow: 0 0 0 3px var(--neon-soft); }

/* main grid */
.main { flex: 1; min-height: 0; display: grid; gap: 12px; padding: 12px 14px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1.1fr) minmax(0, 1fr); }
.pnl { background: var(--surface); border: 0.5px solid var(--line); border-radius: 10px; display: flex; flex-direction: column;
  min-height: 0; min-width: 0; overflow: hidden; }
.p-plot { grid-column: 1; grid-row: 1; }
.p-insp { grid-column: 2; grid-row: 1; }
.p-tbl  { grid-column: 1 / -1; grid-row: 2; min-height: 0; flex: none; animation: none; }
.panel-header { flex-wrap: nowrap; min-height: 40px; }
.ph-spacer { flex: 1; }
.plot-body, .insp-body { min-height: 0; flex: 1; }
.insp-body { background: radial-gradient(120% 90% at 50% 40%, #121c22, #06080f); }
.insp-actions { display: flex; gap: 4px; }
.panel-badge.rank { color: var(--neon); border-color: var(--neon-ring); }
.insp-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--hair); border-top: 1px solid var(--hair); flex-shrink: 0; }
.insp-kv:empty { display: none; }
.insp-kv div { background: var(--surface); padding: 6px 10px; display: flex; flex-direction: column; min-width: 0; }
.insp-kv > div > span { font-family: var(--mono); font-size: 9.5px; color: var(--t3); letter-spacing: 0.06em; white-space: nowrap; }
.insp-kv b { font-family: var(--mono); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-flag { display: none; font-family: var(--mono); font-size: 10.5px; color: var(--warn); padding: 6px 10px; border-top: 1px solid var(--hair); line-height: 1.45; }
.insp-flag.on { display: block; }
.funnel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11px; color: var(--t3); }
.funnel b { color: var(--t1); font-weight: 600; } .funnel i { font-style: normal; color: var(--t3); }
.funnel .off { color: var(--t3); } .funnel .fl { color: var(--warn); }
.detail-panel { flex-shrink: 0; }
.dp-grid { max-height: 112px; }


/* active controls: neon (Matt, 2026-10-08) */
:root { --sweep-ink:#F2C48F; --x:#5fb5b5; --y:#c794d4; --z:#d4b04a; --sec:#5f9470; }
[hidden] { display: none !important; }
.direction-toggle button.active { background: var(--neon-soft); color: var(--neon); }
tbody tr.selected-row { background: var(--neon-soft); box-shadow: inset 2px 0 0 var(--neon); }
input[type=range] { accent-color: var(--neon); }
.row-btn.on { color: var(--neon); border-color: var(--neon-ring); background: var(--neon-soft); }

/* glyphs (16-grid line icons, 23-dock.js swGlyph) */
.g { width: 14px; height: 14px; flex-shrink: 0; display: inline-block; vertical-align: -2px; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; }
.pill-btn .g { width: 12px; height: 12px; }
.row-btn .g { width: 11px; height: 11px; vertical-align: -2px; }
th .sort-indicator .g { width: 11px; height: 11px; vertical-align: -1px; }
.dp-head .pill-btn { padding: 4px 6px; }

/* icon tiles (as F13LD.lab .ico, in Sweep's amber) */
.ico { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 6px;
  background: rgba(227,155,74,0.13); color: var(--sweep-ink); box-shadow: inset 0 0 0 1px rgba(227,155,74,0.24); }
.ico svg { width: 72%; height: 72%; overflow: visible; }
.ico .acc { fill: var(--neon); stroke: var(--sweep-deep); stroke-width: 1.4; }
.ico.ico-sm { width: 18px; height: 18px; border-radius: 5px; }
.ico.ico-md { width: 22px; height: 22px; }
.ico.ico-lg { width: 30px; height: 30px; border-radius: 8px; }
.ico.mdl { background: rgba(29,158,117,0.16); color: #a5d8c8; box-shadow: inset 0 0 0 1px rgba(29,158,117,0.30); }
.ico.mdl .acc { stroke: var(--green); }
.off .ico { background: transparent; color: var(--t3); box-shadow: inset 0 0 0 1px var(--hair2); }
.off .ico .acc { fill: transparent; stroke: var(--t3); }
.empty-ico { display: inline-flex; width: 40px; height: 40px; color: var(--t3); opacity: 0.75; margin-bottom: 10px; }
.empty-ico svg { width: 100%; height: 100%; overflow: visible; }
.empty-ico .acc { fill: var(--neon); stroke: none; opacity: 0.5; }
.preview-empty .empty-ico { margin: 0 auto; }
.recipe-chip .ico { margin-right: 2px; }

/* panel toggles (Rank / Terms, Ideal corner / Outlier) — Lab's segmented look */
.mode-toggle-group { display: inline-flex; background: var(--s1); border: 1px solid var(--hair); border-radius: 7px; padding: 2px; gap: 2px; overflow: visible; }
.mode-toggle-btn { height: 22px; padding: 0 9px; border-radius: 5px; font: 500 10.5px var(--mono); letter-spacing: 0; color: var(--t2); }
.mode-toggle-btn:hover { color: var(--t1); background: rgba(255,255,255,0.04); }
.mode-toggle-btn.active { background: var(--neon-soft); color: var(--neon); box-shadow: inset 0 0 0 1px var(--neon-ring); }

/* funnel + flag dots */
.funnel .g.sep { width: 10px; height: 10px; color: var(--t3); vertical-align: -1px; margin: 0 1px; }
.fl-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-right: 6px; vertical-align: 1px; }
.funnel .fl { margin-left: 6px; }

/* column-header tooltip */
.col-tip { position: fixed; z-index: 50; max-width: 300px; padding: 8px 10px; border-radius: 8px; background: var(--s3); border: 1px solid var(--hair2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5); font-family: var(--mono); font-size: 11px; color: var(--t2); pointer-events: none; opacity: 0; transform: translateY(-2px); transition: opacity 0.08s, transform 0.08s; }
.col-tip.on { opacity: 1; transform: none; }
.col-tip b { color: var(--t1); font-family: 'Exo 2', sans-serif; font-size: 12.5px; margin-right: 4px; }
.col-tip span { display: block; margin-top: 3px; line-height: 1.45; }
.col-tip em { display: block; font-style: normal; color: var(--t3); margin-top: 4px; font-size: 10px; }

/* ── control kit (F13LD.lab 51-dock / lab.css; active = neon) ── */
.seg { display: inline-flex; background: var(--s1); border: 1px solid var(--hair); border-radius: 7px; padding: 2px; gap: 2px; flex-shrink: 0; flex-wrap: wrap; align-self: flex-start; }
.seg button { height: 22px; padding: 0 9px; border: 0; border-radius: 5px; background: transparent; color: var(--t2);
  font: 500 11px/1 var(--mono); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.seg button:hover:not(:disabled) { color: var(--t1); background: rgba(255,255,255,0.04); }
.seg button.on { background: var(--neon-soft); color: var(--neon); box-shadow: inset 0 0 0 1px var(--neon-ring); }
.seg button:disabled { opacity: 0.35; cursor: not-allowed; }
.seg button .g { width: 11px; height: 11px; }
.chip { height: 24px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--hair2); background: transparent; color: var(--t2);
  font: 500 11px var(--mono); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; }
.chip:hover:not(:disabled) { color: var(--t1); border-color: var(--neon-ring); }
.chip.on { color: var(--neon); border-color: var(--neon-ring); background: var(--neon-soft); }
.chip:disabled { opacity: 0.35; cursor: not-allowed; }
.chip .g { width: 12px; height: 12px; }
.dd { position: relative; min-width: 0; }
.dd-btn { height: 28px; width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 10px; background: var(--s1); border: 1px solid var(--hair);
  border-radius: 7px; color: var(--t1); font: 500 12px 'Exo 2', sans-serif; cursor: pointer; min-width: 0; }
.dd-btn:hover:not(:disabled), .dd.open .dd-btn { border-color: var(--hair2); background: var(--s2); }
.dd-btn .val { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn .val em { font-style: normal; color: var(--t3); margin-left: 7px; font: 10.5px var(--mono); }
.dd-btn.off .val { color: var(--t3); }
.dd-btn:disabled { cursor: default; color: var(--t2); }
.dd-btn:disabled .chev { opacity: 0.2; }
.dd-btn .chev { width: 12px; height: 12px; opacity: 0.6; transition: transform 0.15s; }
.dd.open .dd-btn .chev { transform: rotate(180deg); }
.dd-menu { position: fixed; min-width: 0; width: max-content; max-width: calc(100vw - 24px); max-height: 340px; overflow: auto;
  background: #141725; border: 1px solid var(--hair2); border-radius: 10px; padding: 4px; box-shadow: 0 14px 40px rgba(0,0,0,0.6); z-index: 60; }
.dd-grp { padding: 8px 9px 3px; color: var(--t3); font: 600 9px var(--mono); text-transform: uppercase; letter-spacing: 0.14em; }
.dd-opt { display: flex; align-items: flex-start; gap: 8px; width: 100%; text-align: left; padding: 6px 9px; border-radius: 6px; border: 0; background: transparent;
  color: var(--t1); cursor: pointer; font: 12px 'Exo 2', sans-serif; }
.dd-opt:hover { background: rgba(255,255,255,0.05); }
.dd-opt .tick { width: 13px; color: var(--neon); flex-shrink: 0; height: 16px; display: inline-flex; align-items: center; }
.dd-opt .tick .g { width: 13px; height: 13px; }
.dd-opt .dd-txt { min-width: 0; }
.dd-opt .nm em { font-style: normal; color: var(--t3); margin-left: 7px; font: 10.5px var(--mono); }
.dd-opt small { display: block; color: var(--t3); font-size: 10.5px; margin-top: 1px; line-height: 1.4; }
.dd-opt.on .nm { color: var(--neon); }
.hint { font-size: 10.5px; color: var(--t3); line-height: 1.45; }
.hint:empty { display: none; }
input.num { height: 28px; width: 64px; background: var(--s1); border: 1px solid var(--hair); border-radius: 7px; color: var(--t1); font: 500 12px var(--mono);
  padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; outline: none; }
input.num::-webkit-inner-spin-button, input.num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input.num:focus { border-color: var(--neon-ring); background: var(--s2); }
input.num:disabled { color: var(--t3); }
.num-u { display: inline-flex; align-items: center; height: 28px; background: var(--s1); border: 1px solid var(--hair); border-radius: 7px; padding-right: 8px; min-width: 0; }
.num-u:focus-within { border-color: var(--neon-ring); background: var(--s2); }
.num-u input.num { border: 0; background: transparent; height: 26px; width: 100%; min-width: 0; padding: 0 3px 0 8px; }
.num-u i { font: 10.5px var(--mono); font-style: normal; color: var(--t3); flex-shrink: 0; }
.num-u.na { opacity: 0.38; }
.mini-btn { height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--hair2); background: var(--s2); color: var(--t1);
  font: 600 11.5px 'Exo 2', sans-serif; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0; }
.mini-btn:hover { border-color: var(--neon-ring); }
.mini-btn .g { width: 12px; height: 12px; }
.seg button:focus-visible, .chip:focus-visible, .dd-btn:focus-visible, .dd-opt:focus-visible, .mini-btn:focus-visible, .dock-tag:focus-visible,
.cfg-btn:focus-visible, .run:focus-visible, .dr-tab:focus-visible, .dr-x:focus-visible, .mode-toggle-btn:focus-visible { outline: 2px solid var(--neon-ring); outline-offset: 1px; }

/* ── dock (as F13LD.lab 51-dock) ── */
.dock { height: 50px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--surface); border-top: 1px solid var(--hair); position: relative; z-index: 31; }
.cfg-btn { height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 9px; border-radius: 8px; border: 1px solid var(--hair2); background: var(--s2); color: var(--t1);
  font: 600 12px 'Exo 2', sans-serif; cursor: pointer; flex-shrink: 0; }
.cfg-btn .ico { background: none; box-shadow: none; color: currentColor; width: 18px; height: 18px; }
.cfg-btn .ico svg { width: 100%; height: 100%; }
.cfg-btn .chev { display: inline-flex; transition: transform 0.15s; opacity: 0.7; }
.cfg-btn .chev .g { width: 13px; height: 13px; }
.cfg-btn:hover { border-color: var(--neon-ring); }
.cfg-btn.open { color: var(--neon); border-color: var(--neon-ring); background: var(--neon-soft); }
.cfg-btn.open .chev { transform: rotate(180deg); }
.dock-tags { flex: 0 1 auto; min-width: 0; display: flex; gap: 6px; overflow: hidden; }
.dock-tag { height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px 0 5px; border-radius: 7px; background: var(--s1); border: 1px solid var(--hair);
  font: 500 11px var(--mono); color: var(--t2); white-space: nowrap; cursor: pointer; flex-shrink: 0; }
.dock-tag:hover { border-color: var(--hair2); color: var(--t1); }
.dock-tag b { font: 600 11.5px 'Exo 2', sans-serif; color: var(--t1); margin-right: 1px; }
.dock-tag .hw { font: 500 10px var(--mono); margin-left: 2px; color: var(--t3); }
.dock-tag .hw.ok { color: var(--green); } .dock-tag .hw.cpu { color: var(--warn); }
.dock-tag .g.dir { width: 12px; height: 12px; color: var(--t1); margin-left: -2px; }
.dock-tag.off { opacity: 0.55; } .dock-tag.off b { color: var(--t3); }
.rk-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font: 600 11px/1 var(--mono); flex-shrink: 0; }
.rk-n.r1 { background: rgba(200,245,66,0.12); color: var(--rank1); box-shadow: inset 0 0 0 1px rgba(200,245,66,0.30); }
.rk-n.r2 { background: rgba(29,158,117,0.16); color: #4fcb9f; box-shadow: inset 0 0 0 1px rgba(29,158,117,0.38); }
.rk-n.r3 { background: rgba(181,152,212,0.14); color: var(--rank3); box-shadow: inset 0 0 0 1px rgba(181,152,212,0.32); }
.dock-tag .rk-n { width: 18px; height: 18px; border-radius: 5px; font-size: 10px; }
.dock-tag .rk-n + .rk-n { margin-left: -3px; }
.log-chip { height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px 0 5px; border-radius: 7px; background: var(--s1); border: 1px solid var(--hair);
  font: 11px var(--mono); color: var(--t2); min-width: 72px; max-width: 340px; flex: 1 1 0; margin-left: auto; cursor: pointer; overflow: hidden; white-space: nowrap; }
.log-chip b { font: 600 11px 'Exo 2', sans-serif; color: var(--t1); flex-shrink: 0; }
.log-chip #logChipMsg { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.log-chip .w { color: var(--warn); flex-shrink: 0; }
.log-chip .w:empty { display: none; }
.dock-hw { font: 500 11px var(--mono); color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; flex-shrink: 1; min-width: 0; }
.dock-hw.green { color: var(--t2); }
.dock-hw.green::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 6px rgba(29,158,117,0.7); }
.dock-hw.warn { color: var(--warn); }
.dock .progress-wrap { display: none; width: 190px; flex-shrink: 0; margin: 0; padding: 0; }
.dock .progress-wrap.visible { display: block; }
.dock .progress-label { margin-bottom: 3px; }
.run { height: 32px; padding: 0 18px; border-radius: 8px; border: 0; flex-shrink: 0; min-width: 130px; white-space: nowrap;
  background: var(--sweep-deep); color: var(--sweep-tile); box-shadow: inset 0 0 0 1px rgba(227,155,74,0.4);
  font: 700 12px 'Exo 2', sans-serif; letter-spacing: 0.06em; cursor: pointer; transition: background 0.15s, box-shadow 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.run .g { width: 11px; height: 11px; }
.run:hover:not(:disabled) { background: #7a4608; box-shadow: inset 0 0 0 1px var(--sweep), 0 0 18px rgba(227,155,74,0.3); }
.run:disabled { opacity: 0.45; cursor: not-allowed; }
.run.running, .run.running:disabled { opacity: 1; cursor: progress; background: rgba(99,56,6,0.14); color: var(--sweep-tile); box-shadow: inset 0 0 0 1px var(--sweep); }
.dock-spin .arcs { transform-origin: 20px 20px; animation: dockSpin 1.1s linear infinite; }
@keyframes dockSpin { to { transform: rotate(360deg); } }
.cancel-btn { height: 30px; padding: 0 12px 0 9px; border-radius: 8px; border: 1px solid rgba(245,158,11,0.5); background: transparent; color: var(--warn);
  font: 600 12px 'Exo 2', sans-serif; cursor: pointer; flex-shrink: 0; white-space: nowrap; align-items: center; gap: 6px; }
.cancel-btn[style*="block"] { display: inline-flex !important; }
.cancel-btn:hover { background: rgba(245,158,11,0.08); border-color: var(--warn); }
.cancel-btn .g { width: 12px; height: 12px; }

/* ── Configure drawer: slides up over the panels (never resizes them) ── */
.cfg-drawer { display: none; position: absolute; left: 0; right: 0; bottom: 50px; z-index: 30; background: #0f111a;
  border-top: 1px solid var(--hair2); box-shadow: 0 -18px 40px rgba(0,0,0,0.5); }
.cfg-drawer.open { display: block; animation: drIn 0.16s ease-out; max-height: calc(100vh - 110px); overflow-y: auto; overscroll-behavior: contain; }
@keyframes drIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dr-strip { display: flex; align-items: stretch; gap: 2px; height: 40px; padding: 0 10px 0 12px; border-bottom: 1px solid var(--hair); }
.dr-tab { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; border: 0; background: transparent; cursor: pointer;
  font: 500 12.5px 'Exo 2', sans-serif; color: var(--t2); box-shadow: inset 0 -2px 0 transparent; white-space: nowrap; }
.dr-tab:hover { color: var(--t1); }
.dr-tab.on { color: var(--t1); box-shadow: inset 0 -2px 0 var(--neon); }
.dr-tab:not(.on) .ico { background: transparent; color: var(--t3); box-shadow: inset 0 0 0 1px var(--hair2); }
.dr-tab:not(.on) .ico .acc { fill: transparent; stroke: var(--t3); }
.dr-tab .mv { font: 500 10px var(--mono); color: var(--t3); }
.dr-tab .mv.warn { color: var(--warn); }
.dr-strip-note { margin-left: auto; align-self: center; font: 10.5px var(--mono); color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; padding-right: 8px; }
.dr-reset { align-self: center; height: 26px; margin-right: 6px; color: var(--t2); background: transparent; }
.dr-reset:hover { color: var(--t1); }
.dr-reset.done { color: var(--neon); border-color: var(--neon-ring); }
.cfg-drawer:not([data-tab="set"]) .dr-reset { display: none; }
.dr-x { align-self: center; width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--t3); cursor: pointer;
  display: inline-grid; place-items: center; flex-shrink: 0; }
.dr-x:hover { color: var(--t1); border-color: var(--hair2); background: var(--s2); }
.dr-x .g { width: 14px; height: 14px; }
.dr-pane { display: none; } .dr-pane.on { display: block; }

/* Settings: five columns on wide screens */
.dr-cols { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.95fr) minmax(0, 1.5fr); }
.dr-col { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; position: relative; }
.dr-col + .dr-col { border-left: 1px solid var(--hair); }
.dr-col.hl { animation: colHl 1.1s ease-out; }
@keyframes colHl { 0% { background: rgba(200,245,66,0.07); box-shadow: inset 0 2px 0 var(--neon); } 100% { background: transparent; box-shadow: inset 0 2px 0 transparent; } }
.dr-ph { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dr-pt-wrap { min-width: 0; flex: 1; }
.dr-pt { font: 600 13.5px 'Exo 2', sans-serif; color: var(--t1); line-height: 1.25; }
.dr-ps { font-size: 11px; color: var(--t3); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dr-f > label, .rk-grid > label { font: 600 9.5px var(--mono); color: var(--sec); text-transform: uppercase; letter-spacing: 0.14em; }
.dr-f.na, .dr-f .na { opacity: 0.38; pointer-events: none; }
.f-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* v0.26.0 — a field label with a chip on its right (Density · Auto) */
.lbl-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lbl-row > label { font: 600 9.5px var(--mono); color: var(--sec); text-transform: uppercase; letter-spacing: 0.14em; }
.lbl-row .seg { margin-left: auto; align-self: center; }
.lbl-row .seg button { height: 18px; padding: 0 7px; font-size: 10.5px; }
.dens-row .num-u { flex: 1; min-width: 0; }
.dens-to { font-size: 11px; color: var(--t3); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.pair .num-u { width: 100%; }
.pair .dd { min-width: 0; }
.rc-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 6px 6px 8px; background: var(--s1); border: 1px solid var(--hair); border-radius: 8px; min-width: 0; }
.rc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-txt b { font: 600 12px 'Exo 2', sans-serif; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-txt small { font: 10px var(--mono); color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* cell scale */
.sc-rows { display: flex; flex-direction: column; gap: 6px; }
.sc-row { display: grid; grid-template-columns: 30px 64px minmax(48px, 1fr) 64px; gap: 8px; align-items: center; }
.sc-row .num-u { width: 64px; }
.sc-row.bad .num-u { border-color: rgba(245,158,11,0.6); }
.ax { font: 600 11px var(--mono); }
.ax.x { color: var(--x); } .ax.y { color: var(--y); } .ax.z { color: var(--z); }
.ax.all { display: inline-flex; gap: 1px; font-size: 10px; }
.ax.all i { font-style: normal; } .ax.all .x { color: var(--x); } .ax.all .y { color: var(--y); } .ax.all .z { color: var(--z); }
.sc-bar { position: relative; height: 28px; cursor: ew-resize; touch-action: none; }
.sc-bar .trk { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--s3); }
.sc-bar .nom { position: absolute; top: 7px; bottom: 7px; width: 1px; margin-left: -0.5px; background: var(--t3); }
.sc-bar .band { position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--neon); opacity: 0.75; }
.sc-bar .h { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #0f111a; border: 2px solid var(--neon); transition: transform 0.1s; }
.sc-bar:hover .h, .sc-bar.drag .h { transform: scale(1.15); }
.dr-ph .chip { margin-left: auto; }

/* solver */
.st-box { height: 28px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--s1); border: 1px solid var(--hair); border-radius: 7px;
  font: 11.5px var(--mono); color: var(--t2); min-width: 0; }
.st-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.st-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--t3); flex-shrink: 0; }
.st-box.ok { color: var(--t1); } .st-box.ok .st-dot { background: var(--green); box-shadow: 0 0 6px rgba(29,158,117,0.7); }
.st-box.cpu .st-dot { background: var(--warn); }

/* ranks */
.rk-head, .rk-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 116px 72px 24px; gap: 8px; align-items: center; }
/* v0.27.1 — one click turns a rank off */
.rk-clear { width: 24px; height: 24px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--t3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.rk-clear:hover:not(:disabled) { color: var(--t1); border-color: var(--hair2); background: var(--s2); }
.rk-clear:disabled { opacity: 0.25; cursor: default; }
.rk-clear:focus-visible { outline: 2px solid var(--neon-ring); outline-offset: 1px; }
.rk-clear .g { width: 12px; height: 12px; }
.rk-head { margin-bottom: -4px; }
.rk-head > label { font: 600 9.5px var(--mono); color: var(--sec); text-transform: uppercase; letter-spacing: 0.14em; }
.rk-rows { display: flex; flex-direction: column; gap: 7px; }
.rk-sorts { font: 10.5px var(--mono); color: var(--t3); padding-left: 2px; white-space: nowrap; }
.rk-row .num-u { width: 72px; }
.rk-row .seg { flex-wrap: nowrap; }
.num-u .pre { display: none; padding: 0 0 0 8px; }

/* cell shapes */
.sc-vz { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sc-viz { flex-shrink: 0; overflow: visible; }
.sc-viz line { stroke-width: 1.4; stroke-linecap: round; }
.sc-viz line.ex { stroke: var(--x); } .sc-viz line.ey { stroke: var(--y); } .sc-viz line.ez { stroke: var(--z); }
.sc-viz line.n { stroke: var(--t3); stroke-width: 1; stroke-dasharray: 2.5 2.5; }
.sc-viz path.top { fill: rgba(200,245,66,0.07); }
.sc-vz-txt { font: 11px var(--mono); color: var(--t2); line-height: 1.6; min-width: 0; font-variant-numeric: tabular-nums; }
.sc-vz-txt b { color: var(--sweep); font-weight: 600; }
.sc-vz-txt .t3 { color: var(--t3); }
.sc-vz-txt .ax { margin-right: 2px; }
.sc-vz-txt .gap { display: inline-block; width: 8px; }

/* log + metric key panes */
.dr-loghead { display: flex; align-items: center; gap: 10px; padding: 10px 18px 0; }
.cfg-drawer .log-body { height: min(300px, 44vh); max-height: none; min-height: 0; padding: 8px 18px 14px; font-size: 11.5px; }
.cfg-drawer [data-pane="key"] { padding: 14px 18px 16px; max-height: min(330px, 50vh); overflow-y: auto; }
.metric-key { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 22px; font-family: var(--mono); font-size: 10.5px; line-height: 1.5; }

/* five columns; then four with the ranks as one row below; then two; then one — never sideways */
@media (max-width: 1599px) and (min-width: 1280px) {
  .dr-cols { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 0.95fr); }
  .dr-col[data-col="ranks"] { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--hair); display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px 22px; align-items: start; }
  .dr-col[data-col="ranks"] .rk-head { display: none; }
  .dr-col[data-col="ranks"] .rk-rows { flex-direction: row; gap: 18px; }
  .dr-col[data-col="ranks"] .rk-row { flex: 1; min-width: 0; grid-template-columns: 20px minmax(0, 1fr) auto auto 24px; }
  .dr-col[data-col="ranks"] .rk-row .num-u { width: 86px; }
  .dr-col[data-col="ranks"] .num-u .pre { display: inline; }
  .dr-col[data-col="ranks"] .hint { grid-column: 2; }
  .dr-col[data-col="ranks"] .seg button span { display: none; }
}
@media (max-width: 1599px) { .dock-hw { display: none; } }
@media (max-width: 1279px) { .dock-tag .rg, .dock-tag .sub { display: none; } }
@media (max-width: 1100px) {
  .dr-strip-note { display: none; }
}
@media (max-width: 1279px) {
  .dr-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dr-col[data-col="solver"] { border-left: 0; border-top: 1px solid var(--hair); }
  .dr-col[data-col="ranks"] { grid-column: span 2; border-left: 1px solid var(--hair); display: flex; }
  .dr-col[data-col="ranks"] .rk-head { display: grid; }
  .dr-col[data-col="ranks"] .rk-rows { flex-direction: column; gap: 7px; max-width: 640px; }
  .dr-col[data-col="ranks"] .rk-head, .dr-col[data-col="ranks"] .rk-row { grid-template-columns: 20px minmax(0, 1fr) 116px 72px 24px; max-width: 640px; }
  .dr-col[data-col="ranks"] .rk-row .num-u { width: 72px; }
  .dr-col[data-col="ranks"] .num-u .pre { display: none; }
  .dr-col[data-col="ranks"] .seg button span { display: inline; }
  .fh-actions .pill-btn { padding: 4px 9px; font-size: 11px; }
}
@media (max-width: 899px) {
  .dr-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dr-col[data-col="mat"] { border-left: 0; border-top: 1px solid var(--hair); }
  .dr-col[data-col="solver"] { border-left: 1px solid var(--hair); }
  .dr-col[data-col="ranks"] { border-left: 0; }
}
@media (max-width: 760px) {
  html, body { height: auto; }
  .app { height: auto; min-height: 100vh; overflow: visible; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .recipe-chip { order: 3; flex: 1 1 100%; max-width: none; }
  .fh-actions { margin-left: auto; }
  .main { display: flex; flex-direction: column; padding: 10px; overflow: visible; }
  .p-plot { height: 340px; flex: none; }
  .p-insp { flex: none; }
  .insp-body { height: 220px; flex: none; }
  .p-tbl { min-height: 420px; max-height: 80vh; }
  .panel-header { flex-wrap: wrap; }
  .funnel { flex: 1 1 100%; order: 5; white-space: normal; }
  .col-opt { display: none; }
  th.th-actions, td.td-actions { width: 92px; }
  .dock { position: sticky; bottom: 0; height: auto; flex-wrap: wrap; padding: 8px 10px; gap: 8px; }
  .dock-tags { order: 5; flex: 1 1 100%; flex-wrap: wrap; }
  .log-chip { flex: 1; max-width: none; }
  .run { min-width: 0; padding: 0 14px; }
  .cfg-drawer.open { position: fixed; left: 0; right: 0; bottom: 96px; max-height: 64vh; overflow-y: auto; }
  .dr-strip { position: sticky; top: 0; background: #0f111a; z-index: 2; }
  .dr-cols { grid-template-columns: 1fr; }
  .dr-col + .dr-col, .dr-col[data-col="solver"] { border-left: 0; border-top: 1px solid var(--hair); }
  .dr-col[data-col="ranks"] { grid-column: auto; }
  .dr-col[data-col="ranks"] .rk-head, .dr-col[data-col="ranks"] .rk-row { grid-template-columns: 20px minmax(0, 1fr) 116px 24px; }
  .rk-row > .rk-clear { grid-row: 1; grid-column: 4; }
  .dr-col[data-col="ranks"] .rk-row .num-u { width: 100%; }
  .rk-head > label:last-child { display: none; }
  .rk-row > .num-u, .rk-row > .rk-sorts { grid-column: 2 / -1; }
  .rk-row > .num-u { width: 100%; }
  .num-u .pre, .dr-col[data-col="ranks"] .num-u .pre { display: inline; }
}

/* ── v0.28.0 — Target block under the ranks (24-drawer.js paintTarget) ── */
.tg-wrap { margin-top: 12px; padding: 10px 10px 10px 12px; border: 1px solid var(--hair); border-radius: 8px; background: var(--s1); display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.tg-wrap.on { border-color: var(--neon-ring); }
.tg-wrap [hidden] { display: none !important; }
.tg-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tg-head .ico { color: var(--neon, #c8f542); flex-shrink: 0; }
.tg-ht { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tg-ht b { font: 600 12px 'Exo 2', sans-serif; color: var(--t1); }
.tg-ht small { font: 10.5px var(--mono); color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 7px 18px; align-items: center; min-width: 0; }
.tg-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px 24px; gap: 8px; align-items: center; min-width: 0; }
.tg-row .num-u { width: 104px; }
.tg-add { justify-self: start; }
.tg-opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: flex-end; padding-top: 6px; border-top: 1px solid var(--hair); }
.tg-opts .dr-f { min-width: 0; }
.tg-opts .pair { flex: 1 1 260px; max-width: 360px; }
.tg-body > .hint, .dr-col[data-col="ranks"] .tg-body > .hint { grid-column: 1 / -1; }
.dr-col[data-col="ranks"] .rk-rows[hidden] + .hint[hidden] + .tg-wrap, .dr-col[data-col="ranks"] .tg-wrap.on { margin-top: 2px; }
.rk-rows[hidden], .rk-head[hidden], #hRanks[hidden] { display: none !important; }
#hTg.warn { color: var(--warn); }
@media (max-width: 1599px) and (min-width: 1280px) {
  .dr-col[data-col="ranks"] .tg-wrap { grid-column: 2; }
}
/* the plot's target marker colour lives in 85-scatter-plot.js (canvas) */
.funnel .tg { color: var(--neon, #c8f542); }
.tg-on { color: var(--neon, #c8f542); font-weight: 600; }
.tg-off { color: var(--t2); }
th.th-tgt { color: var(--neon, #c8f542); }
/* v0.28.0 — phone: the drawer's tab strip fits (Reset shows its icon only) */
@media (max-width: 560px) {
  .dr-reset span { display: none; }
  .dr-reset { padding: 0 8px; }
}

/* ── v0.29.3 — design space (rebuilt on F13LD.vault's hero view) ───────── */
.plot-body { display: block; overflow: hidden; background: radial-gradient(120% 95% at 50% 42%, #14141c 0%, #0a0b12 55%, #06080f 100%); }
.plot-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#plotCanvas { touch-action: none; cursor: grab; }
.plot-hov { position: absolute; z-index: 3; display: flex; gap: 6px; align-items: center; }
.plot-hov.tr { top: 8px; right: 10px; }
.plot-ibtn, .plot-pill { height: 28px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--hair2); border-radius: 6px; background: rgba(10,12,20,0.78); color: var(--t2); cursor: pointer;
  font: 500 11px 'Exo 2', sans-serif; padding: 0 10px; transition: color .15s, border-color .15s; }
.plot-ibtn { width: 28px; padding: 0; }
.plot-ibtn:hover, .plot-pill:hover { color: var(--t1); border-color: var(--line-2); }
.plot-pill.on { color: var(--neon); border-color: var(--neon-ring); background: rgba(200,245,66,0.06); }
.plot-ibtn svg.g, .plot-pill svg.g { width: 14px; height: 14px; }
.plot-axes { left: 10px; bottom: 26px; flex-wrap: wrap; max-width: calc(100% - 20px); }
.plot-axes[hidden] { display: none; }
.pchip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font: 500 11px var(--mono); color: var(--t1);
  background: rgba(10,12,20,0.82); border: 1px solid var(--hair2); border-radius: 6px; padding: 4px 9px; white-space: nowrap; cursor: default; }
.pchip b { font: 700 11px 'Exo 2', sans-serif; color: var(--neon); }
.pchip .nm { overflow: hidden; text-overflow: ellipsis; }
.pchip .u { color: var(--sweep-ink); }
.pchip .dir { color: var(--t3); }
.plot-hint { position: absolute; left: 0; right: 0; bottom: 7px; text-align: center; font: 400 10px var(--mono); color: var(--t3);
  pointer-events: none; z-index: 2; opacity: 0; transition: opacity .3s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
.plot-body.has-data .plot-hint { opacity: 0.85; }
.plot-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 2; transition: opacity .35s; }
.plot-empty.hidden { opacity: 0; }
.plot-empty-card { text-align: center; max-width: min(320px, calc(100% - 32px)); padding: 18px 22px 16px; border-radius: 12px;
  background: rgba(10,12,20,0.72); border: 1px solid var(--hair2); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.plot-empty-card .empty-ico { margin: 0 auto 8px; }
.plot-empty-card .t1 { font: 600 13px 'Exo 2', sans-serif; color: var(--t1); }
.plot-empty-card .t2 { font-size: 12px; color: var(--t2); margin-top: 5px; line-height: 1.5; }
.plot-empty-card .fam { display: inline-flex; margin-top: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 11px var(--mono); color: var(--sweep); border: 1px solid var(--sweep-ring); border-radius: 999px; padding: 3px 10px; }
.plot-empty-card .fam[hidden] { display: none; }
.plot-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 160px; max-width: 260px; padding: 8px 10px; border-radius: 8px;
  background: rgba(8,10,18,0.95); border: 1px solid var(--line-2); box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.plot-tip[hidden] { display: none; }
.plot-tip .id { display: flex; justify-content: space-between; gap: 12px; font: 600 12px var(--mono); color: var(--neon); margin-bottom: 2px; }
.plot-tip .id span { color: var(--t2); font-weight: 500; }
.plot-tip .r { display: flex; justify-content: space-between; gap: 12px; font: 400 11px var(--mono); color: var(--t1); margin-top: 3px; }
.plot-tip .r i { font-style: normal; color: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plot-tip .fl { font: 500 10.5px var(--mono); color: var(--warn); margin-top: 5px; }
@media (max-width: 760px) {
  .plot-hint { display: none; }
  .plot-axes { bottom: 8px; }
  .pchip .dir { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   v0.31.0 — Preflight popup (64-preflight.js). Fits its pane: wraps,
   scrolls vertically only when the window is short.
   ════════════════════════════════════════════════════════════════ */
.pf-overlay { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(3,4,8,0.66); }
.pf-card { width: min(480px, 100%); max-height: 100%; overflow-y: auto; overflow-x: hidden; background: var(--s2);
  border: 1px solid var(--hair2); border-radius: 12px; padding: 16px 18px; color: var(--t1); font-size: 13px; line-height: 1.45; }
.pf-head { display: flex; gap: 12px; align-items: flex-start; }
.pf-ico { width: 38px; height: 38px; border-radius: 9px; }
.pf-ht { min-width: 0; flex: 1; }
.pf-title { font-size: 15px; font-weight: 600; color: var(--t1); }
.pf-sub { color: var(--t2); margin-top: 2px; }
.pf-probes { margin-top: 12px; }
.pf-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--hair); }
.pf-slice { width: 40px; height: 40px; flex: none; border-radius: 5px; image-rendering: pixelated; background: var(--panel-3);
  box-shadow: inset 0 0 0 1px var(--hair2); }
.pf-slice.none { opacity: 0.35; }
.pf-rtx { flex: 1; min-width: 0; }
.pf-rname { color: var(--t1); overflow-wrap: anywhere; }
.pf-rwhy { color: var(--t2); font-size: 12px; overflow-wrap: anywhere; }
.pf-rnote { color: var(--t3); font-size: 11px; overflow-wrap: anywhere; }
.pf-tag { flex: none; font: 600 10px var(--mono); letter-spacing: 0.04em; padding: 2px 8px; border-radius: 6px; }
.pf-tag.bad { color: var(--bad); background: rgba(251,113,133,0.12); }
.pf-tag.ok { color: var(--success); background: rgba(52,211,153,0.10); }
.pf-tag.skip { color: var(--t3); background: var(--hair); }
.pf-key { font-size: 11px; color: var(--t3); padding-top: 6px; border-top: 1px solid var(--hair); }
.pf-sec { margin-top: 12px; font-size: 11px; color: var(--t3); letter-spacing: 0.04em; }
.pf-fix { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; margin-top: 8px; padding: 9px 11px;
  border: 1px solid var(--hair2); border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.pf-fix:hover { border-color: var(--neon-ring); }
.pf-fix.on { border-color: var(--neon); background: var(--neon-soft); }
.pf-dot { flex: none; width: 13px; height: 13px; margin-top: 3px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--t2); }
.pf-fix.on .pf-dot { box-shadow: inset 0 0 0 1.5px var(--neon), inset 0 0 0 4px var(--s2); background: var(--neon); }
.pf-ftx { display: flex; flex-direction: column; min-width: 0; }
.pf-ft { color: var(--t1); }
.pf-fs { color: var(--t2); font-size: 12px; overflow-wrap: anywhere; }
.pf-none { margin-top: 12px; padding: 9px 11px; border: 1px dashed var(--hair2); border-radius: 8px; color: var(--t2); }
.pf-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.pf-btn { font: 500 13px 'Exo 2', system-ui, sans-serif; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.pf-btn.ghost { background: transparent; color: var(--t1); border: 1px solid var(--hair2); }
.pf-btn.ghost:hover { border-color: var(--line-2); }
.pf-btn.primary { background: var(--neon); color: #11160a; border: 1px solid var(--neon); }
.pf-btn:focus-visible, .pf-fix:focus-visible { outline: 2px solid var(--neon-ring); outline-offset: 2px; }
.pf-card { position: relative; }
.pf-head { padding-right: 28px; }
.pf-x { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; border: 1px solid var(--hair2); background: transparent; color: var(--t2); cursor: pointer; }
.pf-x:hover { color: var(--t1); border-color: var(--line-2); }
.pf-x:focus-visible { outline: 2px solid var(--neon-ring); outline-offset: 2px; }
.pf-x .g { width: 14px; height: 14px; }
.pf-working { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 9px 11px; border: 1px dashed var(--hair2); border-radius: 8px; color: var(--t2); }
