/* ===== Ramanujan Sphere × Harmony Engine — Hardware Synth Studio CSS ===== */
:root {
  --bg: #090c12;
  --panel: #10151e;
  --panel2: #151c27;
  --panel3: #1b2433;
  --line: #1f2733;
  --line-2: #2b3545;
  --text: #dce3ec;
  --muted: #7f8c9f;
  --accent: #36d6c8;
  --accent-bright: #4df3dd;
  --accent-2: #6ee7a0;
  --gold: #ffb04d;
  --magenta: #ff5ca8;
  --coral: #ff6b7a;
  --red: #ff6b6b;
  --blue: #5aa9ff;
  --mono: "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, monospace;
  --radius: 9px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background:
    radial-gradient(1100px 620px at 68% -8%, #102530 0%, transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

/* ---- Compact Studio Topbar ---- */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0f141d, #0a0d14);
}

.brand { display: flex; align-items: center; gap: 11px; flex: 0 1 auto; min-width: 0; }
.brand-copy { min-width: 0; overflow: hidden; }
.brand-mark {
  font-size: 25px;
  line-height: 1;
  color: var(--accent-bright);
  text-shadow: 0 0 14px rgba(54, 214, 200, 0.75);
}
.brand-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.brand h1 { font-size: 15.5px; font-weight: 650; letter-spacing: 0.3px; white-space: nowrap; }
.brand-x { color: var(--accent); font-weight: 400; }

.badge-f32 {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(54, 214, 200, 0.12);
  border: 1px solid rgba(54, 214, 200, 0.35);
  color: var(--accent-bright);
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.brand .pill-btn.subtle {
  white-space: nowrap;
  flex: 0 0 auto;
}

.premise {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.premise em { color: var(--accent-2); font-style: normal; }

/* ---- Topbar Parameter Context Hint Display (Quiet Idle) ---- */
.topbar-hint {
  flex: 1 1 260px;
  min-width: 190px;
  max-width: 640px;
  height: 36px;
  padding: 3px 11px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease, border-color 0.14s ease, background-color 0.14s ease;
}
.topbar-hint[data-state="active"] {
  opacity: 1;
  background: rgba(16, 22, 32, 0.90);
  border-color: rgba(54, 214, 200, 0.32);
  box-shadow: inset 0 0 0 1px rgba(54, 214, 200, 0.08);
}
.topbar-hint[data-state="active"][data-accent="emerald"] {
  border-color: rgba(110, 231, 160, 0.34);
  box-shadow: inset 0 0 0 1px rgba(110, 231, 160, 0.08);
}
.topbar-hint[data-state="active"][data-accent="gold"] {
  border-color: rgba(255, 176, 77, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255, 176, 77, 0.08);
}
.topbar-hint[data-state="active"][data-locked="true"] {
  border-color: rgba(77, 243, 221, 0.52);
}
.topbar-hint[data-state="active"][data-locked="true"][data-accent="emerald"] {
  border-color: rgba(110, 231, 160, 0.56);
}
.topbar-hint[data-state="active"][data-locked="true"][data-accent="gold"] {
  border-color: rgba(255, 176, 77, 0.60);
}
.hint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.hint-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--accent-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-hint[data-accent="emerald"] .hint-title { color: var(--accent-2); }
.topbar-hint[data-accent="gold"] .hint-title { color: var(--gold); }
.hint-status {
  flex: 0 0 auto;
  font-size: 9.5px;
  line-height: 1.2;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.25px;
  white-space: nowrap;
  background: rgba(54, 214, 200, 0.12);
  color: var(--accent-bright);
  border: 1px solid rgba(54, 214, 200, 0.28);
}
.hint-status[data-tone="active"] {
  background: rgba(110, 231, 160, 0.13);
  color: #9ff5c2;
  border-color: rgba(110, 231, 160, 0.34);
}
.hint-status[data-tone="unused"] {
  background: rgba(255, 176, 77, 0.12);
  color: #ffc87d;
  border-color: rgba(255, 176, 77, 0.32);
}
.hint-status[data-tone="info"] {
  background: rgba(54, 214, 200, 0.11);
  color: #8eeae1;
  border-color: rgba(54, 214, 200, 0.26);
}
.hint-body {
  font-size: 11px;
  line-height: 1.25;
  color: #bcc9da;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vessel-summary > span[data-hint] {
  cursor: help;
  border-radius: 3px;
  transition: color 0.12s ease;
}
.vessel-summary > span[data-hint]:hover { color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; flex-wrap: nowrap; }

/* Laptop-width header balance: trim subtitle early while keeping brand badges single-line */
@media (max-width: 1720px) {
  .brand { max-width: 440px; }
}
@media (max-width: 1480px) {
  .brand { max-width: 396px; }
}
@media (max-width: 1320px) {
  .topbar .legend { display: none; }
  .brand { max-width: 392px; }
}
@media (max-width: 1040px) {
  .topbar-hint { display: none; }
  .brand { max-width: none; }
}

.legend { display: flex; gap: 10px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--accent-bright); box-shadow: 0 0 7px var(--accent-bright); }
.dot.shell { background: var(--accent-2); }
.dot.inside { background: var(--blue); }
.dot.outside { background: var(--red); }

/* ---- Segmented Controls ---- */
.segmented {
  display: inline-flex;
  align-items: center;
  background: var(--panel2);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}
.seg-label {
  font-size: 10.5px;
  color: var(--muted);
  padding: 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.seg-btn, .bit-src-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
}
.seg-btn:hover, .bit-src-btn:hover { color: var(--text); }
.seg-btn.active, .bit-src-btn.active {
  background: rgba(54, 214, 200, 0.16);
  color: var(--accent-bright);
  box-shadow: inset 0 0 0 1px rgba(54, 214, 200, 0.42);
}
.seg-btn[data-twin="antipodal"].active {
  background: rgba(255, 92, 168, 0.18);
  color: #ff82be;
  box-shadow: inset 0 0 0 1px rgba(255, 92, 168, 0.5);
}
.seg-btn[data-twin="conjugate"].active {
  background: rgba(255, 176, 77, 0.18);
  color: #ffc575;
  box-shadow: inset 0 0 0 1px rgba(255, 176, 77, 0.5);
}

.pill-btn.subtle {
  background: var(--panel2);
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
}
.pill-btn.subtle:hover { color: var(--accent-bright); border-color: var(--accent); }
.pill-btn.subtle.active {
  background: rgba(110, 231, 160, 0.14);
  color: #a9f5c8;
  border-color: rgba(110, 231, 160, 0.52);
}

/* ---- Collapsible Thesis Banner ---- */
.thesis-banner {
  flex: 0 0 auto;
  background: #111925;
  border-bottom: 1px solid rgba(54, 214, 200, 0.3);
  padding: 9px 16px;
}
.thesis-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: center;
  font-size: 11.5px;
  line-height: 1.45;
  color: #b7c4d6;
}
.thesis-inner strong { color: var(--accent-bright); }
.thesis-inner code {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--accent-2);
  font-size: 11px;
}

/* ---- Main Workspace Layout (Zero Page Scroll) ---- */
.layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 12px;
  padding: 10px 14px;
}

