/* Backloop dashboard. Dark, quiet, precise: Inter, mono eyebrows, hairlines, dot-matrix accents. */
:root {
  --bg: #000;
  --surface: #0a0c0e;
  --surface-2: #101316;
  --surface-3: #161a1e;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #f2f4f5;
  --text-2: #d3d9de;
  --muted: #88939b;
  --faint: #59636a;
  --accent: #bedcec;
  --accent-2: #9db8cc;
  --accent-soft: rgba(190, 220, 236, 0.1);
  --ok: #9ed9b0;
  --warn: #e8c585;
  --bad: #f0a3a3;
  --ok-soft: rgba(158, 217, 176, 0.1);
  --warn-soft: rgba(232, 197, 133, 0.1);
  --bad-soft: rgba(240, 163, 163, 0.1);
  --radius: 14px;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-variant-ligatures: none; }

.eyebrow {
  margin: 0;
  font: 500 10.5px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Dot-matrix type, the signature accent. */
.dot {
  color: var(--accent);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .dot {
    background-image: radial-gradient(circle, var(--accent) 1px, transparent 1.45px);
    background-size: 3px 3px;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* ── top bar ──────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand svg {
  width: 26px;
  height: 26px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
}
.top-stats { display: flex; gap: 22px; }
.top-stat { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.top-stat b { font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; }
.top-stat span { color: var(--muted); font-size: 12px; }
.integrations { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font: 500 11px/1.5 var(--mono);
  color: var(--text-2);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.badge.on::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.badge.dry::before { background: var(--warn); }

.me { display: flex; align-items: center; gap: 10px; padding-left: 14px; margin-left: 4px; border-left: 1px solid var(--line); }
.me:empty { display: none; }
.me img, .me .initial { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); object-fit: cover; }
.me .initial { display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface-3); }
.me .who { display: grid; line-height: 1.2; }
.me .who b { font-weight: 500; font-size: 13px; }
.me .who em { font: normal 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.me form { margin: 0; }
.me .link-button { margin: 0; }
/* Viewers see everything and change nothing (the server enforces it too). */
.viewer [data-action], .viewer #recluster, .viewer .workaround-input, .viewer .note-input { display: none !important; }

/* ── layout ───────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  min-height: calc(100vh - 60px);
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 0 0 20px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}
.sidebar-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  gap: 12px;
  padding: 18px 16px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.sidebar-title { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.sidebar-title h2 { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.sidebar-title .count { margin-left: 4px; color: var(--muted); font: 500 12px var(--mono); }
.filters { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.chip {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.active { color: var(--text); border-color: var(--line-2); background: var(--surface-3); }
.search {
  width: 100%;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
}
.search:focus { outline: none; border-color: rgba(190, 220, 236, 0.4); }

.cluster-list { list-style: none; margin: 0; padding: 8px 8px 0; display: grid; gap: 2px; }
.cluster-row {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.cluster-row:hover { background: var(--surface); }
.cluster-row:focus-visible { outline: 1px solid rgba(190, 220, 236, 0.5); outline-offset: -1px; }
.cluster-row.selected { background: var(--surface-2); }
.cluster-row.selected::before { content: ""; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--accent); }
.cluster-row + .cluster-row::after { content: ""; position: absolute; left: 10px; right: 10px; top: -1px; height: 1px; background: var(--line); }
.cluster-row:hover::after, .cluster-row.selected::after, .cluster-row:hover + .cluster-row::after, .cluster-row.selected + .cluster-row::after { display: none; }
.cluster-row .body { min-width: 0; }
.cluster-row h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.cluster-row.selected h3, .cluster-row:hover h3 { color: var(--text); }
.cluster-row .meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.cluster-row .meta .type { color: var(--accent-2); font: 500 10px/18px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.cluster-row .meta .blocked { color: var(--bad); }
/* Priority: the number, with a bar for how far it is to 100. */
.prio { --p: 50; display: grid; gap: 5px; padding-top: 1px; }
.prio b { font: 500 17px/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.prio i { display: block; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) calc(var(--p) * 1%), rgba(255, 255, 255, 0.1) 0); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 10px/1.6 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.s-new { color: var(--accent); }
.status.s-issue_open, .status.s-investigating { color: var(--accent-2); }
.status.s-awaiting_approval { color: var(--warn); }
.status.s-pr_open, .status.s-resolved { color: var(--ok); }
.status.s-dismissed { color: var(--faint); }
.type { font: 500 10px/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }

.sidebar > .link-button { margin: 14px 18px 0; }
.link-button { margin: 16px 0 0; background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; }
.link-button:hover { color: var(--text); }

/* ── detail ───────────────────────────────────────────────── */
.detail { padding: 32px 40px 80px; min-width: 0; max-width: 1180px; }
.detail-head { display: grid; gap: 12px; margin-bottom: 28px; }
.detail-head h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.035em;
  max-width: 900px;
}
.detail-head .summary { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.6; max-width: 820px; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; color: var(--muted); font-size: 13px; }
.facts b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.facts .bad b { color: var(--bad); }
.facts .prio { --p: 50; display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 4px; border: 1px solid var(--line-2); border-radius: 999px; }
.facts .prio b {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12px;
  background: radial-gradient(closest-side, var(--bg) 78%, transparent 80% 100%), conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255, 255, 255, 0.1) 0);
}
.keywords { display: flex; gap: 6px; flex-wrap: wrap; }
.keywords span { padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: 12px var(--mono); }

/* Pipeline stepper, inside the next-step card. */
.stepper { list-style: none; display: flex; margin: 0 0 18px; padding: 0 0 16px; border-bottom: 1px solid var(--line); counter-reset: step; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); white-space: nowrap; }
.stepper li:not(:last-child)::after { content: ""; flex: 1; height: 1px; margin: 0 10px 0 2px; background: var(--line-2); min-width: 8px; }
.stepper li.done::after { background: rgba(190, 220, 236, 0.35); }
.stepper i { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--faint); }
.stepper .done { color: var(--muted); }
.stepper .done i { background: var(--accent-2); border-color: var(--accent-2); }
.stepper .current { color: var(--text); font-weight: 500; }
.stepper .current i { width: 10px; height: 10px; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.card.next { border-color: rgba(190, 220, 236, 0.22); }
.card.next .card-head { flex-wrap: wrap; }
.actions .sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 2px; }

