/* ============================================================================
   Prompt — conversation intelligence console
   Dark-first, dense, restrained. Theme via [data-theme] on <html>; CSS vars.
   ========================================================================== */

:root {
  /* dark (default) */
  --bg: #0a0e15;
  --grid: #111827;
  --panel: #0e131d;
  --panel-2: #131a26;
  --elev: #161e2c;
  --border: #1f2937;
  --border-soft: #18212f;
  --ink: #d7dde7;
  --ink-soft: #8b97a9;
  --ink-faint: #5a6678;
  --accent: #4f93d6;
  --accent-soft: rgba(79, 147, 214, 0.14);
  --good: #3fb27f;
  --warn: #d2a14e;
  --danger: #d2685d;
  --node-stroke: #0a0e15;
  --node-sel: #eaf1fa;
  /* treemap: a single light-blue ramp — lightness encodes volume, so colour
     carries information rather than category identity. */
  --tile-lo: #1f2a38;
  --tile-hi: #4a6c8f;
  --tile-border: rgba(255, 255, 255, 0.1);
  --cite-line: #d2a14e;
  --cite-bg: rgba(210, 161, 78, 0.13);
  --cite-ink: #e8c07d;
  --cite-glow: rgba(210, 161, 78, 0.28);
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  --radius: 5px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #f6f7f9;
  --grid: #e9ecf1;
  --panel: #ffffff;
  --panel-2: #f3f5f8;
  --elev: #ffffff;
  --border: #d7dce4;
  --border-soft: #e6e9ef;
  --ink: #1b2330;
  --ink-soft: #55616f;
  --ink-faint: #8a94a3;
  --accent: #2f6ca3;
  --accent-soft: rgba(47, 108, 163, 0.1);
  --good: #1f9d63;
  --warn: #b27a1f;
  --danger: #c0493f;
  --node-stroke: #ffffff;
  --node-sel: #0e131d;
  --tile-lo: #eef3f9;
  --tile-hi: #a9c6e4;
  --tile-border: rgba(16, 22, 26, 0.14);
  --cite-line: #b27a1f;
  --cite-bg: rgba(178, 122, 31, 0.12);
  --cite-ink: #8a5c12;
  --cite-glow: rgba(178, 122, 31, 0.26);
  --shadow: 0 14px 36px rgba(20, 26, 35, 0.16);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* beat .userview's display:flex */

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ───────────────────────── command bar ───────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 52px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.brand-mark {
  width: 16px; height: 16px;
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 3px;
  background: var(--accent); border-radius: 1px; opacity: 0.55;
}
.brand-name {
  font-size: 13px; font-weight: 700; letter-spacing: 0.13em; color: var(--ink);
}
.brand-sub {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); padding-left: 9px; margin-left: 3px;
  border-left: 1px solid var(--border);
}
@media (max-width: 820px) { .brand-sub { display: none; } }

.cmd {
  position: relative;
  flex: 1;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cmd:focus-within { border-color: var(--accent); }
.cmd-ico { width: 15px; height: 15px; color: var(--ink-faint); flex: none; }
.cmd input {
  flex: 1; height: 100%;
  border: none; outline: none; background: transparent;
  font: inherit; font-size: 13.5px; color: var(--ink);
}
.cmd input::placeholder { color: var(--ink-faint); }
.cmd-clear {
  font: inherit; font-size: 10px; font-weight: 600; letter-spacing: 0.07em;
  color: var(--ink-soft); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 3px 8px; cursor: pointer;
}
.cmd-clear:hover { color: var(--ink); border-color: var(--ink-faint); }

.topmeta { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.stat { display: flex; align-items: baseline; gap: 5px; font-size: 11px; color: var(--ink-faint); }
/* Topbar stats belong to the view that owns them. Hide all, then show the
   active view's — one line per tab, instead of a rule for every pair of tabs. */
.clusters-only, .users-only, .efficiency-only, .insights-only { display: none; }
[data-view="clusters"] .clusters-only,
[data-view="users"] .users-only,
[data-view="efficiency"] .efficiency-only,
[data-view="insights"] .insights-only { display: flex; }
.stat b { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink); }
.stat span { text-transform: uppercase; letter-spacing: 0.06em; }
.stat.model {
  font-family: var(--mono); font-size: 11px; color: var(--ink-soft);
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px;
}
@media (max-width: 1000px) { .stat:not(.model) { display: none; } }
.icon-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--ink-soft);
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-faint); }

