/* clean/intel.css — page polish for the clean layer (see clean/base.css).
   Pages: Simulations (.simview), Fleet & 3D (.fleetview + the .pv-overlay viewer),
   Brains (.brainsview), Learning (.learnview). Everything is scoped to those classes. */

/* ================================================================ Brains — the stack */
.brainsview .bstack { display: flex; flex-direction: column; }
.brainsview .blayer {
  display: grid; grid-template-columns: 190px minmax(0, 1fr) minmax(0, 470px) 18px; gap: 22px; align-items: center;
  width: 100%; padding: 14px 18px 14px 14px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: linear-gradient(90deg, rgba(var(--tc-rgb), 0.06), transparent 38%), var(--surface);
  border: 1px solid var(--line); border-left: 2px solid rgba(var(--tc-rgb), 0.55); border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}
.brainsview .blayer:hover { border-color: var(--line-3); border-left-color: var(--tc); }
.brainsview .blayer:hover .brow-go { color: var(--text); transform: translateX(2px); }
.brainsview .bl-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brainsview .blayer .tier-ico { width: 36px; height: 36px; border-radius: 9px; }
.brainsview .blayer .tier-ico .i { width: 17px; height: 17px; }
.brainsview .bl-nm { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brainsview .blayer .b-name { font-size: 14px; }
.brainsview .bl-role { font-size: 12.5px; line-height: 1.5; color: var(--text-3); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.brainsview .bl-specs { display: grid; grid-template-columns: 1.4fr 1fr 0.6fr; gap: 16px; min-width: 0; }
.brainsview .bl-spec { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.brainsview .bl-spec .k { font: 500 9.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4); }
.brainsview .bl-spec .v { font: 11.5px/1.35 var(--mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the link between two layers: a two-colour spine under the icons, ↓ down / ↑ up / note */
.brainsview .bk { display: grid; grid-template-columns: 68px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 18px; align-items: center; min-height: 44px; padding-right: 18px; font: 11.5px/1.45 var(--mono); color: var(--text-3); }
.brainsview .bk-spine { align-self: stretch; display: flex; flex-direction: column; padding-left: 33px; }
.brainsview .bk-spine i { flex: 1; width: 1.5px; background: rgba(var(--tc-rgb), 0.55); }
.brainsview .bk-ch b { margin-right: 7px; font-weight: 600; color: var(--text-2); }
.brainsview .bk-note { color: var(--text-4); text-align: right; white-space: nowrap; }
.brainsview .bstack + .vz-more { margin-top: 20px; }
.brainsview .vz-more .bp-note { margin: 0; }
@media (max-width: 1180px) {
  .brainsview .blayer { grid-template-columns: 180px minmax(0, 1fr) 18px; row-gap: 12px; }
  .brainsview .bl-specs { grid-column: 2; grid-row: 2; }
  .brainsview .blayer .brow-go { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 760px) {
  .brainsview .blayer { grid-template-columns: minmax(0, 1fr) 18px; }
  .brainsview .bl-id, .brainsview .bl-role, .brainsview .bl-specs { grid-column: 1; grid-row: auto; }
  .brainsview .blayer .brow-go { grid-column: 2; grid-row: 1; }
  .brainsview .bl-specs { grid-template-columns: 1fr 1fr; }
  .brainsview .bk { grid-template-columns: 52px minmax(0, 1fr); gap: 4px 12px; padding: 6px 0; }
  .brainsview .bk-spine { grid-row: 1 / span 3; }
  .brainsview .bk-ch, .brainsview .bk-note { grid-column: 2; text-align: left; white-space: normal; }
}

/* workspace: a tiny four-bar stack beside the tier name, the open tier lit */
.brainsview .brow-code { font: 500 10.5px var(--mono); color: var(--tc); }
.brainsview .bws-stack { display: inline-flex; flex-direction: column; gap: 2px; margin-left: 4px; }
.brainsview .bws-stack i { display: block; width: 14px; height: 3px; border-radius: 2px; background: var(--line-3); }
.brainsview .bws-stack i.on { background: var(--tc); box-shadow: 0 0 6px rgba(var(--tc-rgb), 0.5); }
/* version history: capped list — the line stops at the last visible version */
.brainsview .vtl-item:last-of-type::before { bottom: calc(100% - 15px); }
.brainsview .vtl > .vz-showall { margin-left: 30px; }

/* ================================================================ Fleet & 3D */
.fleetview .flt-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; align-items: start; }
.fleetview .flt-tile { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.15s; }
.fleetview .flt-tile:hover { border-color: var(--line-3); }
.fleetview .flt-open { display: flex; flex-direction: column; align-items: stretch; padding: 0 0 2px; text-align: left; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.fleetview .flt-stage {
  position: relative; display: flex; align-items: center; justify-content: center; height: 136px; border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse 55% 65% at 50% 55%, rgba(var(--tac), 0.08), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.045) 1px, transparent 0) 0 0 / 16px 16px, var(--bg-2);
}
.fleetview .flt-glyph { display: inline-flex; color: var(--text-2); transition: color 0.2s, transform 0.3s var(--ease); }
.fleetview .flt-glyph .i { width: 66px; height: 66px; stroke-width: 1.05; }
.fleetview .flt-open:hover .flt-glyph { color: var(--text); transform: scale(1.04); }
.fleetview .flt-code { position: absolute; top: 12px; left: 14px; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 5px; background: rgba(10, 11, 13, 0.6); font: 600 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--text-3); }
.fleetview .flt-nm { padding: 16px 18px 0; font-size: 15px; font-weight: 600; letter-spacing: -0.012em; }
.fleetview .flt-sub { padding: 3px 18px 0; font-size: 12.5px; color: var(--text-3); }
.fleetview .flt-figs { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 14px 18px 0; }
.fleetview .flt-fig { display: flex; flex-direction: column; gap: 4px; }
.fleetview .flt-fig b { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.fleetview .flt-fig em { font: normal 500 9.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4); }
.fleetview .flt-tile > .vz-more { margin: 0; padding: 12px 18px 0; }
.fleetview .flt-tile .plist { margin: 0; padding: 0; border-top: 0; }
.fleetview .flt-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 11px 18px 12px; border-top: 1px solid var(--line); }
.flt-tiers { display: inline-flex; flex-wrap: wrap; gap: 6px 12px; }
.flt-tier { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.flt-tier b { width: 6px; height: 6px; border-radius: 50%; background: var(--tc); flex: none; }
.fleetview .flt-go { padding: 0; border: 0; background: none; font: inherit; font-size: 12px; color: var(--text-3); cursor: pointer; transition: color 0.15s, transform 0.15s var(--ease); }
.fleetview .flt-go:hover, .fleetview .flt-tile:hover .flt-go { color: var(--text); }
.fleetview .flt-go:hover { transform: translateX(2px); }

/* full-screen viewer (appended to <body>): quiet tier tags + a calmer brain card */
.pv-badges .flt-tiers { gap: 12px; }
.pv-info .pv-card { display: flex; flex-direction: column; gap: 8px; }
.pv-card-lbl { margin-top: 8px; font: 500 9.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4); }
.pv-card-lbl:first-child { margin-top: 0; }
.pv-card-role { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-2); }
.pv-tier { padding: 9px 0 2px; border-top: 1px solid var(--line); }
.pv-tier-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pv-tier-top b { width: 7px; height: 7px; border-radius: 50%; background: var(--tc); flex: none; }
.pv-tier-nm { font-size: 13px; font-weight: 600; }
.pv-tier-m { margin-left: auto; max-width: 62%; font: 11px var(--mono); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-tier-note { margin: 6px 0 0 15px; padding-left: 8px; border-left: 2px solid rgba(223, 174, 82, 0.45); font-size: 11.5px; line-height: 1.5; color: var(--text-3); }
.pv-card-go { align-self: flex-start; margin-top: 6px; }

/* ================================================================ Simulations › AI testing */
.simview .sx-top-right { margin-left: auto; display: flex; align-items: center; gap: 18px; min-width: 0; }
.simview .sx-score { display: flex; align-items: center; min-width: 0; }
.simview .sx-score:empty { display: none; }
.simview .sx-score .vz-split { flex-direction: row; align-items: center; gap: 10px; }
.simview .sx-score .vz-split-bar { flex: 0 0 64px; height: 6px; }
.simview .sx-score .vz-legend { flex-wrap: nowrap; gap: 10px; }
.simview .sx-score .vz-leg { gap: 5px; font-size: 11px; }
.simview .sx-score .vz-leg em { font-size: 11px; }
@media (max-width: 760px) { .simview .sx-score .vz-legend { display: none; } }

/* empty state: the agent's loop as a diagram, one line, the quick-run chips */
.simview .sx-empty { max-width: 680px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.simview .sx-empty h2 { margin: 0; }
.simview .sx-empty .vz-flow { max-width: 100%; }
.simview .sx-empty .simchat-chips { margin-top: 2px; }

/* session list: delete appears on hover */
.simview .simchat-session .btn { opacity: 0; transition: opacity 0.12s; }
.simview .simchat-session:hover .btn, .simview .simchat-session.active .btn, .simview .simchat-session .btn:focus-visible { opacity: 1; }
@media (hover: none) { .simview .simchat-session .btn { opacity: 1; } }

/* live run card */
.simview .sx-run { background: var(--surface); }
.simview .sx-run .run-feed-head { gap: 10px; background: none; border-bottom: 1px solid var(--line); }
.simview .sx-run-dot, .simview .sx-chip-dot { display: inline-flex; }
.simview .sx-out { font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--vz-c, var(--text-3)); }
.simview .sx-run-meta { margin-left: auto; font: 11px var(--mono); color: var(--text-4); white-space: nowrap; }
.simview .sx-fold { margin: 0; border-top: 1px solid var(--line); }
.simview .sx-fold > .vz-more-sum { display: flex; padding: 8px 12px; font: 11.5px var(--mono); }
.simview .sx-fold > .vz-more-body { padding-top: 0; }
.simview .sx-full { border-top: 1px solid var(--line); }
.simview .sx-run-act { padding: 8px 12px; border-top: 1px solid var(--line); }

/* result metrics: one row per series — name · mean · CI band · spark · ±/n */
.simview .sx-results { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 14px; border-top: 1px solid var(--line); }
.simview .sx-lbl { font: 500 9.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4); }
.simview .sx-file { display: flex; align-items: center; gap: 10px; }
.simview .sx-file-n { flex: 1; min-width: 0; font: 12px var(--mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.simview .sx-metrics:empty { display: none; }
.simview .sx-mtable { display: flex; flex-direction: column; }
.simview .sx-metric { display: grid; grid-template-columns: minmax(90px, 1.2fr) 74px minmax(100px, 1.4fr) 90px 96px; gap: 14px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.simview .sx-mhead { padding: 2px 0 6px; border-top: 0; font: 500 9.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4); }
.simview .sx-m-k { font: 12px var(--mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.simview .sx-m-v { font: 600 13px var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }
.simview .sx-ci { position: relative; display: block; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); }
.simview .sx-ci-band { position: absolute; top: 2px; bottom: 2px; border-radius: 999px; background: rgba(var(--tac), 0.45); }
.simview .sx-ci-mean { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); }
.simview .sx-m-spark { display: block; height: 22px; }
.simview .sx-m-n { font: 10.5px var(--mono); color: var(--text-4); text-align: right; white-space: nowrap; }
.simview .sx-raw { margin: 0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 760px) {
  .simview .sx-metric { grid-template-columns: minmax(0, 1fr) 70px minmax(80px, 1fr); }
  .simview .sx-m-spark, .simview .sx-m-n, .simview .sx-mhead > :nth-child(n+4) { display: none; }
}

/* proposal (diff) card: dim directory, add/delete blocks, folded diff */
.simview .sx-prop .proposal-head { gap: 12px; }
.simview .sx-prop .path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.simview .sx-dir { color: var(--text-4); }
.simview .sx-prop .st { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.simview .sx-delta { display: inline-flex; gap: 2px; margin-right: 4px; }
.simview .sx-delta i { width: 7px; height: 7px; border-radius: 1.5px; background: var(--line-2); }
.simview .sx-delta i.a { background: var(--good); }
.simview .sx-delta i.d { background: var(--bad); }

/* a run from an earlier turn, as one quiet chip */
.simview .sx-runchip { display: inline-flex; align-items: center; gap: 8px; margin: 8px 6px 0 0; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 12.5px; color: var(--text-2); }
.simview .sx-chip-m { font: 11px var(--mono); color: var(--text-4); }
.simview .sx-chip-m:empty { display: none; }

/* ================================================================ Learning */
.learnview .ln-kpis { margin-top: 22px; }
.learnview .ln-kpis .vz-kpi-viz .vz-split { justify-content: center; }
.learnview .sec .vz-quiet { padding: 8px 0; }

/* start a run */
.learnview .ln-start { display: flex; flex-direction: column; gap: 14px; }
.learnview .ln-sims { display: flex; flex-wrap: wrap; gap: 8px; }
.learnview .ln-sim {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 10px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.learnview .ln-sim:hover { border-color: var(--line-3); color: var(--text); }
.learnview .ln-sim.on { border-color: rgba(var(--tac), 0.45); background: var(--accent-soft); color: var(--text); }
.learnview .ln-check { position: relative; width: 13px; height: 13px; flex: none; border-radius: 4px; border: 1.5px solid var(--line-3); }
.learnview .ln-sim.on .ln-check { background: var(--accent); border-color: var(--accent); }
.learnview .ln-sim.on .ln-check::after { content: ''; position: absolute; left: 3px; top: 0.5px; width: 3px; height: 6px; border: solid var(--bg); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.learnview .ln-start-row { display: flex; align-items: center; gap: 8px; }
.learnview .ln-focus { flex: 1; min-width: 0; }
.learnview .ln-runs { flex: none; }
.learnview .ln-start-row .btn { flex: none; height: 32px; padding: 0 14px; }
@media (max-width: 640px) { .learnview .ln-start-row { flex-wrap: wrap; } .learnview .ln-focus { flex-basis: 100%; } }

/* current run: status tag, live timeline, review meter, lessons */
.learnview .ln-status { display: inline-flex; align-items: center; gap: 7px; font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--vz-c, var(--text-3)); white-space: nowrap; }
.learnview .ln-run .vz-tl-t { white-space: normal; overflow: visible; }
.learnview .ln-run .vz-tl-i.t-accent:last-child .vz-tl-dot { animation: livepulse 1.4s ease-out infinite; }
.learnview .ln-run .vz-tl-i.t-accent:last-child .vz-tl-t { color: var(--text-3); }
.learnview .ln-steps > .vz-more { margin: 0 0 6px; }
.learnview .ln-lessons { display: flex; flex-direction: column; gap: 14px; }
.learnview .ln-steps + .ln-lessons { margin-top: 20px; }
.learnview .ln-lessons > .vz-more { margin-top: 0; }

/* rows shared by lessons, memory and proposals */
.learnview .ln-list { display: flex; flex-direction: column; }
.learnview .ln-row { display: flex; align-items: flex-start; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.learnview .ln-list > .ln-row:first-child { border-top: 0; padding-top: 4px; }
.learnview .ln-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.learnview .ln-row-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.learnview .ln-row .ttl { font-size: 13.5px; font-weight: 500; letter-spacing: -0.005em; color: var(--text); }
.learnview .ln-row .sub { font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
.learnview .ln-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; cursor: pointer; }
.learnview .ln-clamp.open { display: block; -webkit-line-clamp: unset; overflow: visible; }
.learnview .ln-kind { display: inline-flex; align-items: center; gap: 6px; font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.learnview .ln-kind b { width: 6px; height: 6px; border-radius: 50%; background: var(--vz-c, var(--text-4)); flex: none; }
.learnview .ln-src { min-width: 0; font: 11px var(--mono); color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.learnview .ln-imp { display: inline-flex; align-items: flex-end; gap: 2px; margin-left: auto; height: 11px; }
.learnview .ln-imp i { width: 3px; border-radius: 1px; background: var(--line-2); }
.learnview .ln-imp i:nth-child(1) { height: 5px; }
.learnview .ln-imp i:nth-child(2) { height: 8px; }
.learnview .ln-imp i:nth-child(3) { height: 11px; }
.learnview .ln-imp i.on { background: var(--accent); }
.learnview .ln-actions { display: flex; gap: 6px; flex: none; align-self: center; }
.learnview .ln-decided { display: inline-flex; align-items: center; gap: 7px; flex: none; align-self: center; font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.learnview .ln-lesson.s-trashed .ttl { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--text-4); }
.learnview .ln-row .vz-more { margin-top: 4px; }
.learnview .ln-evidence { padding: 8px 10px; border-left: 2px solid var(--line-2); background: var(--bg-2); font: 11.5px/1.55 var(--mono); color: var(--text-3); white-space: pre-wrap; word-break: break-word; }
.learnview .ln-del { align-self: center; opacity: 0; transition: opacity 0.12s; }
.learnview .ln-row:hover .ln-del, .learnview .ln-del:focus-visible { opacity: 1; }
@media (hover: none) { .learnview .ln-del { opacity: 1; } }

/* memory: search in the section head, the kind mix as one bar */
.learnview .ln-search { width: 200px; height: 28px !important; padding: 0 10px; font-size: 12.5px; }
.learnview .ln-mix { margin-bottom: 14px; }
.learnview .ln-mix:empty { display: none; }
.learnview .ln-mix .vz-split-bar { height: 6px; }

/* proposals: ring of what is pending + the approved / rejected split */
.learnview .ln-prop-sum { display: flex; align-items: center; gap: 28px; padding: 2px 0 18px; }
.learnview .ln-prop-split { flex: 1; min-width: 0; max-width: 420px; }
.learnview .ln-props .ln-list + .vz-more { margin-top: 14px; }

/* standing instructions */
.learnview .ln-instr { min-height: 120px; font-size: 13px; line-height: 1.6; }
.learnview .ln-instr-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