.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  min-width: 0;
}
.card + .card, .grid-2 + .card, .card + .grid-2, .grid-2 + .grid-2 { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card h2 { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }

/* Impact. */
.impact { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; }
.impact div { background: var(--surface); padding: 14px 16px; }
.impact b { display: block; font-size: 28px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.impact span { color: var(--muted); font-size: 12px; }
.bars { display: grid; gap: 10px; margin-top: 18px; }
.bar { display: grid; grid-template-columns: 160px 1fr 44px; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); }
.bar .track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 3px; }
.bar b { color: var(--text-2); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

.where { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; margin: 18px 0 0; font-size: 13px; }
.where dt { color: var(--muted); font-size: 12px; padding-top: 1px; }
.where dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.where code { font-size: 12px; }

.quotes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.quotes li { display: flex; gap: 12px; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.quotes li span { overflow-wrap: anywhere; }
.quotes li em { font-style: normal; color: var(--muted); font: 12px var(--mono); white-space: nowrap; }

/* Actions. */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.button:hover { background: var(--surface-3); text-decoration: none; }
.button.primary { background: var(--text); color: #0b0d0f; border-color: var(--text); }
.button.primary:hover { background: #fff; }
.button.approve { background: var(--ok); color: #07140c; border-color: var(--ok); }
.button.danger { color: var(--bad); border-color: rgba(240, 163, 163, 0.3); }
.button.ghost { border-color: transparent; color: var(--muted); }
.button:disabled { opacity: 0.4; cursor: not-allowed; }
.button .arrow { font-family: var(--sans); opacity: 0.7; }

.note-input, .workaround-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--bg);
}
.callout {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
}
.callout.warn { border-color: rgba(232, 197, 133, 0.25); background: var(--warn-soft); }
.callout.ok { border-color: rgba(158, 217, 176, 0.25); background: var(--ok-soft); }
.callout.bad { border-color: rgba(240, 163, 163, 0.25); background: var(--bad-soft); }

/* Investigation. */
.log, .diff, .testout {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  border-radius: 10px;
  background: #050607;
  border: 1px solid var(--line);
  font: 12px/1.6 var(--mono);
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.diff { white-space: pre; max-height: 520px; }
.diff span { display: block; min-height: 1.6em; padding: 0 6px; }
.diff .add { color: var(--ok); background: rgba(158, 217, 176, 0.07); }
.diff .del { color: var(--bad); background: rgba(240, 163, 163, 0.07); }
.diff .hunk { color: var(--accent-2); margin-top: 4px; }
.diff .file { color: var(--text); font-weight: 500; margin-top: 14px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.diff .file:first-child { margin-top: 0; }
.markdown { color: var(--text-2); }
.markdown h1, .markdown h2, .markdown h3 { font-size: 13px; font-weight: 500; margin: 16px 0 6px; color: var(--text); }
.markdown h1:first-child, .markdown h2:first-child, .markdown h3:first-child { margin-top: 0; }
.markdown p { margin: 6px 0; }
.markdown ul { margin: 6px 0; padding-left: 18px; }
.markdown code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.markdown pre { background: #050607; padding: 12px; border-radius: 8px; overflow: auto; }
.markdown blockquote { margin: 8px 0; padding-left: 12px; border-left: 2px solid var(--line-2); color: var(--muted); }
.markdown table { border-collapse: collapse; font-size: 12px; }
.markdown td, .markdown th { border: 1px solid var(--line); padding: 4px 8px; }
.pill { display: inline-flex; gap: 6px; align-items: center; padding: 2px 9px; border-radius: 999px; font: 500 11px var(--mono); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.run { background: var(--accent-soft); color: var(--accent); }
.pill.run::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }

/* Records & events. */
table.records { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.records th { text-align: left; font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.records td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.records td.goal { color: var(--text); max-width: 340px; }
.records td .msg { color: var(--muted); display: block; margin-top: 2px; }
.records .outcome { font: 11px var(--mono); }
.records .nowrap { white-space: nowrap; }
.copy { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.copy:not(.mono) { font-family: inherit; text-decoration: underline; text-underline-offset: 2px; }
.copy:hover { color: var(--text); }
.accounts { margin: 12px 0 0; }
#record-json { max-height: 60vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.outcome.blocked { color: var(--bad); }
.outcome.degraded { color: var(--warn); }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.events li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; font-size: 13px; color: var(--text-2); }
.events time { color: var(--faint); font: 11px var(--mono); padding-top: 2px; }

.empty { display: grid; place-items: center; min-height: 60vh; text-align: center; color: var(--muted); }
.empty h1 { color: var(--text); font-weight: 500; letter-spacing: -0.03em; font-size: 34px; margin: 12px 0; }
.empty pre { text-align: left; background: var(--surface); border: 1px solid var(--line); padding: 16px 18px; border-radius: 12px; color: var(--text-2); font-size: 12.5px; }

/* Dialog + toast. */
dialog {
  width: min(820px, calc(100vw - 32px));
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 24px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
dialog form { display: grid; gap: 14px; }
dialog label { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
dialog label .muted { display: inline; }
dialog input, dialog textarea { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); }
dialog textarea { font: 12.5px/1.55 var(--mono); resize: vertical; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  transition: all 0.2s;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(240, 163, 163, 0.4); color: var(--bad); }

@media (max-width: 1100px) {
  .grid-2, .grid-2.even { grid-template-columns: 1fr; }
  .stepper { flex-wrap: wrap; gap: 8px 16px; }
  .stepper li { flex: none; }
  .stepper li:not(:last-child)::after { display: none; }
  .top-stats { display: none; }
}
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; max-height: 50vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .detail { padding: 24px 16px 60px; }
  .impact { grid-template-columns: repeat(2, 1fr); }
  .integrations { display: none; }
  .bar { grid-template-columns: 110px 1fr 40px; }
}

/* ── views + MCP sessions ───────────────────────────────────────────────── */
.views { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.views a { padding: 4px 12px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 500; }
.views a:hover { color: var(--text); text-decoration: none; }
.views a.active { background: var(--surface-3); color: var(--text); }
.sidebar[hidden] { display: none; }
#session-scope:not(:empty) { margin-top: 10px; }
.chip.scope { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.odot { flex: none; width: 9px; height: 9px; margin: 6px 4px 0 6px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04); }
.odot.succeeded { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.odot.partial { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.odot.failed { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.odot.open { background: transparent; border: 1.5px solid var(--accent-2); box-shadow: none; }
.session-row h3 { font-weight: 500; }

.usecases tbody tr { cursor: pointer; }
.usecases tbody tr:hover td, .usecases tbody tr.selected td { background: var(--surface-2); }
.usecases td.bad b { color: var(--bad); }
.share { display: grid; grid-template-columns: 90px auto auto; align-items: center; gap: 8px; }
.share .track { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.share .fill { height: 100%; background: var(--accent-2); border-radius: 3px; }
.frustration { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.frustration.medium { color: var(--warn); }
.frustration.high { color: var(--bad); }

.verdict.succeeded { border-color: rgba(158, 217, 176, 0.25); }
.verdict.failed { border-color: rgba(240, 163, 163, 0.28); }
.verdict.partial { border-color: rgba(232, 197, 133, 0.25); }
.verdict h2 { font-size: 15px; font-weight: 500; line-height: 1.45; }
.review-ask { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08)); }
.score { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); }
.score b { font: 600 16px var(--mono); }
.score span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }

.replay { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--line-2); display: grid; gap: 10px; }
.replay .turn { position: relative; }
.replay .turn::before { content: ""; position: absolute; left: -23px; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line-2); }
.replay .turn p { margin: 0; }
.replay .turn .eyebrow { margin-bottom: 4px; }
.replay .user { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid rgba(190, 220, 236, 0.18); }
.replay .user::before { background: var(--accent); border-color: var(--accent); }
.replay .user p:last-child { color: var(--text); font-weight: 500; }
.replay .thinking { padding: 2px 14px; color: var(--text-2); font-style: italic; }
.replay .thinking .eyebrow { font-style: normal; }
.replay .call details { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.replay .call summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; }
.replay .call summary::-webkit-details-marker { display: none; }
.replay .call summary code { color: var(--text); }
.replay .call .mark { font-weight: 600; width: 14px; text-align: center; }
.replay .call.ok .mark { color: var(--ok); }
.replay .call.fail .mark { color: var(--bad); }
.replay .call.fail::before { background: var(--bad); border-color: var(--bad); }
.replay .call.fail details { border-color: rgba(240, 163, 163, 0.25); }
.replay .call .err-line { color: var(--bad); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.replay .call .when { margin-left: auto; white-space: nowrap; }
.replay .call details > :not(summary) { margin: 0 12px; }
.replay .call details > .eyebrow { margin-top: 4px; }
.replay .call details > pre { margin-bottom: 12px; max-height: 260px; }
.log.err { color: var(--bad); }
.replay { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.replay .turn { min-width: 0; }
.replay .call summary > code { flex: none; }
.replay .call details > pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ══ v2: home, triage inbox, problem page, command palette ══════════════════ */

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
  font: 500 10px/1 var(--mono);
  text-transform: uppercase;
}
.button kbd { margin-left: 2px; background: transparent; }
.button.primary kbd { color: #3b4247; border-color: rgba(0, 0, 0, 0.22); }
.button.small { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.page[hidden], .layout[hidden] { display: none; }
.num, .kpi .v, .c, .pscore { font-variant-numeric: tabular-nums; }
.bad { color: var(--bad); }

/* Top bar. */
.topbar { gap: 18px; }
.views a { display: inline-flex; align-items: center; gap: 6px; }
.nav-count { font: 500 10.5px/1 var(--mono); color: var(--muted); }
.nav-count:empty { display: none; }
.nav-count.warn { padding: 3px 5px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); }
.cmdk {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 240px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--faint);
  font-size: 12.5px;
  cursor: pointer;
}
.cmdk:hover { color: var(--muted); border-color: rgba(190, 220, 236, 0.3); }
.health { position: relative; }
.health:empty { display: none; }
.health > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; color: var(--muted); font: 12px var(--mono); padding: 6px 8px; border-radius: 8px; white-space: nowrap; }
.health > summary::-webkit-details-marker { display: none; }
.health > summary:hover, .health[open] > summary { background: var(--surface-2); color: var(--text-2); }
.health > summary span { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.hdot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.hdot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.hdot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.health-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 340px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  z-index: 10;
}
.hrow { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.hrow b { font-weight: 500; color: var(--text-2); text-align: right; }

/* Sparklines and small charts. */
.spark { display: block; overflow: visible; color: var(--accent-2); }
.spark polygon { fill: currentColor; opacity: 0.13; }
.spark polyline { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark circle { fill: currentColor; }
.spark.bad { color: var(--bad); }
.spark.ok { color: var(--ok); }
.spark.acc { color: var(--accent-2); }
.daybars svg { display: block; width: 100%; }
.daybars rect { fill: var(--accent-2); opacity: 0.75; }
.daybars rect:hover { opacity: 1; }
.daybars .mark, .dstack .grid { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.dstack .grid { stroke: var(--line-2); stroke-dasharray: none; }
.axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--faint); font: 10.5px var(--mono); }

/* ── home ── */
.page { min-width: 0; }
.home-view { max-width: 1280px; margin: 0 auto; padding: 28px 32px 80px; display: grid; gap: 18px; }
.home-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.home-head h1 { margin: 6px 0 0; font-size: 26px; font-weight: 500; letter-spacing: -0.03em; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; gap: 1px; background: var(--line); }
.kpi { display: grid; gap: 6px; align-content: start; padding: 16px 18px 14px; background: var(--surface); color: inherit; }
.kpi:hover { background: var(--surface-2); text-decoration: none; }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi .v { display: flex; align-items: baseline; gap: 10px; font-size: 28px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.1; }
.kpi .spark { width: 100%; margin-top: 4px; }
em.good, em.warn, em.flat { font: normal 500 11px var(--mono); letter-spacing: 0; }
em.good { color: var(--ok); }
em.warn { color: var(--warn); }
em.flat { color: var(--faint); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
.hpanel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; min-width: 0; }
.hpanel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.hpanel > header h2 { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.panel-empty { margin: 0; padding: 22px 16px; color: var(--muted); font-size: 13px; list-style: none; }
.needs, .movers, .tail { list-style: none; margin: 0; padding: 0; }
.needs li + li, .movers li + li, .tail li + li { border-top: 1px solid var(--line); }
.needs a { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; color: inherit; }
.needs a:hover, .movers a:hover, .tail a:hover { background: var(--surface-2); text-decoration: none; }
.needs .t { display: grid; min-width: 0; }
.needs .t b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.needs .t small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font: 500 12px var(--mono); background: var(--surface-3); color: var(--muted); }
.ic.warn { background: var(--warn-soft); color: var(--warn); }
.ic.bad { background: var(--bad-soft); color: var(--bad); }
.ic.acc { background: var(--accent-soft); color: var(--accent); }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; color: var(--muted); font-size: 11px; min-width: 0; }
.legend span { white-space: nowrap; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.s1 { fill: var(--bad); background: var(--bad); }
.s2 { fill: var(--warn); background: var(--warn); }
.s3 { fill: var(--accent); background: var(--accent); }
.s4 { fill: #3d4a52; background: #3d4a52; }
.dstack { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 0 8px; padding: 14px 16px 12px; }
.dstack svg { display: block; width: 100%; }
.dstack rect:hover { opacity: 0.8; }
.dstack .axis { grid-column: 2; }
.yaxis { display: flex; flex-direction: column; justify-content: space-between; text-align: right; color: var(--faint); font: 10px var(--mono); padding: 0 0 2px; }
.movers a { display: grid; grid-template-columns: minmax(0, 1fr) 70px 40px; gap: 12px; align-items: center; padding: 10px 16px; color: inherit; }
.movers .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.movers b { font: 500 12px var(--mono); text-align: right; }
.up { color: var(--bad); }
.down { color: var(--ok); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
.tail a { display: grid; grid-template-columns: 64px 70px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 16px; color: var(--text-2); font-size: 12.5px; }
.tail time { color: var(--faint); font: 11px var(--mono); }
.tail .outcome { font: 11px var(--mono); color: var(--muted); }
.tail .g { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tail .muted { font: 11px var(--mono); white-space: nowrap; }

/* ── triage inbox ── */
.inbox { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: calc(100vh - 60px); }
.inbox-bar { position: sticky; top: 60px; z-index: 3; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 24px; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, 0.9); backdrop-filter: blur(10px); }
.inbox-bar h1 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.inbox-bar .count { color: var(--muted); font: 500 12px var(--mono); margin-left: 4px; }
.inbox-bar .search { width: min(360px, 100%); }
.bulk { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.bulk:empty { display: none; }
.inbox-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.ilist { list-style: none; margin: 0; padding: 0 0 24px; border-right: 1px solid var(--line); min-width: 0; }
.igroup { display: flex; align-items: center; gap: 8px; padding: 9px 24px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 500; position: sticky; top: 121px; z-index: 1; }
.igroup .n { color: var(--muted); font: 500 11px var(--mono); }
.igroup .status::before { width: 6px; height: 6px; }
.irow { display: grid; grid-template-columns: 18px 30px minmax(0, 1fr) 90px 56px 44px 44px; gap: 12px; align-items: center; padding: 9px 24px 9px 20px; border-bottom: 1px solid var(--line); cursor: pointer; border-left: 2px solid transparent; }
.irow:hover { background: var(--surface); }
.irow.cursor { background: var(--surface-2); border-left-color: var(--accent); }
.irow.checked { background: var(--accent-soft); }
.icheck { width: 16px; height: 16px; padding: 0; border: 1px solid var(--line-2); border-radius: 4px; background: transparent; cursor: pointer; opacity: 0.5; display: grid; place-items: center; }
.irow:hover .icheck, .irow.cursor .icheck, .irow.checked .icheck { opacity: 1; }
.irow.checked .icheck { background: var(--accent); border-color: var(--accent); }
.irow.checked .icheck::after { content: ""; width: 8px; height: 4px; border: 2px solid #000; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.pscore { display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 4px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); font: 500 11px var(--mono); }
.pscore.hot { background: var(--bad-soft); color: var(--bad); }
.pscore.mid { background: var(--warn-soft); color: var(--warn); }
.ititle { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ititle b { font-weight: 500; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irow.cursor .ititle b, .irow:hover .ititle b { color: var(--text); }
.ititle .type { flex: none; }
.ispark { display: flex; justify-content: center; }
.irow .c { text-align: right; color: var(--muted); font: 11.5px var(--mono); white-space: nowrap; }
.irow .c.bad { color: var(--bad); }
.irow .pill { justify-self: center; }
.peek { position: sticky; top: 121px; align-self: start; max-height: calc(100vh - 121px); overflow-y: auto; display: grid; gap: 12px; align-content: start; padding: 20px; }
.peek:empty { display: none; }
.peek h2 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; }
.peek h2 a { color: var(--text); }
.peek blockquote { margin: -4px 0 0; padding: 9px 12px; border-left: 2px solid var(--line-2); border-radius: 0 8px 8px 0; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.props { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px 12px; margin: 4px 0; font-size: 12.5px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.props code { font-size: 11.5px; }
.inbox-keys { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0; padding: 10px 24px; border-top: 1px solid var(--line); background: rgba(10, 12, 14, 0.94); backdrop-filter: blur(8px); color: var(--muted); font-size: 12px; }
.inbox-keys span { display: inline-flex; gap: 4px; align-items: center; }
.inbox-keys .link-button { margin: 0 0 0 auto; }

/* ── problem page ── */
.problem { max-width: 1400px; margin: 0 auto; }
.phead { position: sticky; top: 60px; z-index: 3; padding: 14px 32px 0; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, 0.92); backdrop-filter: blur(10px); }
.crumbs { display: flex; align-items: center; gap: 14px; font-size: 12.5px; }
.crumbs .muted { display: inline-flex; gap: 4px; align-items: center; }
.ptitle { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 10px; flex-wrap: wrap; }
.pt { display: grid; gap: 6px; min-width: 0; flex: 1 1 420px; }
.pt h1 { margin: 0; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.2; font-weight: 500; letter-spacing: -0.03em; }
.pt .facts { margin: 0; font-size: 12.5px; }
.ptabs { display: flex; gap: 22px; margin-top: 14px; }
.ptabs a { padding: 9px 0 10px; color: var(--muted); font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; display: inline-flex; gap: 6px; align-items: baseline; }
.ptabs a:hover { color: var(--text); text-decoration: none; }
.ptabs a.active { color: var(--text); border-color: var(--accent); }
.ptabs em { font: normal 11px var(--mono); color: var(--faint); }
.pbody { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.pmain { padding: 24px 32px 80px; display: grid; gap: 26px; align-content: start; min-width: 0; border-right: 1px solid var(--line); }
.pmain > section { display: grid; gap: 10px; }
.pmain .card + .card { margin-top: 0; }
.pmain .lead { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.6; max-width: 76ch; }
.sec { margin: 0; display: flex; gap: 10px; align-items: baseline; font: 500 10.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2); }
.sec .muted { font: 12px var(--sans); letter-spacing: 0; text-transform: none; }
.callout.next { display: grid; gap: 4px; }
.callout.next p { margin: 0; }
.voice { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.voice > div { display: grid; gap: 10px; align-content: start; padding: 14px; background: var(--surface); min-width: 0; }
.voice .quotes li { padding: 8px 10px; font-size: 12.5px; }
.rail { padding: 22px 22px 60px; display: grid; gap: 20px; align-content: start; position: sticky; top: 200px; align-self: start; }
.prop { display: grid; gap: 8px; min-width: 0; }
.prop > span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; }
.prop p { margin: 0; color: var(--text-2); font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips .chip { display: inline-flex; gap: 5px; align-items: baseline; padding: 3px 7px; border: 0; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font: 11.5px var(--mono); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: default; text-decoration: none; }
.chips a.chip, .chips button.chip { cursor: pointer; }
.chips a.chip:hover, .chips button.chip:hover { color: var(--text); background: #1d2227; }
.chips .chip em { font-style: normal; color: var(--faint); }
.vstep { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.vstep li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--faint); }
.vstep i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--faint); }
.vstep .done { color: var(--muted); }
.vstep .done i { background: var(--accent-2); border-color: var(--accent-2); }
.vstep .current { color: var(--text); font-weight: 500; }
.vstep .current i { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.minibars { display: grid; gap: 6px; }
.minibars div { display: grid; grid-template-columns: 78px minmax(0, 1fr) 40px; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.minibars i { height: 4px; border-radius: 2px; background: var(--surface-3); position: relative; overflow: hidden; }
.minibars i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--accent-2); }
.minibars b { font: 500 11px var(--mono); color: var(--text-2); text-align: right; }
.menu { position: relative; }
.menu > summary { list-style: none; padding: 8px 12px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; display: grid; min-width: 260px; padding: 6px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
.menu-pop button { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 13px; text-align: left; cursor: pointer; }
.menu-pop button:hover { background: var(--surface-3); color: var(--text); }
.ev-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ev-bar .search { width: min(380px, 100%); }
.ev-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ev-table .records td, .ev-table .records th { padding-left: 14px; }

/* ── palette, picker, shortcuts ── */
dialog.palette { width: min(620px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.palette input { width: 100%; padding: 16px 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 15px; outline: none; }
.palette ul, .pick-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.palette li[role="option"], .pick-list li[role="option"] { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--text-2); cursor: pointer; }
.palette li[role="option"] > span:first-child, .pick-list li[role="option"] > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette li[aria-selected="true"], .pick-list li[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.pick-list li[aria-selected="true"] { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.palette li:hover, .pick-list li:hover { background: var(--surface-3); }
.pgroup { padding: 10px 12px 4px; color: var(--faint); font: 500 10px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.palette-foot { display: flex; gap: 16px; margin: 0; padding: 9px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.palette-foot span { display: inline-flex; gap: 4px; align-items: center; }
dialog.picker { width: min(640px, calc(100vw - 32px)); }
.pick-list { border: 1px solid var(--line); border-radius: 10px; max-height: 44vh; }
.shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; }
.shortcuts h3 { margin: 0 0 10px; font-size: 13px; font-weight: 500; }
.shortcuts p { display: flex; align-items: center; gap: 4px; margin: 0 0 8px; color: var(--muted); font-size: 12.5px; }
.shortcuts p span { margin-left: 8px; color: var(--text-2); }

/* ── review station ── */
.review { display: grid; grid-template-columns: 290px minmax(0, 1fr) 360px; height: calc(100vh - 60px); }
.rqueue { border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding-bottom: 20px; }
.rgroup { display: flex; justify-content: space-between; margin: 0; padding: 16px 18px 8px; font: 500 10px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.rgroup span { color: var(--muted); }
.rqueue ol { list-style: none; margin: 0; padding: 0 8px; display: grid; gap: 2px; }
.ritem { display: grid; gap: 7px; padding: 10px 12px; border-radius: 9px; color: inherit; border-left: 2px solid transparent; }
.ritem:hover { background: var(--surface-2); text-decoration: none; }
.ritem.on { background: var(--surface-3); border-left-color: var(--accent); }
.ritem.past { opacity: 0.6; }
.ritem.past.on { opacity: 1; }
.ritem .t { font-size: 13px; line-height: 1.35; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ritem.on .t { color: var(--text); }
.ritem .m { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 11px; }
.ritem .m .mono { color: var(--muted); font-size: 10.5px; }
.rq-empty { margin: 0; padding: 4px 20px 8px; color: var(--muted); font-size: 12.5px; }
.rcenter { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.rhead { padding: 16px 24px 0; border-bottom: 1px solid var(--line); }
.rtitle h1 { margin: 6px 0 0; font-size: 19px; line-height: 1.3; font-weight: 500; letter-spacing: -0.02em; }
.rtitle h1 a { color: var(--text); }
.rtabs { display: flex; gap: 20px; margin-top: 12px; }
.rtabs button { padding: 8px 0 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; gap: 6px; align-items: baseline; }
.rtabs button:hover { color: var(--text); }
.rtabs button.active { color: var(--text); border-color: var(--accent); }
.rtabs em { font: normal 11px var(--mono); color: var(--faint); }
.rfiles { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 12px; }
.rfiles button { flex: none; display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 9px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--text-2); font: 11.5px var(--mono); cursor: pointer; }
.rfiles button:hover { border-color: rgba(190, 220, 236, 0.35); color: var(--text); }
b.add { color: var(--ok); font-weight: 500; }
b.del { color: var(--bad); font-weight: 500; }
.rbody { overflow: auto; padding: 18px 24px; min-height: 0; display: grid; gap: 14px; align-content: start; }
.rbody > p { margin: 0; }
.rbody .log, .rbody .testout { max-height: none; }
.dfile { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; scroll-margin-top: 4px; }
.dfile header { position: sticky; top: -18px; z-index: 1; display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--text); }
.dfile .diff { margin: 0; border: 0; border-radius: 0; max-height: none; }
.rdecide { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.rdecide .note-input { min-width: 240px; }
.rwhy { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.rwhy section { display: grid; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line); min-width: 0; }
.rwhy section p { margin: 0; color: var(--text-2); font-size: 13px; }
.rwhy .actions { font-size: 12.5px; }
.rwhy .markdown { font-size: 12.5px; overflow-wrap: anywhere; }
.rwhy pre { max-height: 200px; }
.viewer [data-review], .viewer #review-note { display: none !important; }

@media (max-width: 1100px) {
  .review { grid-template-columns: 1fr; height: auto; }
  .rqueue { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .rcenter { min-height: 70vh; }
  .rwhy { border-left: 0; border-top: 1px solid var(--line); }
  .home-grid { grid-template-columns: 1fr; }
  .voice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox-body { grid-template-columns: 1fr; }
  .peek { display: none; }
  .pbody { grid-template-columns: 1fr; }
  .pmain { border-right: 0; }
  .rail { position: static; border-top: 1px solid var(--line); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .cmdk span { display: none; }
  .cmdk { min-width: 0; gap: 0; }
}
@media (max-width: 800px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .health { display: none; }
  .me .who { display: none; }
  .home-view { padding: 20px 16px 60px; }
  .inbox-bar, .phead { padding-left: 16px; padding-right: 16px; position: static; }
  .igroup { position: static; padding-left: 16px; }
  .irow { grid-template-columns: 18px 30px minmax(0, 1fr); padding-left: 14px; padding-right: 16px; }
  .irow .ispark, .irow .pill, .irow .c { display: none; }
  .pmain { padding: 20px 16px 60px; }
  .voice { grid-template-columns: 1fr; }
  .inbox-keys { display: none; }
  .shortcuts { grid-template-columns: 1fr; }
  .tail a { grid-template-columns: 54px minmax(0, 1fr); }
  .tail .outcome, .tail .muted { display: none; }
}

/* ── tools, settings, impact, fix badges ─────────────────────────────── */
.chan { font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: 0.04em; padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--muted); }
.chan.http { color: var(--warn); border-color: var(--warn-soft); }
.tools-page, .settings-page { max-width: 1180px; margin: 0 auto; padding: 24px; display: grid; gap: 16px; }
table.tools td { vertical-align: top; }
table.tools tr.worse td:first-child { box-shadow: inset 2px 0 0 var(--bad); }
td.bad, .small.bad { color: var(--bad); }
.fix-impact { display: block; margin-bottom: 4px; }
.fix-impact.early h2 { color: var(--muted); }
.impact-row { display: grid; grid-template-columns: 180px 64px 24px 64px; align-items: baseline; gap: 8px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.impact-row .arrow { color: var(--muted); text-align: center; }
.impact-row b.ok { color: var(--ok); }
.impact-row btd.bad, .small.bad { color: var(--bad); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.pill.acc { color: var(--accent); border-color: var(--accent-soft); }
.settings-page .hrow { display: flex; gap: 10px; align-items: center; padding: 4px 0; }
.settings-page .hrow span { min-width: 90px; }
#session-channels { margin-top: 6px; }
@media (max-width: 720px) {
  .impact-row { grid-template-columns: 1fr 52px 18px 52px; }
  .tools-page, .settings-page { padding: 16px; }
}
.usage-row { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; font-variant-numeric: tabular-nums; }
.track.usage { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 6px 0 10px; }
.track.usage .fill { height: 100%; background: var(--accent); }
.track.usage .fill.bad { background: var(--bad); }
.track.usage .fill.warn { background: var(--warn); }
.nav-count.bad { padding: 3px 5px; border-radius: 5px; background: var(--bad-soft); color: var(--bad); }

/* ── Free near or at its events: across every view ───────── */
.plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 10px 24px;
  border-bottom: 1px solid rgba(232, 197, 133, 0.22);
  background: var(--warn-soft);
  color: var(--text-2);
  font-size: 13px;
}
.plan-banner[hidden] { display: none; }
.plan-banner.full { border-bottom-color: rgba(240, 163, 163, 0.25); background: var(--bad-soft); }
.plan-banner p { margin: 0; max-width: 820px; line-height: 1.5; }
.plan-banner b { color: var(--text); font-weight: 500; }
.plan-banner .link-button { margin: 0 0 0 4px; }

/* ── plans a Free workspace can move to ───────────────────── */
.plan-card.full { border-color: rgba(240, 163, 163, 0.22); }
.offers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 10px; }
.offer { display: grid; gap: 8px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.offer.pick { border-color: rgba(190, 220, 236, 0.3); }
.offer .name { margin: 0; display: flex; gap: 8px; align-items: center; font-weight: 500; }
.offer .price { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.offer .price span { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.offer ul { margin: 2px 0 6px; padding: 0; list-style: none; display: grid; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.offer li::before { content: "✓"; color: var(--ok); margin-right: 8px; }
.offer .button { justify-self: start; }
@media (max-width: 720px) {
  .offers { grid-template-columns: 1fr; }
  .plan-banner { padding: 10px 16px; }
}
#alerts-form { display: grid; gap: 10px; }
#alerts-form .field { display: grid; gap: 4px; }