/* ───────────────────────── stage / map ───────────────────────── */
.stage { position: relative; flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* clusters view = treemap on top, traces table underneath */
.cluster-top { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 220px; }

/* breadcrumb (shown when zoomed into a cluster) */
.crumb { display: none; }
.crumb.show { display: flex; align-items: center; gap: 10px; padding: 12px 16px 0; flex: none; }
.crumb-back {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--ink-soft);
  font-family: inherit; font-size: 11px; padding: 4px 9px; border-radius: 4px; cursor: pointer;
}
.crumb-back:hover { color: var(--ink); border-color: var(--ink-faint); }
.crumb-cur { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.crumb-cur .tick { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.crumb-desc { font-size: 11.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }

/* traces table — one row per conversation */
/* fixed height ≈ header + 3 rows; scroll for the rest */
/* min-height:0 + overflow:hidden are required — without them a flex item's
   default min-height:auto lets the full table force the panel taller. */
.traces {
  flex: 0 0 196px; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border); background: var(--panel);
}
.traces-head { display: flex; align-items: baseline; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border-soft); flex: none; }
.traces-hint { font-size: 11px; color: var(--ink-faint); }
.traces-scroll { flex: 1; overflow: auto; min-height: 0; }
.traces-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.traces-table thead th {
  position: sticky; top: 0; z-index: 2; background: var(--panel);
  text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.traces-table th.c-num, .traces-table td.c-num { text-align: right; }
.traces-table tbody tr { border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.traces-table tbody tr:hover { background: var(--panel-2); }
.traces-table td { padding: 8px 12px; color: var(--ink-soft); }
.traces-table td.c-time, .traces-table td.c-num { font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.traces-table td.c-name { color: var(--ink); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-cluster { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.traces-empty { padding: 16px; font-size: 12px; color: var(--ink-faint); }
/* zoomable treemap — clusters -> conversations */
#treemap { position: relative; flex: 1; margin: 14px; min-height: 0; }
.tm-tile {
  position: absolute; overflow: hidden; cursor: pointer; box-sizing: border-box;
  border-radius: 2px; padding: 11px 13px;
  /* single light-blue ramp — lightness encodes volume, no categorical fills */
  background: color-mix(in srgb, var(--tile-hi) var(--lvl, 50%), var(--tile-lo));
  border: 1px solid var(--tile-border);
  transition: background 0.12s ease, border-color 0.12s ease,
    opacity 0.18s ease, transform 0.18s ease;
}
.tm-tile:hover { border-color: var(--accent); }
.tm-tile.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tm-tile.enter { opacity: 0; transform: scale(0.96); }

.tm-name {
  font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.28;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.tm-meta { font-family: var(--mono); font-size: 10.5px; color: var(--ink-soft); margin-top: 5px; }

/* cluster labels */
#labels { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.clabel {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--ink);
  pointer-events: auto; cursor: pointer;
}
.clabel:hover { border-color: var(--ink-faint); }
.clabel .tick { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.clabel .count { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

#tooltip {
  position: absolute; z-index: 20; pointer-events: none;
  max-width: 280px;
  background: var(--elev); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12px; line-height: 1.4; padding: 8px 10px;
  opacity: 0; transition: opacity 90ms ease;
}
#tooltip.show { opacity: 1; }
#tooltip .tt-cluster {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 4px; display: flex; align-items: center; gap: 6px;
}
#tooltip .tt-cluster .tick { width: 7px; height: 7px; border-radius: 2px; }

/* search results dropdown */
.results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: 62vh; overflow: hidden;
}
.results-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--border-soft);
  font-size: 11px; color: var(--ink-soft);
}
.results-head b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.results-head .q-term { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-head button {
  margin-left: auto; flex: none;
  font: inherit; font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--ink-soft); background: transparent;
  border: 1px solid var(--border); border-radius: 4px; padding: 3px 8px; cursor: pointer;
}
.results-head button:hover { color: var(--ink); border-color: var(--ink-faint); }
.results-list { overflow-y: auto; padding: 4px; }
.result-item {
  display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: start;
  padding: 8px 9px; border-radius: 4px; cursor: pointer;
}
.result-item:hover { background: var(--panel-2); }
.result-score { font-family: var(--mono); font-size: 11px; color: var(--accent); padding-top: 2px; }
.result-main { min-width: 0; }
.result-cluster {
  display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-faint);
}
.result-cluster .tick { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.result-text {
  font-size: 12.5px; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.results-empty { padding: 16px 12px; font-size: 12.5px; color: var(--ink-soft); }

/* ───────────────────────── detail record ───────────────────────── */
.detail {
  position: absolute; top: 12px; right: 12px; bottom: 12px;
  width: 396px; max-width: calc(100vw - 24px);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); z-index: 16;
  display: flex; flex-direction: column;
  transform: translateX(calc(100% + 20px));
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.detail.open { transform: translateX(0); }
.detail-head { padding: 14px 16px; border-bottom: 1px solid var(--border); position: relative; }
.detail-kicker {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-soft);
}
.detail-kicker .tick { width: 8px; height: 8px; border-radius: 2px; }
.detail-head h2 { margin: 9px 36px 0 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.detail-close {
  position: absolute; top: 12px; right: 12px;
  width: 26px; height: 26px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--panel-2);
  color: var(--ink-soft); font-size: 15px; cursor: pointer; line-height: 1;
}
.detail-close:hover { color: var(--ink); }
.detail-body { padding: 14px 16px; overflow-y: auto; flex: 1; }

.kv { display: grid; grid-template-columns: 84px 1fr; gap: 6px 10px; margin-bottom: 16px; }
.kv .k {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-faint); padding-top: 1px;
}
.kv .v { font-family: var(--mono); font-size: 12px; color: var(--ink); word-break: break-word; }

.sect {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 7px;
}
.record {
  font-size: 13px; line-height: 1.55; color: var(--ink);
  background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 11px 13px;
  white-space: pre-wrap; word-break: break-word;
}
.cluster-note {
  font-size: 12.5px; line-height: 1.5; color: var(--ink-soft);
  border-left: 2px solid var(--accent); padding: 2px 0 2px 11px; margin-top: 16px;
}

/* cluster overview — component conversations (title + snippet, click to open) */
.ex-list { display: flex; flex-direction: column; gap: 8px; }
.ex-item {
  background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: 4px; padding: 10px 12px; cursor: pointer;
}
.ex-item:hover { background: var(--panel-2); border-color: var(--ink-faint); }
.ex-title {
  font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ex-snippet {
  font-size: 12px; line-height: 1.5; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ───────────────────────── panels / legend ───────────────────────── */
.panel {
  position: absolute; z-index: 10;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.panel-head {
  font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-faint); padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border-soft);
}
.legend { left: 12px; bottom: 12px; width: 232px; }
#legendItems { padding: 5px; max-height: 320px; overflow-y: auto; }
.legend-item {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; color: var(--ink);
  padding: 6px 7px; border-radius: 4px; cursor: pointer;
}
.legend-item:hover { background: var(--panel-2); }
.legend-item.muted { opacity: 0.4; }
.legend-item .tick { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.legend-item .lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-item .lc { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

/* viewport controls */
.viewctl {
  position: absolute; right: 12px; bottom: 12px; z-index: 10;
  display: flex; align-items: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.viewctl button {
  font: inherit; font-size: 14px; color: var(--ink-soft);
  background: transparent; border: none; border-left: 1px solid var(--border);
  width: 34px; height: 32px; cursor: pointer;
}
.viewctl button:first-child { border-left: none; }
.viewctl button:hover { background: var(--panel-2); color: var(--ink); }
.viewctl button#zoomReset { width: auto; padding: 0 12px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; }

/* ───────────────────────── tabs + view switching ───────────────────────── */
.tabs { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px; }
.tab {
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--ink-faint); background: transparent; border: none; border-radius: 3px;
  padding: 6px 14px; cursor: pointer;
}
.tab:hover { color: var(--ink-soft); }
.tab.active { color: var(--ink); background: var(--panel-2); }

[data-view="users"] .cmd { display: none; }

/* ───────────────────────── users view (overview left, timeline right) ─── */
.userview { position: relative; flex: 1; display: flex; overflow: hidden; }

.user-left {
  width: 372px; flex: none; overflow-y: auto;
  padding: 16px 18px; border-right: 1px solid var(--border); background: var(--panel);
}
.subject-row { display: flex; align-items: center; gap: 10px; }
.subject-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.subject-status {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; color: var(--warn);
  border: 1px solid var(--warn); border-radius: 4px; padding: 2px 6px;
}
.subject-sub { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin: 3px 0 16px; }
.user-left .panel-head { border: none; padding: 0 0 8px; }
.tldr { font-size: 13.5px; line-height: 1.65; color: var(--ink); margin-bottom: 16px; }
.tldr .cite { color: var(--accent); cursor: pointer; border-bottom: 1px solid var(--accent-soft); }
.tldr .cite:hover { border-bottom-color: var(--accent); }
.tldr .cite-ico { font-size: 9px; vertical-align: super; margin-left: 1px; }
.subject-stats { display: flex; flex-wrap: wrap; gap: 10px 20px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.ustat { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: baseline; gap: 5px; }
.ustat b { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--ink); letter-spacing: 0; }

.user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-top: 12px; }
.timeline-head { display: flex; align-items: center; gap: 12px; padding: 0 18px 8px; }
.timeline-head .panel-head { border: none; padding: 0; }
.timeline-hint { font-size: 11px; color: var(--ink-faint); }
.timeline-nav { margin-left: auto; display: flex; gap: 4px; }
.timeline-nav button {
  width: 28px; height: 26px; font-size: 15px; color: var(--ink-soft);
  background: var(--panel); border: 1px solid var(--border); border-radius: 4px; cursor: pointer;
}
.timeline-nav button:hover { background: var(--panel-2); color: var(--ink); }
.timeline-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; min-height: 0; }
.timeline-scroll::-webkit-scrollbar { height: 9px; }
.timeline-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
.timeline-scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
#timelineSvg { display: block; height: 100%; }
.marker .mdot { transition: r 120ms ease; }
.marker:hover .mdot { stroke: var(--node-sel); }
.mdot.flash { animation: dotflash 1.3s ease; }
@keyframes dotflash {
  0%, 100% { stroke-width: 1.5; }
  20% { stroke: var(--accent); stroke-width: 7; }
}

/* shared floating tooltip (timeline) */
.tip {
  position: fixed; z-index: 80; pointer-events: none; max-width: 290px;
  background: var(--elev); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 11px; box-shadow: var(--shadow);
  opacity: 0; transition: opacity 90ms ease;
}
.tip.show { opacity: 1; }
.tip .tt-flag { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; color: var(--warn); margin-bottom: 5px; }
.tip .tt-title { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.tip .tt-sub { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); margin: 3px 0 5px; }
.tip .tt-body { font-size: 12px; line-height: 1.45; color: var(--ink-soft); }

/* thread view (reuses .detail) */
.detail-kicker .flag { color: var(--warn); margin-right: 2px; }
.review-note {
  font-size: 12.5px; line-height: 1.5; color: var(--ink);
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px;
}
.review-note b { color: var(--accent); margin-right: 5px; }
.thread { display: flex; flex-direction: column; gap: 12px; }
.turn .who {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 4px;
}
.turn .bubble {
  font-size: 12.5px; line-height: 1.5; padding: 9px 11px; border-radius: var(--radius);
  white-space: pre-wrap; word-break: break-word;
  background: var(--bg); border: 1px solid var(--border-soft); color: var(--ink);
}
.turn.assistant .bubble { background: var(--panel-2); border-color: var(--border); }

/* ───────────────────────── efficiency view ───────────────────────── */
[data-view="efficiency"] .cmd { display: none; }

.effview { position: relative; flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* headline stat cards */
.eff-top {
  display: flex; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.eff-card {
  flex: 0 1 300px; /* two cards, sized — not stretched across the full width */
  background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 12px 14px;
}
.eff-card.warn { border-left: 2px solid var(--warn); }
.eff-card.good { border-left: 2px solid var(--good); }
.eff-card-big { font-family: var(--mono); font-size: 22px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.eff-card-label { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-soft); margin: 5px 0 3px; }
.eff-card-sub { font-size: 11px; line-height: 1.4; color: var(--ink-faint); }
@media (max-width: 900px) { .eff-top { flex-direction: column; } }

/* body: leaderboard + policy side */
.eff-body { flex: 1; display: flex; min-height: 0; }
.eff-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px 0 0; }
.eff-head { display: flex; align-items: baseline; gap: 12px; padding: 0 18px 8px; }
.eff-head .panel-head { border: none; padding: 0; }
.eff-hint { font-size: 11px; color: var(--ink-faint); }
.leaderboard { flex: 1; overflow-y: auto; padding: 0 12px 12px; }
.eff-empty { padding: 22px 16px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }

/* Header + rows share one grid, so the column captions are stated once. */
.eff-thead, .spend-row {
  display: grid; grid-template-columns: 1fr 74px 74px 58px 66px;
  gap: 12px; align-items: center; padding: 0 10px;
}
.eff-thead {
  padding-bottom: 7px; border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-faint);
  position: sticky; top: 0; background: var(--bg); z-index: 1;
}
.ta-r { text-align: right; }
.spend-row {
  padding-top: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft); cursor: pointer;
}
.spend-row:hover { background: var(--panel-2); }
.sr-main { min-width: 0; }
.sr-title { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-why { font-size: 11.5px; line-height: 1.4; color: var(--ink-faint); margin-top: 3px; }
.sr-demand { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); text-align: right; }
.sr-waste { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--warn); text-align: right; }

