/* ============================================================================
   agent.css — the humanised agent surface: Sprig (avatar), the emem-backed
   chat dock, and the agent-to-agent channel panel.

   All colour comes from the page design tokens (--emerald / --amber / --paper*
   / --ink* / --rule* / --crimson / --mono / --sans), so this adapts to light
   and dark themes with the rest of the console and introduces no new palette.

   Rendering cost is deliberately near-zero: Sprig is one inline SVG recoloured
   by CSS custom properties off `data-state`; there is no image, no canvas, no
   redraw loop. The chat dock offloads ALL inference to emem (/api/agent/chat),
   so nothing here loads this server.
   ========================================================================== */

/* ── Sprig avatar ─────────────────────────────────────────────────────────
   `.sprig[data-state]` recolours + re-poses the whole sprite. The leaf group
   perks up (watching) or droops (alert/offline); the body breathes. Every
   transform is percentage-based with `transform-box: fill-box` so it stays
   correct at any rendered size. */
.sprig { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; line-height: 1;
  /* default = standing_by palette (set explicitly below too, for older engines) */
  --s-leaf: var(--amber); --s-leaf2: var(--amber-soft); --s-stem: var(--ink-4);
  --s-body: var(--paper-3); --s-eye: var(--ink-2); --s-mouth: var(--ink-3); --s-foot: var(--rule-2);
  --s-bob: 3.4s; --s-eye-op: 1;
}
.sprig-fig { position: relative; width: var(--sprig-size, 44px); height: var(--sprig-size, 44px); display: inline-block; }
.sprig-svg { display: block; width: 100%; height: 100%; image-rendering: pixelated; overflow: visible; }

.sprig .s-leaf  { fill: var(--s-leaf); }
.sprig .s-leaf2 { fill: var(--s-leaf2); }
.sprig .s-stem  { fill: var(--s-stem); }
.sprig .s-body  { fill: var(--s-body); }
.sprig .s-eye   { fill: var(--s-eye); opacity: var(--s-eye-op); }
.sprig .s-mouth { fill: var(--s-mouth); }
.sprig .s-foot  { fill: var(--s-foot); }
.sprig .s-shadow{ fill: rgba(26,22,18,0.10); }

.sprig-leaf-g { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .5s ease; }
.sprig-body-g { transform-box: fill-box; transform-origin: 50% 100%; animation: sprig-bob var(--s-bob) ease-in-out infinite; }

@keyframes sprig-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4%); } }
@keyframes sprig-blink { 0%,92%,100% { opacity: var(--s-eye-op); } 96% { opacity: 0.12; } }
@keyframes sprig-wiggle { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes sprig-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3%); } 75% { transform: translateX(3%); } }

/* standing by — calm, level leaf, soft amber, slow breath + occasional blink */
.sprig[data-state="standing_by"] { --s-leaf: var(--amber); --s-leaf2: var(--amber-soft); --s-body: var(--paper-3); --s-eye: var(--ink-2); --s-bob: 4.2s; }
.sprig[data-state="standing_by"] .sprig-leaf-g { transform: rotate(-2deg); }
.sprig[data-state="standing_by"] .s-eye { animation: sprig-blink 6s ease-in-out infinite; }

/* watching — bright emerald, leaf perked up, attentive blink */
.sprig[data-state="watching"] { --s-leaf: var(--emerald-2); --s-leaf2: var(--emerald-soft); --s-stem: var(--emerald); --s-body: var(--emerald-soft); --s-eye: var(--ink); --s-bob: 3.2s; }
.sprig[data-state="watching"] .sprig-leaf-g { transform: translateY(-6%) rotate(-7deg); }
.sprig[data-state="watching"] .s-eye { animation: sprig-blink 4.5s ease-in-out infinite; }

