/* custom-llm.css: only solution-custom-llm.html uses these rules. What we build: the whole corpus, a point crossing it
   with thin scan lines to the squares it reads; the passages that answer are held in corners and cited. Deployment: the
   perimeter, colour by meaning (model, data at rest and in transit, policy and audit). The owner's picks of 2026-10-22
   (docs/superpowers/plans/2026-10-22-solutions-blocks.md). Tokens only; the rough panel (docs/EMPHASIS-PATTERNS.md);
   mono only for data, ids, versions and scores; text ≥11px. */
/* ---------- the rough panel and its shared parts ---------- */
.lx {
  position: relative; isolation: isolate; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 38%), var(--surface-solid);
}
.lx::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background-image: var(--grain); background-size: 140px 140px; opacity: .05; mix-blend-mode: overlay; }
.lx > * { position: relative; z-index: 1; }
.lx-st { font: 500 13px/1.3 var(--font-body); white-space: nowrap; transition: opacity .35s var(--ease); }
.lx-st.ok { color: var(--pos-text); }
.lx-st.warn { color: var(--warn-text); }

/* the figures strip: published numbers, no tiles, no icons */
.lx-kpis { display: flex; align-items: flex-end; padding: 16px 24px 14px; border-bottom: 1px solid var(--border); }
.lx-ctx { margin-right: auto; align-self: center; display: flex; flex-direction: column; gap: 3px; font: 500 15px/1.2 var(--font-display); letter-spacing: -.01em; color: var(--text); }
.lx-ctx small { font: 400 12.5px/1.3 var(--font-body); letter-spacing: 0; color: var(--text-faint); }
.lx-k { display: flex; flex-direction: column; gap: 3px; padding: 0 22px; border-left: 1px solid var(--border); }
.lx-k:last-child { padding-right: 0; }
.lx-k span { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }
.lx-k b { font: 500 22px/1.15 var(--font-display); letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }

/* text tabs with a progress hairline (the S2 tabs, laid flat) */

.lx-q { margin: 0; padding: 18px 24px 17px; border-bottom: 1px solid var(--border); font: 500 20px/1.3 var(--font-display); letter-spacing: -.015em; color: var(--text); text-wrap: balance; }

/* the citation in running text */
.cite { font: 500 12px/1 var(--font-mono); color: var(--text-faint); white-space: nowrap; transition: color .3s var(--ease), opacity .25s var(--ease); }
.cite.hot { color: var(--accent-text); }
.w { transition: opacity .28s var(--ease); }