/* tier chips */
.chip {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  padding: 2px 7px; border-radius: 4px; border: 1px solid var(--border);
  color: var(--ink-soft); background: var(--panel-2); white-space: nowrap;
}
.chip.from, .chip.used { color: var(--danger); border-color: var(--danger); background: transparent; }
.chip.to, .chip.rec { color: var(--good); border-color: var(--good); background: transparent; }
.chip.keep { color: var(--ink-faint); }
.chip-arrow { color: var(--ink-faint); font-size: 12px; }

/* routing policy side panel */
.eff-side {
  width: 300px; flex: none; border-left: 1px solid var(--border);
  background: var(--panel); overflow-y: auto; padding-bottom: 14px;
}
.eff-side .panel-head { border-bottom: 1px solid var(--border-soft); }
.policy { padding: 4px 0; }
.policy-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-soft);
}
.policy-topic { font-size: 12.5px; color: var(--ink); min-width: 0; }
.policy-rec { grid-row: span 2; align-self: center; }
.policy-meta { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.policy-empty { padding: 14px; font-size: 12px; color: var(--ink-faint); line-height: 1.5; }

/* methodology — collapsed by default; it's reference, not the headline */
.eff-note { border-top: 1px solid var(--border-soft); margin-top: 8px; }
.eff-note > summary {
  padding: 12px 14px; cursor: pointer; list-style: none;
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-faint);
}
.eff-note > summary::-webkit-details-marker { display: none; }
.eff-note > summary::before { content: "▸ "; }
.eff-note[open] > summary::before { content: "▾ "; }
.eff-note > summary:hover { color: var(--ink-soft); }
.eff-note p { font-size: 11.5px; line-height: 1.6; color: var(--ink-faint); margin: 0 14px 10px; }
.eff-note b { color: var(--ink-soft); }