/* thinking — working on a call; leaf wiggles, body bobs faster */
.sprig[data-state="thinking"] { --s-leaf: var(--emerald-2); --s-leaf2: var(--emerald-soft); --s-stem: var(--emerald); --s-body: var(--emerald-soft); --s-eye: var(--ink); --s-bob: 1.5s; }
.sprig[data-state="thinking"] .sprig-leaf-g { animation: sprig-wiggle 1.1s ease-in-out infinite; }

/* alert — a real risk needs a look; amber, leaf drooped, gentle shake */
.sprig[data-state="alert"] { --s-leaf: var(--amber); --s-leaf2: var(--amber-soft); --s-stem: var(--amber); --s-body: var(--amber-soft); --s-eye: var(--crimson); --s-mouth: var(--crimson); --s-bob: 2.6s; }
.sprig[data-state="alert"] .sprig-leaf-g { transform: rotate(18deg) translateY(4%); }
.sprig[data-state="alert"] .sprig-body-g { animation: sprig-shake 0.9s ease-in-out infinite; }

/* offline — emem unreachable; greyed, dim eyes, no motion */
.sprig[data-state="offline"] { --s-leaf: var(--ink-4); --s-leaf2: var(--rule-2); --s-stem: var(--ink-4); --s-body: var(--paper-3); --s-eye: var(--ink-4); --s-mouth: var(--ink-4); --s-eye-op: 0.5; }
.sprig[data-state="offline"] .sprig-leaf-g { transform: rotate(9deg); }
.sprig[data-state="offline"] .sprig-body-g { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .sprig-body-g, .sprig[data-state] .sprig-leaf-g, .sprig .s-eye { animation: none !important; transition: none !important; }
}

/* AI-Act Art. 50 badge — small, always attached to the sprite */
.sprig-badge {
  position: absolute; right: -6px; bottom: -4px;
  font: 700 8px/1 var(--mono); letter-spacing: .04em;
  background: var(--ink); color: var(--paper);
  border-radius: 999px; padding: 2px 4px; border: 1px solid var(--paper);
}
.sprig-mood { font: 9px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.sprig-speech {
  max-width: 200px; font: 11px/1.4 var(--sans); color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--rule-2); border-radius: 8px;
  padding: 6px 9px; box-shadow: var(--shadow-1);
}

/* ── status-strip integration ─────────────────────────────────────────────
   Sprig sits at the left of the existing agent-strip. Keep it compact. */
.agent-strip-inner .sprig { margin-right: 2px; }
.agent-strip-sprig { display: inline-flex; align-items: center; gap: 10px; }

/* ── chat dock ─────────────────────────────────────────────────────────────
   Floating launcher (bottom-right) → panel. Sits below the cookie banner
   (z 9999) so it never blocks consent. */
.sprig-dock { position: fixed; right: 18px; bottom: 18px; z-index: 800; font-family: var(--sans); }
@media print { .sprig-dock { display: none !important; } }

.sprig-launch {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule-2); border-radius: 999px;
  padding: 6px 14px 6px 6px; cursor: pointer; box-shadow: var(--shadow-2);
  font: 600 13px var(--sans);
}
.sprig-launch:hover { border-color: var(--ink-2); }
.sprig-launch .sprig-launch-txt { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.sprig-launch .sprig-launch-txt small { font: 10px var(--mono); color: var(--ink-3); }

.sprig-panel {
  position: absolute; right: 0; bottom: 58px;
  width: min(390px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px));
  display: none; flex-direction: column;
  background: var(--paper); border: 1px solid var(--rule-2); border-radius: 12px;
  box-shadow: var(--shadow-2); overflow: hidden;
}
.sprig-dock.open .sprig-panel { display: flex; }
.sprig-dock.open .sprig-launch { display: none; }

