/* ============================================================
   Puna adviser-bar widget — bar chrome.

   Source of truth (contract):  _config/adviser-bar-context-contract.md
   Visual reference (verbatim): puna/app/index.html .pga-bar block
                                (lines 25322–25846, mcShimmer @1531).

   Per Clint 2026-05-20 ratification of Brief 70N (Option A, visual +
   behavioral parity), /tools' adviser bar mirrors /app's .pga-bar as
   it stands today. This file is the namespaced port of /app's block;
   class prefix `.pga-` → `.adviser-bar-`, keyframe `mcShimmer` →
   `adviser-bar-shimmer`. The two surfaces should now be pixel-
   indistinguishable in chrome, hover/focus state, panel, suggest
   chips, feedback row, input row, Send button, and empty state.

   Intentional deltas from /app's .pga-bar (both per Brief 70N § Goal):
     1. No fixed positioning anchored to `body.pga-ready` —
        component is mounted by the consuming page at its own root,
        which owns positioning. Default bottom-anchored geometry
        kept so the smoke harness + /tools / /for-capital pages
        don't need extra CSS.
     2. No surface-label header row — title slot renders the
        component's `opts.title` (default "Puna"); surface_label
        from setContext() is no longer rendered (Brief 70N § Tasks 6).
     3. No `.adviser-state-line` state footer — Puna ON/OFF state
        is now conveyed via the input row's disabled+placeholder
        treatment (per chat 1's pre-ratified Brief 70N Q2).
     4. `.adviser-bar-train-link` only renders when the consuming
        page is JWT-trust-mode (`data-trust-mode="jwt"` on the bar
        root); tools-token + public-anon hide it via CSS.

   Component-scoped palette per _config/design-tokens.md §
   Component-scoped palettes — tokens declared on .adviser-bar
   itself, never on :root. Canonical brand cyan / navy ladder /
   text ladder are referenced via var() with fallback hex so the
   file renders cleanly when consumed on a page that has NOT loaded
   design-tokens.css (e.g. the smoke harness).

   Authored 2026-05-18 by chat 2B (design system).
   Rewritten 2026-05-20 by 1-b70N-tools-adviser-bar-parity to mirror
   the /app .pga-bar block verbatim (visual + behavioral parity).
   ============================================================ */

