:root {
  --asu-black: #000000;
  --asu-gold: #c99700;
  --asu-gold-dark: #8f6d00;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #5d5d5d;
  --line: #d9d6cf;
  --surface: #f7f5ef;
  --surface-strong: #eee9dc;
  --surface-soft: #fbfaf6;
  --success: #245c38;
  --warning: #7a5400;
  --danger: #8c1d18;
  /* Bright accent palette: layer over ASU black + gold for AI activity,
     status pills, and priority cues. Used sparingly so the brand still
     reads black + gold. */
  --accent-cyan: #00c2d1;
  --accent-violet: #6f42c1;
  --accent-success: #10b981;
  --accent-warning: #f4b400;
  --accent-danger: #ef4444;
  --accent-info: #0066cc;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Adobe Garamond", "Adobe Garamond Pro", Garamond, "Times New Roman", serif;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.06);
  --shadow-md: 0 16px 40px rgba(17, 17, 17, 0.1);
  /* PR-UI-FIXES — single shared card elevation so left/right column
     cards (and every card family below) read as the same surface. */
  --card-shadow: var(--shadow-sm);
}

/* Dark mode — token remap only. Every surface/text/border that uses the
   semantic tokens above flips automatically. Gold lightens so it reads on
   dark; the gold-dark token (used for text on light) becomes a lighter
   gold so AA contrast holds in dark too. Component-level hardcoded rgba()
   literals are not swept here — most sit on already-dark surfaces (drawer,
   stream panel) and remain legible; a full literal sweep is follow-up.

   PR-UI-FIXES — three-state theme. `html[data-theme]` (set by the inline
   head script from localStorage `askstinger_theme`) wins; with no
   attribute (system mode) the media query applies. The
   `:not([data-theme="light"])` guard lets an explicit light choice
   override a dark OS preference. The two token blocks below MUST stay
   in sync — same tokens, two activation paths. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --paper: #14130f;
    --ink: #f3f0e7;
    --muted: #b7b1a3;
    --line: #3a362c;
    --surface: #1c1a14;
    --surface-strong: #26231a;
    --surface-soft: #201d16;
    --success: #6ec08a;
    --warning: #e0b04a;
    --danger: #f08a84;
    --asu-gold: #e6bf52;
    --asu-gold-dark: #f0d27a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.6);
  }

  html:not([data-theme="light"]) body {
    background: linear-gradient(180deg, #1c1a14 0%, var(--paper) 360px);
  }
}

/* Explicit dark choice — same remap regardless of OS preference.
   Keep in sync with the media-query block above. */