/* ---- Left Synth Rack (Clean Hairline Studio Layout) ---- */
.panel {
  width: 274px;
  flex: 0 0 274px;
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.group { border-top: 1px solid var(--line); padding-top: 10px; }
.group:first-child { border-top: none; padding-top: 0; }
.group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.group-head .kicker { margin-bottom: 0; }

.kicker {
  font-size: 10.5px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
  font-weight: 650;
}
.kicker-sub { font-size: 10.5px; color: var(--accent); }
.hint { text-transform: none; letter-spacing: 0; font-weight: 400; float: right; opacity: 0.75; font-size: 10px; }
.mono { font-family: var(--mono); }

/* ---- VST-Style A/B/C Sphere Slot Bank ---- */
.abc-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.abc-slots {
  display: inline-flex;
  background: var(--panel2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.abc-btn {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}
.abc-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.abc-btn[data-slot="A"].active {
  background: rgba(54, 214, 200, 0.18);
  border-color: rgba(54, 214, 200, 0.58);
  color: var(--accent-bright);
  box-shadow: 0 0 8px rgba(54, 214, 200, 0.18);
}
.abc-btn[data-slot="B"].active {
  background: rgba(255, 176, 77, 0.18);
  border-color: rgba(255, 176, 77, 0.58);
  color: #ffd166;
  box-shadow: 0 0 8px rgba(255, 176, 77, 0.18);
}
.abc-btn[data-slot="C"].active {
  background: rgba(255, 92, 168, 0.18);
  border-color: rgba(255, 92, 168, 0.58);
  color: #ff85c0;
  box-shadow: 0 0 8px rgba(255, 92, 168, 0.18);
}
.abc-bar.copy-armed .abc-btn:not(.active) {
  border-color: rgba(157, 140, 255, 0.72);
  border-style: dashed;
  color: #e2dcff;
  background: rgba(157, 140, 255, 0.09);
}
.abc-tools {
  display: inline-flex;
  gap: 4px;
}
.abc-tool {
  padding: 4px 7px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  background: var(--panel2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}
.abc-tool:hover { color: var(--text); border-color: var(--muted); }
.abc-tool.armed {
  background: rgba(157, 140, 255, 0.22);
  border-color: #9d8cff;
  color: #ece8ff;
}
.abc-tool.active {
  background: rgba(157, 140, 255, 0.18);
  border-color: rgba(157, 140, 255, 0.62);
  color: #cbbfff;
}

select {
  width: 100%;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12.5px;
  cursor: pointer;
}
select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.note {
  color: #9de8c0;
  font-size: 11.5px;
  margin-top: 6px;
  line-height: 1.42;
  background: rgba(110, 231, 160, 0.06);
  border-left: 2px solid rgba(110, 231, 160, 0.45);
  padding: 5px 8px;
  border-radius: 0 5px 5px 0;
}

.shell-meter {
  display: flex;
  justify-content: space-between;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11px;
  color: var(--muted);
}
.shell-meter b { color: var(--accent-bright); margin-left: 4px; }

/* ---- §§1-3 Dual-Sphere Time-Stretch, Lock-V & Modal Syzygy Controls ---- */
.vessel-head-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lock-vol-btn {
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  background: var(--panel2);
  border: 1px solid var(--line-2);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.14s ease;
}
.lock-vol-btn:hover { color: var(--text); border-color: var(--accent); }
.lock-vol-btn.active {
  background: rgba(255, 176, 77, 0.22);
  border-color: rgba(255, 194, 68, 0.78);
  color: #ffd166;
  box-shadow: 0 0 8px rgba(255, 176, 77, 0.22);
}

.syzygy-snap-row {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 6px;
}
.snap-lbl {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
  margin-right: 2px;
}
.snap-chip {
  flex: 1;
  min-width: 0;
  padding: 2px 3px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--panel2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.snap-chip:hover { color: var(--text); border-color: var(--accent); }
.snap-chip.active {
  background: rgba(110, 231, 160, 0.18);
  border-color: rgba(110, 231, 160, 0.65);
  color: #6ee7a0;
}

.stretch-mod-card {
  margin-top: 6px;
  background: rgba(16, 24, 35, 0.78);
  border: 1px solid rgba(54, 214, 200, 0.24);
  border-radius: 6px;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mod-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.mod-cell {
  background: rgba(9, 14, 21, 0.72);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 5px;
}
.mod-cell-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
  color: var(--muted);
  margin-bottom: 2px;
}
.mod-cell-top b {
  color: var(--accent-bright);
  font-size: 10px;
}
.mod-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.mod-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #36d6c8, #6ee7a0);
  border-radius: 2px;
}
.syzygy-status {
  font-size: 10px;
  text-align: center;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(54, 214, 200, 0.08);
  border: 1px solid rgba(54, 214, 200, 0.25);
  color: #b8ece2;
}
.syzygy-status.locked {
  background: rgba(255, 194, 68, 0.14);
  border-color: rgba(255, 194, 68, 0.55);
  color: #ffd166;
}
.stretch-route-row {
  display: flex;
  align-items: center;
  gap: 3px;
}
.route-lbl {
  font-size: 9.5px;
  color: var(--muted);
  margin-right: 2px;
  white-space: nowrap;
}
.route-chip {
  flex: 1;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--panel2);
  color: var(--muted);
  font-size: 9.5px;
  font-family: var(--mono);
  cursor: pointer;
}
.route-chip:hover { color: var(--text); }
.route-chip.active {
  background: rgba(54, 214, 200, 0.2);
  border-color: rgba(54, 214, 200, 0.65);
  color: var(--accent-bright);
}

.strobe-field {
  margin-top: 8px;
  background: rgba(255, 176, 77, 0.05);
  border: 1px solid rgba(255, 176, 77, 0.22);
  border-radius: 6px;
  padding: 5px 8px;
}
.strobe-field output { color: var(--gold); }
.strobe-field input[type=range] { accent-color: var(--gold); }
.strobe-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ---- Parameter Sliders ---- */
.field { margin-bottom: 8px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 2px;
}
.field output { color: var(--accent-bright); font-family: var(--mono); font-size: 11.5px; }
input[type=range] {
  width: 100%;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.highlight-field {
  background: rgba(54, 214, 200, 0.05);
  border: 1px solid rgba(54, 214, 200, 0.22);
  border-radius: 6px;
  padding: 5px 8px;
}
.highlight-field label { color: #b9ece6; font-weight: 500; }

.sub-field { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.sub-field input {
  width: 62px;
  background: var(--panel2);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  color: var(--text);
  padding: 2px 6px;
  font-size: 11.5px;
  font-family: var(--mono);
}
.sub-field span { color: var(--muted); font-size: 11px; }
.sub-field .mono { margin-left: auto; color: var(--accent-2); font-size: 11px; }

.field-row { display: flex; gap: 8px; margin-bottom: 8px; }
.field-row:last-child { margin-bottom: 0; }
.field.small { flex: 1; margin-bottom: 0; min-width: 0; }

/* ---- Collapsible Formula Patch Bay ---- */
.patch-drawer summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
  margin-bottom: 0;
}
.patch-drawer summary::-webkit-details-marker { display: none; }
.patch-drawer summary::before {
  content: "▸ ";
  color: var(--accent);
  margin-right: 4px;
}
.patch-drawer[open] summary::before { content: "▾ "; }
.summary-kicker span {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 10.5px;
  opacity: 0.75;
}
.drawer-body { margin-top: 8px; }
.formula-row { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.axis { width: 34px; font-family: var(--mono); color: var(--accent-bright); font-size: 12px; flex: 0 0 34px; }
.formula {
  flex: 1;
  min-width: 0;
  background: var(--panel2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 5px 7px;
}
.formula:focus { outline: 2px solid var(--accent); border-color: transparent; }
.formula.invalid { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.err { color: var(--red); font-size: 10.5px; min-height: 12px; margin: 0 0 2px 40px; font-family: var(--mono); }

.funcs-body {
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.75;
  font-family: var(--mono);
}
.funcs-body code {
  background: var(--panel2);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--accent-2);
}

/* ---- Right Stage: Hero 3D Sphere + Tabbed Dock ---- */
.stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.viewport {
  flex: 1 1 auto;
  min-height: 260px;
  position: relative;
  background: radial-gradient(850px 520px at 50% 48%, #101d29 0%, #080b10 74%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.viewport canvas { display: block; }

/* ---- Floating Viewport Glass HUD ---- */
.hud {
  position: absolute;
  top: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.hud-left { left: 10px; }
.hud-right { right: 10px; align-items: flex-end; }
.hud-right .hud-row { justify-content: flex-end; }

.hud-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
}
.hud-label {
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(13, 18, 26, 0.78);
  padding: 3px 6px;
  border-radius: 5px;
  font-family: var(--mono);
}
.hud-pill {
  pointer-events: auto;
  background: rgba(15, 21, 30, 0.78);
  backdrop-filter: blur(8px);
  color: var(--muted);
  border: 1px solid rgba(62, 78, 98, 0.55);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
}
.hud-pill:hover { color: var(--text); border-color: var(--accent); }
.hud-pill.active {
  background: rgba(24, 58, 66, 0.82);
  color: var(--accent-bright);
  border-color: rgba(54, 214, 200, 0.6);
  box-shadow: 0 0 10px rgba(54, 214, 200, 0.15);
}
.hud-pill.accent-coral.active {
  background: rgba(74, 26, 38, 0.84);
  color: #ff8c98;
  border-color: rgba(255, 107, 122, 0.7);
}
.hud-pill.accent-gold.active {
  background: rgba(72, 50, 18, 0.85);
  color: #ffd166;
  border-color: rgba(255, 194, 68, 0.72);
}
.hud-pill.accent-cyan.active {
  background: rgba(16, 62, 68, 0.88);
  color: #4df3dd;
  border-color: rgba(77, 243, 221, 0.78);
  box-shadow: 0 0 12px rgba(77, 243, 221, 0.22);
}
.hud-pill.accent-emerald.active {
  background: rgba(16, 60, 42, 0.88);
  color: #6ee7a0;
  border-color: rgba(110, 231, 160, 0.78);
  box-shadow: 0 0 12px rgba(110, 231, 160, 0.22);
}
.hud-pill.accent-green.active {
  background: rgba(5, 48, 22, 0.92);
  color: #00ff66;
  border-color: rgba(0, 255, 102, 0.82);
  box-shadow: 0 0 12px rgba(0, 255, 102, 0.28);
}

/* Harmor Void Palette Mode (§5.6): pure #000000 digital silence void */
body.harmor-void .viewport {
  background: #000000 !important;
  border-color: rgba(0, 255, 102, 0.42);
}

/* ---- Floating Dual-Sphere Modal Resonance & Archimedes Slice HUD Card (§§1–3) ---- */
.res-widget {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  width: 288px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(11, 16, 24, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(110, 231, 160, 0.42);
  border-radius: 11px;
  padding: 8px 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.54);
  transition: right 0.16s ease;
}
.res-widget[hidden] { display: none !important; }
.res-widget.shift-left { right: 204px; }
.res-badge {
  font-size: 10px;
  font-weight: 700;
  color: #6ee7a0;
  background: rgba(110, 231, 160, 0.14);
  border: 1px solid rgba(110, 231, 160, 0.45);
  padding: 1px 6px;
  border-radius: 4px;
}
.res-badge.locked {
  color: #ffd166;
  background: rgba(255, 194, 68, 0.18);
  border-color: rgba(255, 194, 68, 0.68);
}
.res-modes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.res-mode-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 4px;
  border-radius: 5px;
  background: rgba(20, 28, 40, 0.85);
  border: 1px solid var(--line-2);
  font-size: 9px;
  color: var(--muted);
}
.res-mode-item b { font-size: 11px; color: var(--text); margin-top: 1px; }
.res-mode-item em { font-style: normal; font-size: 8.8px; color: var(--muted); }
.res-mode-item.res-outer { border-color: rgba(77, 243, 221, 0.45); }
.res-mode-item.res-outer b { color: #4df3dd; }
.res-mode-item.res-inner { border-color: rgba(255, 107, 122, 0.45); }
.res-mode-item.res-inner b { color: #ff8c98; }
.res-mode-item.res-wall  { border-color: rgba(255, 176, 77, 0.45); }
.res-mode-item.res-wall  b { color: #ffd166; }

.res-arch-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
  color: var(--muted);
}
.arch-chip {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
}
.arch-chip.plateau {
  background: rgba(110, 231, 160, 0.16);
  border: 1px solid rgba(110, 231, 160, 0.55);
  color: #6ee7a0;
}
.arch-chip.cap {
  background: rgba(54, 214, 200, 0.14);
  border: 1px solid rgba(54, 214, 200, 0.45);
  color: #4df3dd;
}
.arch-canvas {
  width: 100%;
  height: 58px;
  display: block;
  background: rgba(8, 12, 18, 0.88);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.res-slice-ctl {
  display: flex;
  align-items: center;
  gap: 6px;
}
.res-slice-ctl .mag-chip {
  flex: 0 0 auto;
  padding: 2px 6px;
  font-size: 9.5px;
}
.res-slice-ctl .mag-chip.active {
  background: rgba(110, 231, 160, 0.22);
  border-color: rgba(110, 231, 160, 0.68);
  color: #6ee7a0;
}
#btnArchHelix.active {
  background: rgba(255, 209, 102, 0.2);
  border-color: rgba(255, 209, 102, 0.65);
  color: #ffd166;
}
.res-slice-ctl input[type=range] {
  flex: 1;
  height: 12px;
  accent-color: #6ee7a0;
}
.slice-z-val {
  font-size: 9.5px;
  color: #b8ece2;
  min-width: 50px;
  text-align: right;
}

/* ---- Floating Four-Bit Orbit & Quadray Palindrome HUD Card ---- */
.fourbit-widget {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 6;
  width: 288px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(11, 16, 24, 0.86);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(77, 243, 221, 0.38);
  border-radius: 11px;
  padding: 8px 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.52);
}
.fourbit-widget[hidden] { display: none !important; }

/* ---- Floating Grover's Search & Colliding Blocks (π) Rosetta Lens Card ---- */
.grover-widget {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 7;
  width: 326px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(11, 16, 24, 0.90);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 176, 77, 0.44);
  border-radius: 11px;
  padding: 8px 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.56);
}
.grover-widget[hidden] { display: none !important; }
.grv-title { color: var(--gold); }
.grv-head-right { display: inline-flex; align-items: center; gap: 5px; }
.grv-close {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--muted);
  border-radius: 4px;
  width: 18px;
  height: 18px;
  line-height: 15px;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.grv-close:hover { color: var(--text); border-color: var(--gold); }
.grv-mode-row, .grv-scale-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.grv-meter {
  background: rgba(17, 24, 36, 0.85);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.grv-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  color: var(--muted);
}
.grv-meter-head b { color: var(--accent-bright); font-size: 11.5px; }
.grv-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.grv-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.08s linear;
}
.grv-sub {
  font-size: 9.8px;
  color: #aebcd0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grv-rosetta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(9, 13, 20, 0.72);
  border: 1px solid var(--line);
}
.grv-ros-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 10px;
  line-height: 1.3;
}
.grv-ros-k {
  color: var(--accent-bright);
  font-family: var(--mono);
  font-size: 9.5px;
  white-space: nowrap;
}
.grv-ros-v {
  color: var(--text);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.fb-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--accent-bright);
}
.fb-nibble {
  font-size: 10.5px;
  font-weight: 700;
  color: #ffd166;
  background: rgba(255, 176, 77, 0.14);
  border: 1px solid rgba(255, 176, 77, 0.42);
  padding: 1px 6px;
  border-radius: 4px;
}
.fb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.fb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 4px;
  border-radius: 5px;
  background: rgba(20, 28, 40, 0.85);
  border: 1px solid var(--line-2);
  font-size: 9.5px;
  color: var(--muted);
}
.fb-item b { font-size: 11px; color: var(--text); margin-top: 1px; }
.fb-item.fb-cyan { border-color: rgba(77, 243, 221, 0.45); }
.fb-item.fb-cyan b { color: #4df3dd; }
.fb-item.fb-gold { border-color: rgba(255, 176, 77, 0.45); }
.fb-item.fb-gold b { color: #ffd166; }
.fb-item.fb-top { border-color: rgba(110, 231, 160, 0.45); }
.fb-item.fb-top b { color: #6ee7a0; }
.fb-item.fb-bot { border-color: rgba(90, 169, 255, 0.45); }
.fb-item.fb-bot b { color: #8ec5ff; }
.fb-live {
  font-size: 10.5px;
  color: #b8ece2;
  text-align: center;
  background: rgba(54, 214, 200, 0.07);
  border-radius: 4px;
  padding: 3px 6px;
}
.fb-btn-row {
  display: flex;
  gap: 4px;
}
.fb-btn-row .mag-chip {
  padding: 3px 5px;
  font-size: 9.8px;
}
.fb-btn-row .mag-chip.active {
  background: rgba(54, 214, 200, 0.2);
  color: var(--accent-bright);
  border-color: rgba(54, 214, 200, 0.65);
}

/* ---- Floating Circular Zoom-Magnifier Lens ---- */
.mag-widget {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(12, 17, 25, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 107, 122, 0.35);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.mag-widget[hidden] { display: none !important; }
.mag-canvas {
  width: 164px;
  height: 164px;
  border-radius: 50%;
  display: block;
}
.mag-controls { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.mag-btn-row { display: flex; justify-content: center; gap: 3px; }
.mag-chip {
  flex: 1;
  background: rgba(25, 33, 46, 0.9);
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 10px;
  font-family: var(--mono);
  cursor: pointer;
}
.mag-chip:hover { color: var(--text); }
.mag-chip.active {
  background: rgba(255, 107, 122, 0.2);
  color: #ff9aa4;
  border-color: rgba(255, 107, 122, 0.65);
}

/* ---- Tabbed Bottom Dock ---- */
.dock {
  flex: 0 0 228px;
  height: 228px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dock-bar {
  flex: 0 0 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line);
}

.dock-tabs { display: flex; gap: 3px; height: 100%; align-items: center; }
.dock-tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.dock-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.dock-tab.active {
  background: rgba(54, 214, 200, 0.14);
  color: var(--accent-bright);
  border-color: rgba(54, 214, 200, 0.42);
}

.telemetry-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
}
.tele-item { display: inline-flex; align-items: center; gap: 4px; }
.tele-item span { color: var(--muted); }
.tele-item b { color: var(--text); font-weight: 600; }

.zone-badge {
  font-style: normal;
  font-weight: 700;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(54, 214, 200, 0.14);
  border: 1px solid rgba(54, 214, 200, 0.35);
  color: var(--accent-bright);
}

.dock-pane {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 10px;
  gap: 10px;
}
.dock-pane.active { display: flex; }

.panel2d {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.panel2d-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.panel2d-head .kicker { margin: 0; font-size: 10px; }
.mini-canvas { flex: 1 1 auto; width: 100%; min-height: 0; display: block; }

.mini-btn {
  background: var(--panel2);
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 10.5px;
  cursor: pointer;
  white-space: nowrap;
}
.mini-btn:hover, .mini-btn.active {
  color: var(--accent-bright);
  border-color: var(--accent);
}
.mini-tag { font-size: 10.5px; color: var(--muted); }
.mini-tag b { color: var(--accent-bright); }
.accent-tag { color: var(--accent-2); }

/* ---- Tab 3: Frobenius Dock Layout ---- */
.frob-controls-card { flex: 0 0 270px; justify-content: space-between; }
.frob-form { display: flex; flex-direction: column; gap: 6px; font-size: 11px; }
.frob-generic-row { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.frob-generic-row select { width: 58px; padding: 2px 4px; font-size: 11px; }
.flex-1 { flex: 1; display: flex; align-items: center; gap: 5px; }
.frob-k-row { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.frob-k-row label { white-space: nowrap; }
.frob-k-row b { color: var(--accent-bright); }
.frob-readouts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  font-size: 10.5px;
  background: var(--panel2);
  padding: 5px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
}
.frob-readouts > div { display: flex; justify-content: space-between; gap: 8px; }
.frob-readouts span { color: var(--muted); }
.frob-readouts b { color: var(--accent-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Tab 4: IEEE-754 Float32 Bit Lab ---- */
.bits-pane { flex-direction: column; gap: 8px; }
.bits-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bits-header .kicker { margin: 0; }
.compact-seg { padding: 1px; }

.bits-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-height: 0;
}
.bit-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.bit-card-top { display: flex; align-items: center; gap: 7px; }
.bit-axis-lbl {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent-bright);
  background: rgba(54, 214, 200, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
}
.bit-val { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bit-exp { font-size: 10.5px; color: var(--gold); margin-left: auto; }
.bit-chip {
  font-style: normal;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  color: var(--muted);
}
.bit-chip.finite { color: var(--accent-2); border-color: rgba(110, 231, 160, 0.4); }
.bit-chip.inf { color: var(--gold); border-color: rgba(255, 176, 77, 0.5); }
.bit-chip.nan { color: var(--red); border-color: rgba(255, 107, 107, 0.5); }

.bit-hex { font-size: 12.5px; color: var(--accent-bright); letter-spacing: 0.5px; }
.bit-bin {
  font-size: 10.5px;
  letter-spacing: 0.4px;
  background: var(--panel2);
  padding: 5px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bit-bin .b-sign { color: var(--magenta); font-weight: 700; }
.bit-bin .b-exp { color: var(--gold); }
.bit-bin .b-mant { color: var(--accent-2); }

/* ---- Scrollbars ---- */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #283241; border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- Responsive Fallback for Smaller Screens ---- */
@media (max-width: 1040px) {
  .hide-narrow { display: none; }
  .thesis-inner { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  html, body { overflow: auto; height: auto; }
  .layout { flex-direction: column; }
  .panel { width: 100%; flex: none; }
  .viewport { min-height: 400px; }
  .dock { height: auto; flex: none; }
  .dock-pane.active { flex-direction: column; min-height: 360px; }
  .bits-grid { grid-template-columns: 1fr; }
}

/* ---- Tab 5: Agent Layer (additive — does not affect the other four panes) ---- */
.agent-pane { display: none; min-height: 0; }
.agent-pane.active { display: flex; overflow: hidden; }

/* The Agent dock gets extra vertical room so its three cards are readable. Only the
   Agent tab is affected: the other four tabs keep the original 228px dock. */
body[data-agent-active-tab="agent"] .dock { flex: 0 0 320px; height: 320px; }

.agent-card {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}
.agent-card > .panel2d-head,
.agent-card > .agent-actions,
.agent-card > .agent-label,
.agent-card > .agent-links,
.agent-card > .agent-hint { flex: 0 0 auto; }
.agent-card-bridge { flex: 1.25 1 0; }
.agent-card-tools { flex: 0 1 250px; }
.agent-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  white-space: nowrap;
}
.agent-badge[data-agent-status="bridge-active"] {
  color: var(--accent-2);
  border-color: rgba(110, 231, 160, 0.45);
  background: rgba(110, 231, 160, 0.12);
}
.agent-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.agent-actions .mini-btn.copy-ok {
  color: var(--accent-2);
  border-color: rgba(110, 231, 160, 0.55);
  background: rgba(110, 231, 160, 0.12);
}
.agent-label {
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 1px;
}
.agent-block {
  margin: 0;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text);
  overflow: auto;
  min-height: 0;
  word-break: break-all;
  white-space: pre-wrap;
  overscroll-behavior: contain;
}
#agentDeeplink { flex: 0 0 auto; max-height: 38px; color: var(--accent-bright); }
.agent-handoff {
  flex: 1 1 auto;
  min-height: 52px;
  font-size: 9.5px;
  line-height: 1.35;
  color: var(--muted);
}
.agent-state {
  flex: 1 1 auto;
  min-height: 0;
  white-space: pre;
  font-size: 9.5px;
  line-height: 1.35;
  overflow: auto;
}
.agent-tools {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.agent-tools li {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  line-height: 1.35;
  min-height: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}
.agent-tools li code { color: var(--accent-bright); flex: 0 0 auto; }
.agent-tools li .agent-tool-desc {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.agent-tools .agent-tool-empty { color: var(--muted); font-style: italic; }
.agent-links { display: flex; gap: 10px; font-size: 10px; flex-wrap: wrap; line-height: 1.3; }
.agent-links a { color: var(--accent); text-decoration: none; }
.agent-links a:hover { text-decoration: underline; }
.agent-hint { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1180px) {
  .dock-tab { padding: 4px 7px; font-size: 11px; }
  .agent-card-tools { flex: 0 1 210px; }
  body[data-agent-active-tab="agent"] .dock { flex: 0 0 300px; height: 300px; }
}

/* Keep the dock bar readable with the fifth (Agent) tab on narrower windows. */
@media (max-width: 1160px) {
  .telemetry-strip { display: none; }
}

/* Short viewports: give the instrument more room and let the agent cards scroll. */
@media (max-height: 820px) {
  body[data-agent-active-tab="agent"] .dock { flex: 0 0 288px; height: 288px; }
}


/* Agent card internal scroll affordances + slight extra room (visual review fixes). */
.agent-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.agent-mini-hint { font-size: 9px; letter-spacing: 0.02em; text-transform: none; color: var(--muted); white-space: nowrap; }
body[data-agent-active-tab="agent"] .dock { flex: 0 0 344px; height: 344px; }
.agent-block::-webkit-scrollbar { width: 6px; height: 6px; }
.agent-block::-webkit-scrollbar-thumb { background: #34405233; border-radius: 5px; }
.agent-block:hover::-webkit-scrollbar-thumb { background: #344052; }
@media (max-width: 1180px) {
  body[data-agent-active-tab="agent"] .dock { flex: 0 0 316px; height: 316px; }
}
@media (max-height: 820px) {
  body[data-agent-active-tab="agent"] .dock { flex: 0 0 300px; height: 300px; }
}

/* Agent card headers stay on one line when the dock is narrow; scrollable text
   fades out at the bottom so overflow is visibly scrollable (not silently clipped). */
.agent-card .panel2d-head { min-height: 16px; align-items: center; }
.agent-card .panel2d-head .kicker { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-card .panel2d-head .kicker code { font-size: 9.5px; }
.agent-card .panel2d-head .agent-badge { margin-left: 6px; }
.agent-handoff, .agent-state {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), rgba(0, 0, 0, 0) 100%);
}

/* The live-state <pre> holds one long compact JSON line: wrap it so the card shows
   the state vertically (readable) instead of a single horizontally-clipped line. */
.agent-state { white-space: pre-wrap; word-break: break-all; overflow-x: hidden; }

/* ---- Phase & Order N Ping-Pong / Repeat Automation ---- */
.field-head {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}
.field-head label {
  margin-bottom: 0;
  white-space: nowrap;
}
.field-head output {
  margin-left: auto;
  min-width: 24px;
  text-align: right;
}
.auto-pills {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 3px;
}
.auto-pill {
  background: var(--panel2);
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}
.auto-pill:hover { color: var(--text); border-color: rgba(110, 231, 160, 0.55); }
.auto-pill[data-auto-mode="pingpong"].active {
  background: rgba(110, 231, 160, 0.18);
  color: #6ee7a0;
  border-color: rgba(110, 231, 160, 0.72);
  box-shadow: 0 0 8px rgba(110, 231, 160, 0.22);
}
.auto-pill[data-auto-mode="repeat"].active {
  background: linear-gradient(90deg, rgba(110, 231, 160, 0.18), rgba(255, 82, 99, 0.2));
  color: #ffd3da;
  border-color: rgba(255, 107, 107, 0.68);
  box-shadow: 0 0 8px rgba(255, 92, 108, 0.2);
}

.range-auto-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.range-auto-wrap input[type=range] {
  position: relative;
  z-index: 2;
  margin: 0;
}
.auto-track-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.auto-track-overlay[hidden] { display: none !important; }

.auto-band {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 3px;
  background: rgba(110, 231, 160, 0.16);
  border-top: 1px solid rgba(110, 231, 160, 0.36);
  border-bottom: 1px solid rgba(110, 231, 160, 0.36);
}
.auto-track-overlay.mode-repeat .auto-band {
  background: linear-gradient(90deg, rgba(110, 231, 160, 0.16), rgba(255, 82, 99, 0.18));
  border-top-color: rgba(255, 140, 140, 0.35);
  border-bottom-color: rgba(255, 140, 140, 0.35);
}
.auto-track-overlay.mode-repeat.dir-rev .auto-band {
  background: linear-gradient(90deg, rgba(255, 82, 99, 0.18), rgba(110, 231, 160, 0.16));
}

.auto-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 10px;
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: ew-resize;
  display: flex;
  justify-content: center;
}
.auto-marker::before {
  content: "";
  width: 2.5px;
  height: 100%;
  border-radius: 2px;
  background: #6ee7a0;
  box-shadow: 0 0 7px rgba(110, 231, 160, 0.9);
}
.auto-marker::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 7px;
  height: 4px;
  border-radius: 2px;
  background: #6ee7a0;
}
.auto-track-overlay.mode-repeat .auto-marker.marker-end::before,
.auto-track-overlay.mode-repeat .auto-marker.marker-end::after {
  background: #ff5263;
  box-shadow: 0 0 7px rgba(255, 82, 99, 0.95);
}

.auto-panel {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(12, 17, 25, 0.85);
  border: 1px solid var(--line-2);
  font-size: 10.5px;
}
.auto-panel[hidden] { display: none !important; }

.auto-play-btn {
  width: 22px;
  height: 20px;
  flex: 0 0 22px;
  border-radius: 4px;
  border: 1px solid rgba(110, 231, 160, 0.45);
  background: rgba(110, 231, 160, 0.14);
  color: #6ee7a0;
  font-size: 9.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auto-play-btn:not(.active) {
  border-color: var(--line-2);
  background: var(--panel2);
  color: var(--muted);
}

.bound-ctl {
  display: inline-flex !important;
  align-items: center;
  gap: 3px;
  margin: 0 !important;
  flex: 1 1 0;
  min-width: 0;
}
.bound-ctl input[type=number] {
  width: 100%;
  min-width: 38px;
  background: var(--panel2);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--text);
  padding: 1px 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: center;
}
.bound-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 6px;
}
.bound-dot.green { background: #6ee7a0; box-shadow: 0 0 5px rgba(110, 231, 160, 0.8); }
.bound-dot.red { background: #ff5263; box-shadow: 0 0 5px rgba(255, 82, 99, 0.85); }

.auto-arrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  flex: 0 0 auto;
}
.auto-speed {
  width: auto !important;
  flex: 0 0 auto;
  padding: 1px 4px !important;
  font-size: 10px !important;
  font-family: var(--mono);
  border-radius: 4px !important;
}

/* ---- Theatre / Fullscreen / Pop-Out Main Display Mode ---- */
body.theatre-mode {
  height: 100dvh !important;
  overflow: hidden !important;
}
body.theatre-mode .topbar,
body.theatre-mode .thesis-banner,
body.theatre-mode .panel,
body.theatre-mode .dock {
  display: none !important;
}
body.theatre-mode .layout {
  padding: 0;
  gap: 0;
  height: 100dvh;
}
body.theatre-mode .stage {
  width: 100%;
  height: 100%;
  gap: 0;
}
body.theatre-mode #viewport3d {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
}

#viewport3d:fullscreen,
#viewport3d:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  background: radial-gradient(850px 520px at 50% 48%, #101d29 0%, #080b10 74%);
  border: none !important;
  border-radius: 0 !important;
}

.popout-sync-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(16, 62, 46, 0.86);
  border: 1px solid rgba(110, 231, 160, 0.55);
  color: #6ee7a0;
  white-space: nowrap;
}
.popout-sync-badge[hidden] { display: none !important; }
.hud-pill[hidden] { display: none !important; }

body.popout-mode #btnTheatre,
body.popout-mode #btnPopout {
  display: none !important;
}

body.hud-hidden #viewport3d .hud,
body.hud-hidden #viewport3d .fourbit-widget,
body.hud-hidden #viewport3d .grover-widget,
body.hud-hidden #viewport3d .mag-widget,
body.hud-hidden #viewport3d .theatre-bar {
  display: none !important;
}
.hud-restore {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  opacity: 0.42;
  font-size: 10.5px;
  font-family: var(--mono);
}
.hud-restore:hover { opacity: 1; }
.hud-restore[hidden] { display: none !important; }

.theatre-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(11, 16, 24, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(54, 214, 200, 0.34);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.52);
  max-width: calc(100% - 24px);
  flex-wrap: wrap;
  justify-content: center;
}
.theatre-bar[hidden] { display: none !important; }
.tb-ctl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tb-ctl input[type=range] {
  width: 96px;
  height: 14px;
}
.tb-lbl {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.tb-val {
  font-size: 11px;
  min-width: 32px;
  text-align: right;
  color: var(--accent-bright);
}
.tb-val.gold { color: var(--gold); min-width: 20px; }
.tb-sep {
  width: 1px;
  height: 18px;
  background: var(--line-2);
}
.tb-exit {
  padding: 3px 8px;
  font-size: 10.5px;
  border-color: rgba(255, 107, 122, 0.48);
  color: #ffb0b8;
}
.tb-exit:hover {
  border-color: #ff6b7a;
  color: #ffd5da;
}

/* =========================================================================
   SECTION 9: CLEAN VERTICAL LEFT RACK, VOLCANO MOD OVERLAYS,
              NATIVE-THEMED 5 · MOD & LOGIC TAB, & COLLAPSIBLE PANELS
   ========================================================================= */

.mono { font-variant-numeric: tabular-nums; }

/* ---- Clean Left Synth Rack Internals ---- */
.rack-top {
  flex: 0 0 auto;
  padding: 10px 11px 9px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.rack-top .abc-bar { margin-bottom: 0; }
.rack-top .abc-tool { padding: 3px 6px; font-size: 10px; }
.rack-top .collapse-ico {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  padding: 2px 6px;
  color: var(--muted);
}
.rack-top .collapse-ico:hover { color: var(--accent-bright); border-color: var(--accent); }
.rack-top select {
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 6px;
}
.compact-note {
  margin-top: 0;
  font-size: 10.5px;
  line-height: 1.34;
  padding: 4px 7px;
  max-height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rack-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 9px 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}
.rack-scroll::-webkit-scrollbar { width: 5px; }
.rack-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 999px; }

.rack-group {
  border-top: 1px solid var(--line);
  padding-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rack-group:first-child { border-top: none; padding-top: 0; }
.rack-group .group-head { margin-bottom: 2px; padding: 0 4px; }
.rack-group .kicker {
  font-size: 10px;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: 0;
}
.rack-hint {
  font-size: 9.5px;
  color: #556377;
  letter-spacing: 0.02em;
}

/* Sleek Lock-V Pill */
.panel .lock-vol-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  background: var(--panel2);
  border: 1px solid var(--line-2);
  color: var(--muted);
  cursor: pointer;
}
.panel .lock-vol-btn .lock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4e5b6e;
  display: inline-block;
}
.panel .lock-vol-btn.active {
  background: rgba(255, 176, 77, 0.16);
  border-color: rgba(255, 194, 68, 0.68);
  color: #ffd166;
}
.panel .lock-vol-btn.active .lock-dot {
  background: #ffd166;
  box-shadow: 0 0 6px rgba(255, 194, 68, 0.85);
}

/* Clean Hairline Parameter Rows + Volcano Drop Targets */
.param-row {
  position: relative;
  border-radius: 6px;
  padding: 4px 6px;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}
.param-row:hover { background: rgba(255, 255, 255, 0.025); }
body.mod-dragging .param-row[data-mod-target] {
  box-shadow: inset 0 0 0 1px rgba(54, 214, 200, 0.34);
  background: rgba(54, 214, 200, 0.045);
}
body.mod-dragging .param-row[data-mod-target].drop-hover {
  box-shadow: inset 0 0 0 1.5px var(--accent-bright), 0 0 14px rgba(54, 214, 200, 0.3);
  background: rgba(54, 214, 200, 0.15);
}

.param-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 1px;
}
.param-lbl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.param-head label {
  font-size: 11.5px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.param-sub {
  font-size: 9.5px;
  color: #5b6a80;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.param-val-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.param-val {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.val-cyan { color: var(--accent-bright); }
.val-emerald { color: var(--accent-2); }
.val-gold { color: var(--gold); }

.order-tag {
  font-size: 9.5px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(255, 176, 77, 0.13);
  color: var(--gold);
  line-height: 15px;
}

/* Volcano-style clickable mod badges on sliders */
.mod-badges {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.mod-pill-badge {
  background: rgba(54, 214, 200, 0.14);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0 5px;
  font-size: 9px;
  line-height: 13px;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.12s ease;
}
.mod-pill-badge:hover { transform: scale(1.08); filter: brightness(1.18); }

/* Clean slider track with live Volcano mod range bar & live tick */
.slider-wrap {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
}
.slider-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  margin: 0;
  position: relative;
  z-index: 2;
  cursor: pointer;
}
.slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}
.slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  margin-top: -4px;
  transition: transform 0.1s ease, background 0.12s ease;
}
.slider-wrap input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.18);
  background: var(--accent-bright);
}
.mod-range-bar {
  position: absolute;
  top: 7.5px;
  height: 3px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.14s ease;
}
.mod-live-dot {
  position: absolute;
  top: 4px;
  width: 4px;
  height: 10px;
  border-radius: 2px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 0 7px currentColor;
}
.mod-live-dot[hidden] { display: none !important; }

.param-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.param-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
}

/* Single-line Vessel Summary & 5 Clean Ratio Snaps */
.vessel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 3px 6px 2px;
  font-size: 10.5px;
  color: var(--muted);
}
.vessel-summary b { color: var(--text); font-weight: 600; }
.syzygy-pill {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  white-space: nowrap;
}
.syzygy-pill.locked {
  background: rgba(255, 176, 77, 0.16);
  color: #ffd166;
}
.panel .syzygy-snap-row {
  padding: 0 5px;
  gap: 4px;
  margin-bottom: 2px;
}
.panel .snap-chip {
  padding: 3px 2px;
  font-size: 10px;
  border-radius: 5px;
}

/* ---- Stage 1: Sentinel Outer Register (σ) & Clef-Identity / LCS Controls ---- */
.sentinel-row,
.clef-lcs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 3px 5px 2px;
  font-size: 10px;
  color: var(--muted);
}
.clef-lcs-row {
  margin: 2px 0 4px;
  padding: 3px 4px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.sentinel-lbl,
.clef-lbl {
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
}
.sentinel-step {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(12, 18, 28, 0.75);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 1px 2px;
}
.sent-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  width: 18px;
  height: 17px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.sent-btn:hover {
  background: rgba(77, 243, 221, 0.14);
  color: #4df3dd;
}
.sent-val {
  min-width: 38px;
  text-align: center;
  font-size: 9.8px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.sent-val.nonzero {
  color: #4df3dd;
  font-weight: 600;
}
.sent-auto-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.sent-auto-btn:hover {
  border-color: rgba(110, 231, 160, 0.5);
  color: var(--text);
}
.sent-auto-btn.active {
  background: rgba(110, 231, 160, 0.16);
  border-color: rgba(110, 231, 160, 0.6);
  color: #6ee7a0;
  font-weight: 600;
}
.lcs-readout {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
}
.lcs-readout.reduced {
  color: #ffd166;
  font-weight: 600;
}
.res-sentinel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(16, 26, 38, 0.85);
  border: 1px solid rgba(77, 243, 221, 0.3);
  font-size: 9.3px;
  color: #b7d5e8;
}
.res-sentinel-bar[hidden] { display: none !important; }
.horizon-chip {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 8.8px;
  font-weight: 600;
  color: #4df3dd;
  background: rgba(77, 243, 221, 0.12);
  border: 1px solid rgba(77, 243, 221, 0.35);
}
.horizon-chip.lcs {
  color: #6ee7a0;
  background: rgba(110, 231, 160, 0.14);
  border-color: rgba(110, 231, 160, 0.5);
}
.horizon-chip.dense {
  color: #ffd166;
  background: rgba(255, 194, 68, 0.14);
  border-color: rgba(255, 194, 68, 0.5);
}
.horizon-chip.warn {
  color: #ff8c98;
  background: rgba(255, 107, 122, 0.16);
  border-color: rgba(255, 107, 122, 0.55);
}

/* ---- Stage 2: Minimal Hairline Vessel Tuner Bar inside #resonanceWidget ---- */
.res-tuner-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(8, 12, 18, 0.86);
  border: 1px solid var(--line-2);
  font-size: 9.5px;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.res-tuner-bar.locked {
  border-color: rgba(110, 231, 160, 0.58);
  background: rgba(12, 24, 20, 0.9);
}
.tuner-id {
  appearance: none;
  flex: 0 0 auto;
  min-width: 34px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-2);
  color: #4df3dd;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  text-align: center;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.tuner-id:hover {
  border-color: rgba(77, 243, 221, 0.55);
  background: rgba(77, 243, 221, 0.1);
}
.res-tuner-bar.locked .tuner-id {
  color: #6ee7a0;
  border-color: rgba(110, 231, 160, 0.55);
  background: rgba(110, 231, 160, 0.14);
}
.res-tuner-bar.mode-note .tuner-id {
  color: #ffd166;
}
.res-tuner-bar.mode-note.locked .tuner-id {
  color: #6ee7a0;
}
.tuner-rail {
  position: relative;
  flex: 1 1 auto;
  height: 10px;
  display: flex;
  align-items: center;
}
.tuner-rail::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(154, 174, 198, 0.28);
}
.tuner-tick {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 1px;
  background: rgba(154, 174, 198, 0.34);
}
.tuner-tick.left { left: 0; }
.tuner-tick.mid {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1.5px;
  transform: translateX(-50%);
  background: rgba(110, 231, 160, 0.45);
}
.tuner-tick.right { right: 0; }
.res-tuner-bar.locked .tuner-tick.mid {
  background: #6ee7a0;
  box-shadow: 0 0 6px rgba(110, 231, 160, 0.75);
}
.tuner-needle {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #ffd166;
  box-shadow: 0 0 6px rgba(255, 209, 102, 0.7);
  transition: left 0.05s linear, background 0.12s ease;
}
.res-tuner-bar.locked .tuner-needle {
  background: #6ee7a0;
  box-shadow: 0 0 8px rgba(110, 231, 160, 0.95);
}
.res-tuner-bar.sat-hi .tuner-needle,
.res-tuner-bar.sat-lo .tuner-needle {
  background: #ff8c98;
  box-shadow: 0 0 6px rgba(255, 107, 122, 0.85);
}
.tuner-cents {
  flex: 0 0 auto;
  min-width: 39px;
  text-align: right;
  font-size: 9.2px;
  color: var(--muted);
}
.res-tuner-bar.locked .tuner-cents {
  color: #6ee7a0;
  font-weight: 600;
}
.tuner-rate {
  flex: 0 0 auto;
  min-width: 26px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 8.6px;
  text-align: center;
  color: #7d8da3;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.tuner-rate.lock-v {
  color: #6ee7a0;
  border-color: rgba(110, 231, 160, 0.42);
  background: rgba(110, 231, 160, 0.1);
  font-weight: 600;
}
.tuner-rate.moving {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.1);
}
body.harmor-void .res-tuner-bar {
  background: #000000;
  border-color: rgba(0, 255, 102, 0.28);
}
body.harmor-void .res-tuner-bar.locked {
  border-color: #00ff66;
  background: rgba(0, 255, 102, 0.08);
}
body.harmor-void .res-tuner-bar.locked .tuner-needle,
body.harmor-void .res-tuner-bar.locked .tuner-tick.mid {
  background: #00ff66;
  box-shadow: 0 0 8px rgba(0, 255, 102, 0.95);
}
body.harmor-void .res-tuner-bar.locked .tuner-id,
body.harmor-void .res-tuner-bar.locked .tuner-cents,
body.harmor-void .tuner-rate.lock-v {
  color: #00ff66;
}