/* efficiency thread detail */
.verdict { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.verdict-waste { font-family: var(--mono); font-size: 12px; color: var(--warn); margin-left: auto; }
.why-rationale {
  font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); font-style: italic;
  border-left: 2px solid var(--accent); padding: 2px 0 2px 11px; margin: 0 0 16px;
}

/* ───────────────── setup / pipeline progress ───────────────── */
.setup {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(3px);
}
.setup-card {
  width: min(560px, calc(100vw - 48px));
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; box-shadow: var(--shadow); padding: 26px 28px 24px;
}
.setup-kicker {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 8px;
}
.setup-title { font-size: 21px; font-weight: 600; color: var(--ink); margin: 0 0 10px; }
.setup-sub { font-size: 13px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 20px; }
.setup-sub code {
  font-family: var(--mono); font-size: 12px;
  background: var(--panel-2); padding: 1px 5px; border-radius: 3px;
}
.setup-go {
  font-size: 13px; font-weight: 600; color: #fff; background: var(--accent);
  border: none; border-radius: 4px; padding: 10px 18px; cursor: pointer;
}
.setup-go:hover { filter: brightness(1.08); }

.setup-stages { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 7px; }
.st { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-faint); }
.st-mark { font-family: var(--mono); width: 14px; text-align: center; }
.st.done { color: var(--ink-soft); }
.st.done .st-mark { color: var(--good); }
.st.active { color: var(--ink); font-weight: 500; }
.st.active .st-mark { color: var(--accent); }