html[data-theme="dark"] {
  --paper: #14130f;
  --ink: #f3f0e7;
  --muted: #b7b1a3;
  --line: #3a362c;
  --surface: #1c1a14;
  --surface-strong: #26231a;
  --surface-soft: #201d16;
  --success: #6ec08a;
  --warning: #e0b04a;
  --danger: #f08a84;
  --asu-gold: #e6bf52;
  --asu-gold-dark: #f0d27a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] body {
  background: linear-gradient(180deg, #1c1a14 0%, var(--paper) 360px);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #fbfaf6 0%, var(--surface) 360px);
  color: var(--ink);
  font-family: var(--font-sans);
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.personal-workspace {
  margin: 0 auto;
  max-width: 1180px;
  min-height: 100vh;
  padding: 24px 28px 44px;
}

/* PR-WORKSPACE-WIDE — when the 3-col layout is active the side cols
   already give the visual containment the 1180px cap was providing,
   so the workspace can fill the viewport. Stack mode (the
   ?layout=stack opt-out) keeps the 1180px cap because a single
   column wider than that becomes hard to read. Uses CSS :has() for
   the parent-aware match — supported by all evergreen browsers. */
.personal-workspace:has(.personal-workspace-3col) {
  max-width: none;
}

.workspace-topbar {
  align-items: center;
  display: grid;
  gap: 18px;
  /* PR-UI-APP-POLISH — extra leading `auto` column for the AskStinger
     brand/home link; avatar + identity + actions keep their slots. */
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  margin-bottom: 24px;
}

/* PR-UI-APP-POLISH — brand wordmark as the home link. Reuses
   .product-mark typography; this rule adds the interactive cues
   (pointer + gold hover) the static wordmark didn't need. */
.topbar-brand-home {
  cursor: pointer;
}

.topbar-brand-home:hover,
.topbar-brand-home:focus-visible {
  color: var(--asu-gold);
}

.product-mark {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  gap: 12px;
  line-height: 1;
  text-decoration: none;
}

/* PR-G — topbar shows the signed-in user's initials, not the
 * mascot. Mascot stays in the workspace card eyebrow + the empty-
 * state panel; the topbar identifies *who is using* AskStinger. The
 * AskStinger wordmark was removed entirely from the topbar — the
 * avatar's `<a class="product-mark">` parent still routes home.
 * Initials are populated at render() time from persona.displayName
 * via the `userInitials()` helper. ASU-gold ring keeps the brand
 * cue consistent with the workspace card avatar. */
.topbar-user-avatar {
  align-items: center;
  background: var(--asu-black);
  border: 2px solid var(--asu-gold);
  border-radius: 50%;
  color: var(--asu-gold);
  display: inline-flex;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  height: 40px;
  justify-content: center;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  width: 40px;
}

.identity-summary {
  border-left: 1px solid var(--line);
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-left: 18px;
}

.identity-summary strong {
  font-size: 15px;
}

.identity-summary span {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  overflow-wrap: break-word;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-workspace-grid {
  display: grid;
  gap: 16px;
  max-width: 100%;
}

.workspace-hero {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

/* PR1 layout reflow — single-column stack so the workspace card is
   full width and the priority brief stacks underneath rather than
   sharing a row. Each child is a standalone card identified by
   data-card-id (target for PR3 card removal + PR2 tab spawning). */
.personal-workspace-stack {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

/* PR-LAYOUT-3COL/1 — 3-col Home tab grid; default since /2.
   Workspace centered (primary action), priority brief right (needs-
   attention), metrics + timeline left (reference data). Side cols
   collapse via `:empty` when dismissed; at <=1024px grid falls back
   to single-column stack.

   PR-LAYOUT-3COL/3 — cap side cols so all extra horizontal space
   flows to the center workspace column instead of being split 1:2:1.

   PR-LAYOUT-3COL/4 — fix the side cols at 260px / 300px instead of
   ranging up to a max. On viewports below the 1024px breakpoint the
   media query collapses everything to a single column anyway, so the
   no-min concern doesn't apply. Keeping the sides fixed lets every
   pixel beyond `260 + 300 + 2*gap` (≈ 592px) flow to the center,
   which is what users want on wide displays — workspace gets ~880px
   on a 1440px viewport (vs ~840px today) and ~1340px on 1920px. */
.personal-workspace-3col {
  display: grid;
  gap: 16px;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  align-items: start;
}

.personal-workspace-3col .ws-col-side,
.personal-workspace-3col .ws-col-center {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.personal-workspace-3col .ws-col-side:empty {
  display: none;
}

.personal-workspace-3col .empty-stack {
  grid-column: 1 / -1;
}

/* PR-LAYOUT-3COL/5 — collapsible side cols. Each side col has a
   chevron toggle button anchored at the top; clicking it flips the
   per-side flag, which lands as `data-collapse-left|right="1"` on
   the parent grid. The CSS narrows the col to a 32px sticky strip
   (just enough to show the expand-chevron) and lets the center col
   absorb the freed real estate. */
.ws-col-toggle {
  align-items: center;
  align-self: flex-end;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  height: 24px;
  justify-content: center;
  margin-bottom: 4px;
  padding: 0;
  width: 24px;
}

.ws-col-toggle-left {
  align-self: flex-end;
}

.ws-col-toggle-right {
  align-self: flex-start;
}

.ws-col-toggle:hover,
.ws-col-toggle:focus-visible {
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
  outline: 2px solid var(--asu-gold);
  outline-offset: 2px;
}

.personal-workspace-3col[data-collapse-left="1"] {
  grid-template-columns: 32px minmax(0, 1fr) 300px;
}

.personal-workspace-3col[data-collapse-right="1"] {
  grid-template-columns: 260px minmax(0, 1fr) 32px;
}

.personal-workspace-3col[data-collapse-left="1"][data-collapse-right="1"] {
  grid-template-columns: 32px minmax(0, 1fr) 32px;
}

.personal-workspace-3col[data-collapse-left="1"] .ws-col-left > :not(.ws-col-toggle),
.personal-workspace-3col[data-collapse-right="1"] .ws-col-right > :not(.ws-col-toggle) {
  display: none;
}

/* PR-METRICS-NARROW — at the narrow side-col width (220-280px) the
   horizontal 3-tile metrics strip wraps badly: longer labels (e.g.
   "Early alerts" wrapping to two lines) push their value-rows down
   while shorter labels (e.g. "Rubrics") leave the value-rows on the
   first line, so the three values appear at different vertical
   positions.

   Switching the strip to a single-column vertical stack inside 3-col
   side cols fixes the misalignment AND reads better in narrow space
   anyway. Borders rotate from left-of-tile to top-of-tile so the
   visual divider still tracks. The center column (workspace) is
   unaffected; this only scopes inside `.ws-col-side`. */
.personal-workspace-3col .ws-col-side .context-strip {
  grid-template-columns: minmax(0, 1fr);
}

.personal-workspace-3col .ws-col-side .context-metric + .context-metric {
  border-left: none;
  border-top: 1px solid var(--line);
}

@media (max-width: 1024px) {
  .personal-workspace-3col {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sidebar {
  background: var(--asu-black);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
  padding: 22px;
  position: sticky;
  top: 0;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: center;
}

.brand-lockup.no-logo {
  grid-template-columns: 1fr;
}

.brand-mark-slot {
  align-items: center;
  border: 1px solid rgba(201, 151, 0, 0.65);
  border-radius: 6px;
  display: flex;
  justify-content: center;
  min-height: 72px;
  padding: 8px;
}

.brand-mark-slot img {
  display: block;
  height: auto;
  max-width: 100%;
}

.brand-mark-slot span {
  color: var(--asu-gold-dark);
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}

.brand-kicker,
.eyebrow {
  color: var(--asu-gold-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  letter-spacing: 0;
  margin: 0;
}

h1 {
  color: var(--paper);
  font-size: 30px;
  line-height: 1;
}

.nav-list {
  display: grid;
  gap: 18px;
}

.nav-section {
  display: grid;
  gap: 6px;
}

.nav-section-title {
  color: rgba(255, 255, 255, 0.48);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 2px;
  text-transform: uppercase;
}

.nav-section-items {
  display: grid;
  gap: 4px;
}

.nav-button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--paper);
  min-height: 40px;
  padding: 0 12px;
  text-align: left;
  width: 100%;
}

.nav-button:hover,
.nav-button.is-active {
  background: rgba(201, 151, 0, 0.12);
  border-color: rgba(201, 151, 0, 0.58);
  color: var(--asu-gold-dark);
}

.brand-note {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin-top: auto;
  padding-top: 18px;
}

.brand-note h2 {
  color: var(--paper);
  font-size: 20px;
}

.brand-note p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.main {
  min-width: 0;
  padding: 24px 28px 40px;
}

.topbar {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 88px;
  padding: 18px 20px;
  max-width: 100%;
}

.topbar h2 {
  font-size: 32px;
  line-height: 1.05;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.ghost-button,
.gold-button,
.icon-button {
  border-radius: 6px;
  min-height: 40px;
  padding: 0 14px;
}

.ghost-button {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}

.gold-button {
  background: var(--asu-gold);
  border: 1px solid var(--asu-gold);
  color: var(--asu-black);
  font-weight: 700;
}

.gold-button:hover {
  background: #d7a400;
}

.icon-button {
  aspect-ratio: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0;
  width: 40px;
}

.content-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-top: 18px;
  min-width: 0;
}

.prompt-stage {
  background:
    linear-gradient(135deg, rgba(201, 151, 0, 0.1), rgba(255, 255, 255, 0) 42%),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  display: grid;
  gap: 24px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  min-height: 236px;
  padding: 26px;
  max-width: 100%;
  min-width: 0;
}

.personal-prompt {
  grid-column: auto;
  grid-template-columns: 1fr;
  min-height: 420px;
}

.prompt-stage-copy {
  align-content: center;
  display: grid;
  max-width: 100%;
  min-width: 0;
}

.prompt-stage h3 {
  color: var(--ink);
  font-size: 42px;
  line-height: 1.02;
  margin-bottom: 14px;
  max-width: 100%;
  overflow-wrap: break-word;
}

.prompt-stage p:not(.eyebrow) {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
  overflow-wrap: break-word;
}

.prompt-box {
  align-self: stretch;
  background: var(--surface-soft);
  border: 1px solid rgba(201, 151, 0, 0.48);
  border-radius: var(--radius);
  color: var(--ink);
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
}

.personal-prompt .prompt-box {
  align-self: end;
}

.prompt-box textarea {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  /* PR-UI-FIXES — taller default + explicit 16px so the primary input
     reads as the main affordance (16px also suppresses iOS zoom-on-
     focus). field-sizing lets the box grow with the draft where
     supported; max-height keeps a runaway paste from eating the page. */
  field-sizing: content;
  font-size: 16px;
  max-height: 40vh;
  min-height: 140px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

.prompt-box textarea:focus {
  border-color: var(--accent-cyan);
  outline: 2px solid rgba(0, 194, 209, 0.32);
}

/* PR-N3 — character counter under the prompt textarea. Tone shifts
 * at 90% (warn) and 100% (over) so the user notices before the cap.
 * Right-aligned + dim by default so it doesn't compete with the
 * prompt copy. */
.prompt-counter {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-align: right;
}

.prompt-counter[data-tone="warn"] {
  color: var(--accent-warning, #b27a00);
  font-weight: 600;
}

.prompt-counter[data-tone="over"] {
  color: var(--accent-danger, #ef4444);
  font-weight: 700;
}

.prompt-actions {
  /* PR-WORKSPACE-WIDE — restack from a 2-col grid (chip-row | Ask
     button) to a flex column. The grid form let chip-row chips wrap
     to multiple lines while the Ask button stayed pinned to row
     bottom-right via align-items:end, which produced a tall row that
     visually collided with the prompt-stream rendered below. The
     flex-col form keeps chips on row 1, button on row 2 (right-
     aligned via align-self), and the stream below — no collision. */
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt-actions > .prompt-submit {
  align-self: flex-end;
}

/* PR-PROMPT-ATTACH — buttons row holds the attach (paperclip) and
   submit (Ask) buttons together, right-aligned at the bottom of the
   prompt-actions column. Replaces the bare .prompt-submit when the
   attach feature is wired in. */
.prompt-actions-buttons {
  align-items: center;
  align-self: flex-end;
  display: flex;
  gap: 8px;
}

.prompt-attach-button {
  font-size: 12.5px;
}

.chip-row-attachments[hidden] {
  display: none;
}

.prompt-attach-chip {
  background: rgba(255, 198, 39, 0.12);
  border-color: rgba(255, 198, 39, 0.4);
  cursor: pointer;
  gap: 6px;
}

.prompt-attach-chip:hover {
  background: rgba(255, 198, 39, 0.2);
}

.prompt-attach-chip-close {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.prompt-attach-chip:hover .prompt-attach-chip-close {
  color: var(--ink);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-chip {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  min-height: 32px;
  padding: 0 12px;
  max-width: 100%;
}

.action-chip:hover {
  border-color: var(--asu-gold);
  color: var(--asu-gold-dark);
}

/* PR-D5 — recent-prompt chip row. Sits above the curated suggestions
   so the user's own latest prompts get the nearest-affordance slot.
   Visually distinct via a subtle eyebrow label + slightly muted chip
   surface, so the curated suggestions stay the primary CTA. */
.chip-row-recent {
  align-items: center;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.08);
  padding-bottom: 8px;
}

.chip-row-recent .chip-row-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-right: 4px;
  text-transform: uppercase;
}

.action-chip-recent {
  background: rgba(15, 23, 42, 0.03);
  font-size: 12.5px;
  min-height: 28px;
  padding: 0 10px;
}

.action-chip-recent:hover {
  background: rgba(255, 198, 39, 0.1);
}

.prompt-submit {
  min-width: 88px;
}

/* PR-I1 — visual state for the in-flight submit. Disabled prevents
 * the double-Enter race; opacity + the "Asking…" pseudo content makes
 * the wait visible. The label swap uses an attribute so the JS only
 * has to flip a flag, not edit textContent. */
.prompt-submit:disabled {
  cursor: progress;
  opacity: 0.65;
}

.prompt-submit[data-busy] {
  position: relative;
}

.prompt-submit[data-busy]::after {
  animation: prompt-submit-pulse 1.4s ease-in-out infinite;
  background: currentColor;
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 6px;
  margin-left: 6px;
  vertical-align: middle;
  width: 6px;
}

@keyframes prompt-submit-pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.section-heading {
  display: grid;
  gap: 4px;
}

.section-heading h3 {
  font-size: 24px;
}

.priority-brief,
.workspace-panel,
.context-strip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

.priority-brief {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.priority-list,
.timeline-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.priority-item {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
}

/* PR-B: bump tone alpha so the severity registers without squinting,
 * and pair the left-edge stripe with a tone-pill on the right. The
 * tone now reads twice — once peripherally (border-left), once
 * foveally (the pill). */
.priority-item.danger {
  background: rgba(239, 68, 68, 0.14);
  border-left-color: var(--accent-danger);
}

.priority-item.warning {
  background: rgba(244, 180, 0, 0.16);
  border-left-color: var(--accent-warning);
}

.priority-item.neutral {
  background: rgba(0, 102, 204, 0.08);
  border-left-color: var(--accent-info);
}

.priority-item-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.priority-item-title {
  font-size: 15px;
  line-height: 1.3;
}

.priority-item-detail {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.priority-item-foot {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 4px;
}

.tone-pill {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tone-pill-danger {
  background: var(--accent-danger);
  color: #fff;
}

.tone-pill-warning {
  background: var(--accent-warning);
  color: #1f1300;
}

.tone-pill-neutral {
  background: var(--accent-info);
  color: #fff;
}

/* Section heading: title + count badge inline. */
.priority-brief .section-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.priority-count {
  background: var(--ink);
  border-radius: 999px;
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  min-width: 26px;
  padding: 3px 10px;
  text-align: center;
}

.priority-empty {
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: 10px;
  color: var(--muted);
  padding: 22px 18px;
  text-align: center;
}

.priority-empty strong {
  color: var(--ink);
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.priority-empty p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.priority-item p,
.timeline-list p,
.agent-tile p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.priority-item small {
  color: var(--asu-gold-dark);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}

.compact-button {
  white-space: nowrap;
}

.context-strip {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.context-metric {
  display: grid;
  gap: 4px;
  padding: 18px;
}

.context-metric + .context-metric {
  border-left: 1px solid var(--line);
}

.context-metric span,
.context-metric small {
  color: var(--muted);
  font-size: 13px;
}

.context-metric strong {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1;
}

.workspace-split {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
}

.workspace-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.timeline-list li {
  display: grid;
  gap: 12px;
  grid-template-columns: 76px minmax(0, 1fr);
}

.timeline-list li > span {
  color: var(--asu-gold-dark);
  font-size: 13px;
  font-weight: 700;
}

.agent-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agent-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-cloud span {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  padding: 7px 10px;
}

.platform-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* PR-UI-FIXES — fabric/workspace cards pick up the same surface
   treatment as the panel/marketplace families (bg + radius + shadow)
   instead of a bare hairline border, so cards match across columns. */
.fabric-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 14px;
}

.fabric-card h4 {
  font-family: var(--font-sans);
  font-size: 15px;
  margin: 8px 0 6px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  grid-column: span 4;
  min-height: 160px;
  padding: 18px;
}

.metric-panel {
  min-height: 136px;
}

.panel.wide {
  grid-column: span 8;
}

.panel.full {
  grid-column: 1 / -1;
}

.panel h3 {
  font-size: 24px;
  margin-bottom: 12px;
}

.panel p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.metric {
  color: var(--asu-black);
  font-family: var(--font-serif);
  font-size: 42px;
  line-height: 1;
}

.data-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.data-row {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  list-style: none;
  padding: 12px;
}

.data-row strong {
  display: block;
}

.data-row small {
  color: var(--muted);
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  min-height: 24px;
  padding: 4px 8px;
  text-transform: uppercase;
}

.badge.gold {
  background: rgba(201, 151, 0, 0.18);
  border-color: var(--asu-gold);
}

.badge.success {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--accent-success);
  color: var(--success);
}

.badge.warning {
  background: rgba(244, 180, 0, 0.16);
  border-color: var(--accent-warning);
  color: var(--warning);
}

.badge.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--accent-danger);
  color: var(--danger);
}

.badge.info {
  background: rgba(0, 102, 204, 0.1);
  border-color: var(--accent-info);
  color: var(--accent-info);
}

.badge.ai {
  background: rgba(0, 194, 209, 0.12);
  border-color: var(--accent-cyan);
  color: #006670;
}

.badge.thinking {
  background: rgba(111, 66, 193, 0.12);
  border-color: var(--accent-violet);
  color: var(--accent-violet);
}

.workspace-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 14px;
}

.workspace-card h3 {
  font-size: 22px;
}

.widget-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.widget-card {
  background: var(--asu-black);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  color: var(--paper);
  min-height: 150px;
  padding: 14px;
}

.widget-card h3 {
  color: var(--paper);
  font-size: 22px;
}

.widget-card p {
  color: rgba(255, 255, 255, 0.74);
}

.approval-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* PR-H1 — "Past runs" drawer. Repurposed shell of the dropped
 * "AskStinger Agent" side panel: same fixed-right slide-in chrome,
 * different content. List of recorded workspace prompt runs (most
 * recent first), each a click-to-expand <details> with the answer +
 * tool-call trace. */
.run-history-drawer {
  background: var(--paper);
  border-left: 1px solid var(--line);
  bottom: 0;
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.18);
  display: grid;
  grid-template-rows: auto 1fr;
  max-width: 480px;
  position: fixed;
  right: 0;
  top: 0;
  width: min(480px, 100vw);
  z-index: 10;
}

.run-history-drawer[hidden] {
  display: none;
}

.run-history-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 18px;
}

/* PR-S4 — Stinger mascot in the drawer header. Decorative — the
   adjacent eyebrow + h2 carry the semantics. Sized to match the
   eyebrow + title block height so the row stays compact. */
.run-history-stinger {
  flex-shrink: 0;
  height: 40px;
  width: 40px;
}

.run-history-header-titles {
  flex: 1 1 auto;
  min-width: 0;
}

/* PR-D2 — search filter for past runs. Sits between the drawer header
   and the run list; native `type=search` includes a clear (×) affordance
   so the user can wipe the filter without selecting + deleting. */
.run-history-search {
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
}

.run-history-search-input {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  padding: 8px 10px;
  width: 100%;
}

.run-history-search-input:focus {
  border-color: var(--asu-gold);
  outline: 2px solid rgba(255, 198, 39, 0.35);
  outline-offset: 1px;
}

/* PR-DRAWER-FILTERS — intent + specialist dropdowns sit beneath
   the text-search input. Two narrow selects in a row with shrink
   so they wrap on narrow drawers (≤768px the drawer is full-width
   per PR-RESP). */
.run-history-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.run-history-filter-select {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  flex: 1 1 140px;
  font-size: 12.5px;
  min-width: 0;
  padding: 6px 8px;
}

.run-history-filter-select:focus {
  border-color: var(--asu-gold);
  outline: 2px solid rgba(255, 198, 39, 0.35);
  outline-offset: 1px;
}

.run-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 18px;
}

.run-history-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.run-history-entry {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

.run-history-entry.is-error {
  border-color: var(--accent-danger);
}

.run-history-entry > summary {
  align-items: baseline;
  column-gap: 8px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  list-style: none;
  padding: 12px 14px;
  row-gap: 4px;
}

.run-history-entry > summary::-webkit-details-marker {
  display: none;
}

.run-history-status {
  color: var(--accent-success);
  font-weight: 700;
  grid-column: 1;
  grid-row: 1 / span 2;
}

.run-history-entry.is-error .run-history-status {
  color: var(--accent-danger);
}

.run-history-prompt {
  color: var(--ink);
  font-weight: 600;
  grid-column: 2;
  grid-row: 1;
  overflow-wrap: anywhere;
}

.run-history-meta {
  color: var(--muted);
  font-size: 12px;
  grid-column: 2;
  grid-row: 2;
}

.run-history-body {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
}

.run-history-spec {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.run-history-answer {
  background: var(--surface);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  margin: 0;
  overflow-x: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.run-history-tools {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.run-history-tools code {
  background: rgba(15, 23, 42, 0.04);
  border-radius: 4px;
  font-size: 12px;
  padding: 4px 8px;
}

/* PR-I2 — Copy answer + Rerun action row inside each past-run entry.
 * Right-aligned so the body text reads top-down without competing
 * with the buttons. `.compact-button` style already exists for the
 * tone-pill action chips in the priority brief. */
.run-history-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* PR-D3 — Remove button reads as muted/danger so it's visually
   distinct from the primary Copy/Rerun affordances. The danger tone
   only kicks in on hover so the row at rest stays calm. */
.run-history-remove {
  color: var(--muted);
}

.run-history-remove:hover,
.run-history-remove:focus-visible {
  background: rgba(214, 28, 78, 0.08);
  border-color: rgba(214, 28, 78, 0.32);
  color: rgb(168, 22, 60);
}

/* Tab-bar pill that triggers the drawer (sibling to PR-D's restore-cards
 * pill). Same visual treatment so the pair reads as one related set. */
.workspace-tabs-history {
  align-items: center;
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--paper, #fff);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-left: auto;
  padding: 4px 12px;
  transition: background 120ms ease, border-color 120ms ease;
}

.workspace-tabs-history:hover,
.workspace-tabs-history:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  outline: 2px solid var(--asu-gold);
  outline-offset: 2px;
}

.workspace-tabs-history + .workspace-tabs-restore {
  margin-left: 8px;
}

.sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* ============================================================
   PARKER UI extensions — cards, forms, modals, toasts, badges
   ============================================================ */

/* --- Shared view layout --- */

.parker-view-wrap {
  grid-column: 1 / -1;
  display: grid;
  gap: 20px;
}

.parker-view-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.parker-section-title {
  font-family: var(--font-serif);
  font-size: 32px;
  margin: 0;
}

.parker-form-wrap {
  grid-column: 1 / -1;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  max-width: 760px;
  padding: 28px;
}

/* --- Form components --- */

.parker-form {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.form-row {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  font-size: 14px;
  font-weight: 700;
}

.form-field input,
.form-field textarea,
.form-field select {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--asu-gold);
  outline: 2px solid var(--asu-gold);
  outline-offset: 1px;
}

.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-color: var(--danger);
  outline-color: var(--danger);
}

.field-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* --- Intake board --- */

.intake-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.intake-row-info {
  display: grid;
  gap: 2px;
}

.intake-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Approval inbox --- */

.approval-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
}

.approval-row-info {
  display: grid;
  gap: 4px;
}

/* --- Marketplace --- */

.marketplace-search-bar {
  display: flex;
  gap: 8px;
}

.marketplace-search-input {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  flex: 1;
  min-height: 40px;
  max-width: 420px;
  padding: 0 12px;
}

.marketplace-search-input:focus {
  border-color: var(--asu-gold);
  outline: 2px solid var(--asu-gold);
  outline-offset: 1px;
}

.marketplace-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.marketplace-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: grid;
  gap: 12px;
  grid-template-rows: auto 1fr auto auto;
  padding: 18px;
}

.marketplace-card-header {
  display: grid;
  gap: 4px;
}

.marketplace-card-header h3 {
  font-size: 20px;
  margin: 4px 0 0;
}

.marketplace-org {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.marketplace-summary {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.marketplace-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.outcome-chip {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  text-transform: uppercase;
}

.marketplace-card-footer {
  display: flex;
  justify-content: flex-end;
}

/* --- Workspace --- */

.workspace-header {
  align-items: start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 20px;
}

.workspace-meta {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
}

/* --- Tab bar --- */

.tab-bar {
  border-bottom: 2px solid var(--line);
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: -2px;
  min-height: 44px;
  padding: 0 20px;
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.is-active {
  border-bottom-color: var(--asu-gold);
  color: var(--ink);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--asu-gold);
  outline-offset: -2px;
}

.tab-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 20px;
}

/* --- Brief detail DL --- */

.brief-detail {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: max-content 1fr;
  margin: 0;
}

.brief-detail dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.brief-detail dd {
  color: var(--ink);
  margin: 0;
}

/* --- Milestone post bar --- */

.milestone-post-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* --- Modal overlay --- */

.modal-overlay {
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;
}

.modal-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 18px;
  max-width: 520px;
  padding: 28px;
  width: min(520px, calc(100vw - 32px));
}

.modal-box h3 {
  font-size: 24px;
  margin: 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* --- Toast notifications --- */

.toast-container {
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  position: fixed;
  right: 24px;
  z-index: 200;
}

.toast {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  font-size: 14px;
  font-weight: 700;
  max-width: 360px;
  padding: 12px 16px;
  animation: toast-in 0.2s ease;
}

.toast-success {
  border-color: var(--success);
  color: var(--success);
}

.toast-warning {
  border-color: var(--warning);
  color: var(--warning);
}

.toast-danger {
  border-color: var(--danger);
  color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Demo notice --- */

.demo-notice {
  background: rgba(201, 151, 0, 0.12);
  border: 1px solid var(--asu-gold);
  border-radius: 6px;
  color: var(--warning);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
}

/* --- Focus states for all interactive elements --- */

.ghost-button:focus-visible,
.gold-button:focus-visible,
.icon-button:focus-visible,
.action-chip:focus-visible,
.tab-btn:focus-visible {
  outline: 2px solid var(--asu-gold);
  outline-offset: 2px;
}

@media (max-width: 1040px) {
  .personal-workspace {
    padding: 20px;
  }

  .workspace-hero,
  .workspace-split {
    grid-template-columns: 1fr;
  }

  .personal-prompt {
    min-height: 360px;
  }

  .priority-brief,
  .workspace-panel {
    min-width: 0;
  }

  .content-grid,
  .workspace-grid,
  .widget-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .panel.wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .main {
    max-width: 100vw;
  }

  .main.personal-workspace {
    margin: 0 16px;
    max-width: none;
    padding: 16px 0 32px;
    width: auto;
  }

  .workspace-topbar {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .product-mark {
    font-size: 30px;
  }

  .identity-summary {
    border-left: 0;
    padding-left: 0;
  }

  .identity-summary span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .personal-workspace-grid,
  .workspace-hero,
  .workspace-split,
  .context-strip,
  .agent-grid,
  .content-grid,
  .prompt-stage,
  .panel,
  .parker-view-wrap,
  .parker-form-wrap {
    max-width: 100%;
    width: 100%;
  }

  .workspace-hero,
  .workspace-split,
  .context-strip,
  .agent-grid,
  .priority-item,
  .timeline-list li {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .topbar-actions .ghost-button,
  .topbar-actions .gold-button {
    width: 100%;
  }

  .ghost-button,
  .gold-button {
    flex: 1;
  }

  .prompt-stage {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .personal-prompt {
    min-height: auto;
  }

  .prompt-box,
  .prompt-box textarea,
  .chip-row {
    min-width: 0;
    max-width: 100%;
  }

  .prompt-box {
    box-sizing: border-box;
    justify-self: start;
    max-inline-size: 100% !important;
    width: 100% !important;
  }

  .prompt-box textarea,
  .prompt-box .chip-row,
  .prompt-box .prompt-submit {
    max-inline-size: 100%;
    width: 100%;
  }

  .prompt-stage h3 {
    font-size: 30px;
    line-height: 1.08;
  }

  .prompt-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .chip-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .action-chip {
    display: block;
    justify-content: center;
    line-height: 1.2;
    min-width: 0;
    min-height: 38px;
    overflow-wrap: anywhere;
    padding: 6px 8px;
    text-align: center;
    white-space: normal;
    width: 100%;
  }

  .prompt-submit {
    width: 100%;
  }

  .context-metric + .context-metric {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .agent-tile,
  .priority-item,
  .timeline-list li {
    min-width: 0;
  }

  .compact-button {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .marketplace-grid {
    grid-template-columns: 1fr;
  }

  .intake-row,
  .approval-row {
    grid-template-columns: 1fr;
  }

  .modal-box {
    padding: 20px;
  }
}

/* --- Phase C: streaming response panel for /agents/runs/stream ----------- */

.parker-home-stream {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.parker-home-stream-header {
  align-items: center;
  display: flex;
  gap: 10px;
}

.parker-home-stream-dot {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
  background: var(--accent-cyan);
  box-shadow: 0 0 0 0 rgba(0, 194, 209, 0.55);
  animation: parker-stream-pulse 1.4s ease-in-out infinite;
}

.parker-home-stream-dot[data-state="complete"] {
  background: var(--accent-success);
  animation: none;
  box-shadow: none;
}

.parker-home-stream-dot[data-state="error"] {
  background: var(--accent-danger);
  animation: none;
  box-shadow: none;
}

@keyframes parker-stream-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(0, 194, 209, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(0, 194, 209, 0);    }
  100% { box-shadow: 0 0 0 0   rgba(0, 194, 209, 0);    }
}

.parker-home-stream-body {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  /* PR-UI-APP-POLISH — theme-aware output text. The body inherits its
     color from the gradient prompt-stage surface, which rendered the
     streamed answer white-on-light in light theme. Pin it to the same
     --ink token the AskStinger chat transcript (.chat-turn-body) uses so
     it is dark-on-light / light-on-dark in either theme. */
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 64px;
}

/* PR-UI-APP-POLISH — rich output. Once the answer completes it is
   re-rendered through the shared PR-MARKDOWN renderer, producing the
   same node set as the chat transcript (headings, paragraphs, lists,
   inline + fenced code). Mirror .chat-turn-body's block styling so the
   markdown reads as prose, not a monospace blob. */
.parker-home-stream-body :is(h1, h2, h3, p, ul, li, pre.md-code-block, table.md-table) {
  white-space: normal;
}

/* --- Capabilities consolidation: chips with agent attribution + tone tags --- */

.action-chip {
  align-items: flex-start;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.action-chip-text {
  display: block;
  line-height: 1.3;
}

.action-chip-agent,
.priority-agent {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 6px;
  padding: 2px 8px;
  text-transform: none;
  white-space: nowrap;
}

.priority-agent {
  margin-top: 8px;
}

/* Six tone classes — one per agent palette slot. Hashing keeps the same
   agent the same colour across chips, priority items, and the disclosure
   tiles. Backgrounds are very light tints; text uses the saturated colour. */
.agent-tone-cyan {
  background: rgba(0, 194, 209, 0.12);
  color: #006670;
}
.agent-tone-violet {
  background: rgba(111, 66, 193, 0.12);
  color: var(--accent-violet);
}
.agent-tone-success {
  background: rgba(16, 185, 129, 0.14);
  color: #0b6f4d;
}
.agent-tone-warning {
  background: rgba(244, 180, 0, 0.18);
  color: #6a4900;
}
.agent-tone-info {
  background: rgba(0, 102, 204, 0.12);
  color: var(--accent-info);
}
.agent-tone-gold {
  background: rgba(201, 151, 0, 0.18);
  color: var(--asu-gold-dark);
}

.agent-tile {
  border-left: 4px solid transparent;
}
.agent-tile.agent-tone-cyan { border-left-color: var(--accent-cyan); }
.agent-tile.agent-tone-violet { border-left-color: var(--accent-violet); }
.agent-tile.agent-tone-success { border-left-color: var(--accent-success); }
.agent-tile.agent-tone-warning { border-left-color: var(--accent-warning); }
.agent-tile.agent-tone-info { border-left-color: var(--accent-info); }
.agent-tile.agent-tone-gold { border-left-color: var(--asu-gold); }

/* --- Capabilities disclosure inside the workspace card -------------------- */

.capabilities-disclosure {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 14px;
}

.capabilities-disclosure summary {
  align-items: center;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 10px;
  list-style: none;
}

.capabilities-disclosure summary::-webkit-details-marker {
  display: none;
}

.capabilities-disclosure summary::before {
  content: "▸";
  color: var(--accent-cyan);
  display: inline-block;
  font-size: 12px;
  transition: transform 0.15s ease;
}

.capabilities-disclosure[open] summary::before {
  transform: rotate(90deg);
}

.capabilities-counts {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-left: auto;
}

.capabilities-body {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}

.capabilities-section .eyebrow {
  margin-bottom: 8px;
}

/* ---------------------------------------------------------------------------
 * PR2 — workspace tabs + inline stream panel + spawned tab body
 * Tabs sit *inside* the mission-control region, above the card stack. The
 * Home tab renders the four-card stack from PR1; spawned tabs hold the
 * answer of any run whose orchestrator returned `render_target: tab:<name>`.
 * ------------------------------------------------------------------------- */

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 0 8px;
  margin: 0 0 12px;
}

.workspace-tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--paper-muted, rgba(255, 255, 255, 0.65));
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 8px 14px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.workspace-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper, #fff);
}

.workspace-tab.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--asu-gold, #ffc627);
}

.workspace-tab-panel {
  display: block;
}

.spawned-tab-empty {
  /* PR-WORKSPACE-POLISH-2 — richer empty state. Was a single italic
     "Waiting for X content…" line; now a stack with title + hint
     pointing the user at the prompt-target convention. */
  align-items: center;
  color: var(--paper-muted, rgba(255, 255, 255, 0.65));
  display: flex;
  flex-direction: column;
  font-style: italic;
  gap: 6px;
  padding: 28px 20px;
  text-align: center;
}

.spawned-tab-empty-title {
  color: var(--ink, #1a1a1a);
  font-size: 1.05rem;
  font-style: normal;
  font-weight: 600;
  margin: 0;
}

.spawned-tab-empty-hint {
  color: var(--muted, rgba(0, 0, 0, 0.55));
  font-size: 0.92rem;
  margin: 0;
  max-width: 520px;
}

.spawned-tab-empty code {
  background: rgba(15, 23, 42, 0.05);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  padding: 1px 6px;
}

/* PR-WORKSPACE-POLISH-2 — action button on toasts (used by tab
   dismiss undo). Compact gold pill aligned to the right of the
   message text. */
.toast-action {
  background: rgba(255, 198, 39, 0.85);
  border: 0;
  border-radius: 999px;
  color: var(--asu-black, #000);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  margin-left: 12px;
  padding: 4px 12px;
  text-transform: uppercase;
}

.toast-action:hover,
.toast-action:focus-visible {
  background: var(--asu-gold, #ffc627);
  outline: 2px solid var(--asu-black, #000);
  outline-offset: 2px;
}

.spawned-tab-answer {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  color: var(--paper, #fff);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  margin: 0;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.prompt-stream {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  /* PR-WORKSPACE-WIDE — bump from 14 → 24px so the stream panel reads
     as a clearly-separate section beneath the prompt-actions row,
     and explicit z-index/position so an overzealous transform on the
     prompt-stage parent can't ever pull it under the chip row. */
  margin-top: 24px;
  padding: 14px 16px;
  position: relative;
  z-index: 1;
}

.prompt-stream[hidden] {
  display: none;
}

.prompt-stream-header {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

/* PR-I2 — Copy button sits at the right end of the stream header. */
.prompt-stream-copy {
  margin-left: auto;
}

.prompt-stream-dot {
  background: var(--accent-info, #4ea1ff);
  border-radius: 50%;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.prompt-stream-dot[data-state="thinking"] {
  animation: prompt-stream-pulse 1.2s ease-in-out infinite;
}

.prompt-stream-dot[data-state="complete"] {
  background: var(--accent-success, #4ec9a0);
  animation: none;
}

.prompt-stream-dot[data-state="error"] {
  background: var(--accent-danger, #f04e4e);
  animation: none;
}

.prompt-stream-body {
  color: var(--paper, #fff);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  margin: 0;
  transition: opacity 200ms ease;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* PR-I3 — N1: dim the prior answer while a new run is in-flight.
 * The dim signals "this is stale, fresh tokens incoming" without
 * blanking the panel and losing the user's reading context. */
.prompt-stream-body[data-fading="1"] {
  opacity: 0.45;
}

@keyframes prompt-stream-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* PR-MARKDOWN — formatted DOM rendered into the prompt-stream-body
   `<pre>` after the run completes. The pre's monospace + pre-wrap
   keep streaming-time raw text legible; once the parser swaps in
   real elements (h1/p/ul/code) we restore proportional fonts and
   normal whitespace handling so the answer reads as prose. */
.prompt-stream-body :is(h1, h2, h3, p, ul, li, pre.md-code-block, table.md-table) {
  font-family: var(--font-sans, system-ui, sans-serif);
  white-space: normal;
}

.prompt-stream-body h1,
.prompt-stream-body h2,
.prompt-stream-body h3 {
  margin: 14px 0 6px;
}

.prompt-stream-body h1 { font-size: 1.2rem; }
.prompt-stream-body h2 { font-size: 1.1rem; }
.prompt-stream-body h3 { font-size: 1.0rem; }

.prompt-stream-body p {
  margin: 0 0 10px;
}

.prompt-stream-body p:last-child {
  margin-bottom: 0;
}

.prompt-stream-body ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.prompt-stream-body li {
  margin-bottom: 4px;
}

.prompt-stream-body :not(pre) > code {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 1px 5px;
}

.prompt-stream-body pre.md-code-block {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  margin: 0 0 10px;
  overflow: auto;
  padding: 10px 12px;
  white-space: pre;
}

.prompt-stream-body pre.md-code-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.prompt-stream-body a {
  color: var(--asu-gold, #ffc627);
  text-decoration: underline;
}

.prompt-stream-body a:hover,
.prompt-stream-body a:focus-visible {
  color: var(--asu-gold-light, #ffd766);
}

/* PR-MD-TABLES — GFM pipe tables rendered by parseMarkdownToNodes().
   Shared across the chat stream, the chat transcript, and PARKER's app
   stream (parker_ops emits brief listings as pipe tables). Theme-aware
   via --ink / --line / --surface tokens so it reads in light AND dark
   mode; header emphasis + row borders mirror the app's card idiom. */
.prompt-stream-body table.md-table,
.chat-turn-body table.md-table,
.parker-home-stream-body table.md-table {
  border-collapse: collapse;
  color: var(--ink);
  display: block;
  font-size: 0.9em;
  margin: 0 0 10px;
  max-width: 100%;
  overflow-x: auto;
}

.prompt-stream-body table.md-table th,
.prompt-stream-body table.md-table td,
.chat-turn-body table.md-table th,
.chat-turn-body table.md-table td,
.parker-home-stream-body table.md-table th,
.parker-home-stream-body table.md-table td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}

.prompt-stream-body table.md-table thead th,
.chat-turn-body table.md-table thead th,
.parker-home-stream-body table.md-table thead th {
  background: var(--surface-strong);
  font-weight: 600;
}

.prompt-stream-body table.md-table tbody tr:nth-child(even),
.chat-turn-body table.md-table tbody tr:nth-child(even),
.parker-home-stream-body table.md-table tbody tr:nth-child(even) {
  background: var(--surface);
}

/* ---------------------------------------------------------------------------
 * PR3 — per-card × close button + empty-stack restore + tab-close affordance
 * ------------------------------------------------------------------------- */

.card-close {
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--paper-muted, rgba(255, 255, 255, 0.7));
  cursor: pointer;
  font: 600 16px/1 system-ui, sans-serif;
  height: 26px;
  padding: 0;
  position: absolute;
  right: 12px;
  top: 12px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  width: 26px;
  z-index: 2;
}

.card-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--paper, #fff);
}

/* Anchor the absolutely-positioned × against each card. */
[data-card-id] {
  position: relative;
}

.empty-stack {
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--paper-muted, rgba(255, 255, 255, 0.7));
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  padding: 40px 16px 36px;
  text-align: center;
}

.empty-stack strong {
  color: var(--ink);
  font-size: 18px;
}

.empty-stack p {
  margin: 0;
}

/* PR-F3 — Stinger fronts the empty-state panel. 120px circular crop
 * matches the panel's center-axis treatment; ASU-gold ring keeps the
 * brand cue consistent with the topbar (PR-F1) and the workspace
 * eyebrow (PR-F2). Subtle entrance animation makes the panel feel
 * earned rather than abrupt — fires only when prefers-reduced-motion
 * is not set. */
.empty-stack-stinger {
  animation: empty-stack-stinger-in 480ms ease-out;
  background: var(--asu-black);
  border: 3px solid var(--asu-gold);
  border-radius: 50%;
  height: 120px;
  margin-bottom: 4px;
  object-fit: cover;
  width: 120px;
}

@keyframes empty-stack-stinger-in {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .empty-stack-stinger {
    animation: none;
  }
}

@media (max-width: 520px) {
  .empty-stack-stinger {
    height: 96px;
    width: 96px;
  }
}

.workspace-tab {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.workspace-tab-close {
  align-items: center;
  background: transparent;
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  height: 18px;
  justify-content: center;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 120ms ease, background 120ms ease;
  width: 18px;
}

.workspace-tab-close:hover {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

/* ---------------------------------------------------------------------------
 * PR-A — workspace card visual identity + persona accent + powered-by pill.
 *
 * The prompt-stage card is the primary action surface. Three things give it
 * presence relative to its siblings (priority brief / metrics / timeline):
 *   1. A persona-keyed top accent strip (4px) — colour reflects the active
 *      role. Same 6-slot palette as `agentToneClass`, just driven by
 *      `persona.id` so each role reads as a distinct surface.
 *   2. A second accent gradient (low alpha) layered on top of the existing
 *      ASU-gold gradient so the card has more saturation than the rest.
 *   3. A larger radius + heavier shadow so it visually floats above the
 *      paper-on-paper sibling cards.
 *
 * The capabilities disclosure is gone (PR-A) — replaced with a slim
 * `.powered-by-pill` in the eyebrow row.
 * ------------------------------------------------------------------------- */

.prompt-stage {
  /* Default accent — overridden by persona-tone classes below. */
  --workspace-accent: var(--accent-cyan);
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--workspace-accent) 14%, transparent), transparent 38%),
    linear-gradient(135deg, rgba(201, 151, 0, 0.1), rgba(255, 255, 255, 0) 42%),
    var(--paper);
  border-radius: 20px;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 18px 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  padding: 32px 30px;
  position: relative;
}

.prompt-stage::before {
  background: var(--workspace-accent);
  content: "";
  height: 4px;
  inset: 0 0 auto 0;
  position: absolute;
}

/* Persona accent mapping. Each `.agent-tone-*` class is also applied at
 * the workspace card root by renderPromptStage; here we hijack it to set
 * `--workspace-accent` so the same 6-slot palette drives both per-agent
 * chips and per-persona card chrome. */
.prompt-stage.agent-tone-cyan    { --workspace-accent: var(--accent-cyan); }
.prompt-stage.agent-tone-violet  { --workspace-accent: var(--accent-violet); }
.prompt-stage.agent-tone-success { --workspace-accent: var(--accent-success); }
.prompt-stage.agent-tone-warning { --workspace-accent: var(--accent-warning); }
.prompt-stage.agent-tone-info    { --workspace-accent: var(--accent-info); }
.prompt-stage.agent-tone-gold    { --workspace-accent: var(--asu-gold); }

/* Eyebrow row: role label + powered-by pill side-by-side. */
.prompt-stage-eyebrow-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 4px;
}

.prompt-stage-eyebrow-row .eyebrow {
  margin: 0;
}

.powered-by-pill {
  align-items: center;
  background: color-mix(in srgb, var(--workspace-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--workspace-accent) 35%, transparent);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
  letter-spacing: 0.02em;
  padding: 4px 10px;
}

.powered-by-dot {
  background: var(--workspace-accent);
  border-radius: 50%;
  display: inline-block;
  height: 6px;
  width: 6px;
}

/* Internal divider — the inline stream panel sits below the form, but
 * before this PR there was no visual break between them. Add a hairline
 * + extra top margin so the answer reads as a distinct section, not as a
 * dropdown of the input. */
.prompt-stage > .prompt-stream {
  border-top: 1px solid color-mix(in srgb, var(--workspace-accent) 22%, var(--line));
  margin-top: 8px;
  padding-top: 16px;
}

/* ---------------------------------------------------------------------------
 * PR-C — stream-status overhaul: tool-call trace + duration footer.
 *
 * Stream panel now renders:
 *   [ • status — "✓ specialist handled intent"          ]
 *   [ answer body                                        ]
 *   [ ▸ What it did                                      ]   (collapsible)
 *   [   → connector.fn(args)                             ]
 *   [ confidence 0.83 · 2 tool calls · 418ms             ]   (dim footer)
 *
 * Status copy describes WHAT happened. Duration moves to the dim meta
 * footer + the dot's `title=` tooltip. Tool calls render as plain
 * <code> children of <li> so a malicious connector argument can't
 * inject markup (textContent only — never innerHTML).
 * ------------------------------------------------------------------------- */

.prompt-stream-trace {
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
  margin-top: 12px;
  padding-top: 10px;
}

.prompt-stream-trace[hidden] {
  display: none;
}

.prompt-stream-trace > summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  list-style: none;
  text-transform: uppercase;
}

.prompt-stream-trace > summary::-webkit-details-marker {
  display: none;
}

.prompt-stream-trace > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 120ms ease;
}

.prompt-stream-trace[open] > summary::before {
  transform: rotate(90deg);
}

.prompt-stream-trace-list {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.prompt-stream-trace-entry code {
  background: rgba(15, 23, 42, 0.04);
  border-radius: 4px;
  color: var(--ink);
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  overflow-wrap: anywhere;
  padding: 6px 8px;
}

/* PR-I4 — expandable tool-call rows. The collapsed `<summary>` keeps
   the original truncated `→ name(args…)` look; expanding reveals
   pretty-printed full arguments + the connector-assigned tool id. */
.prompt-stream-trace-toolcall {
  border-radius: 4px;
}

.prompt-stream-trace-toolcall > summary {
  cursor: pointer;
  list-style: none;
}

.prompt-stream-trace-toolcall > summary::-webkit-details-marker {
  display: none;
}

.prompt-stream-trace-toolcall > summary:hover code {
  background: rgba(15, 23, 42, 0.07);
}

.prompt-stream-trace-toolcall[open] > summary code {
  background: rgba(15, 23, 42, 0.07);
}

.prompt-stream-trace-args {
  background: rgba(15, 23, 42, 0.03);
  border-radius: 4px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  margin: 4px 0 0;
  max-height: 240px;
  overflow: auto;
  padding: 8px 10px;
  white-space: pre;
}

.prompt-stream-trace-id {
  color: var(--muted);
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  margin-top: 4px;
  padding-left: 8px;
}

.prompt-stream-meta {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  margin-top: 10px;
  text-transform: uppercase;
}

.prompt-stream-meta[hidden] {
  display: none;
}

/* PR-S1 — Demo / Live data badges. Tones reuse the existing accent
 * palette so the live-data variant stays visually quiet (success
 * green) and the demo variant pops in warning amber. Both share a
 * compact pill shape so the pair reads as a single signal family. */
.prompt-stream-source {
  align-self: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: 8px;
  padding: 2px 10px;
  text-transform: uppercase;
}

.prompt-stream-source[data-tone="demo"] {
  background: rgba(244, 180, 0, 0.18);
  color: var(--accent-warning, #b27a00);
}

.prompt-stream-source[data-tone="live"] {
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-success, #0e7a55);
}

.run-history-source {
  align-self: center;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: 6px;
  padding: 2px 8px;
  text-transform: uppercase;
}

.run-history-source[data-tone="demo"] {
  background: rgba(244, 180, 0, 0.18);
  color: var(--accent-warning, #b27a00);
}

.run-history-source[data-tone="live"] {
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-success, #0e7a55);
}

/* ---------------------------------------------------------------------------
 * PR-D — a11y + interaction polish:
 *   - visible focus ring on the tablist (keyboard nav now works)
 *   - "+ N hidden" affordance next to the tabs (always-available restore)
 *   - chip row + Ask button reflow at narrow viewports
 * ------------------------------------------------------------------------- */

/* The tab itself is now `<div role="tab">` (PR-D) — restate the cursor +
 * baseline display so the new element behaves like the previous <button>. */
.workspace-tab[role="tab"] {
  cursor: pointer;
  user-select: none;
}

.workspace-tab:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-cyan) 80%, white 0%);
  outline-offset: 2px;
}

.workspace-tab-close {
  appearance: none;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.workspace-tab-close:focus-visible {
  outline: 2px solid var(--accent-danger);
  outline-offset: 1px;
}

.workspace-tabs-restore {
  align-items: center;
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--paper, #fff);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-left: auto; /* push to far right of tab bar */
  padding: 4px 12px;
  transition: background 120ms ease, border-color 120ms ease;
}

.workspace-tabs-restore:hover,
.workspace-tabs-restore:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  outline: none;
}

/* G11 — chip row + Ask reflow. At narrow widths the 2-col grid of
 * (chip-row | Ask) stops fitting and the Ask button overlaps the last
 * chip. Below this breakpoint, stack vertically: chips full-width,
 * Ask button on its own row, full-width. */
@media (max-width: 560px) {
  .prompt-actions {
    grid-template-columns: 1fr;
  }
  .prompt-submit {
    width: 100%;
  }
}

/* ---------------------------------------------------------------------------
 * PR-E — mobile sweep (G7).
 *
 * The post-PR1/PR3 layout was never re-verified at phone widths. Five
 * concrete issues fixed in one block:
 *
 *   1. Card × button overlapped the card title because the absolute
 *      positioning has no width budget reserved in the card content.
 *   2. Priority-item title + tone pill share a single row; on narrow
 *      widths the long title pushed the pill off the edge.
 *   3. Workspace tab bar had no overflow strategy — three or four
 *      spawned tabs ran past the viewport edge.
 *   4. Workspace card h3 stayed at 42px at all widths.
 *   5. Stream panel + trace + meta footer had desktop-sized padding.
 *
 * Breakpoint: ≤520px (covers iPhone 13 mini at portrait + Android medium).
 * Sits below the existing 720px block so its rules win the cascade.
 * ------------------------------------------------------------------------- */

@media (max-width: 520px) {
  /* (1) reserve 38px on the right of every dismissable card so the × never
     overlaps title/h3/pill. The PR3 ×is 26px + a little gutter. */
  [data-card-id] {
    padding-right: 44px;
  }

  /* (1) make the × a touch smaller so it doesn't dominate the card */
  .card-close {
    height: 22px;
    right: 10px;
    top: 10px;
    width: 22px;
  }

  /* (2) tone pill drops to its own row instead of fighting the title for
     horizontal real-estate */
  .priority-item-head {
    flex-wrap: wrap;
  }

  /* (3) horizontal scroll for the workspace tab bar so spawned tabs
     don't clip; restore-cards pill stays at the end of the scroll line */
  .workspace-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .workspace-tab {
    flex-shrink: 0;
  }
  .workspace-tabs-restore {
    flex-shrink: 0;
    margin-left: 8px;
  }

  /* (4) shrink the workspace card hero copy so it fits without
     orphaning words on a sub-400px viewport */
  .prompt-stage {
    padding: 22px 16px;
  }
  .prompt-stage h3 {
    font-size: 26px;
    line-height: 1.1;
    margin-bottom: 10px;
  }
  .prompt-stage p:not(.eyebrow) {
    font-size: 14px;
  }
  .prompt-stage-eyebrow-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  /* (5) tighter stream + trace + meta */
  .prompt-stream {
    padding: 12px;
  }
  .prompt-stream-body,
  .prompt-stream-trace-entry code {
    font-size: 12px;
  }
  .prompt-stream-meta {
    font-size: 10.5px;
  }

  /* PR-F2 — Stinger avatar shrinks on phone so it doesn't dominate the
     eyebrow row when the powered-by pill wraps below it. */
  .workspace-stinger {
    height: 32px;
    width: 32px;
  }
}

/* ---------------------------------------------------------------------------
 * PR-F2 — workspace card eyebrow Stinger avatar.
 *
 * Photo lives next to "Faculty workspace" / "Student workspace" so each
 * persona's card "introduces itself". Reuses the `--workspace-accent`
 * custom property set on `.prompt-stage.agent-tone-*` (PR-A) so the
 * ring around Stinger inherits the persona tone:
 *   student → cyan, admissions → violet, advisor → success,
 *   faculty → warning, president → info, admin → gold (per agentToneClass).
 * Same Stinger photo for every role — the ring carries the per-persona
 * signal without distorting the photo via hue-rotate or blend modes.
 * ------------------------------------------------------------------------- */

.prompt-stage-eyebrow-lead {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.prompt-stage-eyebrow-lead .eyebrow {
  margin: 0;
}

.workspace-stinger {
  background: var(--asu-black);
  border: 2px solid var(--workspace-accent, var(--asu-gold));
  border-radius: 50%;
  flex-shrink: 0;
  height: 40px;
  object-fit: cover;
  width: 40px;
}

/* ---------------------------------------------------------------------------
 * PR-H2 — user-uploaded avatar.
 *
 * The topbar avatar is now wrapped in a button so a click fires the
 * hidden `<input type="file">`. On hover/focus the avatar surfaces a
 * soft gold overlay reading "Edit" so the affordance is discoverable
 * without cluttering the resting state. The hidden file input stays
 * out of the layout flow.
 * ------------------------------------------------------------------------- */

.topbar-avatar-button {
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  padding: 0;
  position: relative;
}

.topbar-avatar-button:disabled {
  cursor: progress;
  opacity: 0.6;
}

.topbar-avatar-button:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.topbar-avatar-overlay {
  align-items: center;
  background: rgba(201, 151, 0, 0.78);
  border-radius: 50%;
  color: var(--asu-black);
  display: flex;
  font-size: 11px;
  font-weight: 700;
  inset: 0;
  justify-content: center;
  letter-spacing: 0.04em;
  opacity: 0;
  position: absolute;
  text-transform: uppercase;
  transition: opacity 120ms ease;
}

.topbar-avatar-button:hover .topbar-avatar-overlay,
.topbar-avatar-button:focus-visible .topbar-avatar-overlay {
  opacity: 1;
}

/* When an uploaded image is present, the avatar `<span>` holds an
 * `<img>` child instead of initials. The image fills the circle and
 * the parent's gold ring is what the user sees. */
.topbar-user-avatar[data-has-image="1"] {
  background: transparent;
  color: transparent;
  overflow: hidden;
  padding: 0;
}

.topbar-user-avatar-img {
  border-radius: 50%;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.topbar-avatar-input {
  display: none;
}

/* PR-S3 — Help cheatsheet dialog. Native <dialog> styles default to
   browser chrome; reset to match the rest of the surfaces. */
.help-dialog {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
  color: var(--ink);
  max-width: 520px;
  padding: 0;
  width: 90%;
}

.help-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.help-dialog-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
}

.help-dialog-header h2 {
  font-size: 16px;
  margin: 0;
}

.help-dialog-list {
  display: grid;
  gap: 6px 16px;
  grid-template-columns: max-content 1fr;
  margin: 0;
  padding: 18px 20px;
}

.help-dialog-list dt {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.help-dialog-list dd {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* PR-HELP-DYNAMIC — section-title divider between the keyboard
   shortcuts list and the live-status list. */
.help-dialog-section-title {
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0;
  padding: 14px 20px 0;
  text-transform: uppercase;
}

.help-dialog kbd {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  padding: 1px 6px;
}

/* PR-S2 — sidecar status pill. Lives in the topbar actions row;
   tone-keyed via `data-status` so the user can read state at a
   glance without focusing the title attribute. Hidden until first
   poll lands (avoids flashing "down" during page boot). */
.sidecar-pill {
  align-items: center;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  text-transform: uppercase;
}

.sidecar-pill[hidden] {
  display: none;
}

.sidecar-pill[data-status="ready"] {
  background: rgba(72, 187, 120, 0.12);
  border-color: rgba(72, 187, 120, 0.4);
  color: rgb(45, 120, 75);
}

.sidecar-pill[data-status="down"] {
  background: rgba(214, 28, 78, 0.1);
  border-color: rgba(214, 28, 78, 0.35);
  color: rgb(168, 22, 60);
}

.sidecar-pill[data-status="unconfigured"] {
  background: rgba(15, 23, 42, 0.04);
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
 * PR-RESP — explicit responsive breakpoints (resolved). Both the RESP
 * media-query block and the H4 avatar-menu styles need to coexist;
 * the squash-merge of #79 left raw conflict markers in main, this
 * commit resolves them in place.
 * --------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .workspace-topbar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-auto-flow: row;
  }
  .workspace-topbar .topbar-actions {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .run-history-drawer {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .prompt-stage,
  .workspace-panel {
    padding: 14px;
  }
  .workspace-stinger {
    height: 32px;
    width: 32px;
  }
  .identity-summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .action-chip-text {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* PR-H4 — avatar popover menu. */
.topbar-avatar-popover {
  position: relative;
}

.topbar-avatar-menu {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
  list-style: none;
  margin: 6px 0 0;
  min-width: 180px;
  padding: 4px;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 40;
}

.topbar-avatar-menu[hidden] {
  display: none;
}

.topbar-avatar-menu li {
  margin: 0;
  padding: 0;
}

.topbar-avatar-menu-item {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  display: block;
  font-size: 13px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.topbar-avatar-menu-item:hover,
.topbar-avatar-menu-item:focus-visible {
  background: rgba(15, 23, 42, 0.06);
  outline: none;
}

/* PR-S7 — dispatch trace timeline. */
.prompt-stream-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.prompt-stream-timeline[hidden] {
  display: none;
}

.prompt-stream-timeline-event {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 11.5px;
  gap: 5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.prompt-stream-timeline-dot {
  background: var(--asu-gold);
  border-radius: 50%;
  display: inline-block;
  height: 7px;
  width: 7px;
}

.prompt-stream-timeline-event[data-kind="intent"] .prompt-stream-timeline-dot {
  background: rgb(120, 180, 240);
}

.prompt-stream-timeline-event[data-kind="dispatch"] .prompt-stream-timeline-dot {
  background: rgb(255, 198, 39);
}

.prompt-stream-timeline-event[data-kind="tool"] .prompt-stream-timeline-dot {
  background: rgb(159, 122, 234);
}

.prompt-stream-timeline-event[data-kind="completed"] .prompt-stream-timeline-dot {
  background: rgb(72, 187, 120);
}

.prompt-stream-timeline-label {
  color: var(--ink);
  font-weight: 600;
}

.prompt-stream-timeline-delta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  text-transform: none;
}

/* PR-I8 — pulse a workspace tab pill briefly when its body was just
   refreshed by a follow-up run. The flag is set in ensureWorkspaceTab
   when the new body differs from the previous one; the render emits
   data-recently-updated="1" for ~2s and CSS plays a single ASU-gold
   pulse so the user notices the in-place update. */
.workspace-tab[data-recently-updated="1"] {
  animation: workspace-tab-pulse 1.6s ease-out 1;
}

@keyframes workspace-tab-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 198, 39, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 198, 39, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 198, 39, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-tab[data-recently-updated="1"] {
    animation: none;
    box-shadow: 0 0 0 2px rgba(255, 198, 39, 0.45);
  }
}

/* PR-DEMO-BANNER — top-of-page strip surfacing the demo-data signal
   (PR-S1 only had a corner pill; easy to miss during stakeholder
   demos). Yellow / gold tone matches the existing "Demo data" pill
   so the visual language is consistent. */
.demo-banner {
  align-items: center;
  background: rgba(255, 198, 39, 0.18);
  border-bottom: 1px solid rgba(201, 151, 0, 0.4);
  color: rgb(120, 80, 0);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
  justify-content: center;
  padding: 8px 16px;
  text-align: center;
}

.demo-banner[hidden] {
  display: none;
}

.demo-banner strong {
  font-weight: 700;
}

.demo-banner code {
  background: rgba(201, 151, 0, 0.15);
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 1px 4px;
}

/* PR-CHROME-POLISH — skip-to-content link. Hidden off-screen until
   keyboard-focused; jumps to #view-root. */
.skip-to-content {
  background: var(--asu-gold);
  border-radius: 0 0 6px 0;
  color: var(--asu-black);
  font-size: 13px;
  font-weight: 700;
  left: 0;
  padding: 8px 14px;
  position: absolute;
  text-decoration: none;
  top: -100px;
  z-index: 100;
}

.skip-to-content:focus,
.skip-to-content:focus-visible {
  top: 0;
  outline: 2px solid var(--asu-black);
  outline-offset: 2px;
}

/* PR-CHROME-POLISH — refresh button busy state. Disabled + spinner
   ::after pseudo-element. CSS-driven so no DOM thrash; the button
   stays interactive (focus-visible) but rejects clicks via the
   `disabled` attribute. */
#refresh-button[data-busy="1"] {
  cursor: progress;
  opacity: 0.7;
}

#refresh-button[data-busy="1"]::after {
  animation: refresh-spinner 0.9s linear infinite;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  content: "";
  display: inline-block;
  height: 10px;
  margin-left: 6px;
  vertical-align: middle;
  width: 10px;
}

@keyframes refresh-spinner {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  #refresh-button[data-busy="1"]::after {
    animation: none;
  }
}

/* PR-TOOL-EVENTS — in-flight tool-call row in the stream-trace panel.
   Reuses the refresh-spinner keyframes; the inline label sits next to
   the spinner so the user sees WHICH tool is running. */
.prompt-stream-trace-entry-inflight {
  align-items: center;
  display: flex;
  gap: 8px;
  opacity: 0.85;
}

.prompt-stream-trace-spinner {
  animation: refresh-spinner 0.9s linear infinite;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  display: inline-block;
  flex: 0 0 auto;
  height: 12px;
  width: 12px;
}

.prompt-stream-trace-inflight-label {
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  .prompt-stream-trace-spinner {
    animation: none;
  }
}

/* PR-PIN-RUN — pinned past-run rows lift to the top via JS sort; the
   marker + subtle gold edge make the sticky state visible at a glance.
   Pin button shares the existing compact-button surface so it doesn't
   add a new visual primitive. */
.run-history-entry.is-pinned {
  border-left: 3px solid var(--asu-gold);
  padding-left: 8px;
}

.run-history-pin-marker {
  font-size: 12px;
  margin-left: 4px;
}

.run-history-pin[aria-pressed="true"] {
  background: rgba(255, 198, 39, 0.15);
}

/* ------------------------------------------------------------------ */
/* Loading skeletons — shimmer placeholders during cold-boot data fetch */
/* ------------------------------------------------------------------ */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-card {
  min-height: 120px;
  width: 100%;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-line:last-child {
  width: 60%;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------------------------------------------------------------- */
/* Offline banner — fixed top-of-page warning when navigator.onLine */
/* is false. Hidden by default; revealed via JS class toggle.       */
/* ---------------------------------------------------------------- */

.offline-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: var(--asu-black);
  color: var(--asu-gold);
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.offline-banner.is-visible {
  display: block;
}

/* ---------------------------------------------------------------- */
/* Screen-reader-only — visually hidden, announced by assistive tech */
/* ---------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- */
/* Stop button — red-tinted ghost button next to Copy in stream hdr */
/* ---------------------------------------------------------------- */
.prompt-stream-stop {
  color: #d32f2f;
}
.prompt-stream-stop:hover {
  background: rgba(211, 47, 47, 0.12);
}

/* ---------------------------------------------------------------- */
/* Thinking dot — pulsing while orchestrator classifies/dispatches  */
/* ---------------------------------------------------------------- */
.prompt-stream-dot[data-state="thinking"] {
  animation: prompt-stream-dot-pulse 0.8s ease-in-out infinite;
}
@keyframes prompt-stream-dot-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

/* ---------------------------------------------------------------- */
/* Focus ring — custom gold outline replacing browser default        */
/* ---------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--asu-gold);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- */
/* Reduced-motion — disable all animations for accessibility         */
/* ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------- */
/* Keyboard shortcut hint — subtle footer below the prompt area      */
/* ---------------------------------------------------------------- */
.prompt-shortcut-hint {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  padding: 8px 0 0 0;
  user-select: none;
}
.prompt-shortcut-hint kbd {
  font-family: inherit;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 1px 5px;
}

/* ---------------------------------------------------------------- */
/* Stream step indicator — 3 phases that light up as run progresses  */
/* ---------------------------------------------------------------- */
.prompt-stream-steps {
  display: flex;
  gap: 0;
  list-style: none;
  padding: 4px 12px 8px 12px;
  margin: 0;
  font-size: 11px;
  color: rgba(255,255,255,0.20);
}
.prompt-stream-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.prompt-stream-step::after {
  content: "→";
  position: absolute;
  right: -6px;
  color: inherit;
}
.prompt-stream-step:last-child::after { content: none; }
.prompt-stream-step[data-active] {
  color: var(--asu-gold);
  font-weight: 500;
}
.prompt-stream-step[data-done] {
  color: rgba(255,255,255,0.35);
}

/* ---------------------------------------------------------------- */
/* Completion pulse — gold border flash on stream panel when done    */
/* ---------------------------------------------------------------- */
@keyframes stream-complete-pulse {
  0%   { border-color: var(--asu-gold); }
  50%  { border-color: rgba(201, 151, 0, 0.3); }
  100% { border-color: transparent; }
}
.prompt-stream[data-complete-pulse] {
  animation: stream-complete-pulse 0.6s ease-out;
  border: 1px solid transparent;
}

/* ---------------------------------------------------------------- */
/* Welcome card — first-visit onboarding above the prompt            */
/* ---------------------------------------------------------------- */
/* PR-UI-FIXES — was a hardcoded #1e1e1e dark slab that clashed with the
   light theme. Re-tokenised onto the shared card surface; the gold left
   edge stays as the semantic "onboarding" accent. */
.welcome-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-left: 3px solid var(--asu-gold);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px 20px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}
.welcome-card strong {
  color: var(--ink);
}
.welcome-card em {
  color: var(--asu-gold-dark);
  font-style: normal;
}
.welcome-card .welcome-close {
  float: right;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
}

/* ---------------------------------------------------------------- */
/* Confirmation dialog — minimal native <dialog> styling             */
/* ---------------------------------------------------------------- */
.confirm-dialog {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 20px 24px;
  color: #fff;
  max-width: 360px;
}
.confirm-dialog::backdrop {
  background: rgba(0,0,0,0.6);
}
.confirm-dialog p {
  margin: 0 0 16px 0;
  font-size: 14px;
}
.confirm-dialog .confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.confirm-dialog .confirm-actions button {
  padding: 6px 16px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}
.confirm-dialog .confirm-actions .confirm-danger {
  background: rgba(211,47,47,0.15);
  border-color: rgba(211,47,47,0.3);
  color: #d32f2f;
}

/* ---------------------------------------------------------------- */
/* Thread mode toggle — subtle indicator in the prompt area          */
/* ---------------------------------------------------------------- */
.thread-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: none;
}
.thread-toggle[aria-pressed="true"] {
  color: var(--asu-gold);
  border-color: rgba(201,151,0,0.25);
  background: rgba(201,151,0,0.06);
}

/* ---------------------------------------------------------------- */
/* Run history — date group headers                                  */
/* ---------------------------------------------------------------- */
.run-history-date-group {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  padding: 8px 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.run-history-date-group:first-child {
  padding-top: 0;
}

/* ---------------------------------------------------------------- */
/* Agent selector — thin row of chips above the prompt               */
/* ---------------------------------------------------------------- */
.agent-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.agent-selector-chip {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.82);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.agent-selector-chip:hover {
  border-color: rgba(201,151,0,0.5);
  color: #fff;
}
.agent-selector-chip[aria-pressed="true"] {
  background: rgba(201,151,0,0.12);
  border-color: rgba(201,151,0,0.35);
  color: var(--asu-gold);
}

/* ---------------------------------------------------------------- */
/* Progressive disclosure — cards hidden before first run             */
/* ---------------------------------------------------------------- */
.prompt-stage.is-first-visit .card-section {
  opacity: 0.4;
  pointer-events: none;
}
.prompt-stage:not(.is-first-visit) .card-section {
  opacity: 1;
  pointer-events: auto;
}

/* ---------------------------------------------------------------- */
/* Auto-expanding textarea                                           */
/* ---------------------------------------------------------------- */
#quick-prompt-input {
  min-height: 48px;
  max-height: 200px;
  overflow-y: auto;
  resize: none;
}

/* ---------------------------------------------------------------- */
/* Prompt input wrapper — textarea + inline attach button             */
/* ---------------------------------------------------------------- */
.prompt-input-wrapper {
  position: relative;
  display: flex;
  align-items: flex-end;
}
.prompt-input-wrapper textarea {
  flex: 1;
  padding-left: 40px;
}
.prompt-input-attach {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--asu-gold);
  opacity: 0.45;
  cursor: pointer;
  font-size: 16px;
  transition: opacity 0.15s;
  z-index: 1;
}
.prompt-input-attach:hover {
  opacity: 0.9;
  background: rgba(201,151,0,0.1);
}

/* ---------------------------------------------------------------------------
 * Accreditation View (E10) — SACSCOC crosswalk table
 * ------------------------------------------------------------------------- */
.accreditation-view {
  display: grid;
  gap: 16px;
  grid-column: 1 / -1;
}

.accreditation-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.accreditation-table-wrap {
  overflow-x: auto;
}

.accreditation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.accreditation-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  color: var(--ink-muted, #555);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.accreditation-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-subtle, #eee);
  vertical-align: top;
}

.accreditation-table tbody tr:last-child td {
  border-bottom: none;
}

.accreditation-standard-id {
  white-space: nowrap;
  width: 120px;
}

.accreditation-standard-id code {
  font-size: 12px;
  background: var(--bg-muted, #f5f5f5);
  padding: 1px 5px;
  border-radius: 3px;
}

.accreditation-desc {
  display: block;
  color: var(--ink-muted, #666);
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.4;
}

.accreditation-kinds {
  width: 140px;
  font-size: 12px;
  color: var(--ink-muted, #666);
}

.accreditation-count {
  width: 60px;
  text-align: center;
}

.accreditation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
}

.accreditation-badge.has-evidence {
  background: rgba(16, 185, 129, 0.14);
  color: #0b6f4d;
}

.accreditation-badge.no-evidence {
  background: transparent;
  color: var(--ink-muted, #999);
}

/* ---------------------------------------------------------------------------
 * PR-CHAT-LAYOUT — classic chat shape for the workspace card.
 *
 * The conversation transcript sits above the prompt box (which is now
 * pinned at the bottom of the card) and scrolls independently so long
 * conversations never push the composer off-screen. User turns render
 * as right-aligned gold-tinted bubbles; assistant turns reuse the
 * stream-panel surface treatment so archived answers read as the same
 * material as the live panel they were archived from.
 * ------------------------------------------------------------------------- */

.prompt-transcript {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(55vh, 540px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 2px;
  scroll-behavior: smooth;
}

.prompt-transcript[hidden] {
  display: none;
}

/* The live stream panel inherits a 24px top margin from its old slot
 * below the prompt-actions row; inside the transcript the flex gap
 * already provides the separation. */
.prompt-transcript .prompt-stream {
  margin-top: 0;
}

.chat-turn {
  margin: 0;
  min-width: 0;
}

.chat-turn-user {
  align-self: flex-end;
  max-width: min(80%, 560px);
}

.chat-turn-bubble {
  background: color-mix(in srgb, var(--asu-gold) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--asu-gold) 32%, transparent);
  border-radius: 14px 14px 4px 14px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: break-word;
  padding: 10px 14px;
  white-space: pre-wrap;
}

.chat-turn-assistant {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
}

.chat-turn-assistant[data-tone="error"] {
  border-color: color-mix(in srgb, var(--accent-danger, #f04e4e) 55%, transparent);
}

.chat-turn-meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

/* Archived answer bodies — same typography contract as the live
 * .prompt-stream-body: monospace pre-wrap while plain text, restored
 * proportional fonts once markdown elements are hydrated in. */
.chat-turn-body {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  margin: 0;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.chat-turn-body :is(h1, h2, h3, p, ul, li, pre.md-code-block, table.md-table) {
  font-family: var(--font-sans, system-ui, sans-serif);
  white-space: normal;
}

@media (max-width: 520px) {
  .prompt-transcript {
    max-height: 48vh;
  }

  .chat-turn-user {
    max-width: 92%;
  }
}

/* PR-THEME-BUTTON — standalone sun/moon theme toggle in the topbar
 * actions cluster. Builds on .icon-button (40px square, paper bg,
 * 1px line border); bumps the glyph size so ◐ / ☾ / ☀ read at a
 * glance and answers hover/focus with the gold brand cue to match
 * the avatar ring. */
.topbar-theme-button {
  align-items: center;
  border-radius: 50%;
  color: var(--ink);
  display: inline-flex;
  font-size: 18px;
  justify-content: center;
  line-height: 1;
}

.topbar-theme-button:hover,
.topbar-theme-button:focus-visible {
  border-color: var(--asu-gold);
  color: var(--asu-gold);
}

/* PR-TURN-ACTIONS — per-turn response action bar (copy + 👍/👎) under
 * each assistant turn. Compact 28px variant of .icon-button so the row
 * reads as chrome, not content; pressed thumbs keep the gold brand cue. */
.chat-turn-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.chat-turn-action {
  align-items: center;
  display: inline-flex;
  font-size: 13px;
  justify-content: center;
  line-height: 1;
  min-height: 28px;
  width: 28px;
}

.chat-turn-action:hover,
.chat-turn-action:focus-visible {
  border-color: var(--asu-gold);
}

.chat-turn-action[aria-pressed="true"] {
  background: var(--asu-gold);
  border-color: var(--asu-gold);
}

.chat-turn-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* PR-SIDEBAR-S2 — Chats panel search box + per-conversation actions
 * (pin/rename/delete). Actions stay hidden until the row is hovered or
 * focused so the rail reads as a list, not a toolbar; mirrors the
 * .chat-turn-actions hover-chrome idiom. */
.chats-search {
  background: transparent;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.16));
  border-radius: 8px;
  color: inherit;
  font-size: 13px;
  margin: 8px 0;
  padding: 6px 10px;
  width: 100%;
}

.chats-search:focus-visible {
  border-color: var(--asu-gold);
  outline: none;
}

.chats-item-row {
  align-items: center;
  display: flex;
  gap: 4px;
}

.chats-item-row .chats-item {
  flex: 1 1 auto;
  min-width: 0;
}

.chats-item-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.chats-item-row:hover .chats-item-actions,
.chats-item-row:focus-within .chats-item-actions {
  opacity: 1;
}

.chats-item-action {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  min-height: 24px;
  padding: 0;
  width: 24px;
}

.chats-item-action:hover,
.chats-item-action:focus-visible {
  border-color: var(--asu-gold);
}

.chats-item-action[aria-pressed="true"] {
  background: var(--asu-gold);
  border-color: var(--asu-gold);
}

/* PR-SIDEBAR-S3 — inline rename input (mirrors .chats-search field styling)
 * and the collapsible Archived group at the rail bottom. Archived rows read
 * dimmer so the live history stays the visual focus. */
.chats-rename-input {
  background: transparent;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.16));
  border-radius: 8px;
  color: inherit;
  flex: 1 1 auto;
  font-size: 13px;
  min-width: 0;
  padding: 6px 10px;
  width: 100%;
}

.chats-rename-input:focus-visible {
  border-color: var(--asu-gold);
  outline: none;
}

.chats-archived {
  margin-top: 8px;
}

.chats-archived > summary {
  cursor: pointer;
  list-style: revert;
  margin-bottom: 4px;
}

.chats-archived .chats-item {
  opacity: 0.7;
}

/* PR-TURN-ACTIONS-2 — per-turn Sources row: which connectors/tools fed
 * the answer. Chip styling echoes the agent-selector chips but smaller
 * and non-interactive; the label keeps the row scannable. */
.chat-turn-sources {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chat-turn-sources-label {
  color: var(--ink-soft, var(--ink));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-turn-source-chip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  padding: 4px 10px;
}

/* PR-SIDEBAR-S1 — left-column Chats panel ------------------------- */
.chats-panel .chats-new-button {
  width: 100%;
  margin-bottom: 12px;
  text-align: left;
}

.chats-group-label {
  margin: 10px 0 4px;
}

.chats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chats-item {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chats-item:hover,
.chats-item:focus-visible {
  background: rgba(0, 0, 0, 0.06);
}

.chats-item-active {
  background: rgba(255, 199, 44, 0.18); /* gold wash for active chat */
  font-weight: 600;
}

.chats-apps {
  margin-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  padding-top: 4px;
}

html[data-theme="dark"] .chats-item:hover,
html[data-theme="dark"] .chats-item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .chats-item-active {
  background: rgba(255, 199, 44, 0.28);
}

html[data-theme="dark"] .chats-apps {
  border-top-color: rgba(255, 255, 255, 0.12);
}