.sprig-panel-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.sprig-panel-head .who { display: flex; flex-direction: column; line-height: 1.2; }
.sprig-panel-head .who b { font: 600 13px var(--sans); color: var(--ink); }
.sprig-panel-head .who small { font: 10px var(--mono); color: var(--ink-3); }
.sprig-panel-head .grow { flex: 1; }
.sprig-x { background: transparent; border: none; color: var(--ink-3); font-size: 18px; cursor: pointer; line-height: 1; padding: 2px 6px; }
.sprig-x:hover { color: var(--ink); }

.sprig-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sprig-msg { display: flex; gap: 8px; max-width: 100%; }
.sprig-msg .bubble { border-radius: 10px; padding: 8px 11px; font: 13px/1.5 var(--sans); border: 1px solid var(--rule-2); }
.sprig-msg.user { justify-content: flex-end; }
.sprig-msg.user .bubble { background: var(--emerald-soft); border-color: color-mix(in oklab, var(--emerald) 30%, var(--rule-2)); color: var(--ink); }
.sprig-msg.agent .bubble { background: var(--paper-2); color: var(--ink-2); }
.sprig-msg.agent .mini { flex: 0 0 auto; }
.sprig-msg .bubble p { margin: 0 0 6px; }
.sprig-msg .bubble p:last-child { margin-bottom: 0; }
.sprig-msg .bubble strong { color: var(--ink); }

.sprig-verdict { display: inline-flex; align-items: center; gap: 6px; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; margin-bottom: 6px; }
.sprig-verdict.ok { color: var(--emerald); background: var(--emerald-soft); }
.sprig-verdict.warn { color: var(--amber); background: var(--amber-soft); }
.sprig-verdict.info { color: var(--ink-3); background: var(--paper-3); }

.sprig-scene { margin: 6px 0; border: 1px solid var(--rule-2); border-radius: 6px; overflow: hidden; max-width: 220px; }
.sprig-scene img { display: block; width: 100%; height: auto; }
.sprig-scene figcaption { font: 9px var(--mono); color: var(--ink-3); padding: 3px 6px; background: var(--paper-2); }

.sprig-cites { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sprig-cite { font: 9px var(--mono); color: var(--ink-3); background: var(--paper-3); border: 1px solid var(--rule-2); border-radius: 999px; padding: 1px 6px; text-decoration: none; }
.sprig-cite:hover { color: var(--ink); border-color: var(--ink-3); }

.sprig-caveats { margin: 6px 0 0; padding-left: 16px; font: 11px/1.45 var(--sans); color: var(--ink-3); }
.sprig-caveats li { margin: 2px 0; }
.sprig-nudge { margin-top: 7px; font: 11.5px/1.45 var(--sans); color: var(--ink-2); border-left: 2px solid var(--emerald); padding-left: 8px; }
.sprig-nudge a { color: var(--emerald); }

.sprig-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; }
.sprig-chip { font: 11px var(--mono); background: var(--paper-2); border: 1px solid var(--rule-2); border-radius: 999px; padding: 3px 9px; cursor: pointer; color: var(--ink-2); }
.sprig-chip:hover { border-color: var(--ink-2); color: var(--ink); }

