:root {
  --bg: #0e1116;
  --card: #171a21;
  --card-2: #1c212b;
  --line: #2a3140;
  --ink: #f4f6fb;
  --muted: #8b93a7;
  --green: #3dd68c;
  --green-ink: #062117;
  --green-dim: rgba(61, 214, 140, 0.16);
  --blue: #7c9cff;
  --rose: #ff5d73;
  --warn: #f5b942;
  --sans: Inter, "Segoe UI", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.42; }
h1, h2, h3, p { margin: 0; }

.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 12px 14px;
  background: #0c0f14;
  border-right: 1px solid var(--line);
}
.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 8px; }
.mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: #151922; border: 1px solid var(--line); border-radius: 10px;
}
.eyebrow {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}
.brand strong { display: block; margin-top: 2px; font-size: 15px; font-weight: 650; letter-spacing: -0.03em; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-group-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.nav-group-btn span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.nav-group-btn em {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 99px;
}
.nav-group-database .nav-group-btn { color: #9ee8c4; }
.nav-group-database .nav-group-btn em {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.18);
}
.nav-group-tools {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.nav-group-tools .nav-group-btn { color: #b9c7ff; }
.nav-group-tools .nav-group-btn em {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.2);
}
.nav-group-btn i {
  width: 7px; height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.7;
  transform: rotate(-45deg);
}
.nav-group.open .nav-group-btn i { transform: rotate(45deg); }
.nav-children { display: none; padding: 0 4px 6px; }
.nav-group.open .nav-children { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #d5dbe8;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 550;
}
.nav-group-database .nav-item.active {
  background: rgba(61, 214, 140, 0.14);
  color: #7ddeb4;
}
.nav-group-tools .nav-item.active {
  background: rgba(124, 156, 255, 0.16);
  color: #b7c6ff;
}
.nav-empty { margin: 0; padding: 6px 12px 10px; color: var(--muted); font-size: 13px; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.pill, .lang, button.ghost {
  border: 1px solid var(--line);
  background: #12161e;
  color: #d5dbe8;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 550;
}
.pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.ok { border-color: rgba(61, 214, 140, 0.45); color: var(--green); background: var(--green-dim); }
.pill.bad { border-color: rgba(255, 93, 115, 0.45); color: var(--rose); background: rgba(255, 93, 115, 0.12); }
.lang, button.ghost { cursor: pointer; }

.main { min-width: 0; padding: 22px 28px 48px; display: flex; flex-direction: column; gap: 16px; }
.card, .page-head, .result, .stat, .signal, .progress-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.conn-bar { position: relative; z-index: 20; }
.conn-bar.is-open { z-index: 40; }
.conn-bar.is-open .conn-summary { position: relative; z-index: 37; }
.conn-summary {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  text-align: left;
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(16, 20, 28, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
}
.conn-copy { min-width: 0; flex: 1; }
.conn-bar.is-ok .conn-summary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(61, 214, 140, 0.05)),
    rgba(61, 214, 140, 0.14);
  border-color: rgba(61, 214, 140, 0.38);
  color: #e7fff3;
}
.conn-bar.is-bad .conn-summary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 93, 115, 0.04)),
    rgba(255, 93, 115, 0.12);
  border-color: rgba(255, 93, 115, 0.36);
  color: #ffe4e8;
}
.conn-summary .crumb { display: block; }
.conn-summary .lamp { flex: none; }
.conn-lines { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin-top: 8px; }
.conn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  line-height: 1.3;
}
.conn-chip em {
  flex: none;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
}
.conn-chip b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 620;
}
.conn-chip.pg-host {
  color: #d9ffe9;
  background: rgba(61, 214, 140, 0.16);
  border-color: rgba(61, 214, 140, 0.42);
}
.conn-chip.pg-user {
  color: #e7fff4;
  background: rgba(110, 196, 154, 0.14);
  border-color: rgba(150, 214, 176, 0.38);
}
.conn-chip.kev-url {
  color: #e4eaff;
  background: rgba(124, 156, 255, 0.16);
  border-color: rgba(124, 156, 255, 0.42);
}
.conn-chip.kev-run {
  color: #efe9ff;
  background: rgba(168, 146, 255, 0.16);
  border-color: rgba(176, 156, 255, 0.4);
}
.conn-scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(8, 10, 14, 0.28);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
}
.conn-scrim[hidden] { display: none; }
.conn-pop {
  position: absolute;
  z-index: 36;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  max-height: min(72vh, 640px);
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 22, 30, 0.62);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(22px) saturate(1.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
}
.conn-pop[hidden] { display: none; }