.w1-ah { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--text-faint); }
.w1-sh { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-faint); }
.w3-u em { font: 400 12px var(--font-mono); font-style: normal; color: var(--text-faint); margin-left: 4px; }
.pre .w3-u:not(.in) { opacity: 0; transform: translateY(4px); }
.pre .w:not(.in), .pre .cite:not(.in) { opacity: 0; }
.pre .lx-st:not(.in) { opacity: 0; }
/* ---------- W3 · the whole corpus ---------- */
.w3-qs, .w3-bot { display: grid; }
.w3-qq, .w3-res { grid-area: 1 / 1; min-width: 0; }
.w3-qq:not(.on), .w3-res:not(.on) { visibility: hidden; }
.w3-field { padding: 16px 24px 14px; border-bottom: 1px solid var(--border); }
.w3-grid { --p: calc((100cqw - 64px) / 98); --lab: 40px; position: relative; display: flex; gap: 16px; container-type: inline-size; }
.w3-blk { flex: var(--n) 1 0; min-width: 0; }
.w3-lab { display: flex; flex-direction: column; gap: 1px; height: var(--lab); }
.w3-lab span { font-size: 13px; line-height: 1.3; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w3-lab b { font: 400 12px/1.3 var(--font-mono); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.w3-cells { height: calc(var(--p) * 24); background: conic-gradient(at 68% 68%, transparent 75%, color-mix(in srgb, var(--text) 12%, transparent) 0) 0 0 / var(--p) var(--p); }
.w3.drawn .w3-cells { background: none; }
.w3-cv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.w3-pins { position: absolute; inset: 0; pointer-events: none; visibility: hidden; }
.w3-pins.on { visibility: visible; }
.w3-pin { position: absolute; left: calc(var(--p) * (var(--c) + .34) + 16px * var(--b)); top: calc(var(--lab) + var(--p) * (var(--r) + .34)); width: 0; height: 0; transition: opacity .35s var(--ease); }
.w3-pin i { position: absolute; width: 5px; height: 5px; border: 0 solid var(--text); }
.w3-pin i:nth-child(1) { left: -8px; top: -8px; border-width: 1px 0 0 1px; }
.w3-pin i:nth-child(2) { right: -8px; top: -8px; border-width: 1px 1px 0 0; }
.w3-pin i:nth-child(3) { left: -8px; bottom: -8px; border-width: 0 0 1px 1px; }
.w3-pin i:nth-child(4) { right: -8px; bottom: -8px; border-width: 0 1px 1px 0; }
.w3-pin b { position: absolute; left: 10px; top: -22px; padding: 0 3px; border-radius: 3px; background: var(--surface-solid); font: 500 11.5px/16px var(--font-mono); color: var(--accent-text); }
.w3.armed .w3-pin:not(.in) { opacity: 0; }
.w3-leg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin-top: 12px; font-size: 12.5px; color: var(--text-faint); }
.w3-leg span { display: flex; align-items: center; gap: 7px; }
.w3-leg em { margin-left: auto; font-style: normal; }
.w3-keys { display: none; }
.sw.s0, .sw.s1, .sw.s2 { width: 8px; height: 8px; border-radius: 1px; }
.sw.s0 { background: color-mix(in srgb, var(--text) 16%, transparent); }
.sw.s1 { background: color-mix(in srgb, var(--text) 48%, transparent); }
.sw.s2 { background: var(--accent-text); }
.w3-res { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.w3-ans { padding: 16px 24px 20px; min-width: 0; }
.w3-a { margin: 8px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--text); text-wrap: pretty; max-width: 62ch; }
.w3-used { padding: 16px 24px 20px; border-left: 1px solid var(--border); min-width: 0; }
.w3-u { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; height: 40px; border-bottom: 1px solid var(--border); font-size: 13.5px; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.w3-u .n { font: 500 12px var(--font-mono); color: var(--text-faint); transition: color .3s var(--ease); }
.w3-u.hot .n { color: var(--accent-text); }
.w3-u .tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.w3-u .ty { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }
.w3-u b { font: 500 12.5px var(--font-mono); text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* the questions as controls: a hint, then chips; the picked one fills while the next one waits */
.w3-ask { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.w3-hint { font-size: 13px; color: var(--text-faint); white-space: nowrap; }
.w3-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.w3-chip { --p: 1; min-height: 36px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-solid); cursor: pointer;
  font: 500 13.5px/1 var(--font-body); color: var(--text-muted); white-space: nowrap;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease), transform .16s var(--ease); }
.w3-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); background-color: color-mix(in srgb, var(--accent) 5%, var(--surface-solid)); }
.w3-chip:active { transform: scale(.97); }
.w3-chip[aria-selected="true"] { color: var(--text); border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 20%, var(--surface-solid)) calc(var(--p) * 100%), color-mix(in srgb, var(--accent) 9%, var(--surface-solid)) 0); }
.w3-chip:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.w3-u.hot .tx { color: var(--text); }
/* ---------- drawings (D1–D3): opaque boxes, dotted links, a lit route ---------- */
.lxs { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.lxs .t { font-size: 12px; fill: var(--text-muted); }
.lxs .tt { font-size: 13px; font-weight: 500; fill: var(--text); }
.lxs .th { font-family: var(--font-display); font-size: 14px; font-weight: 500; letter-spacing: -.01em; fill: var(--text); }
.lxs .tf { font-size: 12px; fill: var(--text-faint); }
.lxs .m { font-family: var(--font-mono); font-size: 11.5px; fill: var(--text-faint); }
.lxs .box { fill: var(--bg-deep); stroke: color-mix(in srgb, var(--text) 18%, transparent); transition: fill .35s var(--ease), stroke .35s var(--ease); }
.lxs .nd.on .box { fill: color-mix(in srgb, var(--accent) 8%, var(--bg-deep)); stroke: color-mix(in srgb, var(--accent-text) 60%, transparent); }
.lxs .ghost { fill: none; stroke: color-mix(in srgb, var(--text) 26%, transparent); stroke-dasharray: 3 3; }
.lxs .dot { fill: none; stroke: color-mix(in srgb, var(--text) 34%, transparent); stroke-dasharray: 1.5 3; stroke-linecap: round; }
.lxs .lit { fill: none; stroke: var(--accent-text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.lxs .head { fill: var(--accent-text); }
.lxs .per { fill: none; stroke: color-mix(in srgb, var(--text) 38%, transparent); stroke-width: 1.2; }
.lxs .per.dash { stroke-dasharray: 7 5; }
.lxs .stop { stroke: var(--text-muted); stroke-width: 1.6; stroke-linecap: round; }
.lxs .fade { transition: opacity .45s var(--ease); }
.lxs .off { opacity: 0; }

/* ---------- D1 · the perimeter ---------- */
.d1-top { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.d1-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--bg-deep); border: 1px solid var(--border); }
.d1-seg button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: none; cursor: pointer; font: 500 13.5px/1 var(--font-body); color: var(--text-muted); transition: color .2s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease); }
.d1-seg button:hover { color: var(--text); }
.d1-seg button[aria-pressed="true"] { color: var(--text); background: color-mix(in srgb, var(--accent) 14%, var(--surface-solid)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, var(--border)); }
.d1-seg button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.d1-sub { display: grid; flex: 1 1 260px; min-width: 0; font-size: 14px; color: var(--text-muted); }
.d1-sub span, .d1-v b { grid-area: 1 / 1; transition: opacity .35s var(--ease), visibility 0s linear .35s; }
.d1-sub span:not(.on), .d1-v b:not(.on) { opacity: 0; visibility: hidden; }
.d1-sub span.on, .d1-v b.on { transition-delay: 0s; }
.d1-fig { padding: 16px 24px 12px; overflow-x: auto; }
.d1-led { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.1fr); border-top: 1px solid var(--border); }
.d1-cell { display: grid; align-content: start; gap: 5px; padding: 14px 18px 16px; border-left: 1px solid var(--border); min-width: 0; }
.d1-cell:first-child { border-left: 0; padding-left: 24px; }
.d1-cell > span { font-size: 12.5px; color: var(--text-faint); }
.d1-v { display: grid; font-size: 14px; line-height: 1.35; color: var(--text); }
.d1-v b { font-weight: 500; }
.d1-cell.end .d1-v { font: 500 22px/1.15 var(--font-display); letter-spacing: -.02em; color: var(--pos-text); }