.rack-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: #5c6a7f;
}
.rack-route-count {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
}
.rack-route-count:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.rack-route-count.has-routes { color: var(--accent-2); font-weight: 600; }

/* ---- Collapsible Left Panel & Bottom Dock ---- */
.dock-bar-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dock-collapse-btn {
  padding: 2px 7px;
  font-size: 10px;
  line-height: 1.2;
}

.edge-reveal {
  position: absolute;
  z-index: 15;
  background: rgba(16, 21, 30, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 4px 9px;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.edge-reveal:hover {
  color: var(--accent-bright);
  border-color: var(--accent);
  background: rgba(16, 25, 36, 0.94);
}
.edge-reveal[hidden] { display: none !important; }
.edge-reveal-left {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  border-left: none;
  border-radius: 0 7px 7px 0;
  padding: 8px 7px;
}
.edge-reveal-bottom {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom: none;
  border-radius: 7px 7px 0 0;
}

body.panel-collapsed .panel {
  display: none !important;
}
body.dock-collapsed .dock {
  display: none !important;
}

/* ---- Native-Themed Tab 5: Mod & Logic (matches original bottom dock 100%) ---- */
.mod-tab-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #445166;
  margin-right: 5px;
  vertical-align: middle;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.mod-tab-dot.active {
  background: var(--accent-2);
  box-shadow: 0 0 7px rgba(110, 231, 160, 0.9);
}

body[data-agent-active-tab="modlogic"] .dock { flex: 0 0 344px; height: 344px; }
@media (max-width: 1180px) {
  body[data-agent-active-tab="modlogic"] .dock { flex: 0 0 316px; height: 316px; }
}
@media (max-height: 820px) {
  body[data-agent-active-tab="modlogic"] .dock { flex: 0 0 300px; height: 300px; }
}

.modlogic-pane {
  display: none;
  flex-direction: column;
  gap: 7px;
  padding: 7px 10px 9px;
}
.modlogic-pane.active { display: flex; }

.mod-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 8px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  flex-wrap: wrap;
}
.mod-toolbar-left, .mod-toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.mod-kicker { margin-bottom: 0; font-size: 10px; color: var(--accent-bright); }
.mod-scrub-ctl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--muted);
}
.mod-scrub-ctl input[type="range"],
.mod-rt-depth input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  background: transparent;
  margin: 0;
  cursor: pointer;
}
.mod-scrub-ctl input[type="range"] { width: 82px; }
.mod-rt-depth input[type="range"] { width: 60px; }
.mod-scrub-ctl input[type="range"]::-webkit-slider-runnable-track,
.mod-rt-depth input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
.mod-scrub-ctl input[type="range"]::-webkit-slider-thumb,
.mod-rt-depth input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-bright);
  border: 2px solid var(--panel2);
  margin-top: -3.5px;
}
.mod-preset-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.mod-clear-btn:hover { border-color: var(--coral); color: var(--coral); }

