/* AI page v2 (2026-10-05) — "the guts of our box". Tokens only (RULEBOOK
   R-T1/R-S1/R-C1/R-C4); every rule scoped to .v2-ai so nothing leaks. Loads
   after v2-screens.css and refines the .v2-model card it defines there. */

.v2-ai .v2-ai-note { margin: calc(-1 * var(--s-4)) 0 var(--s-6); font-size: var(--t-body); color: var(--text-2); max-width: var(--read-max); }

/* ── 1. Thinking now: role tiles + the memory tank ─────────────────────── */
.v2-ai .v2-now { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.v2-ai .v2-role {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: var(--s-5) var(--s-6); min-width: 0;
  display: flex; flex-direction: column; gap: var(--s-2);
}
.v2-ai .v2-kicker { margin: 0; font-size: var(--t-small); font-weight: var(--w-medium); color: var(--text-2); }
.v2-ai .v2-role h3 { margin: 0; font-size: var(--t-title-3); font-weight: var(--w-bold); letter-spacing: var(--track-title); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.v2-ai .v2-role h3 small { font-size: var(--t-body); font-weight: var(--w-regular); color: var(--text-2); }
.v2-ai .v2-role .meta { margin: 0; font-size: var(--t-small); color: var(--text-3); line-height: var(--lh-snug); }
.v2-ai .v2-role-state { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-top: auto; padding-top: var(--s-2); }
.v2-ai .v2-role[data-state="none"] h3 { color: var(--text-2); font-weight: var(--w-medium); }

.v2-ai .v2-tank { height: var(--s-2); border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; margin-top: var(--s-1); }
.v2-ai .v2-tank-fill { height: 100%; border-radius: var(--r-pill); background: var(--text); transition: width var(--dur-3) var(--ease); }
.v2-ai .v2-tank-fill.unread { background: transparent; }
.v2-ai .v2-tank-tile h3 { font-variant-numeric: tabular-nums; }

/* ── the id row: the exact engine id, monospace, one tap to copy ───────── */
.v2-ai .v2-id-row { display: flex; align-items: center; gap: var(--s-1); min-width: 0; margin: calc(-1 * var(--s-1)) 0 0; }
.v2-ai .v2-id {
  font-family: var(--mono); font-size: var(--t-small); color: var(--text-2);
  background: var(--surface-2); border-radius: var(--r-sm); padding: var(--s-1) var(--s-2);
  overflow-wrap: anywhere; letter-spacing: 0;
}
.v2-ai .v2-copy { color: var(--text-3); }
.v2-ai .v2-copy svg { width: 18px; height: 18px; }

/* ── 2. Installed: the model card ─────────────────────────────────────── */
.v2-ai .v2-models { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v2-ai .v2-model { gap: var(--s-3); }
/* app.css lets a card's description grow to fill; here the ACTIONS row takes
   the slack (R-S4), so the facts sit under the sentence, not a gap away. */
.v2-ai .v2-model .desc { flex: none; }
.v2-ai .v2-model .v2-id-row { margin-top: 0; }
.v2-ai .v2-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2) var(--s-4); margin: 0; }
.v2-ai .v2-facts > div { min-width: 0; }
.v2-ai .v2-facts dt { font-size: var(--t-caption); color: var(--text-3); }
.v2-ai .v2-facts dd { margin: 0; font-size: var(--t-body); color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.v2-ai .v2-facts-note { margin: 0; }
.v2-ai .v2-speed { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; font-size: var(--t-small); color: var(--text); }
.v2-ai .v2-speed .unread { color: var(--idle); }
.v2-ai .v2-roles { margin: 0; }
.v2-ai .v2-model .v2-model-acts:empty { display: none; }
.v2-ai .v2-model-tech { margin-top: var(--s-2); border-top: 1px solid var(--hairline); }
.v2-ai .v2-model-tech > summary { font-size: var(--t-body); }
.v2-ai .v2-model-tech .tech-body { padding: 0 0 var(--s-3); }
.v2-ai .v2-model-tech .tech-body dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s-1) var(--s-4); margin: 0; font-size: var(--t-small); }
.v2-ai .v2-model-tech .tech-body dt { color: var(--text-3); }
.v2-ai .v2-model-tech .tech-body dd { margin: 0; color: var(--text); font-family: var(--mono); overflow-wrap: anywhere; }
.v2-ai .v2-remove { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--hairline); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.v2-ai .v2-remove .meta { margin: 0; flex: 1; min-width: 200px; }
.v2-ai .v2-remove-note { margin: var(--s-4) 0 0; padding-top: var(--s-4); border-top: 1px solid var(--hairline); }

/* ── 3. Add AI: the catalogue by purpose ──────────────────────────────── */
.v2-ai .v2-cat-intro, .v2-ai .v2-cat-net { margin: 0 0 var(--s-4); font-size: var(--t-body); color: var(--text-2); max-width: var(--read-max); line-height: var(--lh-body); }
.v2-ai .v2-cat-group { margin-top: var(--s-6); }
.v2-ai .v2-cat-group h3 { margin: 0; font-size: var(--t-lead); font-weight: var(--w-medium); }
.v2-ai .v2-cat-group > .meta { margin: var(--s-1) 0 var(--s-3); font-size: var(--t-small); color: var(--text-2); }
.v2-ai .v2-cat { flex-wrap: wrap; position: relative; }
.v2-ai .v2-cat .title { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.v2-ai .v2-cat .desc + .desc { margin-top: var(--s-1); }
.v2-ai .v2-cat .trail { gap: var(--s-3); }
.v2-ai .v2-cat .install-zone { flex-basis: 100%; }
.v2-ai .v2-cat .install-zone .progress { margin-top: var(--s-2); }

/* ── widths ────────────────────────────────────────────────────────────── */
/* 1280 keeps three columns (the desk); the split pane and narrower go to two. */
@media (max-width: 1100px) {
  .v2-ai .v2-now { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v2-ai .v2-models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .v2-ai .v2-now, .v2-ai .v2-models { grid-template-columns: minmax(0, 1fr); }
  .v2-ai .v2-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v2-ai .v2-cat .trail { flex-basis: 100%; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .v2-ai .v2-tank-fill { transition: none; } }