/* ---------- D1 v2 · colour by meaning: model, data (at rest and in transit), policy and audit, inside the perimeter ---------- */
.d1v .k-model { --c: var(--accent-text); }
.d1v .k-data { --c: var(--accent-2-text); }
.d1v .k-policy { --c: var(--warn-text); }
.d1v .k-plain { --c: var(--text-faint); }
.d1v .nd .box { stroke: color-mix(in srgb, var(--c) 50%, transparent); }
.d1v .nd .gl { fill: var(--c); }
.d1v .nd.on .box { fill: var(--bg-deep); stroke: var(--c); stroke-width: 1.5; }   /* the route lights the edge only: the text keeps its contrast */
.d1v .zone { fill: color-mix(in srgb, var(--pos-text) 4%, transparent); }
.d1v .per { stroke: color-mix(in srgb, var(--pos-text) 62%, transparent); }
.d1v .pz { fill: var(--pos-text); }
.d1v .eg { font-family: var(--font-body); fill: var(--warn-text); }
.d1v .stop { stroke: var(--warn-text); }
.d1v .lit { stroke: var(--accent-2-text); }
.d1v .head { fill: var(--accent-2-text); }
.d1v .lk rect, .d1v .lk path { fill: none; stroke: var(--accent-2-text); stroke-width: 1.2; stroke-linejoin: round; }
.d1v .t.rest { fill: var(--accent-2-text); }
.d1v .tls rect { fill: var(--surface-solid); stroke: color-mix(in srgb, var(--accent-2-text) 40%, var(--border)); }
.d1v .tls text { fill: var(--accent-2-text); }
.d1-key { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 0 2px; font-size: 12.5px; color: var(--text-muted); }
.d1-key span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.d1-key .sw { width: 9px; height: 9px; border-radius: 2px; }
.d1-key .k-model { background: var(--accent-text); }
.d1-key .k-data { background: var(--accent-2-text); }
.d1-key .k-policy { background: var(--warn-text); }
.d1-key .k-per { background: color-mix(in srgb, var(--pos-text) 14%, transparent); box-shadow: inset 0 0 0 1.5px var(--pos-text); }
.d1-key .k-move { width: 16px; height: 0; border-radius: 0; border-top: 1.5px solid var(--accent-2-text); }
.d1v .d1-fig { padding-bottom: 14px; }
.d1v .d1-cell.end .d1-v { color: var(--pos-text); }