.crumb { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }
.crumb-sep { margin: 0 6px; }
.page-head { padding: 18px 18px 0; }
.page-title-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-top: 8px; min-width: 0; }
.page-title-row > div { min-width: 0; }
.page-head h1, .card h2, .card h3, dialog h2 { font-weight: 650; letter-spacing: -0.04em; line-height: 1.1; }
.page-head h1 { font-size: 32px; }
#pageLead, .card-head p, .lock-note, .hero-lead, .run-block p, .run-block .hint, dialog form > p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 72ch;
}
.status-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-dim);
  color: var(--green);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.subtabs { display: flex; gap: 6px; margin-top: 16px; border-bottom: 1px solid var(--line); }
.subtab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px 12px;
  border-bottom: 2px solid transparent;
  font-weight: 600;
}
.subtab.active { color: var(--ink); border-bottom-color: var(--green); }

.panel { display: flex; flex-direction: column; gap: 14px; }
.panel[hidden],
#pageHead[hidden],
#connBar[hidden],
.json-workspace[hidden],
.json-panel[hidden] { display: none; }
.card, .progress-card { padding: 16px 18px; }
.card h2 { font-size: 20px; }
.card h3 { font-size: 22px; }
.kicker {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
.card-head { margin-bottom: 14px; }
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 14px; }