.mod-grid-3 {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(250px, 1.05fr) minmax(300px, 1.35fr) minmax(220px, 0.9fr);
  gap: 8px;
}

.mod-col-sources, .mod-col-routes, .mod-col-scope {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  gap: 6px;
}

.mod-lfo-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
}
.mod-src-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.mod-src-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.mod-src-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
}
.mod-src-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.mod-mini-sel {
  width: auto !important;
  padding: 2px 5px !important;
  font-size: 10px !important;
  border-radius: 4px !important;
  background: var(--panel2);
  border: 1px solid var(--line-2);
  color: var(--text);
}
.mod-clef-sel {
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.35);
  padding: 2px 4px !important;
}

.mod-drag-handle {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: rgba(54, 214, 200, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  flex: 0 0 auto;
  transition: transform 0.12s ease;
}
.mod-drag-handle.small { width: 16px; height: 16px; }
.mod-drag-handle i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: block;
}
.mod-drag-handle.small i { width: 5px; height: 5px; }
.mod-drag-handle:hover { transform: scale(1.15); }
.mod-drag-handle:active { cursor: grabbing; }

.mod-tap-section {
  margin-top: auto;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}
.mod-sub-lbl {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}
.mod-tap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}
.mod-tap-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 2px 5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 9.8px;
}