/* ---------- narrower screens ---------- */
@media (max-width: 1024px) {
  .lx-kpis { flex-wrap: wrap; row-gap: 12px; }
  .lx-ctx { flex: 1 1 100%; }
  .lx-k:first-of-type { padding-left: 0; border-left: 0; }
  .w3-res { grid-template-columns: minmax(0, 1fr); }
  .w3-used { border-left: 0; border-top: 1px solid var(--border); }
  .d1-led { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d1-cell { border-top: 1px solid var(--border); }
  .d1-cell:nth-child(odd) { border-left: 0; padding-left: 24px; }
  .d1-cell.end { grid-column: 1 / -1; }
  .d1-svg { min-width: 900px; }
}
@media (max-width: 640px) {
  .lx-k { padding: 0 14px; }
  .lx-k b { font-size: 18px; }
  .lx-q { font-size: 18px; padding: 16px 20px; }
  .w3-ask { padding: 12px 20px; }
  .w3-chip { min-height: 44px; }
  .w3-ans, .w3-used { padding-left: 20px; padding-right: 20px; }
  .w3-u .ty { display: none; }
  .w3-u { grid-template-columns: 26px minmax(0, 1fr) 40px; }
  .w3-grid { gap: 8px; --p: calc((100cqw - 32px) / 98); }
  .w3-pin { left: calc(var(--p) * (var(--c) + .34) + 8px * var(--b)); }
}
/* the group names stop fitting over their squares below ~840px («Compliance» is the narrowest): a legend under the grid */
@media (max-width: 900px) {
  .w3-grid { --lab: 0px; }
  .w3-lab { display: none; }
  .w3-keys { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12.5px; color: var(--text-muted); }
  .w3-keys b { font: 400 12px var(--font-mono); color: var(--text-faint); margin-left: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .lx * { transition: none !important; animation: none !important; }
}

/* Proof: the 3-up cases grid (cg-3 is not in components.css) */
.cases-grid.cg-3{ grid-template-columns:repeat(3,minmax(0,1fr)); justify-content:center; }
@media (max-width:980px){ .cases-grid.cg-3{ grid-template-columns:repeat(2,minmax(0,360px)); } }
@media (max-width:680px){ .cases-grid.cg-3{ grid-template-columns:minmax(0,420px); } }

/* Deployment on a phone: the perimeter laid out top to bottom, nothing to scroll sideways; the mode switch keeps 44px */
@media (max-width: 640px) {
  .d1-fig { overflow-x: visible; padding: 14px 12px 10px; }
  .d1-svg:not(.ph) { display: none; }
  .d1-svg.ph { display: block; min-width: 0; width: 100%; height: auto; }
  .d1-seg button { min-height: 44px; }
}
@media (min-width: 641px) { .d1-svg.ph { display: none; } }