.adviser-bar {
  /* ---- Component-scoped tokens ----
     Mirror the .pga-bar's quiet-at-rest / cyan-on-attention discipline.
     The canonical --cyan token resolves from design-tokens.css when
     the consuming page imports it; otherwise the inline hex fallback
     applies. */
  --ab-bg:                linear-gradient(180deg, rgba(8, 18, 33, 0.94), rgba(11, 26, 46, 0.94));
  --ab-border-rest:       rgba(255, 255, 255, 0.08);
  --ab-border-active:     var(--cyan, #00c8c8);
  --ab-shadow-rest:       0 4px 14px rgba(0, 0, 0, 0.45);
  --ab-shadow-active:     0 12px 32px rgba(0, 0, 0, 0.6),
                          0 0 0 2px rgba(0, 200, 200, 0.22),
                          0 0 0 1px rgba(0, 200, 200, 0.10) inset;
  --ab-radius:            8px;
  --ab-text:              var(--white, #f0f4f8);
  --ab-text-dim:          var(--white-dim, #8794ad); /* rev6 token floor — stale #6b7280 retired */
  --ab-text-muted:        var(--white-muted, #9babc4);

  /* ---- Container chrome ----
     Bar is fixed at the bottom by default. Consumers may override
     position / left / right / width per surface. The collapsed-at-
     rest discipline lives in this file; the placement details live
     at the consuming surface. */
  position: fixed;
  bottom: 6px;
  left: 0;
  right: 0;
  margin: 0 auto;
  /* 620px keeps the bar feeling like a focused command surface, not a
     full-width footer. The mobile media-query below stretches it
     edge-to-edge once both rails collapse. Matches /app .pga-bar. */
  width: 620px;
  max-width: calc(100vw - 32px);
  z-index: 9000;

  display: flex;
  flex-direction: column;
  /* DEFAULT state — unobtrusive. The bar is pervasive but quiet so it
     doesn't compete with main content. Cyan border + travelling
     shimmer + ambient glow only land on hover/focus/expanded. */
  background: var(--ab-bg);
  border: 1px solid var(--ab-border-rest);
  border-radius: var(--ab-radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--ab-shadow-rest);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ab-text);
  overflow: hidden;
  /* Hard cap so a tall input + history panel cannot exceed viewport. */
  max-height: calc(100vh - 36px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Travelling cyan glint band — same animation tokens as the FIND
   bar so they shimmer in lockstep. Kept inside the bar via
   background-position animation, not overflow:hidden alone. Hidden
   at rest (opacity 0); fades in on hover / focus-within / is-expanded
   so the bar earns attention rather than demanding it. Animation
   keeps running so the reveal is mid-sweep, not a starting flash. */
.adviser-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent 0%, transparent 35%, rgba(0, 229, 229, 0.16) 50%, transparent 65%, transparent 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  animation: adviser-bar-shimmer 6s linear infinite;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 0;
}
.adviser-bar:hover::before,
.adviser-bar:focus-within::before,
.adviser-bar.is-expanded::before { opacity: 1; }

/* Earned-attention state — cyan border + ambient glow + inset cyan
   edge mirror the FIND search bar so both bars read as one family
   when active. */
.adviser-bar:hover,
.adviser-bar:focus-within,
.adviser-bar.is-expanded {
  border-color: var(--ab-border-active);
  box-shadow: var(--ab-shadow-active);
}

/* Lift the children above the shimmer pseudo-element so they read
   cleanly against the moving glint. */
.adviser-bar > * { position: relative; z-index: 1; }

/* ============================================================
   BL-069 slice B — the FRAME travels with the mount (canon §1).
   The SOLID BAND runs across the page bottom ("a solid bar behind the
   text box and the record button" — Clint, walk 2026-06-07); the bar
   (and, slice C, the mic) sit IN the band; page content is bottom-
   bounded ABOVE it via body.has-adviser-band padding — nothing scrolls
   behind the bar. Geometry mirrors the app's body.pga-ready::after band
   (rgba(8,18,33,.95), --border-light top, 86px); the bar rests ~6-8px
   inside it and the typewriter growth crosses just over it (canon §1).
   ============================================================ */
/* M184-3 frame geometry (walk red M413-6, Clint: "The sidebar on the right
   and left should go down all the way on the page, not the bottom bar over
   the top of it. The solid part... can also be lower/tighter down."):
   the band spans the MAIN COLUMN ONLY — between the rails, never over them
   (rails run full height past it). The consuming page declares its rail
   clearances as --adviser-rail-left/right (0 default = no rails, e.g. the
   smoke harness). Band hugs the bar: 68px, top edge ~8px above the
   small-state bar; typewriter growth crosses just over it (canon §1). */
.adviser-band {
  position: fixed;
  left: var(--adviser-rail-left, 0);
  right: var(--adviser-rail-right, 0);
  bottom: 0;
  height: 68px;
  background: rgba(8, 18, 33, 0.95);
  border-top: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
  z-index: 8990;
}
body.has-adviser-band { padding-bottom: 90px; }

/* Component-local keyframes so the file works even when the consuming
   page does not declare mcShimmer (smoke harness, /for-capital). */
@keyframes adviser-bar-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Mobile — both side rails collapse, band spans full viewport width. */
@media (max-width: 720px) {
  .adviser-bar {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    bottom: 8px;
    margin: 0;
  }
}

/* ============================================================
   Expanded panel — hidden at rest; revealed on hover / focus /
   is-expanded. Contains the history of chat per Clint's direct
   direction 2026-05-18 ("inside the open section is the history
   of chat").
   ============================================================ */

.adviser-bar-panel {
  display: none;
  flex-direction: column;
  max-height: 440px;
  min-height: 120px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
/* BL-069 walk-RED fix (M299-6): the PANEL must NOT reveal on :focus-within.
   Slice A's persistent caret keeps #pga-input focused at all times (canon §5),
   so a focus-within reveal = the bar can never rest shut — exactly the
   stays-open Clint walked into. Canon §6: the panel opens on hover or send
   (+ ⌘K via is-expanded) ONLY. focus-within stays on the border/glow rules
   above (canon §3 earned-attention) — the glow is not the panel. */
.adviser-bar:hover .adviser-bar-panel,
.adviser-bar.is-expanded .adviser-bar-panel {
  display: flex;
}

/* Panel header — icon + title + collapse arrow + spacer + Train Puna.
   The Train Puna link is JWT-trust-mode-only; CSS hides it on
   tools-token + public-anon surfaces (see § Trust-mode visibility). */
.adviser-bar-head {
  flex: 0 0 auto;
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.adviser-bar-symbol { width: 16px; height: 16px; flex: 0 0 auto; display: inline-block; }
.adviser-bar-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ab-text);
  letter-spacing: -0.005em;
  /* No truncation — title is a fixed brand string ("Puna" / "Puna Agent"),
     never user-supplied / surface-label text. */
}
.adviser-bar-collapse {
  background: transparent;
  border: 0;
  color: var(--ab-text-dim);
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.adviser-bar-collapse:hover {
  color: var(--ab-text);
  background: rgba(255, 255, 255, 0.04);
}
.adviser-bar-spacer { flex: 1 1 auto; }

.adviser-bar-train-link {
  flex: 0 0 auto;
  background: rgba(0, 200, 200, 0.10);
  border: 1px solid rgba(0, 200, 200, 0.45);
  color: var(--cyan, #00c8c8);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.32rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.12s;
}
.adviser-bar-train-link:hover {
  background: rgba(0, 200, 200, 0.22);
  color: var(--cyan-bright, #00f0f0);
  border-color: var(--cyan, #00c8c8);
  transform: translateY(-1px);
}

/* Trust-mode visibility — Train Puna only on JWT surfaces.
   Component sets data-trust-mode on the bar root from opts.surfaceTrust. */
.adviser-bar:not([data-trust-mode="jwt"]) .adviser-bar-train-link { display: none; }
/* BL-129 — with a teach provider mounted (.has-teach) the affordance is
   meaningful on tools-token too: the capture writes the same per-user
   profile row. public-anon stays hidden — no identity to teach into.
   (Canon §8 JWT-only delta, flagged in the slice-C design review.) */
.adviser-bar.has-teach:not([data-trust-mode="public-anon"]) .adviser-bar-train-link { display: inline-block; }

/* ============================================================
   Suggestion chip — appears in the panel above messages when
   there is no conversation yet. Click sends.
   ============================================================ */

.adviser-bar-suggest {
  flex: 0 0 auto;
  padding: 0.55rem 0.95rem 0;
}
.adviser-suggest {
  display: inline-block;
  background: transparent;
  border: 1px solid rgba(0, 200, 200, 0.28);
  color: rgba(0, 200, 200, 0.9);
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.74rem;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.adviser-suggest:hover {
  background: rgba(0, 200, 200, 0.1);
  border-color: var(--cyan, #00c8c8);
  color: var(--white, #f0f4f8);
}
.adviser-suggest:empty { display: none; }

/* ============================================================
   Message list — scrolls within the panel.
   ============================================================ */

.adviser-bar-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.7rem 0.95rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
}
.adviser-msg { display: flex; flex-direction: column; gap: 0.2rem; }
.adviser-msg-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ab-text-dim);
}
.adviser-msg-eyebrow.is-user { color: rgba(0, 200, 200, 0.85); }
.adviser-msg-body {
  /* Shrunk to 0.74rem/1.45 to match /app's .pga-msg-body (Clint
     2026-05-10: "the puna agent text is too big — should be 2-3
     lines of condensed information only"). */
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--ab-text);
  word-wrap: break-word;
}
.adviser-msg-body p { margin: 0 0 0.55rem; }
.adviser-msg-body p:last-child { margin-bottom: 0; }
.adviser-msg-body strong { color: var(--ab-text); font-weight: 600; }
.adviser-msg-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 5px;
  border-radius: 3px;
}
/* Inline citation anchors — same .fa-cite class used by /for-capital's
   .fa-bar and /app's .pga-bar so a future style refresh touches one
   selector. Cyan baseline; dotted underline reads as "footnote" rather
   than "navigation link"; :visited held to the same hue so the second
   tap doesn't get a different signal. */
.adviser-msg-body .fa-cite,
.adviser-msg-body .fa-cite:link,
.adviser-msg-body .fa-cite:visited {
  color: var(--cyan, #00c8c8);
  text-decoration: underline dotted rgba(0, 200, 200, 0.55);
  text-underline-offset: 0.15em;
  cursor: pointer;
  transition: color 0.12s, text-decoration-color 0.12s;
}
.adviser-msg-body .fa-cite:hover,
.adviser-msg-body .fa-cite:focus {
  color: var(--cyan-bright, #00f0f0);
  text-decoration-color: rgba(0, 240, 240, 0.85);
}
.adviser-msg.is-user .adviser-msg-body {
  color: rgba(255, 255, 255, 0.94);
  background: rgba(0, 200, 200, 0.07);
  border-radius: 8px 8px 8px 2px;
  padding: 0.45rem 0.65rem;
  align-self: flex-end;
  max-width: 92%;
}
.adviser-msg.is-adviser .adviser-msg-body,
.adviser-msg.is-assistant .adviser-msg-body {
  background: transparent;
  padding: 0.05rem 0;
  max-width: 100%;
}
.adviser-msg.is-error .adviser-msg-body {
  color: rgba(255, 180, 180, 0.92);
  background: rgba(255, 100, 100, 0.06);
  border: 1px solid rgba(255, 100, 100, 0.18);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.74rem;
  line-height: 1.45;
}

/* Feedback row per assistant / adviser message (👍 / 👎 / Correct…). */
.adviser-msg-feedback {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.1rem;
  align-items: center;
}
.adviser-fb-btn {
  background: transparent;
  border: 0;
  color: var(--ab-text-dim);
  padding: 0.1rem 0.35rem;
  font-size: 0.78rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  opacity: 0.55;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
}
.adviser-fb-btn:hover {
  opacity: 1;
  color: var(--ab-text);
  background: rgba(255, 255, 255, 0.04);
}
.adviser-fb-btn.is-on { color: var(--cyan, #00c8c8); opacity: 1; }
.adviser-msg-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: var(--ab-text-dim);
  letter-spacing: 0.04em;
  margin-left: auto;
  opacity: 0.5;
}

/* Trust-mode visibility — public-anon surfaces have no feedback row
   (anonymous traffic can't be tied to a feedback row). tools-token
   and jwt both show it (per chat 1 pre-ratified Brief 70N Q1; the
   tools-token row carries a "Sign in to /app for feedback" hover
   hint until per-feedback endpoints accept tools-token auth in a
   follow-up brief). */
.adviser-bar[data-trust-mode="public-anon"] .adviser-msg-feedback { display: none; }

/* Empty state inside the panel — "Ask anything." centred text. */
.adviser-bar-empty {
  text-align: center;
  color: var(--ab-text-dim);
  font-size: 0.78rem;
  padding: 1.2rem 0.5rem;
  opacity: 0.7;
}

/* ============================================================
   Citation chips — rendered on adviser turns when the trunk
   returns a citations array per contract § 7. Component is dumb
   about routing; chips dispatch puna:citation-click CustomEvent
   on click; consumer subscribes.
   ============================================================ */

.citation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}
.citation-chip {
  background: rgba(0, 200, 200, 0.08);
  border: 1px solid rgba(0, 200, 200, 0.35);
  color: var(--cyan, #00c8c8);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.citation-chip:hover,
.citation-chip:focus-visible {
  background: rgba(0, 200, 200, 0.16);
  color: var(--cyan-bright, #00e5e5);
  border-color: var(--cyan-bright, #00e5e5);
}

/* ============================================================
   Input row — always visible at the bottom of the bar.
   Textarea grows as content is typed (cap at 78px ≈ 3 lines so
   the bar stays a focused command box, not a scrolling editor).
   ============================================================ */

.adviser-bar-input-row {
  flex: 0 0 auto;
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.5rem 0.7rem 0.5rem 0.85rem;
}
.adviser-input {
  flex: 1 1 auto;
  background: transparent;
  border: 0;
  color: var(--ab-text);
  padding: 0.4rem 0.2rem;
  font-family: inherit;
  font-size: 0.88rem;
  resize: none;
  min-height: 28px;
  max-height: 78px;
  line-height: 1.4;
  outline: 0;
  overflow-y: auto;
}
.adviser-input::placeholder { color: var(--ab-text-dim); }
.adviser-input:disabled {
  /* Disabled state is reserved for in-flight requests (and any future
     non-toggle-related disable). SPEC-Q-119-4 removed the Brief 70N Q2
     "disabled when Puna OFF" pattern — the read-permission toggle no
     longer gates chat availability. */
  cursor: not-allowed;
  opacity: 0.6;
}

.adviser-send {
  flex: 0 0 auto;
  padding: 0.42rem 0.85rem;
  background: rgba(0, 200, 200, 0.16);
  border: 1px solid rgba(0, 200, 200, 0.5);
  color: var(--cyan, #00c8c8);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, opacity 0.12s;
}
.adviser-send:hover:not(:disabled) {
  background: rgba(0, 200, 200, 0.3);
  color: var(--cyan-bright, #00f0f0);
}
.adviser-send:disabled,
.adviser-send.is-inflight {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   Reactive observation container — Brief 83 Q7 orange tint.

   Reactive output is private-surface-derived from the user's
   nav events (per principles doc § Persona: reactive → "Private
   by default" + § Visible mode signal: ORANGE for private). The
   tint is component-local in V1; 2B's design tokens (orange-
   private-bg / orange-private-border / orange-private-text) will
   subsume these values once the cross-surface color discipline
   lands. Surface as `[CROSS-CUT for 2B]` in the brief [DONE] so
   2B can lift to shared tokens.

   Cyan (chat-persona typed Q&A) and orange (reactive observation)
   intentionally read differently — the user can tell at a glance
   "I asked this" vs "the system volunteered this."
   ============================================================ */

.adviser-msg.is-reactive {
  /* Component-local orange palette; values reference /for-capital's
     existing orange usage (orange-private-bg ~ rgba(255, 150, 60, 0.10)
     and a stronger orange-private-border for the left edge). When 2B
     ships shared tokens, swap to var(--orange-private-bg, …). */
  background: rgba(255, 150, 60, 0.08);
  border-left: 3px solid rgba(255, 150, 60, 0.55);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  margin: 0.05rem 0 0.05rem 0;
}
.adviser-msg.is-reactive .adviser-msg-body {
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--ab-text);
  background: transparent;
  padding: 0;
  max-width: 100%;
}
.adviser-msg-eyebrow.is-reactive {
  color: rgba(255, 170, 90, 0.90);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

/* ============================================================
   First-reactive notice — one-time per session.

   Surfaces the first time a reactive observation lands; carries
   the [Turn off] affordance. Per Brief 83 47E lightweight. Sits
   above the observation that triggered it. Dismissed on click
   OR on opt-out (caller-wired via the puna:reactive-disable
   CustomEvent the button dispatches).
   ============================================================ */

.adviser-reactive-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.45rem;
  background: rgba(255, 150, 60, 0.05);
  border: 1px solid rgba(255, 150, 60, 0.32);
  border-radius: 4px;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--ab-text-muted);
}
.adviser-reactive-notice-text {
  flex: 1 1 auto;
}
.adviser-reactive-notice-disable {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid rgba(255, 150, 60, 0.45);
  color: rgba(255, 170, 90, 0.92);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.adviser-reactive-notice-disable:hover:not(:disabled) {
  background: rgba(255, 150, 60, 0.15);
  color: rgba(255, 200, 130, 1);
}
.adviser-reactive-notice-disable:disabled {
  opacity: 0.5;
  cursor: default;
}
.adviser-reactive-notice.is-disabling {
  opacity: 0.6;
}

/* Anon surfaces never see reactive — defensive CSS hide on public-anon. */
.adviser-bar[data-trust-mode="public-anon"] .adviser-msg.is-reactive,
.adviser-bar[data-trust-mode="public-anon"] .adviser-reactive-notice {
  display: none;
}

/* ============================================================
   Reduced-motion accessibility floor — drop transitions +
   shimmer animation when the user has indicated prefers-reduced-
   motion. Mirrors the discipline shipped in privacy-mode.css.
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .adviser-bar,
  .adviser-bar-panel,
  .adviser-bar-collapse,
  .adviser-bar-train-link,
  .adviser-suggest,
  .citation-chip,
  .adviser-input,
  .adviser-send,
  .adviser-fb-btn,
  .adviser-reactive-notice-disable {
    transition: none;
  }
  .adviser-bar::before { animation: none; }
}

/* ============================================================
   BL-069 slice C — THE DOCK (canon §2) + the mic + the recording
   chip + nav-as-act toast. Mechanics lifted from the canonical
   mockup (BL-069-canonical-mockup.html) verbatim, namespaced.

   The dock: [ 🎙 48px mic ] ·10px· [ bar 620px ], bottom-aligned,
   centered. The mic is NEXT TO the box but of the same chrome
   family — part of it without being inside it (Clint 2026-06-07).
   flex-end keeps the mic seated as the bar grows. The mic sits
   OUTSIDE the bar so the rec quiet zone is STRUCTURAL — and the
   open-guard is GEOMETRIC on top (bounding-box +12px halo,
   computed in JS, never an event-target — Stylist M180 / BL-095).
   ============================================================ */
.adviser-dock {
  position: fixed;
  bottom: 10px;
  /* M184-3 — the dock centers between the rails (same page-declared
     clearances as the band), so the mic+bar pair sits IN the main-column
     band, never over a rail. */
  left: var(--adviser-rail-left, 0);
  right: var(--adviser-rail-right, 0);
  z-index: 9000;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;            /* children re-enable */
  padding: 0 16px;
}
/* Docked bar — the dock owns positioning; the bar's standalone
   fixed-bottom default (above) stays for non-dock consumers
   (smoke harness, legacy mounts). */
.adviser-dock .adviser-bar {
  pointer-events: auto;
  position: static;
  margin: 0;
  left: auto;
  right: auto;
  bottom: auto;
}

/* --- the mic (BL-062 seat) — affordance reads BEFORE first tap --- */
.adviser-rec {
  pointer-events: auto;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(8, 18, 33, 0.94), rgba(11, 26, 46, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
}
.adviser-rec svg {
  width: 19px;
  height: 19px;
  stroke: var(--white-muted, #9babc4);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.15s;
}
.adviser-rec:hover {
  border-color: var(--cyan, #00c8c8);
  transform: scale(1.06);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(0, 200, 200, 0.18);
}
.adviser-rec:hover svg { stroke: var(--cyan, #00c8c8); }
.adviser-rec.is-rec {
  border-color: var(--accent-live, var(--cyan-bright, #00e5e5));
  background: rgba(0, 229, 229, 0.10);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(0, 229, 229, 0.20);
}
.adviser-rec.is-rec svg {
  stroke: var(--accent-live, var(--cyan-bright, #00e5e5));
  animation: adviser-rec-pulse 1.2s ease-in-out infinite;
}
@keyframes adviser-rec-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(0.55); opacity: 0.55; }
}

/* --- recording chip — true bottom-right; follows the user around
   the page (Clint: "the little icon is in the bottom right… it
   keeps showing them they are being recorded as they tap around") --- */
.adviser-rec-chip {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9002;
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-end;
}
.adviser-rec-chip.is-on { display: flex; }
.adviser-rec-chip-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(6, 15, 29, 0.96);
  border: 1px solid rgba(0, 229, 229, 0.55);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--accent-live, var(--cyan-bright, #00e5e5));
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.adviser-rec-chip-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-live, var(--cyan-bright, #00e5e5));
  animation: adviser-rec-pulse 1.2s ease-in-out infinite;
}
/* the capture trail — each page-move stamps a quiet line (BL-095
   carries per-tap granularity; v1 stamps page moves) */
.adviser-rec-stamp {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  color: var(--white-dim, #8794ad);
  background: rgba(6, 15, 29, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 0.22rem 0.5rem;
  opacity: 0;
  transform: translateY(4px);
  animation: adviser-stamp-in 0.25s ease forwards;
}
@keyframes adviser-stamp-in {
  to { opacity: 1; transform: translateY(0); }
}

/* --- nav-as-act toast (BL-061, canon §11) — fires ONLY when the
   panel is shut; open panel = history narration only (rev6
   subtraction: no double signal) --- */
.adviser-action-notice {
  position: fixed;
  left: 16px;
  bottom: 98px;   /* just above the 86px band */
  z-index: 9001;
  background: rgba(6, 15, 29, 0.96);
  border: 1px solid rgba(0, 200, 200, 0.45);
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  color: var(--cyan, #00c8c8);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.adviser-action-notice.is-show { opacity: 1; transform: translateY(0); }

/* visually-hidden live region — recording state announced
   aria-live, not colour-only (canon §10) */
.adviser-rec-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile — dock spans edge to edge; the mic keeps its seat (canon §9). */
@media (max-width: 720px) {
  .adviser-dock { padding: 0 10px; gap: 8px; }
  .adviser-dock .adviser-bar {
    width: auto;
    flex: 1 1 auto;
    max-width: none;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 0;
  }
  .adviser-action-notice { left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .adviser-rec,
  .adviser-action-notice { transition: none; }
  .adviser-rec.is-rec svg,
  .adviser-rec-chip-pill .dot { animation: none; }
  .adviser-rec-stamp { animation: none; opacity: 1; transform: none; }
}

/* ============================================================
   BL-129 Train Puna v1 — TEACH MODE (folded into slice C).
   The capture lives in the bar's own grammar: the input is the
   one field, the placeholder is the invitation, Send reads Save.
   The eyebrow line keeps the mode unambiguous. Quiet, no new
   chrome — canon §8 intact.
   ============================================================ */
.adviser-teach-line {
  flex: 0 0 auto;
  padding: 0.35rem 0.95rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan, #00c8c8);
  opacity: 0.85;
}
.adviser-bar.is-teach .adviser-input { caret-color: var(--cyan-bright, #00e5e5); }

/* ============================================================
   Citations-on-reach (M337-3 canon addition — ships WITH slice C).
   The pp-prov-tooltip aesthetic: one provenance grammar across
   the project pages and the bar. JS-positioned below the anchor;
   pointer-events NONE — the chip previews, never intercepts
   (puna:citation-click flow is load-bearing and unchanged).
   ============================================================ */
.adviser-cite-chip {
  position: fixed;
  z-index: 9999;
  width: max-content;
  max-width: min(360px, 92vw);
  background: var(--navy-deep, #060f1d);
  border: 1px solid rgba(0, 200, 200, 0.32);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.adviser-cite-chip.is-show { opacity: 1; transform: translateY(0); }
.adviser-cite-chip-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan, #00c8c8);
  margin-bottom: 0.25rem;
}
.adviser-cite-chip-eyebrow:last-child { margin-bottom: 0; }
.adviser-cite-chip-body {
  font-size: 0.7rem;
  line-height: 1.45;
  color: var(--white-muted, #9babc4);
}

@media (prefers-reduced-motion: reduce) {
  .adviser-cite-chip { transition: none; }
}