.mod-route-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mod-empty {
  margin: auto 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  padding: 14px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 6px;
}
.mod-route-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.mod-route-row.selected { background: rgba(54, 214, 200, 0.07); }
.mod-route-row.muted { opacity: 0.48; }
.mod-rt-toggle {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  flex: 0 0 9px;
}
.mod-rt-src {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.mod-rt-arrow { color: var(--muted); font-size: 11px; }
.mod-rt-dst { font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap; }
.mod-rt-depth {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 82px;
}
.mod-rt-depth input[type="range"] { width: 56px; margin: 0; }
.mod-rt-pct { font-size: 10px; color: var(--muted); min-width: 32px; text-align: right; }
.mod-rt-del {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 0 3px;
  cursor: pointer;
}
.mod-rt-del:hover { color: var(--coral); }

.mod-scope-canvas {
  flex: 0 0 96px !important;
  height: 96px !important;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.mod-inspector {
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  font-size: 10.5px;
}
.mod-insp-empty { margin: auto 0; text-align: center; color: var(--muted); font-size: 10.5px; }
.mod-insp-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mod-insp-desc { color: var(--muted); font-size: 10px; line-height: 1.35; }
.mod-insp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
.mod-insp-foot b { color: var(--text); }
.mod-insp-btns { display: inline-flex; gap: 4px; }

/* Live SVG Patch Cable Overlay */
#modCableOverlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 95;
}

/* ---- Preset '!' Explainer Toggle (Unclipped When Expanded, Hidden By Default) ---- */
.preset-row {
  display: flex;
  align-items: stretch;
  gap: 5px;
}
.preset-row select {
  flex: 1 1 auto;
  min-width: 0;
}
.preset-info-btn {
  flex: 0 0 26px;
  width: 26px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--panel2);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.14s ease;
}
.preset-info-btn:hover {
  border-color: rgba(110, 231, 160, 0.65);
  background: rgba(110, 231, 160, 0.1);
}
.preset-info-btn.active {
  background: rgba(110, 231, 160, 0.18);
  border-color: rgba(110, 231, 160, 0.75);
  color: #a9f5c8;
  box-shadow: 0 0 8px rgba(110, 231, 160, 0.22);
}
.preset-save-btn {
  flex: 0 0 auto;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--panel2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.preset-save-btn:hover {
  border-color: rgba(255, 194, 68, 0.65);
  color: #ffd166;
  background: rgba(255, 194, 68, 0.1);
}
.preset-save-btn.active,
.preset-save-btn.has-saved {
  border-color: rgba(255, 194, 68, 0.5);
  color: #ffd166;
}
.preset-save-btn.active {
  background: rgba(255, 194, 68, 0.16);
}
.save-preset-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 7px;
  border-radius: 6px;
  background: rgba(12, 18, 28, 0.9);
  border: 1px solid rgba(255, 194, 68, 0.32);
}
.save-preset-bar[hidden] { display: none !important; }
.save-preset-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.save-preset-input {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(7, 11, 18, 0.9);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 4px 6px;
  color: var(--text);
  font-size: 11px;
  outline: none;
}
.save-preset-input:focus {
  border-color: rgba(255, 194, 68, 0.65);
}
.save-preset-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 9.5px;
  color: var(--muted);
}
.save-preset-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.save-preset-actions {
  display: inline-flex;
  gap: 3px;
  flex: 0 0 auto;
}
.save-act-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.save-act-btn:hover {
  border-color: rgba(77, 243, 221, 0.55);
  color: var(--text);
}
.save-act-btn.primary {
  background: rgba(255, 194, 68, 0.16);
  border-color: rgba(255, 194, 68, 0.6);
  color: #ffd166;
  font-weight: 600;
}
.save-act-btn.primary:hover {
  background: rgba(255, 194, 68, 0.25);
}
.save-act-btn.danger {
  color: #ff8c98;
  border-color: rgba(255, 107, 122, 0.4);
}
.save-act-btn.danger:hover {
  background: rgba(255, 107, 122, 0.16);
  border-color: rgba(255, 107, 122, 0.7);
}
.preset-explainer {
  margin-top: 0;
  font-size: 11px;
  line-height: 1.44;
  padding: 7px 9px;
  color: #b7f0cf;
  background: rgba(110, 231, 160, 0.07);
  border-left: 2px solid rgba(110, 231, 160, 0.6);
  border-radius: 0 6px 6px 0;
  max-height: 126px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.preset-explainer[hidden] { display: none !important; }

/* ---- Floating Auto z(t) Slice Slider as Volcano Drop Target ---- */
.res-slice-ctl {
  border-radius: 5px;
  padding: 2px 3px;
  transition: box-shadow 0.14s ease, background 0.14s ease;
}
.res-slider-wrap {
  flex: 1 1 auto;
  min-width: 0;
}
body.mod-dragging .res-slice-ctl[data-mod-target] {
  box-shadow: inset 0 0 0 1px rgba(54, 214, 200, 0.45);
  background: rgba(54, 214, 200, 0.08);
}
body.mod-dragging .res-slice-ctl[data-mod-target].drop-hover {
  box-shadow: inset 0 0 0 1.5px var(--accent-bright), 0 0 14px rgba(54, 214, 200, 0.35);
  background: rgba(54, 214, 200, 0.2);
}
.mod-dst-sel {
  color: var(--accent-bright) !important;
  font-weight: 600;
  max-width: 88px;
}

/* ---- Native-Themed '? Guide' Introduction & Interactive Demo Tab ---- */
.dock-tab-guide {
  color: var(--accent-2);
}
.dock-tab-guide.active {
  background: rgba(110, 231, 160, 0.15);
  color: #a9f5c8;
  border-color: rgba(110, 231, 160, 0.48);
}

body[data-agent-active-tab="guide"] .dock { flex: 0 0 344px; height: 344px; }
@media (max-width: 1180px) {
  body[data-agent-active-tab="guide"] .dock { flex: 0 0 316px; height: 316px; }
}
@media (max-height: 820px) {
  body[data-agent-active-tab="guide"] .dock { flex: 0 0 300px; height: 300px; }
}

.guide-pane {
  display: none;
  padding: 8px 10px 9px;
}
.guide-pane.active { display: flex; }

.guide-grid-3 {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(255px, 1.05fr) minmax(320px, 1.35fr) minmax(240px, 1fr);
  gap: 8px;
}

.guide-col-chapters, .guide-col-story, .guide-col-ref {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  gap: 6px;
}
.guide-step-btns { display: inline-flex; gap: 4px; }

.guide-chapters {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.guide-ch-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.13s ease;
}
.guide-ch-btn:hover {
  border-color: var(--line-2);
  color: var(--text);
  background: var(--panel2);
}
.guide-ch-btn.active {
  border-color: rgba(54, 214, 200, 0.55);
  background: rgba(54, 214, 200, 0.1);
  color: var(--text);
}
.guide-ch-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent-bright);
  flex: 0 0 auto;
}
.guide-ch-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.guide-ch-title {
  font-size: 11.5px;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guide-ch-sub {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guide-ch-play {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--accent-2);
  opacity: 0.78;
  flex: 0 0 auto;
}

.guide-story-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  font-size: 11.5px;
  line-height: 1.5;
  color: #c5d1e0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 2px;
}
.guide-story-body p { margin: 0; }
.guide-story-body code {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-2);
}
.guide-try-box {
  padding: 6px 8px;
  border-radius: 5px;
  background: rgba(54, 214, 200, 0.06);
  border-left: 2px solid var(--accent);
  font-size: 11px;
  color: #d6e6f2;
}
.guide-try-box b { color: var(--accent-bright); }