.setup-log {
  margin: 0; max-height: 168px; overflow-y: auto;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.55;
  color: var(--ink-faint); background: var(--bg);
  border: 1px solid var(--border-soft); border-radius: 4px; padding: 10px 12px;
  white-space: pre-wrap; word-break: break-word;
}
.setup-err {
  margin-top: 14px; font-size: 12.5px; line-height: 1.5; color: var(--danger);
  border-left: 2px solid var(--danger); padding: 2px 0 2px 11px;
}
.setup-note {
  font-size: 12px; line-height: 1.55; color: var(--ink-soft);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border-left: 2px solid var(--warn);
  padding: 9px 12px; border-radius: 0 4px 4px 0; margin: 0 0 18px;
}
.setup-note b { color: var(--ink); }
.setup-note code {
  font-family: var(--mono); font-size: 11px;
  background: var(--panel-2); padding: 1px 5px; border-radius: 3px;
}

/* ───────────────── Discover (semantic search) ───────────────── */

.discover { position: relative; flex: 1; overflow-y: auto; }
.disc-inner { max-width: 780px; margin: 0 auto; padding: 56px 24px 64px; }
.disc-search {
  display: flex; align-items: center; gap: 11px;
  height: 50px; padding: 0 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
}
.disc-search:focus-within { border-color: var(--accent); }
.disc-search .cmd-ico { width: 17px; height: 17px; color: var(--ink-faint); flex: none; }
.disc-search input {
  flex: 1; height: 100%; border: none; outline: none; background: transparent;
  font: inherit; font-size: 15px; color: var(--ink);
}
.disc-search input::placeholder { color: var(--ink-faint); }

.disc-status { font-size: 12px; color: var(--ink-faint); margin: 14px 2px 18px; }