.sprig-composer { border-top: 1px solid var(--rule); padding: 8px 10px; background: var(--paper-2); }
.sprig-composer-row { display: flex; gap: 6px; align-items: flex-end; }
.sprig-composer textarea { flex: 1; resize: none; min-height: 36px; max-height: 96px; font: 12px var(--sans); background: var(--paper); }
.sprig-send { background: var(--emerald); color: #fff; border: 1px solid var(--emerald); border-radius: 6px; padding: 8px 12px; font: 600 12px var(--sans); cursor: pointer; }
.sprig-send:hover { background: var(--emerald-2); }
.sprig-send[disabled] { opacity: .5; cursor: default; }
.sprig-where { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font: 10px var(--mono); color: var(--ink-3); }
.sprig-where .pin { color: var(--emerald); }
.sprig-where button { background: transparent; border: none; color: var(--ink-3); text-decoration: underline; cursor: pointer; font: 10px var(--mono); padding: 0; }

.sprig-disc { padding: 6px 12px 9px; font: 9.5px/1.4 var(--mono); color: var(--ink-3); background: var(--paper-2); border-top: 1px dashed var(--rule); }
.sprig-disc a { color: var(--ink-3); }

/* ── agent-to-agent channel panel (landing section) ────────────────────────
   Read-only "learn from the wire" surface. Same visual language as .eco. */
.a2a { max-width: 920px; margin: 0 auto; padding: 8px 28px 56px; }
.a2a-head { border-top: 1px solid var(--rule); padding-top: 26px; }
.a2a-head h2 { font: 600 24px/1.1 var(--serif); letter-spacing: -.02em; margin: 0 0 10px; color: var(--ink); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.a2a-lede { font: 15px/1.6 var(--serif); color: var(--ink-2); margin: 0 0 18px; max-width: 760px; }
.a2a-id { display: flex; flex-wrap: wrap; gap: 10px 18px; font: 11px var(--mono); color: var(--ink-3); margin: 0 0 18px; }
.a2a-id b { color: var(--ink-2); font-weight: 600; }
.a2a-id code { color: var(--ink); word-break: break-all; }
.a2a-feed { display: grid; grid-template-columns: 1fr; gap: 10px; }
.a2a-note { border: 1px solid var(--rule-2); border-radius: 6px; padding: 11px 13px; background: var(--paper-2); }
.a2a-note .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.a2a-note .who { font: 600 11px var(--mono); color: var(--ink); }
.a2a-note .who.self { color: var(--emerald); }
.a2a-note .when { font: 10px var(--mono); color: var(--ink-3); }
.a2a-note .title { font: 500 13px var(--sans); color: var(--ink); margin: 0 0 4px; }
.a2a-note .snip { font: 12px/1.5 var(--sans); color: var(--ink-2); margin: 0; }
.a2a-note .cid { font: 9px var(--mono); color: var(--ink-3); margin-top: 6px; word-break: break-all; }
.a2a-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border: 1px solid var(--rule-2); border-radius: 999px; font: 9px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.a2a-chip.live { color: var(--emerald); border-color: color-mix(in oklab, var(--emerald) 40%, var(--rule-2)); }
.a2a-chip.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); }
.a2a-foot { margin: 16px 0 0; font: 11px var(--mono); color: var(--ink-3); }
.a2a-foot a { color: var(--ink-3); border-bottom: 1px dotted var(--rule-2); text-decoration: none; }
.a2a-foot a:hover { color: var(--ink); }
@media (max-width: 720px) { .a2a { padding: 8px 14px 48px; } }
@media print { .a2a { display: none !important; } }

/* ── Canopy hero (landing) + bioluminescent glow ─────────────────────────── */
.canopy-hero { position: relative; text-align: left; padding-top: 6px; }
.canopy-hero-sprig { display: block; margin: 0 0 6px; filter: drop-shadow(0 0 20px color-mix(in oklab, var(--emerald) 60%, transparent)); }
.canopy-hero-badge { display: inline-flex; align-items: center; gap: 7px; font: 600 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--emerald-2); border: 1px solid color-mix(in oklab, var(--emerald) 30%, var(--rule-2)); border-radius: 999px; padding: 4px 12px; margin: 0 0 16px; }
.canopy-hero-badge .ch-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 10px var(--emerald); animation: chPulse 1.9s ease-in-out infinite; }
@keyframes chPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.canopy-hero-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.ch-ask { display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--sans); color: #04150c; background: linear-gradient(135deg, var(--cta), var(--cta-2)); border: none; border-radius: 12px; padding: 11px 20px; cursor: pointer; box-shadow: var(--glow); }
.ch-ask:hover { filter: brightness(1.06); transform: translateY(-1px); }
.canopy-hero-meta { font: 12px var(--mono); color: var(--ink-3); display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.canopy-hero-meta a { color: var(--ink-3); text-decoration: none; border-bottom: 1px dotted var(--rule-2); }
.canopy-hero-meta a:hover { color: var(--emerald-2); }

/* Byte-verified signed values in a chat reply (echo_verify) — a warm inline
   line, not a rigid grid. */
.sprig-verified { margin: 8px 0 0; border-top: 1px dashed var(--rule-2); padding-top: 7px; }
.sprig-verified-head { font: 11px/1.4 var(--sans); color: var(--ink-3); margin-bottom: 4px; }
.sprig-verified-row { display: inline; margin-right: 14px; font: 11px var(--mono); line-height: 2; white-space: nowrap; }
.sprig-verified-row .vv-label { color: var(--ink-3); }
.sprig-verified-row .vv-val { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--rule-2); }
.sprig-verified-row .vv-val:hover { color: var(--emerald-2); }