.guide-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}
.guide-run-btn {
  background: rgba(110, 231, 160, 0.16) !important;
  border-color: rgba(110, 231, 160, 0.55) !important;
  color: #a9f5c8 !important;
  font-weight: 600;
}
.guide-run-btn:hover {
  background: rgba(110, 231, 160, 0.25) !important;
}

.guide-ref-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
}
.guide-ref-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.guide-ref-row b { color: var(--text); font-weight: 600; }
.guide-ref-row code {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent-bright);
}
.guide-key {
  flex: 0 0 58px;
  text-align: center;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--panel2);
  border: 1px solid var(--line-2);
  color: var(--accent-bright);
  font-size: 9.5px;
  white-space: nowrap;
}

/* ---- Native-Themed Tab 6: Floor WT (3D Wavetable & MiniMeters 3D Spectrogram) ---- */
body[data-agent-active-tab="floorwt"] .dock { flex: 0 0 344px; height: 344px; }
@media (max-width: 1180px) {
  body[data-agent-active-tab="floorwt"] .dock { flex: 0 0 316px; height: 316px; }
}
@media (max-height: 820px) {
  body[data-agent-active-tab="floorwt"] .dock { flex: 0 0 300px; height: 300px; }
}

.floorwt-pane {
  display: none;
  flex-direction: column;
  gap: 7px;
  padding: 7px 10px 9px;
}
.floorwt-pane.active { display: flex; }

.floor-enable-btn.active {
  background: rgba(54, 214, 200, 0.18) !important;
  border-color: rgba(54, 214, 200, 0.65) !important;
  color: var(--accent-bright) !important;
}
.floor-audio-btn.active {
  background: rgba(255, 92, 168, 0.2) !important;
  border-color: rgba(255, 92, 168, 0.65) !important;
  color: #ff85c0 !important;
}

.floor-grid-2 {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(380px, 2.15fr) minmax(240px, 1fr);
  gap: 8px;
}
.floor-col-scope, .floor-col-info {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  gap: 6px;
}
.floor-canvas {
  flex: 1 1 auto !important;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.floor-readouts {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
  padding: 6px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10.5px;
}
.floor-readouts > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.floor-readouts b { color: var(--text); font-weight: 600; }
.floor-preset-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

/* ---- BPM, Window T & MP3 Lookahead Transport Controls ---- */
.floor-bpm-ctl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
}
.floor-bpm-ctl input[type="number"] {
  width: 48px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--accent-bright);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 4px;
  text-align: center;
}
.floor-file-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  background: rgba(16, 25, 36, 0.85);
  border: 1px solid rgba(54, 214, 200, 0.34);
  border-radius: 5px;
  font-size: 10.5px;
}
.floor-file-bar[hidden] { display: none !important; }
.floor-play-btn {
  min-width: 24px;
  color: var(--accent-2) !important;
  border-color: rgba(110, 231, 160, 0.48) !important;
}
.floor-file-name {
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--accent-bright);
  font-weight: 600;
}
.floor-file-seek {
  flex: 1 1 auto;
  min-width: 80px;
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  background: transparent;
  margin: 0;
  cursor: pointer;
}
.floor-file-seek::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
.floor-file-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  border: 2px solid var(--panel2);
  margin-top: -3.5px;
}
.floor-file-time {
  color: var(--muted);
  white-space: nowrap;
}
.floorwt-pane.drag-over {
  outline: 1.5px dashed var(--accent-bright);
  outline-offset: -4px;
  background: rgba(54, 214, 200, 0.05);
}