.disc-results { display: flex; flex-direction: column; gap: 8px; }
.disc-row {
  display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: start;
  padding: 13px 15px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 5px;
}
.disc-row:hover { border-color: var(--accent); background: var(--panel-2); }
.disc-score {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  text-align: right; padding-top: 1px;
}
.disc-text {
  font-size: 13px; line-height: 1.55; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.disc-meta {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--ink-faint); margin-top: 7px;
}
.disc-meta .tick { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* Discover: prompts / responses toggle */
.disc-bar { display: flex; align-items: center; gap: 14px; margin: 14px 2px 18px; }
.disc-toggle {
  display: inline-flex; flex: none;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 2px;
}
.dt-opt {
  font: inherit; font-size: 11.5px; font-weight: 500; color: var(--ink-faint);
  background: transparent; border: none; border-radius: 3px;
  padding: 5px 13px; cursor: pointer; white-space: nowrap;
}
.dt-opt:hover { color: var(--ink-soft); }
.dt-opt.active { background: var(--accent); color: #fff; }
.disc-bar .disc-status { margin: 0; }
.disc-role {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px; flex: none;
  color: var(--ink-soft); background: var(--panel-2); border: 1px solid var(--border);
}
.disc-role.assistant { color: var(--accent); border-color: var(--accent); background: transparent; }

/* ───────────── Login gate ───────────── */
.login {
  position: fixed;
  inset: 0;
  z-index: 1000;                 /* above the app and the setup overlay */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);         /* opaque: hides the app rendering behind it */
}
.login[hidden] { display: none; }
.login-card {
  width: 340px;
  max-width: calc(100vw - 48px);
  padding: 28px 28px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.login-card[hidden] { display: none; }
.login-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.login-title {
  margin: 6px 0 20px;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}
.login-form { display: flex; flex-direction: column; }
.login-label {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.login-input {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  margin-bottom: 14px;
  outline: none;
}
.login-input:focus { border-color: var(--accent); }
.login-err {
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 12px;
}
.login-err[hidden] { display: none; }
.login-go {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  margin-top: 4px;
}
.login-go:hover { filter: brightness(1.08); }
.login-go:disabled { opacity: 0.6; cursor: default; }
/* ═══════════════════════════════════════════════════════════════════════════
   INSIGHTS — the report. A single readable column: this is meant to be read
   top to bottom like a document, not scanned like a dashboard. Every claim
   carries clickable evidence, so nothing has to be taken on trust.
   ═══════════════════════════════════════════════════════════════════════════ */
/* The scroll lives on .rep, not on .insights. .detail is absolutely positioned
   against its nearest positioned ancestor — if that ancestor is the scroller,
   the panel scrolls away with the report instead of staying pinned. */
.insights { position: relative; flex: 1; display: flex; overflow: hidden; }
.rep { flex: 1; overflow-y: auto; padding: 48px 24px 96px; }
.rep > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.rep-empty { text-align: center; padding: 80px 0; color: var(--ink-soft); }
.rep-empty h2 { font-size: 17px; color: var(--ink); margin-bottom: 8px; }
.rep-empty code { font-family: var(--mono); font-size: 12px; color: var(--accent); }

.rep-head { border-bottom: 1px solid var(--border); padding-bottom: 22px; margin-bottom: 24px; }
.rep-kicker {
  font-size: 10px; letter-spacing: 0.14em; color: var(--ink-faint);
  font-weight: 600; margin-bottom: 12px;
}
.rep-head h1 {
  font-size: 25px; line-height: 1.3; font-weight: 600; color: var(--ink);
  letter-spacing: -0.015em; margin: 0 0 14px;
}
.rep-meta { font-size: 12px; color: var(--ink-faint); }

.rep-tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border-soft); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 34px;
}
.rt { background: var(--panel); padding: 13px 14px; }
.rt b { display: block; font-size: 18px; font-weight: 600; color: var(--ink); }
.rt span { font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.02em; }

.rep-sec { margin-bottom: 40px; }
.rep-sec .panel-head { margin-bottom: 14px; }
.rep-summary { font-size: 14.5px; line-height: 1.72; color: var(--ink); margin: 0; }
.rep-summary .cite { color: var(--accent); cursor: pointer; border-bottom: 1px solid var(--accent-soft); }
.rep-summary .cite:hover { border-bottom-color: var(--accent); }
.rep-summary .cite-ico { font-size: 9px; vertical-align: super; margin-left: 1px; }

/* findings ---------------------------------------------------------------- */
.find {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 15px 16px; margin-bottom: 10px;
}
.find.friction { border-left: 2px solid var(--warn); }
.find-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.find-top h3 { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0; flex: 1; }
.find-n { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
.find p { font-size: 13px; line-height: 1.62; color: var(--ink-soft); margin: 0; }
.cause {
  display: inline-block; font-size: 10px; letter-spacing: 0.04em; color: var(--warn);
  background: rgba(210, 161, 78, 0.12); border-radius: 3px; padding: 2px 7px; margin-bottom: 8px;
}
.find-ev { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.ev {
  font-family: var(--mono); font-size: 10.5px; color: var(--accent);
  background: var(--accent-soft); border: 1px solid transparent; border-radius: 3px;
  padding: 2px 7px; cursor: pointer; transition: border-color 0.12s;
}
.ev:hover { border-color: var(--accent); }
.ev-turn { color: var(--ink-faint); margin-left: 1px; }

/* verbatim moments -------------------------------------------------------- */

/* actions ----------------------------------------------------------------- */
.act-lead { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 12px; }
.rules-lead { margin-top: 26px; }
.act-lead code { font-family: var(--mono); font-size: 11.5px; color: var(--accent); }
.skill {
  border: 1px solid var(--border); border-left: 2px solid var(--good);
  border-radius: var(--radius); background: var(--panel); padding: 15px 16px; margin-bottom: 10px;
}
.skill-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.skill-top h3 {
  font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--good);
  margin: 0; flex: 1;
}
.skill-desc { font-size: 13px; line-height: 1.6; color: var(--ink); margin: 0 0 6px; }
.skill-why { font-size: 12px; line-height: 1.6; color: var(--ink-soft); margin: 0; }
.skill-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.btn-ghost, .btn-go {
  font-size: 11.5px; font-family: inherit; border-radius: 4px; padding: 5px 12px;
  cursor: pointer; border: 1px solid var(--border); transition: all 0.12s;
}
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-faint); }
.btn-go { background: var(--good); color: #06130d; border-color: var(--good); font-weight: 500; }
.btn-go:hover { filter: brightness(1.1); }
.btn-go:disabled { opacity: 0.5; cursor: default; filter: none; }
.skill-status { font-size: 11px; color: var(--ink-faint); }
.skill-status.ok { color: var(--good); }
.skill-status.err { color: var(--danger); }
.skill-file {
  margin: 12px 0 0; padding: 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; font-family: var(--mono); font-size: 11px; line-height: 1.6;
  color: var(--ink-soft); white-space: pre-wrap; max-height: 340px; overflow-y: auto;
}
.rules { list-style: none; margin: 0; padding: 0; }
.rules li {
  display: flex; align-items: baseline; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border-soft); font-size: 13px; line-height: 1.6;
}
.rules li:last-child { border-bottom: 0; }
.rule-text { flex: 1; color: var(--ink); }