/* ── "remembered" memory marker on the where-line ─────────────────────────── */
.sprig-mem { display: inline-flex; align-items: center; gap: 4px; font: 9px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--emerald-2); border: 1px solid color-mix(in oklab, var(--emerald) 34%, var(--rule-2)); border-radius: 999px; padding: 0 6px; }
.sprig-mem::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--emerald); }

/* ── hunt: ranked hotspot cards ───────────────────────────────────────────── */
.sprig-hunt { margin: 8px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sprig-hotspot { border: 1px solid var(--rule-2); border-radius: 7px; padding: 6px; background: var(--paper); display: flex; flex-direction: column; gap: 5px; }
.sprig-hotspot .hh { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sprig-hotspot .hrank { font: 700 10px var(--mono); color: var(--emerald-2); }
.sprig-hotspot .hcoord { font: 10px var(--mono); color: var(--ink-2); text-decoration: none; border-bottom: 1px dotted var(--rule-2); }
.sprig-hotspot .hcoord:hover { color: var(--emerald-2); }
.sprig-hotspot .hval { margin-left: auto; font: 600 10px var(--mono); color: var(--ink-3); }
.sprig-hotspot .hscene { display: block; width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--rule-2); }
.sprig-hotspot .hcite { font: 9px var(--mono); color: var(--ink-3); text-decoration: none; word-break: break-all; }
.sprig-hotspot .hcite:hover { color: var(--emerald-2); }
@media (max-width: 420px) { .sprig-hunt { grid-template-columns: 1fr; } }

/* ── change: the per-term evidence ledger ─────────────────────────────────── */
.sprig-change-obs { margin: 8px 0 0; font: 11px var(--mono); color: var(--ink-2); display: flex; align-items: baseline; gap: 3px; flex-wrap: wrap; }
.sprig-change-obs .lbl { color: var(--ink-3); }
.sprig-change-obs .val { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--rule-2); }
.sprig-change-obs .val:hover { color: var(--emerald-2); }
.sprig-change-obs .enc { color: var(--ink-3); }
.sprig-change-terms { margin: 6px 0 0; }
.sprig-change-terms .th { font: 10px var(--sans); color: var(--ink-3); margin-bottom: 3px; }
.sprig-change-terms .tr { font: 11px/1.7 var(--mono); color: var(--ink-2); }
.sprig-change-absent { margin: 6px 0 0; }
.sprig-change-absent .tr { font: 10px/1.6 var(--mono); color: var(--ink-3); }
.sprig-ledger { margin: 7px 0 0; font: 10px var(--mono); color: var(--ink-3); }
.sprig-ledger a { color: var(--ink-2); text-decoration: none; border-bottom: 1px dotted var(--rule-2); word-break: break-all; }
.sprig-ledger a:hover { color: var(--emerald-2); }
.sprig-caveat { margin: 7px 0 0; font: 10.5px/1.5 var(--sans); color: var(--ink-3); font-style: italic; }