.floor-zoom-ctl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--muted);
  padding: 1px 5px;
  border-radius: 5px;
  transition: box-shadow 0.14s ease, background 0.14s ease;
}
.floor-zoom-wrap {
  width: 78px;
}
.floor-zoom-ctl span.mono { color: var(--accent-bright); min-width: 34px; }
body.mod-dragging .floor-zoom-ctl[data-mod-target] {
  box-shadow: inset 0 0 0 1px rgba(54, 214, 200, 0.45);
  background: rgba(54, 214, 200, 0.08);
}
body.mod-dragging .floor-zoom-ctl[data-mod-target].drop-hover {
  box-shadow: inset 0 0 0 1.5px var(--accent-bright), 0 0 14px rgba(54, 214, 200, 0.35);
  background: rgba(54, 214, 200, 0.2);
}
.floor-scope-head-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.floor-scope-btn {
  padding: 2px 6px !important;
  font-size: 10px !important;
}

/* ---- Read-Only BitWave Register Feed Strip (Section 10.6) ---- */
.floor-bw-btn.active {
  background: rgba(74, 242, 138, 0.16) !important;
  border-color: rgba(74, 242, 138, 0.62) !important;
  color: #7affad !important;
}
.floor-bw-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: rgba(7, 16, 13, 0.88);
  border: 1px solid rgba(74, 242, 138, 0.34);
  border-radius: 5px;
  font-size: 10px;
}
.floor-bw-bar[hidden] { display: none !important; }
.floor-bw-badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(74, 242, 138, 0.1);
  border: 1px solid rgba(74, 242, 138, 0.32);
  color: #6ee7a0;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}
.floor-bw-badge.live {
  background: rgba(74, 242, 138, 0.24);
  border-color: rgba(74, 242, 138, 0.8);
  color: #b7ffd0;
  box-shadow: 0 0 8px rgba(74, 242, 138, 0.28);
}
.floor-bw-badge.err {
  background: rgba(255, 107, 122, 0.16);
  border-color: rgba(255, 107, 122, 0.55);
  color: #ffb0b8;
}
.floor-bw-input {
  flex: 1 1 180px;
  min-width: 110px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: #b7ffd0;
  font-size: 10.5px;
  padding: 2px 7px;
  outline: none;
}
.floor-bw-input:focus {
  border-color: rgba(74, 242, 138, 0.65);
}
.floor-bw-apply {
  color: #7affad !important;
  border-color: rgba(74, 242, 138, 0.48) !important;
}
.floor-bw-sync.active {
  background: rgba(74, 242, 138, 0.22) !important;
  border-color: rgba(74, 242, 138, 0.78) !important;
  color: #b7ffd0 !important;
  box-shadow: 0 0 8px rgba(74, 242, 138, 0.24);
}
.floor-bw-frame-btn {
  padding: 1px 6px !important;
  font-size: 10px !important;
}
.floor-scope-btn[data-fscope="bitwave"].active {
  color: #7affad !important;
}
.floor-bw-twin.active {
  background: rgba(54, 214, 200, 0.16) !important;
  border-color: rgba(54, 214, 200, 0.62) !important;
  color: var(--accent-bright) !important;
}
.floor-bw-bow.active {
  background: rgba(255, 209, 102, 0.2) !important;
  border-color: rgba(255, 209, 102, 0.72) !important;
  color: #ffd166 !important;
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.22);
}
.floor-bw-expand {
  color: #ffd166 !important;
  border-color: rgba(255, 209, 102, 0.42) !important;
}
.floor-bw-null {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.36);
  color: #ffd166;
  font-size: 9.5px;
  white-space: nowrap;
}
.floor-bw-null[hidden] { display: none !important; }
.floor-tank-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 3px 8px;
  background: rgba(8, 17, 25, 0.90);
  border: 1px solid rgba(54, 214, 200, 0.34);
  border-radius: 5px;
  font-size: 10px;
}
.floor-tank-bar[hidden] { display: none !important; }
.floor-tank-badge {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(54, 214, 200, 0.14);
  border: 1px solid rgba(54, 214, 200, 0.42);
  color: var(--accent-bright);
  font-size: 9.5px;
  font-weight: 700;
}
.floor-tank-ref.active {
  background: rgba(110, 231, 160, 0.16) !important;
  border-color: rgba(110, 231, 160, 0.58) !important;
  color: #6ee7a0 !important;
}
.floor-tank-pulse {
  color: #ffd166 !important;
  border-color: rgba(255, 209, 102, 0.48) !important;
}
.floor-tank-stat {
  color: var(--muted);
  white-space: nowrap;
}
.floor-tank-stat b { color: var(--text); }
body.harmor-void .floor-tank-bar {
  background: rgba(2, 10, 5, 0.94);
  border-color: rgba(0, 255, 102, 0.34);
}
body.harmor-void .floor-tank-badge {
  background: rgba(0, 255, 102, 0.14);
  border-color: rgba(0, 255, 102, 0.52);
  color: #39ff14;
}
.collapse-grid { margin-top: 4px; }
.val-emerald { color: #6ee7a0; }
.conductive-bar {
  margin-top: 6px;
  padding: 5px 6px;
  border-radius: 6px;
  background: rgba(8, 17, 25, 0.85);
  border: 1px solid rgba(54, 214, 200, 0.34);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 9.5px;
}
.conductive-bar[hidden] { display: none !important; }
.conductive-bar-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.cond-ping-btn {
  color: #ffd166 !important;
  border-color: rgba(255, 209, 102, 0.5) !important;
}
.conductive-info {
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.harmor-void .conductive-bar {
  background: rgba(2, 10, 5, 0.94);
  border-color: rgba(0, 255, 102, 0.36);
}
.floor-readouts[hidden] { display: none !important; }
.floor-twin-readouts b {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.floor-twin-readouts .twin-row-p span { color: var(--accent-bright); }
.floor-twin-readouts .twin-row-conj span { color: #ffc575; }
.floor-twin-readouts .twin-row-null span { color: #ff82be; }
.floor-twin-readouts .twin-row-obs span,
.floor-twin-readouts .twin-row-obs b { color: #7affad; }

/* =========================================================================
   SECTION 11: MULTI-CHIME FRONT f(x) RACK & VISUAL "ALL CHIMES" CARD MENU
   ========================================================================= */

.stage-mode-seg {
  background: rgba(11, 16, 24, 0.84) !important;
  border: 1px solid var(--line-2) !important;
}
.stage-view-btn {
  padding: 2px 7px !important;
  font-size: 10.5px !important;
  font-weight: 600;
}

body[data-stage-view="rack"] #viewport3d .hud,
body[data-stage-view="rack"] #viewport3d .fourbit-widget,
body[data-stage-view="rack"] #viewport3d .grover-widget,
body[data-stage-view="rack"] #viewport3d .resonance-widget,
body[data-stage-view="rack"] #viewport3d .mag-widget,
body[data-stage-view="menu"] #viewport3d .hud,
body[data-stage-view="menu"] #viewport3d .fourbit-widget,
body[data-stage-view="menu"] #viewport3d .grover-widget,
body[data-stage-view="menu"] #viewport3d .resonance-widget,
body[data-stage-view="menu"] #viewport3d .mag-widget {
  display: none !important;
}

.chime-overlay {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.chime-overlay[hidden] { display: none !important; }
body.harmor-void .chime-overlay { background: #000000; }

.chime-ov-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(12, 18, 28, 0.92);
  border-bottom: 1px solid var(--line);
}
.chime-ov-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.chime-ov-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  white-space: nowrap;
}
.chime-ov-sub {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chime-ov-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* ---- Stage 3: ChimeRack Clockwork Master Bus Strip ---- */
.chime-bus-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 12px;
  background: rgba(9, 14, 22, 0.94);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
  flex-wrap: wrap;
}
body.harmor-void .chime-bus-bar {
  background: #000000;
  border-bottom-color: rgba(0, 255, 102, 0.25);
}
.cbb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cbb-item > span:first-child {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #6e7f96;
}
.cbb-item b { color: var(--text); font-weight: 600; }
.cbb-item b.is-null { color: #ff5ca8; }
.cbb-meter {
  width: 68px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: inline-block;
}
.cbb-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #36d6c8, #6ee7a0);
  border-radius: 999px;
  transition: width 0.08s linear;
}
body.harmor-void .cbb-meter i { background: #00ff66; }
.cbb-regime {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid var(--line-2);
}
.cbb-regime.osmosis {
  color: #6ee7a0;
  background: rgba(110, 231, 160, 0.14);
  border-color: rgba(110, 231, 160, 0.55);
}
.cbb-regime.coupled {
  color: #4df3dd;
  background: rgba(77, 243, 221, 0.12);
  border-color: rgba(77, 243, 221, 0.45);
}
.cbb-regime.wavefold {
  color: #ffd166;
  background: rgba(255, 209, 102, 0.14);
  border-color: rgba(255, 209, 102, 0.52);
}
.cbb-regime.bus_null {
  color: #ff5ca8;
  background: rgba(255, 92, 168, 0.16);
  border-color: rgba(255, 92, 168, 0.58);
}

/* ---- Side-by-Side Front f(x) Chime Rack ---- */
.chime-rack-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
}
.chime-rack-cards {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.chime-rack-cards::-webkit-scrollbar { height: 6px; }
.chime-rack-cards::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }

.chime-card {
  flex: 1 1 280px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
  cursor: pointer;
}
.chime-card:hover {
  border-color: rgba(54, 214, 200, 0.45);
}
.chime-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(54, 214, 200, 0.35), 0 8px 24px rgba(0, 0, 0, 0.4);
}
.chime-card-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 9px;
  background: rgba(16, 24, 36, 0.85);
  border-bottom: 1px solid var(--line);
}
.chime-card-id {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.chime-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3d4e63;
  flex: 0 0 auto;
}
.chime-dot.active {
  background: var(--accent-2);
  box-shadow: 0 0 7px rgba(110, 231, 160, 0.7);
}
.chime-slot-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-bright);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.chime-patch-name {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chime-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.chime-ico-btn {
  background: var(--panel2);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  padding: 2px 5px;
  cursor: pointer;
}
.chime-ico-btn:hover { color: var(--text); border-color: var(--accent); }
.chime-del-btn:hover { color: #ff8a96; border-color: rgba(255, 107, 122, 0.6); }
.chime-stage-btn {
  background: rgba(54, 214, 200, 0.12);
  border: 1px solid rgba(54, 214, 200, 0.42);
  border-radius: 4px;
  color: var(--accent-bright);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  cursor: pointer;
}
.chime-stage-btn:hover {
  background: rgba(54, 214, 200, 0.24);
  border-color: var(--accent-bright);
}

.chime-canvas-wrap {
  flex: 1 1 auto;
  min-height: 140px;
  position: relative;
  background: #060a10;
}
.chime-front-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chime-card-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 6px 9px;
  background: rgba(12, 18, 28, 0.9);
  border-top: 1px solid var(--line);
  font-size: 10px;
}
.chime-mini-ctl {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}
.chime-mini-ctl input[type="range"] {
  flex: 1 1 auto;
  min-width: 36px;
  height: 14px;
}
.chime-mini-ctl b {
  color: var(--text);
  font-weight: 600;
  min-width: 28px;
  text-align: right;
}
.chime-twin-btn {
  flex: 0 0 auto;
  padding: 2px 6px !important;
  font-size: 10px !important;
}

/* Right-hand vertical "+ ADD CHIME" rail (Screenshot 4 structural motif) */
.chime-add-rail {
  flex: 0 0 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(12, 18, 28, 0.72);
  border: 1px dashed rgba(54, 214, 200, 0.35);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.chime-add-rail:hover:not(:disabled) {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  background: rgba(54, 214, 200, 0.08);
}
.chime-add-rail:disabled { opacity: 0.35; cursor: not-allowed; }
.car-plus { font-size: 18px; line-height: 1; }
.car-lbl {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  font-weight: 600;
}

/* ---- Visual "All Chimes" Browser Menu (Screenshots 1 & 2) ---- */
.chime-menu-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
}
.chime-menu-sec[hidden] { display: none !important; }
.chime-menu-sec-head {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}
.chime-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 10px;
}
.chime-menu-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.14s ease, transform 0.12s ease, box-shadow 0.14s ease;
}
.chime-menu-card:hover {
  border-color: rgba(54, 214, 200, 0.55);
  transform: translateY(-1px);
}
.chime-menu-card.active {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(110, 231, 160, 0.36);
  background: rgba(16, 30, 32, 0.92);
}
.cmc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  font-size: 9.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.cmc-slot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-bright);
  font-weight: 700;
}
.cmc-acts { display: inline-flex; gap: 3px; }
.cmc-canvas {
  display: block;
  width: 100%;
  height: 112px;
  background: #060a10;
}
.cmc-meta {
  padding: 6px 8px 7px;
  border-top: 1px solid var(--line);
}
.cmc-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmc-sub {
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 2px;
}
.chime-menu-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 174px;
  background: rgba(12, 18, 28, 0.5);
  border: 1px dashed rgba(54, 214, 200, 0.36);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10.5px;
  letter-spacing: 0.1em;
}
.chime-menu-add:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  background: rgba(54, 214, 200, 0.08);
}
.cmc-plus {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

/* ===== Gestalt Monad Score (Ramanujan-Style Serif Equation + Converging Stream · Hidden by Default) ===== */
.seed-formula-dock {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  max-width: min(504px, calc(100% - 24px));
  pointer-events: none;
}
.seed-formula-dock.expanded {
  max-width: min(672px, calc(100% - 24px));
  max-height: calc(100% - 20px);
  z-index: 14;
}
@media (min-width: 1580px) {
  .seed-formula-dock:not(.expanded) { max-width: min(560px, calc(100% - 24px)); }
}
.seed-formula-dock[hidden] { display: none !important; }
body.hud-hidden .seed-formula-dock { display: none !important; }

.gm-serif {
  font-family: "Cambria Math", "STIX Two Math", Georgia, "Times New Roman", serif;
  font-feature-settings: "lnum" 1;
}
.gm-serif i { font-style: italic; font-weight: 400; }
.gm-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  font-size: 0.72em;
  line-height: 1.02;
  margin: 0 2px;
  transform: translateY(-1px);
}
.gm-frac > span:first-child {
  border-bottom: 1px solid rgba(168, 232, 194, 0.55);
  padding: 0 2px 1px;
}
.gm-frac > span:last-child { padding: 1px 2px 0; }
.gm-sep {
  display: inline-block;
  margin: 0 7px;
  color: rgba(160, 185, 210, 0.42);
  font-style: normal;
}
.gm-tick {
  font-weight: 600;
  color: #7bf0a8;
  text-shadow: 0 0 10px rgba(110, 231, 160, 0.32);
  font-variant-numeric: tabular-nums;
}