/* session index ----------------------------------------------------------- */
.sess-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sess-table th {
  text-align: left; font-size: 10px; letter-spacing: 0.08em; color: var(--ink-faint);
  font-weight: 600; padding: 0 10px 8px 0; border-bottom: 1px solid var(--border);
}
.sess-table td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.sess-table tbody tr { cursor: pointer; }
.sess-table tbody tr:hover td { background: var(--panel); }
.sess-table .c-num { text-align: right; }
.s-ref { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.s-title { color: var(--ink); max-width: 340px; }
.s-intent { display: block; color: var(--ink-faint); font-size: 11px; line-height: 1.45; margin-top: 3px; }
.s-proj { color: var(--ink-soft); font-size: 11px; }
.fric { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 3px; }
.fric-lo { color: var(--ink-faint); }
.fric-mid { color: var(--warn); background: rgba(210, 161, 78, 0.1); }
.fric-hi { color: var(--danger); background: rgba(210, 104, 93, 0.12); }
.out { font-size: 10.5px; letter-spacing: 0.03em; color: var(--ink-soft); }
.out-shipped { color: var(--good); }
.out-abandoned { color: var(--danger); }
.out-partial { color: var(--warn); }

/* ---- the cited turn -----------------------------------------------------
   A citation is only worth following if the reader can see where it landed.
   The marked turn gets a colour no other turn uses, a rail down its left edge,
   and a one-shot pulse on arrival — enough to find instantly after the panel
   scrolls, without leaving the thread looking decorated. */
.turn .turn-n { color: var(--ink-faint); margin-left: 6px; font-family: var(--mono); font-size: 9.5px; }
.turn .hit-tag {
  margin-left: 7px; font-size: 8.5px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--cite-ink); background: var(--cite-bg); border-radius: 3px; padding: 1px 5px;
}
.turn.hit { position: relative; scroll-margin: 40px; }
.turn.hit .bubble {
  border-color: var(--cite-line);
  background: var(--cite-bg);
  box-shadow: -3px 0 0 0 var(--cite-line), 0 0 0 1px var(--cite-line);
}
.turn.hit.flash .bubble { animation: citepulse 1.5s ease-out; }
@keyframes citepulse {
  0%   { box-shadow: -3px 0 0 0 var(--cite-line), 0 0 0 1px var(--cite-line), 0 0 0 7px var(--cite-glow); }
  70%  { box-shadow: -3px 0 0 0 var(--cite-line), 0 0 0 1px var(--cite-line), 0 0 0 11px transparent; }
  100% { box-shadow: -3px 0 0 0 var(--cite-line), 0 0 0 1px var(--cite-line), 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .turn.hit.flash .bubble { animation: none; }
}

@media (max-width: 760px) {
  .rep-tiles { grid-template-columns: repeat(2, 1fr); }
  .rep { padding: 32px 16px 64px; }
}

/* deliverables: grouped by artifact type ---------------------------------- */
.act-head {
  font-size: 12px; font-weight: 600; color: var(--ink); margin: 26px 0 6px;
  letter-spacing: 0.01em;
}
.act-head:first-of-type { margin-top: 4px; }
.rules li .js-rule { flex: none; }
.rules li .skill-status { flex: none; font-size: 10.5px; }
.connectors .rule-text b { color: var(--ink); }

/* friction cause: the tag plus what it actually means --------------------- */
.cause { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.cause-tag {
  font-size: 10px; letter-spacing: 0.04em; color: var(--warn);
  background: rgba(210, 161, 78, 0.12); border-radius: 3px; padding: 2px 7px; white-space: nowrap;
}
.cause-plain { font-size: 11.5px; color: var(--ink-faint); }

/* collapsed session index -------------------------------------------------- */
.sessions-fold > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 9px;
  padding: 4px 0; user-select: none;
}
.sessions-fold > summary::-webkit-details-marker { display: none; }
.sessions-fold > summary::before {
  content: "▸"; color: var(--ink-faint); font-size: 10px; transition: transform 0.15s;
}
.sessions-fold[open] > summary::before { transform: rotate(90deg); }
.sessions-fold > summary .panel-head { margin: 0; }
.fold-n {
  font-size: 10.5px; color: var(--ink-faint); background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; padding: 0 7px;
}
.sessions-fold[open] .sess-table { margin-top: 12px; }

/* inline evidence quotes --------------------------------------------------
   Quotes live under the claim they support rather than in a highlight reel of
   their own, so they read as proof instead of decoration. */
.ev-quote {
  margin: 12px 0 12px 2px; padding: 8px 0 8px 14px; cursor: pointer;
  border-left: 2px solid var(--border); background: none; text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.ev-quote:hover { border-left-color: var(--cite-line); background: var(--panel-2); }
.ev-quote p {
  margin: 0 0 5px; font-size: 13px; line-height: 1.55; color: var(--ink-soft);
  font-style: italic;
}
.ev-quote cite {
  font-style: normal; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.03em; color: var(--ink-faint);
}
.ev-quote:hover cite { color: var(--cite-line); }

/* the fix attached to a friction ------------------------------------------ */
.fix {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 12px; border-radius: 5px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  border-left: 3px solid var(--good);
}
.fix-label {
  font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--good); font-weight: 600; flex: none;
}
.fix p { margin: 0; flex: 1 1 240px; font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.fix-jump {
  flex: none; font-family: var(--mono); font-size: 10.5px; cursor: pointer;
  color: var(--good); background: none; border: 1px solid var(--good);
  border-radius: 4px; padding: 3px 8px; transition: background 0.15s;
}
.fix-jump:hover { background: rgba(50, 164, 103, 0.12); }
.skill.jumped { animation: jumpflash 1.4s ease-out; }
@keyframes jumpflash {
  0%   { box-shadow: 0 0 0 3px var(--cite-glow); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* an unanalysed report: counts are real, the writing is missing --------- */
.rep-note {
  padding: 12px 14px; border-radius: 5px; font-size: 12.5px; line-height: 1.6;
  color: var(--ink-soft); background: var(--panel-2);
  border: 1px solid var(--border-soft); border-left: 3px solid var(--warn);
}
.rep-note b { color: var(--ink); }

/* ───────────── Upload (setup) ───────────── */
.upload-zone { margin: 18px 0 0; }
.upload-pick {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  width: 100%;
  cursor: pointer;
}
.upload-pick:hover { border-color: var(--accent); color: var(--accent); }
.upload-help {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 10px 2px 0;
  line-height: 1.5;
}
.upload-help kbd {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
}
.upload-projects {
  margin-top: 14px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.upload-proj {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}
.upload-proj:last-child { border-bottom: none; }
.upload-proj:hover { background: var(--panel-2); }
.upload-proj-name {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-proj-count { font-size: 12px; color: var(--ink-faint); }
.upload-empty { font-size: 13px; color: var(--ink-soft); padding: 12px; }

/* nested per-session selection under each project */
.upload-proj-group { border-bottom: 1px solid var(--border-soft); }
.upload-proj-group:last-child { border-bottom: none; }
.upload-proj { background: var(--panel-2); font-weight: 600; }
.upload-sessions { padding: 2px 0 6px 0; }
.upload-sess {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 30px;   /* indented under the project */
  cursor: pointer;
}
.upload-sess:hover { background: var(--panel-2); }
.sess-label {
  flex: 1;
  font-size: 12px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ───────────── Users tab: per-user picker ───────────── */
.user-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}
.upill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}
.upill:hover { border-color: var(--accent); color: var(--ink); }
.upill.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.upill-n {
  font-size: 10px;
  opacity: 0.7;
}
.upill.active .upill-n { opacity: 0.9; }

/* "Skip for now" — upload is optional, not a wall */
.setup-skip {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
}
.setup-skip:hover { color: var(--accent); }