/* ── why-it-moved (compact change read on a place alert) ───────────────────── */
.sprig-why { margin: 7px 0 0; padding-left: 8px; border-left: 2px solid var(--amber); font: 11.5px/1.5 var(--sans); color: var(--ink-2); }
.sprig-why .wlbl { color: var(--ink-3); font-weight: 600; }
.sprig-why a { color: var(--emerald-2); }
.sprig-why small { color: var(--ink-3); font: 10px var(--mono); }

/* ── The conversation (the human front door is now a talk with Sprig) ────── */
.cv { max-width: 640px; margin: 0 auto; padding: 8px 20px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cv-sprig { margin: 6px auto 14px; filter: drop-shadow(0 0 22px color-mix(in oklab, var(--emerald) 55%, transparent)); }
.cv-thread { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* Sprig's lines — warm prose, not chrome. Newest line a touch brighter. */
.cv-say { max-width: 560px; font: 400 18px/1.55 var(--serif); color: var(--ink); text-wrap: balance; margin: 0; }
.cv-say.soft { font-size: 15px; color: var(--ink-2); }
.cv-say a { color: var(--emerald-2); }
.cv-say strong { color: var(--ink); font-weight: 600; }
.cv-you { max-width: 520px; align-self: center; font: 500 15px/1.5 var(--sans); color: var(--emerald-2); }
.cv-you::before { content: "you: "; color: var(--ink-3); font-weight: 400; }
/* Suggestions + actions Sprig offers — centered, tappable, no grid. */
.cv-suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 14px auto 0; max-width: 600px; }
.cv-chip { display: inline-flex; align-items: center; gap: 6px; font: 500 14px var(--sans); color: var(--ink); background: color-mix(in oklab, var(--paper-2) 82%, transparent); border: 1px solid var(--rule-2); border-radius: 999px; padding: 9px 16px; cursor: pointer; transition: border-color .16s, box-shadow .16s, transform .16s; }
.cv-chip:hover { border-color: color-mix(in oklab, var(--emerald) 55%, var(--rule-2)); box-shadow: var(--glow); transform: translateY(-1px); }
.cv-btn { font: 600 15px var(--sans); border-radius: 12px; padding: 11px 22px; cursor: pointer; border: 1px solid var(--rule-2); }
.cv-btn.primary { color: #04150c; background: linear-gradient(135deg, var(--cta), var(--cta-2)); border: none; box-shadow: var(--glow); }
.cv-btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.cv-btn.ghost { background: transparent; color: var(--ink-3); border: none; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; font-weight: 400; font-size: 14px; padding: 9px 12px; }
.cv-btn.ghost:hover { color: var(--emerald-2); }
/* A thing Sprig prepared for you (verdict artifacts, evidence) — offered, not a dashboard. */
.cv-prepared { width: 100%; max-width: 580px; margin: 6px auto 0; text-align: left; }
.cv-prepared .cv-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 12px 0 0; }
.cv-verdict { display: inline-flex; align-items: center; gap: 8px; font: 600 13px var(--sans); border-radius: 999px; padding: 4px 14px; margin: 2px auto 4px; }
.cv-verdict.ok { color: var(--emerald-2); background: var(--emerald-soft); }
.cv-verdict.warn { color: var(--amber); background: var(--amber-soft); }
.cv-refs { font: 12px/1.9 var(--mono); color: var(--ink-3); margin: 8px auto 0; }
.cv-refs .k { color: var(--ink-3); } .cv-refs .v { color: var(--ink-2); }
.cv-refs a { color: var(--ink-2); border-bottom: 1px dotted var(--rule-2); text-decoration: none; }
.cv-more { margin: 12px auto 0; }
.cv-more > summary { cursor: pointer; font: 13px var(--sans); color: var(--ink-3); list-style: none; text-align: center; }
.cv-more > summary::-webkit-details-marker { display: none; }
.cv-more > summary:hover { color: var(--emerald-2); }
.cv-more[open] > summary { margin-bottom: 10px; }
/* Progress: Sprig narrating, a soft breathing line — not an instrument panel. */
.cv-steps { list-style: none; margin: 12px auto 0; padding: 0; max-width: 420px; text-align: left; }
.cv-steps li { font: 14px/1.9 var(--sans); color: var(--ink-3); display: flex; align-items: center; gap: 9px; }
.cv-steps li .d { width: 7px; height: 7px; border-radius: 50%; background: var(--rule-3); flex: none; }
.cv-steps li.now { color: var(--ink); } .cv-steps li.now .d { background: var(--emerald); box-shadow: 0 0 9px var(--emerald); animation: chPulse 1.4s ease-in-out infinite; }
.cv-steps li.done { color: var(--ink-2); } .cv-steps li.done .d { background: var(--emerald); }
@media (max-width: 640px) { .cv { padding: 8px 14px 32px; } .cv-say { font-size: 16px; } }
/* The one merged input + the thread it answers into. */
.cv-chat { width: 100%; max-width: 560px; margin: 6px auto 0; display: flex; flex-direction: column; gap: 12px; }
.cv-you { align-self: flex-end; max-width: 82%; margin: 0; font: 500 15px/1.5 var(--sans); color: var(--ink); background: color-mix(in oklab, var(--emerald) 15%, var(--paper-2)); border: 1px solid color-mix(in oklab, var(--emerald) 26%, var(--rule-2)); border-radius: 14px 14px 4px 14px; padding: 8px 13px; }
.cv-you::before { content: none; }
.cv-reply { border-left: 2px solid color-mix(in oklab, var(--emerald) 40%, transparent); padding-left: 12px; text-align: left; }
.cv-composer { display: flex; gap: 8px; width: 100%; max-width: 560px; margin: 18px auto 0; }
.cv-composer input { flex: 1; font: 15px var(--sans); background: color-mix(in oklab, var(--paper) 65%, #000); border: 1px solid var(--rule-2); border-radius: 999px; padding: 13px 18px; color: var(--ink); }
.cv-composer input::placeholder { color: var(--ink-3); }
.cv-composer input:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px var(--emerald-soft); outline: none; }
/* Scope to ONLY the round send button (direct child of the input row). Was
   `.cv-composer button`, which matched every button in the composer and forced
   the new plot-panel buttons ("Add a plot", "Use this plot", etc.) into 46px
   circles with overflowing text. */
.cv-composer-row > button { flex: none; width: 46px; height: 46px; border-radius: 50%; border: none; background: linear-gradient(135deg, var(--cta), var(--cta-2)); color: #04150c; font: 700 20px/1 var(--sans); cursor: pointer; box-shadow: var(--glow); }
.cv-composer-row > button:hover { filter: brightness(1.06); }

/* Homepage composer: the "Reason it through" toggle stacked ABOVE a full-width
   input row (input keeps its whole width; the toggle never crowds it). */
#cv-composer { flex-direction: column; align-items: stretch; gap: 10px; }
#cv-composer .cv-composer-row { display: flex; gap: 8px; align-items: center; }
.cv-deep { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font: 12px var(--sans); color: var(--ink-3); cursor: pointer; user-select: none; }
.cv-deep small { color: var(--ink-3); opacity: .8; }
.cv-deep input { position: absolute; opacity: 0; pointer-events: none; }
.cv-switch { width: 34px; height: 19px; border-radius: 999px; background: var(--rule-2); position: relative; transition: .2s; flex: none; }
.cv-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--ink-3); transition: .2s; }
.cv-deep input:checked + .cv-switch { background: var(--emerald); }
.cv-deep input:checked + .cv-switch::after { left: 17px; background: #06170e; }
.cv-deep input:focus-visible + .cv-switch { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* Reason reply: AI-composed provenance badge, caveat, and the verifiable CIDs. */
.cv-model { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; font: 9.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--brass, #d3ac63); border: 1px solid color-mix(in oklab, var(--brass, #d3ac63) 34%, var(--rule-2)); border-radius: 5px; padding: 3px 8px; }
.cv-caveat { font-style: italic; color: var(--ink-3); }
.cv-cites { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin: 6px 0 0; font: 10px var(--mono); color: var(--ink-3); }
.cv-cites a { color: var(--emerald); text-decoration: none; }
.cv-cites a:hover { text-decoration: underline; }
.cv-pending { opacity: .7; font-style: italic; }

/* Interactive plot entry in the landing conversation (parity with /app). The
   reason toggle + "Add a plot" share the top row; the panel drops in above the
   input. Buttons reuse the global .cv-btn styles. */
.cv-composer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cv-composer-top .cv-deep { align-self: center; margin: 0; }
.cv-plotbtn { display: inline-flex; align-items: center; gap: 6px; flex: none; font: 12.5px var(--sans); color: var(--ink-2); background: color-mix(in oklab, var(--emerald) 10%, transparent); border: 1px solid color-mix(in oklab, var(--emerald) 32%, var(--rule-2)); border-radius: 999px; padding: 6px 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.cv-plotbtn:hover { border-color: var(--emerald); background: color-mix(in oklab, var(--emerald) 16%, transparent); }
.cv-plotbtn[aria-expanded="true"] { border-color: var(--emerald); background: var(--emerald-soft); }
.cv-plotbtn .pin { color: var(--emerald); font-size: 12px; }
.cv-plotpanel { border: 1px solid var(--rule-2); border-radius: 14px; background: color-mix(in oklab, var(--paper-2) 60%, transparent); padding: 14px; }
.cv-plotpanel[hidden] { display: none; }
.cv-plot-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.cv-plot-hint { flex: 1; min-width: 190px; font: 11.5px/1.5 var(--sans); color: var(--ink-3); }
.cv-plot-count { font: 11px var(--mono); color: var(--emerald); }
.cv-plot-upload { display: inline-flex; align-items: center; font: 12px var(--sans); color: var(--ink-2); border: 1px solid var(--rule-2); border-radius: 8px; padding: 6px 12px; cursor: pointer; transition: border-color .15s; }
.cv-plot-upload:hover { border-color: var(--emerald); }
.cv-plot-map { height: 260px; border: 1px solid var(--rule-2); border-radius: 10px; overflow: hidden; }
.cv-plot-paste { margin-top: 10px; font: 11px var(--mono); color: var(--ink-3); }
.cv-plot-paste summary { cursor: pointer; padding: 2px 0; }
.cv-plot-paste textarea { width: 100%; margin-top: 6px; min-height: 76px; font: 11px/1.5 var(--mono); background: color-mix(in oklab, var(--paper) 60%, #000); color: var(--ink); border: 1px solid var(--rule-2); border-radius: 8px; padding: 9px 11px; resize: vertical; }
.cv-plot-note { margin-top: 10px; font: 12.5px var(--sans); color: var(--ink-3); min-height: 1.1em; }
.cv-plot-actions { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.cv-plot-cta { margin-top: 12px; }
.cv-btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }

/* Sprig + dock: a soft bioluminescent glow on the dark canvas. */
.sprig-svg { filter: drop-shadow(0 0 7px color-mix(in oklab, var(--s-leaf) 60%, transparent)); }
.sprig-launch { background: color-mix(in oklab, var(--paper-2) 88%, transparent); box-shadow: var(--shadow-2), var(--glow); }
.sprig-panel { box-shadow: var(--shadow-2), 0 0 44px -20px color-mix(in oklab, var(--emerald) 60%, transparent); }
.sprig-msg.user .bubble { background: color-mix(in oklab, var(--emerald) 15%, var(--paper-2)); }
.sprig-badge { box-shadow: 0 0 10px -2px color-mix(in oklab, var(--emerald) 60%, transparent); }