.progress-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.hero-num { font-size: 56px; font-weight: 650; letter-spacing: -0.06em; line-height: 0.9; }
.bar { height: 8px; margin: 14px 0; background: #242a36; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7c9cff, var(--green)); border-radius: inherit; }

.metric-row, .feature-grid, .signal-row {
  display: grid;
  gap: 10px;
}
.metric-row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.signal-row { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 10px; }
.stat-board { display: flex; flex-direction: column; gap: 10px; }
.metric, .signal {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0;
}
.metric span, .signal span { display: block; color: var(--muted); font-size: 12px; }
.metric .idx { color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 4px; }
.metric strong, .signal strong { display: block; margin-top: 4px; font-size: 18px; letter-spacing: -0.04em; }
.stat { padding: 16px; min-height: 132px; }
.stat strong { display: block; margin-top: 6px; font-size: 34px; letter-spacing: -0.05em; line-height: 1; }
.stat p:last-child { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.4; }

.viz { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: center; }
.donut-wrap { position: relative; width: 150px; height: 150px; }
.donut-wrap svg { width: 100%; height: 100%; display: block; }
.donut-center {
  position: absolute; inset: 32px; display: grid; place-content: center; text-align: center;
}
.donut-center strong { font-size: 22px; letter-spacing: -0.04em; }
.donut-center span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.swatch { width: 10px; height: 10px; border-radius: 50%; }
.legend .share { color: var(--muted); font-size: 13px; font-weight: 650; }
.legend .count { font-size: 18px; font-weight: 650; letter-spacing: -0.04em; }
.bars, .skip-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bars { list-style: none; }
.hbar, .skip-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 48px; gap: 10px; align-items: center; font-size: 14px; }
.skip-row { grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 48px; }
.track { height: 8px; background: #242a36; border-radius: 999px; overflow: hidden; }
.fill { height: 100%; background: var(--blue); border-radius: inherit; }
.hbar:nth-child(odd) .fill, .skip-row .fill { background: var(--green); }
.hbar b, .skip-row b { text-align: right; font-variant-numeric: tabular-nums; }
.skip-bars li.empty-row, .empty {
  color: var(--muted);
  background: var(--card-2);
  border-radius: 12px;
  padding: 14px;
}

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .wide, .form button.primary { grid-column: 1 / -1; }
.form button.primary { justify-self: start; width: auto; }
.form label, .inline { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.form label.check { flex-direction: row; align-items: center; color: var(--ink); font-weight: 450; }
input, textarea, select {
  background: #10141b;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(124, 156, 255, 0.35); border-color: #4d5b78; }
textarea { width: 100%; min-height: 420px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.inline { flex-direction: row; align-items: center; gap: 8px; margin-top: 14px; }
.inline input { width: 96px; }

button.primary, button.danger, .dialog-actions button, .run-actions button, .log-filters button {
  border: 1px solid var(--line);
  background: #12161e;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
}
button.primary, .run-actions button.primary, .log-filters button {
  background: #f4f6fb;
  border-color: #f4f6fb;
  color: #11141a;
}
button.danger, .run-actions button.danger {
  background: rgba(255, 93, 115, 0.12);
  border-color: rgba(255, 93, 115, 0.4);
  color: var(--rose);
}
.run-actions button.test-btn { border-color: rgba(124, 156, 255, 0.5); color: var(--blue); background: rgba(124, 156, 255, 0.1); }
.run-block { margin-top: 4px; padding: 8px 2px 16px; border-bottom: 1px solid var(--line); }
.run-block:last-of-type { border-bottom: 0; }
.run-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.run-actions .inline { margin-top: 0; }
.restart-row { margin-top: 12px; }
.restart-row .hint { margin: 0; }

.msg { margin: 12px 0 0; font-size: 14px; }
.msg:not(:empty) { color: #ffd0d6; background: rgba(255, 93, 115, 0.12); border: 1px solid rgba(255, 93, 115, 0.35); padding: 10px 12px; border-radius: 12px; }
.msg.busy:not(:empty) { color: var(--ink); background: #12161e; border-color: var(--line); }
.lamp { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 650; }
.lamp .dot { width: 8px; height: 8px; border-radius: 50%; background: #5c6578; }
.lamp.ok { color: var(--green); }
.lamp.ok .dot { background: var(--green); }
.lamp.bad { color: var(--rose); }
.lamp.bad .dot { background: var(--rose); }
.lamp.busy { color: var(--warn); }
.lamp.busy .dot { background: var(--warn); animation: lamp-pulse 1s ease-in-out infinite; }
@keyframes lamp-pulse { 50% { opacity: 0.35; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 14px 0 0; }
.fact { background: var(--card-2); border-radius: 12px; padding: 10px 12px; }
.facts dt { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.facts dd { margin: 6px 0 0; font-size: 14px; word-break: break-all; }

.verify-list, .events { display: flex; flex-direction: column; gap: 12px; }
.result { padding: 16px 18px; }
.result header { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.qid { letter-spacing: 0.04em; text-transform: uppercase; font-weight: 650; }
.choice { font-size: 32px; margin: 8px 0 4px; letter-spacing: -0.045em; font-weight: 650; }
.confidence { color: var(--rose); font-weight: 700; margin-bottom: 10px; }
.prob { display: grid; grid-template-columns: minmax(90px, 200px) 1fr 64px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.payload { margin-top: 10px; }
.payload summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.payload pre { white-space: pre-wrap; font-size: 12px; color: #d5dbe8; font-family: var(--mono); }
.log-filters { display: grid; grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) 96px; gap: 10px; align-items: end; }
.log-filters label { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.log-filters input, .log-filters select, .log-filters button { width: 100%; height: 42px; }
.log-meta { margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
.event { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.event .detail { color: var(--rose); margin-top: 4px; word-break: break-word; }
.tag { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.tag.written { color: var(--green); }
.tag.skipped { color: var(--warn); }
.tag.failed { color: var(--rose); }

dialog { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
dialog form { width: min(640px, 92vw); background: var(--card); padding: 22px; border: 1px solid var(--line); border-radius: 18px; }
dialog h2 { font-size: 28px; }
dialog textarea { min-height: 220px; margin-top: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; }

.json-workspace { display: flex; flex-direction: column; gap: 16px; min-width: 0; max-width: 100%; }
.json-panel { min-width: 0; }
.json-workspace .page-head {
  padding: 20px 22px 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 46%),
    var(--card);
}
.json-workspace .page-head h1 { font-size: 28px; }
.json-workspace .page-lead {
  margin-top: 8px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
.json-workspace .subtabs { margin-top: 18px; }
.json-workspace .subtab { padding: 10px 2px 12px; margin-right: 18px; }
.json-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.json-col { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.json-label { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: 0.04em; }
.json-input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 280px;
  overflow: auto;
}
.json-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.json-actions button {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
}
.json-actions button.primary {
  background: #f4f6fb;
  border-color: #f4f6fb;
  color: #11141a;
}
.json-stats {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #141820;
}
.json-stats .json-error,
.json-stats .json-note {
  margin: 0 0 8px;
  overflow-wrap: break-word;
  font-size: 13px;
  line-height: 1.45;
}
.json-stats .json-error { color: var(--rose); font-weight: 650; }
.json-note { color: var(--green); font-weight: 650; }
.json-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.json-metric {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.json-metric em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.json-metric strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.json-tree, .json-diff {
  min-width: 0;
  min-height: 280px;
  max-height: 640px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
}
.json-empty { color: var(--muted); padding: 8px; overflow-wrap: anywhere; }
.json-row, .diff-cell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 32px;
  padding-right: 8px;
  border-radius: 8px;
}
.json-row:hover, .diff-cell:hover { background: rgba(255, 255, 255, 0.035); }
.jcopy {
  position: absolute;
  right: 4px;
  top: 50%;
  z-index: 2;
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(16, 20, 28, 0.9);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
}
.diff-cell.has-badge .jcopy { right: 34px; }
.json-row:hover .jcopy,
.diff-cell:hover .jcopy,
.json-row:focus-within .jcopy,
.diff-cell:focus-within .jcopy {
  opacity: 1;
  pointer-events: auto;
}
.jcopy-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #d5dbe8;
  padding: 3px 7px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.jcopy-btn:hover { background: rgba(124, 156, 255, 0.2); color: #fff; }
.jcopy-btn.is-done { color: var(--green); }
@media (hover: none) {
  .jcopy { position: static; transform: none; opacity: 1; pointer-events: auto; margin-left: auto; }
}
.twisty {
  width: 18px;
  height: 18px;
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  line-height: 1;
}
button.twisty:hover { color: var(--ink); }
.jkey, .jval, .jmiss {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jkey { flex: 0 1 auto; max-width: 46%; color: var(--blue); }
.jval { flex: 1 1 auto; color: var(--ink); }
.jmiss { flex: 1 1 auto; color: var(--rose); }
.jbadge {
  margin-left: auto;
  flex: none;
  min-width: 1.5em;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}
.diff-head, .diff-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.diff-head {
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: 6px;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  background: var(--card);
}
.diff-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff-line.is-diff .diff-cell { background: rgba(255, 93, 115, 0.16); }
.diff-line.is-diff .diff-cell:hover { background: rgba(255, 93, 115, 0.24); }

@media (max-width: 1100px) {
  .feature-grid, .signal-row, .split, .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viz { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: sticky; top: 0; z-index: 30; height: auto; width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { max-height: 240px; overflow: auto; }
  .side-foot { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 14px; }
  .page-head h1, .hero-num { font-size: 32px; }
  .form, .log-filters, .metric-row, .feature-grid, .signal-row, .json-split { grid-template-columns: 1fr; }
  .json-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .json-workspace .page-head h1 { font-size: 26px; }
  .page-title-row { display: block; }
  .conn-summary { align-items: flex-start; }
  .status-pill { margin-top: 10px; }
  .hbar, .skip-row, .event, .prob { grid-template-columns: 1fr; }
}