.seed-ribbon {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  padding: 7px 14px 6px;
  border-radius: 12px;
  background: rgba(4, 7, 11, 0.90);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(110, 231, 160, 0.24);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.62);
  color: #e6f3ec;
  cursor: pointer;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.seed-ribbon:hover {
  border-color: rgba(110, 231, 160, 0.52);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.68), 0 0 16px rgba(110, 231, 160, 0.12);
}
.gm-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}
.gm-clef {
  font-size: 9.4px;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(140, 175, 200, 0.20);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.gm-clef.key-shifted {
  color: var(--accent-2);
  border-color: rgba(110, 231, 160, 0.38);
  background: rgba(110, 231, 160, 0.08);
}
.gm-equation {
  font-size: 14.5px;
  line-height: 1.2;
  color: #daf5e3;
  letter-spacing: 0.015em;
  font-variant-numeric: tabular-nums;
}
.gm-controls {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
}
.sf-expand-ico {
  font-size: 9px;
  color: var(--muted);
  transition: color 0.15s ease;
}
.seed-ribbon:hover .sf-expand-ico { color: var(--accent-2); }
.sf-hide-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease;
}
.sf-hide-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.10);
}

/* Converging Identity Stream beneath the motionless formula (Ramanujan-Short aesthetic) */
.gm-stream-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  font-size: 10.2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gm-stream-sym {
  font-size: 12px;
  color: #58c4ff;
  font-weight: 600;
}
.gm-stream-eq { color: rgba(180, 200, 220, 0.48); }
.gm-stream-digits { letter-spacing: 0.08em; }
.gm-stream-digits i { font-style: normal; }
.gm-lit { color: #75ea9f; }
.gm-cur {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(110, 231, 160, 0.85);
  border-bottom: 1px solid rgba(110, 231, 160, 0.72);
}
.gm-dim { color: rgba(188, 206, 224, 0.36); }
.gm-dot { color: rgba(160, 180, 200, 0.32); }
.gm-stream-scalar {
  color: rgba(210, 228, 240, 0.72);
  font-size: 9.8px;
}

/* Unfolded Serene Gestalt Dual-Lens Sheet */
.seed-drawer {
  pointer-events: auto;
  width: min(656px, 94vw);
  min-height: 0;
  overflow-y: auto;
  background: rgba(4, 7, 11, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(110, 231, 160, 0.28);
  border-radius: 12px;
  padding: 8px 11px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: sfSlideUp 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.seed-drawer[hidden] { display: none !important; }
@keyframes sfSlideUp {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sf-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(140, 175, 200, 0.14);
}
.sf-side-tag {
  font-family: var(--mono);
  font-size: 9.2px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sf-side-a { color: #9de8be; }
.sf-bridge-pill {
  font-size: 9.4px;
  color: var(--gold);
  background: rgba(255, 176, 77, 0.08);
  border: 1px solid rgba(255, 176, 77, 0.28);
  border-radius: 999px;
  padding: 1px 9px;
  white-space: nowrap;
}

/* Interchangeable Musical Key Selector */
.gm-key-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}
.gm-key-btn {
  flex: 1;
  appearance: none;
  background: transparent;
  border: 1px solid rgba(140, 175, 200, 0.14);
  border-radius: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.3px;
  padding: 3px 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.gm-key-btn:hover {
  color: var(--text);
  border-color: rgba(110, 231, 160, 0.36);
}
.gm-key-btn.active {
  color: #eafff2;
  border-color: rgba(110, 231, 160, 0.62);
  background: rgba(110, 231, 160, 0.13);
}
.gm-key-btn.auto-picked {
  color: var(--accent-2);
  border-color: rgba(110, 231, 160, 0.35);
  background: rgba(110, 231, 160, 0.06);
}

/* Dimensional Self-Similarity Triad: 1 - eta^d = eta (psi / phi / 2) */
.gm-triad {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(140, 175, 200, 0.12);
  font-size: 9.4px;
}
.gm-triad-eq {
  font-size: 12px;
  color: #58c4ff;
  padding-right: 6px;
  border-right: 1px solid rgba(140, 175, 200, 0.16);
}
.gm-anchor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(190, 210, 225, 0.62);
  padding: 1px 4px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}
.gm-anchor b { color: var(--muted); font-weight: 600; }
.gm-anchor em { font-style: normal; font-size: 8.8px; color: rgba(160, 180, 200, 0.55); }
.gm-anchor.nearest { color: #d6f2e2; background: rgba(110, 231, 160, 0.06); }
.gm-anchor.locked { color: #7bf0a8; background: rgba(110, 231, 160, 0.14); }
.gm-anchor.locked em { color: var(--gold); font-weight: 700; }

/* Hairline Paired 5-Rung Closure Table */
.sf-ladder {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(140, 175, 200, 0.12);
}
.sf-ladder-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-bottom: 1px solid rgba(140, 175, 200, 0.10);
  background: transparent;
  cursor: pointer;
  transition: background 0.14s ease;
}
.sf-ladder-row:hover,
.sf-ladder-row.pinned {
  background: rgba(110, 231, 160, 0.07);
}
.sf-ladder-row.sf-row-close {
  border-bottom-style: dashed;
  border-bottom-color: rgba(255, 176, 77, 0.26);
}
.sf-cell-a, .sf-cell-b {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.sf-cell-b { text-align: right; align-items: flex-end; }
.sf-r-name, .sf-b-expr {
  font-size: 8.9px;
  color: rgba(165, 186, 205, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-c-expr { font-size: 12px; color: #d8f4e2; font-weight: 400; }
.sf-c-val { font-style: normal; font-size: 9.2px; color: rgba(190, 212, 230, 0.72); }
.sf-b-hex {
  font-size: 10.4px;
  color: #75ea9f;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.sf-nexus {
  font-size: 9px;
  color: rgba(255, 190, 105, 0.82);
  padding: 1px 5px;
}

.sf-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 2px 4px;
  font-size: 9.1px;
}
.sf-meta-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.sf-meta-item span { color: rgba(215, 232, 242, 0.82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-meta-item em { font-style: normal; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-meta-b { text-align: right; }

.sf-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.sf-actions .mag-chip {
  padding: 4px 6px;
  font-size: 9.4px;
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(140, 175, 200, 0.16);
}
.sf-actions .mag-chip.active {
  background: rgba(110, 231, 160, 0.14);
  color: var(--accent-2);
  border-color: rgba(110, 231, 160, 0.58);
}

/* Harmor Void integration: luminous green over pure #000000 silence */
body.harmor-void .seed-ribbon,
body.harmor-void .seed-drawer {
  background: rgba(0, 0, 0, 0.96);
  border-color: rgba(0, 255, 102, 0.36);
}
body.harmor-void .gm-tick,
body.harmor-void .gm-lit,
body.harmor-void .sf-b-hex,
body.harmor-void .sf-side-a,
body.harmor-void .gm-clef.key-shifted,
body.harmor-void .gm-anchor.locked {
  color: #39ff14;
}
body.harmor-void .gm-equation,
body.harmor-void .sf-c-expr {
  color: #d9ffe2;
}

@media (max-width: 1240px) {
  .seed-formula-dock:not(.expanded) .gm-stream-scalar,
  .seed-formula-dock:not(.expanded) .gm-dot { display: none; }
}
