/* GENERATED by apps/web/scripts/bundle-page-css.mjs — do not edit.
 * Source: apps/web/public/styles/pages/chat-page.css
 * Flattened from 65 @import'd files into one render-blocking request. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Newsreader:ital,wght@0,200..800;1,200..800&display=swap");

/*
 * Dedicated entrypoint for /chat.
 *
 * Chat reuses the run-chat shell and message/composer primitives, then layers
 * global-chat route layout on top. It does not render run reports, pricing,
 * account dashboard, start-chat, docs, or system map styles.
 */
/*
 * app-base.css — the shared CSS layer every app page composes.
 *
 * Contains only the truly cross-page foundation:
 *   - base/*        (foundation, nav-shell, brand, typography, article)
 *   - tables        (research-table component + variants)
 *   - components/*  (canonical status color map)
 *   - postlude/*    (code, footer, interaction, responsive, motion)
 *
 * Page-specific trees (home, job, runs, entity, topics, discord-agent,
 * global-chat, start-chat) are imported by each page's own entry CSS on top of
 * this base. This guarantees shared components can never diverge between pages.
 */
:root {
  /* Both schemes are available by default; the theme toggle narrows this to a
     single scheme via [data-theme] below. With no explicit choice this stays
     "light dark", so light-dark() tracks the OS preference live (System mode)
     with zero JS. */
  color-scheme: light dark;

  --font-fallback: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-primary: var(--font-inter, var(--font-fallback));
  --font-secondary: var(--font-newsreader, var(--font-fallback));
  --font-code: "SF Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
    Courier, monospace;

  /* ============================================================
     SEMANTIC COLOR TOKENS
     Every themeable color is light-dark(<light>, <dark>). The browser
     resolves it from the element's used color-scheme (inherited from :root),
     so a single token definition serves both themes. Migrate raw hex / rgba
     onto these — never hard-code a themeable color in a leaf file again.
     Dark values are ChatGPT-anchored and WCAG-AA verified (see
     docs/adr/dark-mode-and-token-system-2026-06.md).
     ============================================================ */

  /* Surfaces — page ground up through overlays. Light mode: off-white page,
     white cards sit close to it. Dark mode uses a DIFFERENT philosophy: a TRUE
     BLACK page with components lifted as distinct greys, so cards clearly float
     (depth reads via the lightness ladder since shadows vanish on black). */
  --surface: light-dark(#faf9f6, #000000);
  --surface-raised: light-dark(#ffffff, #1a1a1c);
  --surface-sunken: light-dark(#f8f8f8, #0d0d0f);
  --surface-overlay: light-dark(#ffffff, #242426);
  /* Sent-message (user) chat bubble: a soft grey that floats off the page in
     both themes (charcoal on the black page, warm light-grey on the off-white
     page) — instead of a hard white/ink block. Text uses --ink for contrast. */
  --chat-bubble-user: light-dark(#eeece8, #2c2c2e);
  --surface-scrim: light-dark(rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.62));
  /* Frosted dialog/dock backdrop — a LIGHT blur over the page in light mode,
     a dark dim in dark mode (used with backdrop-filter). Distinct from the pure
     dark scrim above. */
  --surface-backdrop: light-dark(rgba(248, 248, 247, 0.72), rgba(18, 18, 20, 0.6));

  /* Ink — text ladder. MUST be solid (or alpha-on-black in light only); the
     dark values are solid greys, never low-alpha white, so contrast is
     deterministic over any surface. */
  --ink: light-dark(#111111, #ececec);
  --ink-muted: light-dark(rgba(0, 0, 0, 0.56), #b4b4b4);
  --ink-faint: light-dark(rgba(0, 0, 0, 0.4), #8e8e93);
  --ink-inverse: light-dark(#ffffff, #1c1c1e);

  /* Lines / borders. Dark values are intentionally higher-alpha than a literal
     10% hairline: on the true-black ground a 6–10% white line is nearly
     invisible (table rules, tab underlines, list dividers), so they're bumped
     for legibility. */
  --line: light-dark(#efece6, rgba(255, 255, 255, 0.15));
  --line-strong: light-dark(#d9d9d9, rgba(255, 255, 255, 0.24));
  --line-faint: light-dark(#e8e5df, rgba(255, 255, 255, 0.1));

  /* Accent — the real app accent (#1d4ed8), lightened in dark for AA. */
  --accent: light-dark(#1d4ed8, #4d9fff);
  --accent-hover: light-dark(#1640b8, #6cb2ff);
  --accent-ink: light-dark(#ffffff, #0a1220);
  /* Accent tint fill + line — the faint blue "current/running/highlighted"
     callouts (rgba(36,128,237,.045-.07) fills, rgba(29,78,216,.16-.22) borders). */
  --accent-tint: light-dark(rgba(36, 128, 237, 0.07), rgba(77, 159, 255, 0.16));
  --accent-line: light-dark(rgba(29, 78, 216, 0.2), rgba(77, 159, 255, 0.34));
  /* Info / queued — indigo status, distinct from the link accent. */
  --info: light-dark(#4f46e5, #8b87f0);

  /* State — success / danger / warning. Each: base + tint fill + line. */
  --success: light-dark(#65c466, #3fcf5f);
  --success-tint: light-dark(rgba(101, 196, 102, 0.13), rgba(63, 207, 95, 0.16));
  --success-line: light-dark(rgba(101, 196, 102, 0.45), rgba(63, 207, 95, 0.42));
  --danger: light-dark(#ea3223, #ff6257);
  --danger-hover: light-dark(#d42c20, #ff7a70);
  --danger-tint: light-dark(rgba(234, 50, 35, 0.07), rgba(255, 98, 87, 0.14));
  --danger-line: light-dark(rgba(234, 50, 35, 0.22), rgba(255, 98, 87, 0.34));
  --warning: light-dark(#b45309, #f5b942);
  --warning-tint: light-dark(rgba(180, 83, 9, 0.1), rgba(245, 185, 66, 0.14));
  --warning-line: light-dark(rgba(180, 83, 9, 0.3), rgba(245, 185, 66, 0.34));
  /* Text/icon on a SOLID --warning fill (white in light; dark in dark, since the
     dark warning is a light amber). */
  --warning-ink: light-dark(#ffffff, #2a1500);

  /* Interaction overlays — black wash in light, white wash in dark. light-dark()
     does the black->white flip for free; consumers just use the token. */
  --hover-bg: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.055));
  --active-bg: light-dark(rgba(0, 0, 0, 0.07), rgba(255, 255, 255, 0.09));
  --selected-bg: light-dark(rgba(29, 78, 216, 0.08), rgba(77, 159, 255, 0.16));

  /* Focus + selection */
  --focus-ring: light-dark(rgba(0, 122, 255, 0.5), rgba(108, 178, 255, 0.6));
  --selection-bg: light-dark(#e8e5df, rgba(77, 159, 255, 0.3));
  --selection-color: light-dark(#111111, #ffffff);

  /* Elevation — geometry is constant; only the shadow color flips per theme.
     Dark shadows are much heavier (a soft black shadow is invisible on dark). */
  --shadow-color-weak: light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.45));
  --shadow-color: light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.55));
  --shadow-color-strong: light-dark(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.7));
  --shadow-sm: 0 1px 2px var(--shadow-color-weak);
  --shadow-md: 0 12px 32px var(--shadow-color);
  --shadow-lg: 0 24px 64px -18px var(--shadow-color-strong),
    0 2px 8px var(--shadow-color-weak);

  /* ---- Back-compat aliases: old token names → new semantic tokens. Keeps
     existing consumers working (and themed) during/after the leaf migration.
     Light values are preserved exactly; only the alias target changed. ---- */
  --body-color: var(--ink);
  --heading-color: var(--ink);
  --body-bg: var(--surface);
  --muted: light-dark(rgba(0, 0, 0, 0.4), #b4b4b4);
  --link-color: var(--accent);
  --soft-line: var(--line-faint);
  --focus-color: var(--focus-ring);
  --success-color: var(--success);
  --danger-color: var(--danger);
  --danger-color-hover: var(--danger-hover);
  --danger-soft-tint: var(--danger-tint);
  --danger-soft-line: var(--danger-line);

  /* Warm-surface pilot RETIRED into the neutral cool scale (one system, themes
     to dark for free). These four are kept as permanent neutral aliases so the
     ~40 var(--warm-*) consumers stay terse and themed — do NOT reintroduce warm
     values here. New code should prefer the canonical --surface-*/--line/--ink. */
  --warm-surface: var(--surface);
  --warm-panel: var(--surface-raised);
  --warm-line: var(--line);
  --warm-ink: var(--ink);

  --researcher-page-width: 64rem;

  /* Motion language (shared so surfaces don't re-derive easings/durations).
     --ease-drawer is the iOS/Vaul "settle" curve; --ease-out-soft is a
     standard decelerate used for entrances and micro-interactions. */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out-soft: cubic-bezier(0, 0, 0.2, 1);
  --dur-panel: 320ms;
  --dur-drawer: 360ms;
  --dur-sheet: 380ms;
  --dur-entrance: 300ms;
  --dur-micro: 150ms;
  --stagger-step: 50ms;
}

/* Theme override: the toggle sets data-theme on <html>; that narrows
   color-scheme to a single scheme, which flips every light-dark() token.
   "system" (or no attribute) leaves both schemes active = follow the OS. */
:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

:root[data-theme="system"] {
  color-scheme: light dark;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  animation-name: researcher-page-out;
}

::view-transition-new(root) {
  animation-name: researcher-page-in;
}

::view-transition-old(researcher-chat-composer),
::view-transition-new(researcher-chat-composer) {
  animation-duration: 210ms;
  animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes researcher-page-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(0, -0.25rem, 0) scale(0.998);
  }
}

@keyframes researcher-page-in {
  from {
    opacity: 0;
    transform: translate3d(0, 0.45rem, 0) scale(0.998);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--body-bg);
  color: var(--body-color);
  scroll-behavior: smooth;
  scroll-padding-top: 5.25rem;
  overflow-anchor: none;
}

html,
html body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-y: scroll;
  background: var(--body-bg);
  color: var(--body-color);
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.25rem;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  text-size-adjust: none;
  backface-visibility: hidden;
}

[hidden] {
  display: none !important;
}

main {
  width: 100%;
  margin: 0 auto;
  padding: 5rem 1rem 2.5rem;
}

@media screen and (max-width: 768px) {
  main {
    padding: 2rem 1.5rem 2.5rem;
  }
}

article {
  max-width: none;
}

.site-nav {
  display: grid;
  grid-template-columns: auto 1fr repeat(4, auto);
  align-items: center;
  gap: 0.875rem;
  /* Clear the iOS notch on pages that opt into edge-to-edge (viewport-fit=cover,
     e.g. the entity/job chat surfaces). Resolves to 0 everywhere else, so this
     is a no-op on pages without viewport-fit=cover. */
  padding-top: env(safe-area-inset-top);
  padding-bottom: 2.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 460;
  line-height: 1.25rem;
  letter-spacing: -0.0025rem;
}

/* Account avatar dropdown — bundles the create actions (New run, New topic),
   Pricing, Docs, a collapsible theme chooser, and Log out. The container is the
   grid cell; the menu is absolutely positioned beneath the avatar. */
.site-nav-account {
  position: relative;
}

.site-nav-account-login {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav-account-login:hover {
  color: var(--ink);
}

.site-nav-account-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 40;
  min-width: 15rem;
  display: flex;
  flex-direction: column;
  padding: 0.375rem;
  border: 1px solid var(--soft-line);
  border-radius: 0.625rem;
  background: var(--warm-panel);
  box-shadow:
    0 0.5rem 1.5rem var(--shadow-color),
    0 0.0625rem 0.125rem var(--shadow-color-weak);
}

.site-nav-account-menu[hidden] {
  display: none;
}

.site-nav-account-menu-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.4375rem 0.625rem;
  border: 0;
  border-radius: 0.4375rem;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 0.12s ease,
    background-color 0.12s ease;
}

.site-nav-account-menu-item:hover {
  color: var(--ink);
  background: var(--hover-bg);
}

.site-nav-account-trigger:focus-visible,
.site-nav-account-menu-item:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

/* Coarse pointers (touch) — keep the tappable rows at the ~44px minimum. */
@media (pointer: coarse) {
  .site-nav-account-menu-item {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
  }
}

.site-nav-account-menu-divider {
  height: 1px;
  margin: 0.3125rem 0.375rem;
  background: var(--soft-line);
}

.site-nav-account-menu-logout {
  color: var(--danger);
}

.site-nav-account-menu-logout:hover {
  color: var(--danger);
  background: var(--danger-tint);
}

/* Create group — the primary "New run" / "New topic" actions at the top of the
   menu. Emphasized (ink, not muted) so they read as the main reason to open it. */
.site-nav-account-menu-group {
  display: flex;
  flex-direction: column;
}

.site-nav-account-menu-create {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 500;
}

.site-nav-account-menu-icon {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  color: var(--ink-muted);
  transition: color 0.12s ease;
}

.site-nav-account-menu-icon svg {
  width: 0.875rem;
  height: 0.875rem;
}

.site-nav-account-menu-create:hover .site-nav-account-menu-icon {
  color: var(--ink);
}

/* Theme chooser as a collapsible secondary row, not an always-open block. */
.site-nav-account-theme {
  display: flex;
  flex-direction: column;
}

.site-nav-account-theme-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-nav-account-theme-icon,
.site-nav-account-theme-chevron {
  display: inline-grid;
  place-items: center;
  color: currentColor;
}

.site-nav-account-theme-icon {
  width: 1rem;
  height: 1rem;
}

.site-nav-account-theme-icon svg {
  width: 1rem;
  height: 1rem;
}

.site-nav-account-theme-value {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.65;
}

.site-nav-account-theme-chevron {
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.65;
  transition: transform 0.15s ease;
}

.site-nav-account-theme-chevron svg {
  width: 0.875rem;
  height: 0.875rem;
}

.site-nav-account-theme.is-open .site-nav-account-theme-chevron {
  transform: rotate(180deg);
}

.site-nav-account-theme-panel {
  padding-top: 0.125rem;
  /* Entrance paired with the chevron rotation so the reveal feels deliberate
     rather than a snap while the chevron animates. */
  animation: site-nav-theme-panel-in 0.15s ease;
}

.site-nav-account-theme-panel[hidden] {
  display: none;
}

@keyframes site-nav-theme-panel-in {
  from {
    opacity: 0;
    transform: translateY(-0.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respect reduced-motion: no chevron spin, item transitions, or panel reveal. */
@media (prefers-reduced-motion: reduce) {
  .site-nav-account-menu-item,
  .site-nav-account-menu-icon,
  .site-nav-account-trigger,
  .site-nav-account-theme-chevron {
    transition: none;
  }

  .site-nav-account-theme.is-open .site-nav-account-theme-chevron {
    transform: none;
  }

  .site-nav-account-theme-panel {
    animation: none;
  }
}

.legal-page main {
  width: min(100%, 42rem);
}

/* Theme chooser — a System / Light / Dark segmented control that lives inside
   the account dropdown menu (rendered by shared/site-nav-account.js, built by
   shared/theme.js). Styled entirely from semantic tokens so it themes itself.
   Revealed by the collapsible "Theme" row in the account menu. */

.theme-control {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
}

.theme-control-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.4375rem 0.5625rem;
  border: 0;
  border-radius: 0.4375rem;
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.1;
  text-align: left;
  cursor: pointer;
  transition:
    color 0.12s ease,
    background-color 0.12s ease;
}

.theme-control-option:hover {
  color: var(--ink);
  background: var(--hover-bg);
}

.theme-control-option:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: -1px;
}

@media (prefers-reduced-motion: reduce) {
  .theme-control-option {
    transition: none;
  }
}

.theme-control-option.is-active {
  color: var(--ink);
  background: var(--selected-bg);
}

.theme-control-icon {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  color: currentColor;
}

.theme-control-icon svg {
  width: 1rem;
  height: 1rem;
}

.theme-control-label {
  margin-right: auto;
}

.theme-control-option.is-active::after {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  margin-left: 0.5rem;
  background: currentColor;
  -webkit-mask: var(--theme-check) center / contain no-repeat;
  mask: var(--theme-check) center / contain no-repeat;
}

:root {
  --theme-check: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5l4.5 4.5L19 7"/></svg>');
}

.brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 1.5rem;
  height: 1.5rem;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav-account.has-avatar {
  display: inline-flex;
  align-items: center;
}

.site-nav-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
}

.site-nav-account-trigger:hover,
.site-nav-account[data-open="true"] .site-nav-account-trigger {
  color: var(--ink);
}

.site-nav-balance {
  font-variant-numeric: tabular-nums;
  font-weight: 480;
}

.site-nav-avatar {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-inverse);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.brand-mark {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  border-radius: 999px;
}

.brand-footer {
  padding: 1rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.brand-footer a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 450;
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
}

.brand-footer a:hover {
  color: var(--heading-color);
}

.brand-footer-logo {
  display: inline-block;
  width: 0.875em;
  height: 0.875em;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.brand-footer a:hover .brand-footer-logo {
  opacity: 0.7;
}

blockquote,
dd,
dl,
dt,
fieldset,
figure,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
html,
iframe,
legend,
li,
ol,
p,
pre,
textarea,
ul {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--heading-color);
  position: relative;
  display: flex;
  text-wrap: balance;
  -webkit-text-stroke: 0.001px transparent;
  font-weight: 400;
  line-height: normal;
  letter-spacing: 0;
}

h1 {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.00813rem;
}

h2,
h3 {
  font-size: 0.875rem;
  font-weight: 560;
  letter-spacing: -0.00563rem;
}

h3 {
  font-weight: 500;
}

p,
li,
dl {
  font-size: 0.875rem;
  font-weight: 460;
  line-height: 1.25rem;
  letter-spacing: -0.00563rem;
}

p strong,
li strong,
dl strong {
  font-weight: 600;
}

time {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 460;
  line-height: 1.25rem;
  letter-spacing: -0.00563rem;
}

a {
  color: inherit;
  text-decoration: none;
}

.basic-link,
.nav a {
  position: relative;
  display: inline;
  color: inherit;
  font-weight: inherit;
  line-height: inherit;
  transition: all 0.2s ease;
}

.basic-link::before,
.nav a::before {
  pointer-events: none;
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  border-radius: 2px;
  background: var(--line-strong);
  opacity: 1;
  transition: inherit;
}

.basic-link:hover::before,
.nav a:hover::before {
  background: var(--ink-faint);
}

.basic-link:focus-visible,
.nav a:focus-visible {
  border-radius: 2px;
  padding: 0 2px;
  margin: 0 -2px;
  transition: none;
  outline: 2px solid var(--focus-color);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding-top: 1rem;
}

hr {
  border: 0;
  display: block;
  width: 3.125rem;
  height: 1px;
  background: var(--soft-line);
  margin: 2.5rem 0 2rem;
}

.shell {
  width: min(100%, 70ch);
  max-width: none;
  margin-inline: auto;
}

header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0 0.5rem;
}

header h1 {
  color: var(--ink);
  font-weight: 500;
}

header h1,
header time {
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: -0.00563rem;
}

.lede {
  color: var(--muted);
}

article > p,
article > p + h1 {
  padding-top: 1rem;
}

article > p + h2 {
  padding-top: 2.25rem;
}

article > p + h3,
article > p + h4,
article > p + h5,
article > p + h6 {
  padding-top: 1rem;
}

article h1 + ol,
article h1 + ul,
article h2 + ol,
article h2 + ul,
article h3 + ol,
article h3 + ul,
article h4 + ol,
article h4 + ul,
article h5 + ol,
article h5 + ul,
article h6 + ol,
article h6 + ul {
  padding-top: 1.5rem;
}

article > section {
  padding-top: 2.25rem;
}

article > section > p + p {
  padding-top: 0.5rem;
}

.research-table-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding-top: 0.875rem;
}

.research-table {
  width: 100%;
  max-width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  font-size: 0.8125rem;
  table-layout: fixed;
}

.research-table thead tr th {
  padding: 0.375rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.15rem;
  letter-spacing: -0.00563rem;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-table thead tr th:first-child {
  padding-left: 0;
}

.research-table thead tr th:last-child {
  padding-right: 0;
}

.research-table tbody {
  color: var(--ink-faint);
}

.research-table tbody tr {
  transition:
    background-color 90ms ease,
    opacity 90ms ease;
}

.research-table tbody tr.is-entering {
  animation: research-row-enter 140ms cubic-bezier(0.215, 0.61, 0.355, 1);
  animation-delay: var(--research-row-enter-delay, 0ms);
  animation-fill-mode: both;
}

@media (hover: hover) and (pointer: fine) {
  .research-table tbody:hover tr {
    opacity: 0.48;
  }

  .research-table tbody tr:hover {
    opacity: 1;
  }
}

.research-table tbody tr.is-clickable {
  cursor: pointer;
}

.research-table tbody tr.is-clickable:active {
  background: var(--hover-bg);
}

.research-table tbody tr td {
  padding: 0.375rem 0.75rem;
  border-bottom: 1px solid var(--line);
  font-weight: 460;
  line-height: 1.15rem;
  letter-spacing: -0.00563rem;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.research-table tbody tr td:first-child {
  padding-left: 0;
  color: var(--ink);
}

@keyframes research-row-enter {
  0% {
    opacity: 0;
    transform: translateY(0.2rem);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .research-table tbody tr.is-entering {
    animation: none;
  }
}

.research-table tbody tr td:last-child {
  padding-right: 0;
}

.research-table-empty {
  color: var(--muted);
  white-space: normal;
}

.research-markdown-table-wrapper {
  margin: 0.75rem 0 1rem;
  padding-top: 0;
}

.research-markdown-table {
  table-layout: auto;
}

.research-markdown-table tbody,
.research-markdown-table tbody tr td {
  color: var(--ink);
}

.research-markdown-table-wide {
  table-layout: fixed;
}

.research-markdown-table-wide thead tr th,
.research-markdown-table-wide tbody tr td {
  min-width: 11rem;
}

.research-markdown-table-wide thead tr th:first-child,
.research-markdown-table-wide tbody tr td:first-child {
  min-width: 13rem;
}

.research-markdown-table tbody tr td {
  white-space: normal;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}

.research-markdown-table tbody tr td:first-child {
  width: auto;
}

@media screen and (max-width: 640px) {
  .research-markdown-table-stack.research-markdown-table {
    display: block;
    width: 100%;
    border: 0;
  }

  .research-markdown-table-stack thead {
    display: none;
  }

  .research-markdown-table-stack tbody,
  .research-markdown-table-stack tbody tr {
    display: block;
    width: 100%;
  }

  .research-markdown-table-stack tbody tr {
    padding: 0.875rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 0;
  }

  .research-markdown-table-stack tbody tr:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .research-markdown-table-stack tbody tr:last-child {
    padding-bottom: 0;
  }

  .research-markdown-table-stack tbody tr td {
    display: block;
    padding: 0;
    border-bottom: 0;
    max-width: none;
    width: 100%;
  }

  .research-markdown-table-stack tbody tr td:first-child {
    color: var(--ink);
    font-weight: 560;
    font-size: 0.9375rem;
    line-height: 1.25rem;
    letter-spacing: -0.00813rem;
    margin-bottom: 0.5rem;
    padding: 0;
  }

  .research-markdown-table-stack tbody tr td:not(:first-child) {
    margin-top: 0.625rem;
  }

  .research-markdown-table-stack tbody tr td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--ink-faint);
    font-size: 0.75rem;
    font-weight: 460;
    line-height: 1rem;
    letter-spacing: -0.0025rem;
    margin-bottom: 0.25rem;
  }

  .research-markdown-table-wrapper:has(.research-markdown-table-stack) {
    overflow-x: visible;
    padding-top: 0.5rem;
  }
}

@media screen and (max-width: 680px) {
  .research-table-wrapper {
    padding-top: 0.75rem;
  }
}

.research-table-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  padding-top: 0.875rem;
}

.research-table-filters[hidden] {
  display: none;
}

.research-table-filter {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-faint);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 480;
  line-height: 1.15rem;
  letter-spacing: -0.00563rem;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.research-table-filter:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.research-table-filter.is-active {
  color: var(--ink);
  border-color: var(--line-strong);
  font-weight: 560;
}

.research-table-filter-count {
  color: var(--ink-faint);
  font-size: 0.75rem;
  font-weight: 460;
  font-variant-numeric: tabular-nums;
}

.research-table-filter.is-active .research-table-filter-count {
  color: var(--ink-faint);
}

.research-table-filters + .research-table-wrapper {
  padding-top: 0.625rem;
}

/*
 * Shared column-width + cell rules for the named research-table variants.
 * Moved here from account/styles/usage.css so the table component lives with
 * its base definition and every page that renders these tables (dashboard,
 * account, server-rendered /runs) stays in sync.
 */
.research-table-usage th:nth-child(1),
.research-table-usage td:nth-child(1) {
  width: 43%;
}

.research-table-usage th:nth-child(2),
.research-table-usage td:nth-child(2),
.research-table-usage th:nth-child(3),
.research-table-usage td:nth-child(3) {
  width: 10%;
}

.research-table-usage th:nth-child(4),
.research-table-usage td:nth-child(4) {
  width: 27%;
}

.research-table-usage th:nth-child(5),
.research-table-usage td:nth-child(5) {
  width: 10%;
}

.research-table-topics th:nth-child(1),
.research-table-topics td:nth-child(1) {
  width: 52%;
}

.research-table-topics th:nth-child(2),
.research-table-topics td:nth-child(2),
.research-table-topics th:nth-child(3),
.research-table-topics td:nth-child(3),
.research-table-topics th:nth-child(4),
.research-table-topics td:nth-child(4) {
  width: 16%;
}

.research-table-entities th:nth-child(1),
.research-table-entities td:nth-child(1) {
  width: 52%;
}

.research-table-entities th:nth-child(2),
.research-table-entities td:nth-child(2),
.research-table-entities th:nth-child(3),
.research-table-entities td:nth-child(3),
.research-table-entities th:nth-child(4),
.research-table-entities td:nth-child(4) {
  width: 16%;
}

.home-entity-cell {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.home-entity-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-sunken);
}

.home-entity-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-faint);
}

.research-table-usage-admin {
  min-width: 74rem;
}

.research-table-usage-admin th:nth-child(1),
.research-table-usage-admin td:nth-child(1) {
  width: 24%;
}

.research-table-usage-admin th:nth-child(2),
.research-table-usage-admin td:nth-child(2) {
  width: 15%;
}

.research-table-usage-admin th:nth-child(3),
.research-table-usage-admin td:nth-child(3),
.research-table-usage-admin th:nth-child(4),
.research-table-usage-admin td:nth-child(4),
.research-table-usage-admin th:nth-child(5),
.research-table-usage-admin td:nth-child(5),
.research-table-usage-admin th:nth-child(6),
.research-table-usage-admin td:nth-child(6),
.research-table-usage-admin th:nth-child(7),
.research-table-usage-admin td:nth-child(7),
.research-table-usage-admin th:nth-child(8),
.research-table-usage-admin td:nth-child(8),
.research-table-usage-admin th:nth-child(9),
.research-table-usage-admin td:nth-child(9) {
  width: 7%;
}

.research-table-usage-admin th:nth-child(10),
.research-table-usage-admin td:nth-child(10) {
  width: 17%;
}

.research-table-usage tbody tr td {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.research-table-skeleton-row td {
  height: 2.5rem;
}

/*
 * Canonical run/topic status color map.
 *
 * Three class families consume the same logical states (succeeded, running,
 * queued, paused, failed/cancelled, ...). They are kept as separate classes
 * because different JS surfaces emit different prefixes, but their colors are
 * defined together here so they can never drift:
 *
 *   .status-text-*   — inline status text in run/runs tables (research-table)
 *   .account-status-* — account/dashboard status text + topic states
 *
 * The .status-pill / .status-<state> pill variants (background + border + color)
 * live with the pill layout in /styles/job/status-message.css.
 */

/* --- Inline status text (run tables, server-rendered /runs) --- */
.status-text-succeeded {
  color: var(--success-color);
}

.status-text-running {
  color: var(--accent);
  animation: job-running-pill 2.2s ease-in-out infinite;
}

.status-text-queued {
  color: var(--info);
}

.status-text-paused {
  color: var(--warning);
}

.status-text-failed,
.status-text-cancelled,
.status-text-canceled {
  color: var(--danger-color);
}

/* --- Account / dashboard status text + topic lifecycle states --- */
.account-status {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink-faint);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-status-succeeded {
  color: var(--success);
}

.account-status-running {
  color: var(--accent);
  animation: account-running-status 1.7s ease-in-out infinite;
}

.account-status-queued {
  color: var(--info);
}

.account-status-paused {
  color: var(--warning);
}

.account-status-failed,
.account-status-canceled,
.account-status-cancelled {
  color: var(--danger-color);
}

/* Topic statuses — paused/archived fall through to the muted base color. */
.account-status-active {
  color: var(--success);
}

.account-status-bootstrapping {
  color: var(--accent);
  animation: account-running-status 1.7s ease-in-out infinite;
}

.account-status-bootstrap-failed {
  color: var(--danger-color);
}

@keyframes account-running-status {
  0%,
  100% {
    opacity: 0.62;
  }
  50% {
    opacity: 1;
  }
}

code {
  position: relative;
  display: inline-block;
  font-family: var(--font-code);
  font-size: 0.9em;
  line-height: 1;
  color: var(--ink);
  padding: 0.1rem 0.2rem;
}

code::before {
  pointer-events: none;
  content: "";
  position: absolute;
  transform: translateY(-1px);
  inset: -0.1em 0;
  border-radius: 0.25rem;
  background: var(--surface-sunken);
  z-index: -1;
}

pre code {
  display: block;
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

pre code::before {
  display: none;
}

ul,
ol {
  list-style: none;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding-top: 2rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 460;
  letter-spacing: -0.0025rem;
  line-height: 1.25rem;
}

.footer a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.footer a::before {
  pointer-events: none;
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  border-radius: 2px;
  background: var(--line-strong);
  transition: background 0.18s ease, transform 0.18s ease;
}

.footer a:hover {
  color: var(--ink);
}

.footer a:hover::before {
  background: var(--line-strong);
  transform: translateY(-0.5px);
}

.footer-commit {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0;
  color: var(--muted);
}

site-footer {
  display: block;
}

::selection {
  color: var(--selection-color);
  background: var(--selection-bg);
}

::-moz-selection {
  color: var(--selection-color);
  background: var(--selection-bg);
}

:focus-visible {
  outline: 2px solid var(--focus-color);
}

@media screen and (max-width: 520px) {
  dl {
    grid-template-columns: 1fr;
  }

  .harness-node text {
    font-size: 15px;
  }
}

@media screen and (max-width: 900px) {
  .job-page main {
    width: min(100%, var(--researcher-page-width, 64rem));
  }
}

@media screen and (max-width: 680px) {
body.job-page {
  overflow-x: clip;
}

.job-page main {
  width: 100%;
  padding: 1.5rem 1rem 2rem;
  overflow-x: clip;
}

.job-page .site-nav {
  gap: 0.75rem;
  padding-bottom: 1.75rem;
}

/* Raised to `.job-page .job-header` (0,2,0) so this mobile column layout
   beats the base `.job-header { flex-direction: row }` in runs/job-shell.css,
   which is imported later in the cascade and would otherwise win at equal
   specificity — collapsing the title row to width 0 (one char per line). */
.job-page .job-header {
  flex-direction: column;
  gap: 0.75rem;
}

.job-heading,
.job-title-row,
.job-title-copy {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.job-title-copy {
  flex: 1 1 auto;
}

.job-heading h1 {
  max-width: 100%;
  font-size: 1.0625rem;
  line-height: 1.375rem;
  letter-spacing: -0.015rem;
  text-wrap: pretty;
}

.job-kicker {
  max-width: 100%;
  font-size: 0.8125rem;
  line-height: 1.125rem;
}

.job-parent-run-inline {
  max-width: 100%;
}

.job-parent-run-inline .job-parent-run-link {
  flex: 1 1 auto;
  max-width: 100%;
}

.job-header-actions {
  width: 100%;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.status-pill-has-detail::after {
  left: 0;
  right: auto;
  width: min(20rem, calc(100vw - 2rem));
}

.job-progress {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.job-progress ol {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem 0.75rem;
}

}

@media screen and (max-width: 680px) {
.job-summary {
  grid-template-columns: 1fr;
  margin-top: 0.75rem;
}

.job-summary > div,
.job-summary > div:nth-child(4n),
.job-summary > div:nth-child(2n) {
  border-right: 0;
}

.job-summary > div,
.job-summary > div:nth-last-child(-n + 4) {
  border-bottom: 1px solid var(--soft-line);
}

.job-summary > div:last-child,
.job-summary > div:nth-last-child(-n + 2):last-child {
  border-bottom: 0;
}

.job-summary p:not(.job-label) {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.job-event-actions {
  justify-content: flex-start;
}

.job-dialog-actions {
  justify-content: stretch;
}

.job-dialog-button {
  width: 100%;
}

.job-primary-tabs,
.job-tabbar {
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.job-primary-tabs::-webkit-scrollbar,
.job-tabbar::-webkit-scrollbar {
  display: none;
}

.job-primary-tab,
.job-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

.job-view {
  gap: 1.25rem;
  padding-top: 1.25rem;
}

.job-section,
.job-storage-group {
  gap: 0.625rem;
}

.job-section-heading,
.job-report-heading {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.625rem;
}

.job-report-title-block {
  gap: 0.5rem;
}

.job-report-title-block h2 {
  max-width: none;
  font-size: 1rem;
  line-height: 1.35rem;
  letter-spacing: -0.014rem;
  text-wrap: pretty;
}

.job-brief-actions {
  gap: 0.5rem;
  padding-top: 0;
}

}

@media screen and (max-width: 680px) {
.job-dialog {
  width: calc(100vw - 1rem);
}

.job-dialog-header,
.job-dialog-content {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.job-brief h3 {
  margin: 2rem 0 0.625rem;
}

.job-brief p,
.job-brief li {
  font-size: 0.8125rem;
  line-height: 1.3125rem;
}

.job-brief ul,
.job-brief ol {
  padding-left: 1.125rem;
}

}

@media screen and (max-width: 680px) {
.job-page .research-table-wrapper,
.job-page .research-markdown-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: visible;
  padding-top: 0.25rem;
}

.job-page .research-table,
.job-page .research-markdown-table,
.job-page .research-markdown-table-wide {
  width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.job-page .research-table thead,
.job-page .research-markdown-table thead,
.job-page .research-markdown-table-wide thead {
  display: none;
}

.job-page .research-table tbody,
.job-page .research-markdown-table tbody,
.job-page .research-markdown-table-wide tbody {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.job-page .research-table tbody tr,
.job-page .research-markdown-table tbody tr,
.job-page .research-markdown-table-wide tbody tr {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.job-page .research-table tbody tr:first-child,
.job-page .research-markdown-table tbody tr:first-child,
.job-page .research-markdown-table-wide tbody tr:first-child {
  border-top: 0;
}

.job-page .research-table tbody:hover tr,
.job-page .research-markdown-table tbody:hover tr,
.job-page .research-markdown-table-wide tbody:hover tr {
  opacity: 1;
}

.job-page .research-table tbody tr td,
.job-page .research-markdown-table tbody tr td,
.job-page .research-markdown-table-wide tbody tr td {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 0;
  border-bottom: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  vertical-align: top;
}

.job-page .research-table tbody tr td:first-child,
.job-page .research-table tbody tr td:last-child,
.job-page .research-markdown-table tbody tr td:first-child,
.job-page .research-markdown-table tbody tr td:last-child,
.job-page .research-markdown-table-wide tbody tr td:first-child,
.job-page .research-markdown-table-wide tbody tr td:last-child {
  padding-left: 0;
  padding-right: 0;
}

.job-page .research-table tbody tr td[data-label]:not([colspan]),
.job-page .research-markdown-table tbody tr td[data-label]:not([colspan]),
.job-page .research-markdown-table-wide tbody tr td[data-label]:not([colspan]) {
  display: grid;
  grid-template-columns: minmax(0, 5.75rem) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.job-page .research-table tbody tr td[data-label]:not([colspan])::before,
.job-page .research-markdown-table tbody tr td[data-label]:not([colspan])::before,
.job-page .research-markdown-table-wide tbody tr td[data-label]:not([colspan])::before {
  content: attr(data-label);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 0.9375rem;
  letter-spacing: 0;
}

.job-page .research-table-empty {
  padding: 0.125rem 0 0;
}

.job-page .research-table td a {
  max-width: 100%;
}

/* ── List tables (Activity / Sources / Artifacts): compact one-line rows ──
   Overrides the stacked-card treatment above for `.research-table` only (report
   markdown tables keep stacking). Each row is a single tap-friendly line showing
   a subset of columns; actions collapse to icons. */
.job-page .research-table tbody {
  display: block;
  gap: 0;
}

.job-page .research-table tbody tr {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 2.875rem;
  padding: 0.4375rem 0;
}

.job-page .research-table tbody tr td {
  display: block;
  width: auto;
  min-width: 0;
}

/* drop the label/value grid + inline ::before labels for list tables */
.job-page .research-table tbody tr td[data-label]:not([colspan]) {
  display: block;
  grid-template-columns: none;
  gap: 0;
}

.job-page .research-table tbody tr td[data-label]:not([colspan])::before {
  content: none;
}

.job-page .research-table tbody tr td[colspan] {
  flex: 1 1 auto;
}

/* secondary columns hidden on small screens (tap the row for full detail).
   The :not([colspan]) lifts specificity to (0,4,3) so display:none beats the
   td[data-label]:not([colspan]){display:block} override above. */
.job-page .research-table tbody tr td[data-label="Domain"]:not([colspan]),
.job-page .research-table tbody tr td[data-label="Type"]:not([colspan]),
.job-page .research-table tbody tr td[data-label="Record"]:not([colspan]),
.job-page .research-table tbody tr td[data-label="Source score"]:not([colspan]) {
  display: none;
}

/* short scannable prefix column (activity stage) */
.job-page .research-table tbody tr td[data-label="Stage"] {
  flex: 0 0 auto;
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.75rem;
}

/* primary column fills the row and truncates to one line */
.job-page .research-table tbody tr td[data-label="Update"],
.job-page .research-table tbody tr td[data-label="Title"] {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-page .research-table .job-source-comment {
  display: none;
}

/* actions hug the right edge */
.job-page .research-table tbody tr td[data-label="Actions"],
.job-page .research-table tbody tr td[data-label="Preview"] {
  flex: 0 0 auto;
  margin-left: auto;
}

/* keep the message on one line; hide its secondary detail line */
.job-page .research-table .research-table-update {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}

.job-page .research-table .research-table-update-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.job-page .research-table .research-table-update-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-page .research-table .research-table-update-meta {
  display: none;
}

/* Activity row order on mobile: stage · message · relative time · actions.
   Class-targeted (set in job-activity-renderer.js) so it doesn't depend on the
   auto-applied data-labels. */
.job-page .research-table tbody tr td.job-event-stage {
  order: 1;
}

.job-page .research-table tbody tr td.job-event-message {
  order: 2;
  flex: 1 1 auto;
  min-width: 0;
}

.job-page .research-table tbody tr td.job-event-time {
  order: 3;
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}

.job-page .research-table tbody tr td.job-event-actions-cell {
  order: 4;
  flex: 0 0 auto;
  margin-left: 0;
}

/* actions render as icons only on mobile */
.job-page .research-table .job-event-actions,
.job-page .research-table .job-source-row-actions {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.job-page .research-table .job-inline-button {
  padding: 0.25rem;
}

.job-page .research-table .job-inline-button .job-inline-label {
  display: none;
}

.job-page .research-table .job-inline-button .job-inline-icon {
  display: inline-flex;
  align-items: center;
}

.job-page .research-table .job-inline-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.job-page .source-ref-list {
  margin-left: 0;
}

.job-page .source-ref,
.job-page .source-ref-more {
  max-width: 100%;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-wrapper {
  max-width: 100%;
  overflow: visible;
  padding: 0.125rem 0 0;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-wide,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-stack {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: auto;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table thead,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-wide thead {
  display: none;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table tbody,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-wide tbody {
  display: grid;
  gap: 0;
  width: 100%;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table tbody tr,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-wide tbody tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.625rem;
  width: 100%;
  padding: 0.875rem 0;
  border-top: 1px solid var(--line);
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table tbody tr:first-child,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-wide tbody tr:first-child {
  border-top: 0;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table tbody tr td,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-wide tbody tr td {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.3125rem;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
  hyphens: auto;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table tbody tr td[data-label]:not([colspan]),
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-wide tbody tr td[data-label]:not([colspan]) {
  display: block;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table tbody tr td[data-label]:not([colspan])::before,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-wide tbody tr td[data-label]:not([colspan])::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 0.125rem;
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 520;
  line-height: 1rem;
  letter-spacing: 0;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table .research-markdown-cell-value,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-wide .research-markdown-cell-value {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table .source-ref-list,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-table-wide .source-ref-list {
  max-width: 100%;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-source-coverage-wrapper {
  overflow-x: auto;
  padding: 0;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-source-coverage-table {
  display: table;
  min-width: 54rem;
  table-layout: fixed;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-source-coverage-table thead {
  display: table-header-group;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-source-coverage-table tbody {
  display: table-row-group;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-source-coverage-table tbody tr {
  display: table-row;
  padding: 0;
  border-top: 0;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-source-coverage-table thead tr th,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-source-coverage-table tbody tr td {
  display: table-cell;
  width: auto;
  max-width: none;
  padding: 0.3125rem 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  line-height: 1.0625rem;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  white-space: normal;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-source-coverage-table tbody tr td[data-label]:not([colspan]) {
  display: table-cell;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-source-coverage-table tbody tr td[data-label]:not([colspan])::before {
  content: none;
  display: none;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-record-tables {
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-record-table {
  table-layout: fixed;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-record-table th,
.job-page :is(#job-report-view, #job-notes-view) .research-markdown-record-table td {
  padding: 0.4375rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.job-page :is(#job-report-view, #job-notes-view) .research-markdown-record-table th {
  width: 7.25rem;
  font-weight: 560;
}

/* ── Trade-ideas table: stack into labeled cards on mobile ─────────────────
   The structured trade-ideas table carries `.research-table`, so it would
   otherwise inherit the list-table "compact one-line flex row" treatment
   above. That treatment relies on per-column flex rules that only the
   Activity/Sources/Artifacts tables have — without them the trade table's
   narrow cells (the Side badge, the Type) collapse to a few pixels and short
   words like "LONG" wrap one letter per line. Stack each row as a labeled
   card instead, matching the report markdown tables. (Scoped through the
   report/notes view IDs so it beats the `.research-table` list rules above.) */
.job-page :is(#job-report-view, #job-notes-view) .research-table-trade-ideas tbody {
  display: grid;
  gap: 0;
}

.job-page :is(#job-report-view, #job-notes-view) .research-table-trade-ideas tbody tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  width: 100%;
  min-height: 0;
  padding: 0.875rem 0;
  border-top: 1px solid var(--line);
}

.job-page :is(#job-report-view, #job-notes-view) .research-table-trade-ideas tbody tr:first-child {
  border-top: 0;
}

.job-page :is(#job-report-view, #job-notes-view) .research-table-trade-ideas tbody tr td {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.job-page :is(#job-report-view, #job-notes-view) .research-table-trade-ideas tbody tr td[data-label]:not([colspan]) {
  display: block;
}

.job-page :is(#job-report-view, #job-notes-view) .research-table-trade-ideas tbody tr td[data-label]:not([colspan])::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 0.125rem;
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 520;
  line-height: 1rem;
  letter-spacing: 0;
}

}

@media (prefers-reduced-motion: reduce) {
  .harness-pulse,
  .harness-node rect {
    animation: none;
  }
}

.chat-composer-shell,
.home-start-composer,
.job-run-chat-composer,
.job-chat-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--warm-panel);
  box-shadow:
    0 0.625rem 1.75rem var(--shadow-color-weak),
    0 0.0625rem 0.125rem var(--shadow-color-weak);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 140ms ease,
    transform 170ms cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Run/run-analyst chatbars are flat — the border (and focus ring) carry them;
   the floating drop shadow reads as a regression against the dark ground. The
   home composer (.home-start-composer) keeps its lift. */
.chat-composer-shell,
.job-run-chat-composer,
.job-chat-composer {
  box-shadow: none;
}

.chat-composer-shell:focus-within,
.job-run-chat-composer:focus-within,
.job-chat-composer:focus-within {
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.home-start-composer:focus-within {
  border-color: var(--line-strong);
  box-shadow:
    inset 0 0 0 1px var(--line-strong),
    0 0.75rem 2rem var(--shadow-color-weak),
    0 0.0625rem 0.125rem var(--shadow-color-weak);
}

/* Persona (entity) chat composer sits flat against the panel — no drop shadow
   (the run/job chat composer keeps its shadow). */
.entity-page .job-chat-composer {
  box-shadow: none;
}
.entity-page .job-chat-composer:focus-within {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.home-start-composer {
  position: relative;
  overflow: hidden;
  min-height: 2.875rem;
  padding: 0.375rem 0.4375rem 0.375rem 0.75rem;
  view-transition-name: researcher-chat-composer;
  contain: layout;
}

.home-start-composer.has-youtube-intent {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
}

.chat-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  width: min(100%, 56rem);
  margin: 0.5rem auto 0;
}

.chat-attachment-chip {
  appearance: none;
  max-width: 16rem;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--ink-muted);
  padding: 0.25rem 0.625rem;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.chat-attachment-chip:hover {
  border-color: var(--line-strong);
  background: var(--hover-bg);
  color: var(--ink);
}

.home-start-composer button {
  appearance: none;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  font: inherit;
}

.home-start-composer > button:first-child {
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  border: 0;
  background: var(--hover-bg);
  color: var(--ink-faint);
  font-size: 1.125rem;
  line-height: 1;
  outline: none;
}

.home-start-composer > button:first-child:hover {
  background: var(--active-bg);
  color: var(--ink-muted);
}

.home-start-composer > button:first-child:disabled {
  cursor: progress;
  opacity: 0.8;
}

.home-start-composer input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.125rem 0;
}

.home-start-composer input:focus {
  outline: 0;
}

.home-start-composer input::placeholder {
  color: var(--ink-faint);
}

.home-start-submit {
  width: 2rem;
  height: 2rem;
  background: var(--ink);
  color: var(--ink-inverse);
  cursor: pointer;
  transition:
    background 140ms ease,
    transform 140ms ease;
}

.home-start-submit:hover {
  background: light-dark(#000000, #ffffff);
  transform: translateY(-0.03125rem);
}

.home-start-submit:disabled {
  background: light-dark(#e9e9e9, #2f2f31);
  color: var(--ink-faint);
  cursor: default;
  transform: none;
}

.home-start-submit.is-busy:disabled {
  background: light-dark(#000000, #ffffff);
  color: var(--ink-inverse);
  cursor: progress;
  opacity: 1;
}

.home-start-submit svg {
  width: 1rem;
  height: 1rem;
}

.home-start-submit-spinner {
  width: 0.875rem;
  height: 0.875rem;
  border: 0.125rem solid color-mix(in srgb, var(--ink-inverse) 34%, transparent);
  border-top-color: var(--ink-inverse);
  border-radius: 999px;
  animation: home-start-spin 700ms linear infinite;
}

.home-start-intent-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  min-height: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--ink-muted);
  padding: 0.125rem 0.5625rem;
  font-size: 0.75rem;
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
}

.home-start-intent-pill.is-starting {
  border-color: var(--line-strong);
  background: var(--hover-bg);
  color: var(--ink);
}

.home-start-intent-pill svg {
  width: 1rem;
  height: 1rem;
}

.home-start-status-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 999px;
  background: var(--ink);
  animation: home-start-pulse 900ms ease-in-out infinite;
}

.home-start-chat-button {
  min-width: 2.75rem;
  min-height: 1.75rem;
  border: 1px solid var(--line) !important;
  background: var(--hover-bg);
  color: var(--ink-muted);
  padding: 0 0.625rem !important;
  font-size: 0.75rem !important;
  font-weight: 560;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.home-start-chat-button:hover,
.home-start-chat-button:focus-visible {
  border-color: var(--line-strong) !important;
  background: var(--hover-bg);
  color: var(--ink);
}

.home-start-composer.is-submitting {
  border-color: var(--line-strong);
  box-shadow:
    0 0.75rem 2rem var(--shadow-color-weak),
    0 0.0625rem 0.125rem var(--shadow-color-weak);
  opacity: 0.92;
  transform: translateY(-0.0625rem);
}

@keyframes home-start-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes home-start-pulse {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-start-status-dot,
  .home-start-submit-spinner {
    animation: none;
  }
}

.job-inline-button {
  appearance: none;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1rem;
  cursor: pointer;
  width: fit-content;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.1875rem;
}

.job-inline-button:hover {
  color: var(--ink);
  text-decoration-color: var(--line-strong);
}

/* Desktop keeps the text label; the icon span is mobile-only (shown by the
   responsive list-table rules in responsive-job/tables.css). */
.job-inline-button .job-inline-icon {
  display: none;
}

.job-inline-button .job-inline-icon svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

.status-pill {
  appearance: none;
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 4.5rem;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: var(--warm-panel);
  color: var(--ink-muted);
  padding: 0.1875rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1rem;
  letter-spacing: 0;
  text-transform: none;
  cursor: default;
}

.status-pill-has-detail {
  cursor: help;
}

.status-pill-has-detail::after {
  content: attr(data-status-detail);
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 10;
  width: min(22rem, calc(100vw - 2rem));
  border: 1px solid var(--soft-line);
  border-radius: 0.625rem;
  background: var(--warm-panel);
  box-shadow: 0 12px 32px var(--shadow-color);
  color: var(--ink);
  padding: 0.625rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 460;
  line-height: 1.25rem;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.25rem);
  transition: opacity 120ms ease, transform 120ms ease;
}

.status-pill-has-detail:hover::after,
.status-pill-has-detail:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.status-pending,
.status-queued {
  border-color: var(--line);
  background: var(--surface-sunken);
  color: var(--ink-muted);
}

.status-succeeded {
  border-color: var(--success-line);
  background: var(--success-tint);
  color: var(--success-color);
}

.status-warning {
  border-color: var(--warning-line);
  background: var(--warning-tint);
  color: var(--warning);
}

.status-running,
.status-loading,
.status-generating-report {
  border-color: var(--accent-line);
  background: var(--accent-tint);
  color: var(--accent);
}

.status-running,
.status-loading,
.status-generating-report,
.job-progress.is-running li.is-active .job-progress-track {
  will-change: transform, opacity, background-position, box-shadow;
}

.status-running,
.status-loading,
.status-generating-report {
  animation: job-running-pill 2.2s ease-in-out infinite;
}

.status-failed,
.status-auth {
  border-color: var(--danger-line);
  background: var(--danger-tint);
  color: var(--danger-color);
}

.status-cancelled,
.status-paused,
.status-missing {
  border-color: var(--line);
  background: var(--surface-sunken);
  color: var(--ink-muted);
}

.status-awaiting-funding {
  border-color: var(--warning-line);
  background: var(--warning-tint);
  color: var(--warning);
}

.job-message {
  margin-top: 1rem;
  border: 1px solid var(--soft-line);
  border-radius: 0.5rem;
  background: var(--warm-panel);
  color: var(--ink-muted);
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 460;
  line-height: 1.25rem;
  letter-spacing: -0.00563rem;
}

.job-message-warning {
  border-color: var(--warning-line);
  background: var(--warning-tint);
  color: var(--warning);
}

.job-message-error {
  border-color: var(--danger-soft-line);
  background: var(--danger-tint);
  color: var(--danger-color);
}

.job-message-neutral {
  border-color: var(--soft-line);
  background: var(--warm-panel);
  color: var(--ink-muted);
}

.job-funding-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  border: 1px dashed var(--warning-line);
  border-radius: 0.625rem;
  background: var(--warning-tint);
  color: var(--warning);
  padding: 0.875rem 1rem;
}

.job-funding-panel-lock {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.25rem;
}

.job-funding-panel-copy {
  flex: 1 1 16rem;
  min-width: 0;
}

.job-funding-panel-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  letter-spacing: -0.00563rem;
}

.job-funding-panel-detail {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  font-weight: 460;
  line-height: 1.25rem;
  color: var(--warning);
}

.job-funding-panel-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
}

.job-funding-panel-fund {
  appearance: none;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--warning-line);
  border-radius: 999px;
  background: var(--warning);
  color: var(--warning-ink);
  padding: 0.3125rem 0.875rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 560;
  line-height: 1.25rem;
  text-decoration: none;
  cursor: pointer;
}

.job-funding-panel-fund:hover {
  background: color-mix(in srgb, var(--warning) 82%, black);
}

.job-funding-panel-resume {
  appearance: none;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--warning-line);
  border-radius: 999px;
  background: transparent;
  color: var(--warning);
  padding: 0.3125rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 560;
  line-height: 1.25rem;
  cursor: pointer;
}

.job-funding-panel-resume:hover {
  background: var(--warning-tint);
}

.job-funding-panel-resume:disabled {
  opacity: 0.6;
  cursor: default;
}

.job-dialog.job-funding-dialog {
  width: min(24rem, calc(100vw - 2rem));
  box-shadow: 0 1.25rem 4rem var(--shadow-color);
}

.job-funding-dialog-header {
  position: relative;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-bottom: none;
  padding: 1.125rem 1.25rem 0;
}

.job-funding-dialog-header .job-dialog-close {
  position: absolute;
  top: 0.5rem;
  right: 0.625rem;
}

.job-funding-dialog-header h2,
.job-funding-dialog-status,
.job-funding-address-description {
  margin: 0;
}

.job-funding-dialog-header h2 {
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.375rem;
}

.job-funding-dialog-content {
  display: grid;
  gap: 1rem;
  padding: 1rem 1.25rem 1.25rem;
  justify-items: center;
  text-align: center;
}

.job-funding-dialog-status,
.job-funding-address-description {
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-weight: 450;
  line-height: 1.25rem;
  max-width: 19rem;
}

.job-funding-dialog-status.is-error {
  color: var(--danger-color);
}

/* Network selector — one pill dropdown replaces the per-chain chip row. */
.job-funding-chain-field {
  position: relative;
  width: 100%;
  max-width: 18rem;
}

.job-funding-chain-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 1px solid var(--soft-line);
  border-radius: 0.875rem;
  background: var(--warm-panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 560;
  line-height: 1.25rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  text-align: left;
  cursor: pointer;
}

.job-funding-chain-select:hover {
  border-color: var(--line-strong);
}

.job-funding-chain-select:focus-visible {
  outline: 0;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--shadow-color-weak);
}

.job-funding-chain-select:disabled {
  opacity: 0.6;
  cursor: default;
}

.job-funding-chain-chevron {
  position: absolute;
  top: 50%;
  right: 0.9375rem;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--ink-faint);
  pointer-events: none;
}

.job-funding-qr-frame {
  width: 100%;
  max-width: 13.5rem;
  border: 1px solid var(--soft-line);
  border-radius: 1.125rem;
  background: #ffffff;
  padding: 0.875rem;
}

.job-funding-qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.375rem;
}

/* Address chip with an inline copy icon (was a full-width copy button). */
.job-funding-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 20rem;
  border: 1px solid var(--soft-line);
  border-radius: 0.875rem;
  background: var(--warm-panel);
  padding: 0.5625rem 0.5625rem 0.5625rem 0.875rem;
}

.job-funding-address-row code {
  min-width: 0;
  font-family: var(--font-code);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--ink);
  word-break: break-all;
  text-align: left;
}

.job-funding-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0;
}

.job-funding-copy:hover:not(:disabled) {
  background: var(--hover-bg);
  color: var(--ink);
}

.job-funding-copy.is-copied {
  color: var(--ink);
}

.job-funding-copy:disabled {
  opacity: 0.5;
  cursor: default;
}

.job-funding-copy svg {
  width: 1rem;
  height: 1rem;
}

.job-funding-dialog-actions {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 0.5rem;
  margin-top: 0.125rem;
}

.job-funding-dialog .job-dialog-button {
  width: 100%;
  min-height: 2.625rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 560;
}

body.job-chat-modal-open,
body.job-chat-modal-closing {
  --job-chat-dock-width: 30rem;
}

/* The chat window in the modal/dock is a clean single column — the sessions
   sidebar (and its widened dock) only exist on the full-page /chat route. */
.job-chat-modal-open:not(.job-chat-route) .job-chat-header-sidebar,
.job-chat-modal-closing:not(.job-chat-route) .job-chat-header-sidebar,
.job-chat-modal-open:not(.job-chat-route) .job-chat-sessions,
.job-chat-modal-closing:not(.job-chat-route) .job-chat-sessions {
  display: none;
}

.job-chat-modal-open:not(.job-chat-route) .job-chat-workspace-header,
.job-chat-modal-closing:not(.job-chat-route) .job-chat-workspace-header {
  grid-template-columns: minmax(0, 1fr) auto;
}

.job-chat-modal-open:not(.job-chat-route) .job-chat-workspace-body,
.job-chat-modal-closing:not(.job-chat-route) .job-chat-workspace-body {
  grid-template-columns: minmax(0, 1fr);
}

/* Persona (entity) chat opts back IN to the sessions sidebar so prior chats stay
   reachable from the modal/dock. The expander stays collapsed by default (clean
   single column); tapping the header toggle slides the sessions list in. This
   just re-asserts the existing sidebar machinery the run-chat dock turns off
   above — scoped to .entity-page so the run-chat dock is untouched. */
.entity-page.job-chat-modal-open:not(.job-chat-route) .job-chat-header-sidebar,
.entity-page.job-chat-modal-closing:not(.job-chat-route) .job-chat-header-sidebar,
.entity-page.job-chat-modal-open:not(.job-chat-route) .job-chat-sessions,
.entity-page.job-chat-modal-closing:not(.job-chat-route) .job-chat-sessions {
  display: flex;
}

.entity-page.job-chat-modal-open:not(.job-chat-route) .job-chat-workspace-header,
.entity-page.job-chat-modal-closing:not(.job-chat-route) .job-chat-workspace-header {
  grid-template-columns: 3.375rem minmax(0, 1fr) auto;
}

.entity-page.job-chat-modal-open:not(.job-chat-route) .job-chat-workspace-body,
.entity-page.job-chat-modal-closing:not(.job-chat-route) .job-chat-workspace-body {
  grid-template-columns: 0 minmax(0, 1fr);
}

/* Expanded: the sessions list slides in and the header widens its first column
   to match. (The base .job-chat-sidebar-open rules are lower-specificity than
   the modal single-column rules above, so re-assert them at entity scope.) */
.entity-page.job-chat-sidebar-open.job-chat-modal-open:not(.job-chat-route) .job-chat-workspace-header,
.entity-page.job-chat-sidebar-open.job-chat-modal-closing:not(.job-chat-route) .job-chat-workspace-header {
  grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr) auto;
}
.entity-page.job-chat-sidebar-open.job-chat-modal-open:not(.job-chat-route) .job-chat-workspace-body,
.entity-page.job-chat-sidebar-open.job-chat-modal-closing:not(.job-chat-route) .job-chat-workspace-body {
  grid-template-columns: 16rem minmax(0, 1fr);
}

.job-chat-view {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  background: rgba(234, 234, 230, 0.82);
  backdrop-filter: blur(10px) saturate(0.98);
  -webkit-backdrop-filter: blur(10px) saturate(0.98);
}

.job-chat-view[hidden] {
  display: none !important;
}

body:not(.job-chat-route):not(.job-chat-modal-open):not(.job-chat-modal-closing) #job-chat-section {
  display: none !important;
}

.job-chat-modal-open,
.job-chat-modal-closing {
  overflow: hidden;
}

.job-chat-modal-open .job-chat-launch,
.job-chat-modal-closing .job-chat-launch {
  visibility: hidden;
}

.job-chat-modal-open .job-chat-view {
  animation: job-chat-modal-backdrop-in 180ms cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

.job-chat-modal-closing .job-chat-view {
  animation: job-chat-modal-backdrop-out 160ms cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

.job-chat-modal-open .job-chat-workspace,
.job-chat-modal-closing .job-chat-workspace {
  height: min(52rem, calc(100dvh - 2.5rem));
  width: min(100%, 64rem);
  transform-origin: center;
  /* Flat against the page — no drop shadow (it muddied the page feel). Shared
     across ALL chat surfaces (persona, run, topic) so the dock looks identical
     everywhere; the border / border-left still separates it from the page. */
  box-shadow: none;
  will-change: transform, opacity;
}

.job-chat-modal-open .job-chat-workspace {
  animation: job-chat-modal-panel-in var(--dur-panel) var(--ease-drawer) both;
}

.job-chat-modal-closing .job-chat-workspace {
  animation: job-chat-modal-panel-out 160ms cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

/* (Sidebar-widened modal width removed — the modal chat is single-column.) */

/* Phones: the chat takes over as a full-screen sheet sliding over the
   report. Breakpoint matches the job-chat mobile rules in
   global-chat/responsive-motion.css (760px). */
@media (max-width: 760px) {
  .job-chat-modal-open .job-chat-view,
  .job-chat-modal-closing .job-chat-view {
    padding: 0;
    /* True bottom sheet: anchor to the BOTTOM edge, not the top. iOS Safari's
       visible area and `100dvh` routinely disagree (the dynamic viewport lags
       the toolbar as it collapses/expands), so a TOP-anchored 100dvh box leaves
       the composer floating with a strip of the page showing beneath it. Pinning
       to the bottom (`position: fixed; bottom: 0`, which Safari keeps above the
       toolbar) keeps the composer on the visible bottom edge; any height
       shortfall now lands at the TOP, under the URL bar / notch, where it is not
       seen. */
    place-items: end stretch;
    inset: auto 0 0 0;
    height: 100vh;
    height: 100dvh;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: none;
  }

  .job-chat-modal-open .job-chat-workspace,
  .job-chat-modal-closing .job-chat-workspace {
    width: 100%;
    /* Fill the dynamic viewport; the view pins us to the bottom edge, so the
       composer always rides the visible bottom regardless of toolbar state. */
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Keyboard up (toggled by job-chat-viewport.js): iOS Safari does not shrink
     `dvh` for the soft keyboard, so the JS mirrors the *visual* viewport into
     --chat-vvh / --chat-vvtop. The sheet then sizes to the area ABOVE the
     keyboard and the composer + streaming tail ride just above it, instead of
     being stranded behind the keyboard. Falls back to the bottom-anchored
     100dvh sheet (above) when the keyboard is down or visualViewport is absent. */
  .job-chat-kb-open.job-chat-modal-open .job-chat-view,
  .job-chat-kb-open.job-chat-modal-closing .job-chat-view {
    inset: var(--chat-vvtop, 0) 0 auto 0;
    height: var(--chat-vvh, 100dvh);
  }

  .job-chat-kb-open.job-chat-modal-open .job-chat-workspace,
  .job-chat-kb-open.job-chat-modal-closing .job-chat-workspace {
    height: var(--chat-vvh, 100dvh);
    max-height: var(--chat-vvh, 100dvh);
  }

  .job-chat-modal-open .job-chat-workspace {
    animation: job-chat-sheet-in var(--dur-sheet) var(--ease-drawer) both;
  }

  .job-chat-modal-closing .job-chat-workspace {
    animation: job-chat-sheet-out 160ms cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
  }
}

/* Wide screens: the chat docks on the right and the report stays readable
   beside it. The page keeps scrolling; only the dock column is overlaid. */
@media (min-width: 75rem) {
  /* The closing state drops the padding immediately so the report expands
     in step with the dock sliding out, instead of in a second phase after
     the close timer fires. */
  body.job-chat-modal-open,
  body.job-chat-modal-closing {
    overflow: auto;
  }

  body.job-chat-modal-open {
    padding-right: var(--job-chat-dock-width);
  }

  /* Widen the persona dock while the sessions list is open so the sidebar and
     chat aren't cramped; collapses back to 30rem when closed. */
  body.entity-page.job-chat-modal-open.job-chat-sidebar-open {
    --job-chat-dock-width: 44rem;
  }

  body.job-page {
    transition: padding-right 160ms cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  body.job-page.job-chat-modal-open {
    transition: padding-right var(--dur-drawer) var(--ease-drawer);
  }

  .job-chat-modal-open .job-chat-launch {
    display: none;
  }

  /* Reappears at close start, together with everything else. */
  .job-chat-modal-closing .job-chat-launch {
    visibility: visible;
  }

  .job-chat-modal-open .job-chat-view,
  .job-chat-modal-closing .job-chat-view {
    inset: 0 0 0 auto;
    width: var(--job-chat-dock-width);
    display: block;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: none;
    transition: width var(--dur-drawer) var(--ease-drawer);
  }

  .job-chat-modal-open .job-chat-workspace,
  .job-chat-modal-closing .job-chat-workspace {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-left: 1px solid var(--soft-line);
    border-radius: 0;
    /* Flat dock — the border-left alone separates it from the report (matches
       the persona dock; the directional falloff muddied the page feel). */
    box-shadow: none;
  }

  .job-chat-modal-open .job-chat-workspace {
    animation: job-chat-dock-in var(--dur-drawer) var(--ease-drawer) both;
  }

  .job-chat-modal-closing .job-chat-workspace {
    animation: job-chat-dock-out 160ms cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
  }
}

@keyframes job-chat-dock-in {
  from {
    transform: translate3d(100%, 0, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes job-chat-dock-out {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(100%, 0, 0);
  }
}

@keyframes job-chat-sheet-in {
  from {
    transform: translate3d(0, 100%, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes job-chat-sheet-out {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, 100%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .job-chat-modal-open .job-chat-view,
  .job-chat-modal-closing .job-chat-view,
  .job-chat-modal-open .job-chat-workspace,
  .job-chat-modal-closing .job-chat-workspace {
    animation: none;
    transition: none;
  }

  body.job-page {
    transition: none;
  }
}

.job-chat-route {
  background: var(--warm-panel);
  overflow: hidden;
}

.job-chat-route main {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
}

.job-chat-route .site-nav,
.job-chat-route .job-header,
.job-chat-route #job-message,
.job-chat-route #job-error,
.job-chat-route .job-progress,
.job-chat-route .job-summary,
.job-chat-route .job-prompt-section,
.job-chat-route .job-chat-launch,
.job-chat-route .job-primary-tabs,
.job-chat-route #job-report-view,
.job-chat-route #job-activity-section,
.job-chat-route #job-storage-section,
.job-chat-route site-footer,
.job-chat-route .footer {
  display: none !important;
}

.job-chat-route .job-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 0;
}

.job-chat-route .job-chat-view {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

.job-chat-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100%, 92rem);
  height: min(100%, 56rem);
  margin: 0 auto;
  border: 1px solid var(--soft-line);
  border-radius: 0.75rem;
  background: var(--warm-panel);
  box-shadow: none;
  overflow: hidden;
}

.job-chat-route .job-chat-workspace {
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.job-chat-route .job-chat-workspace-header {
  display: none;
}

.job-chat-workspace-header {
  display: grid;
  grid-template-columns: 3.375rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--soft-line);
  padding: 0;
  transition: grid-template-columns 190ms cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

/* The swipe-to-dismiss drag handle is mobile-only (shown via the 760px rules). */
.job-chat-grabber {
  display: none;
}

.job-chat-sidebar-open .job-chat-workspace-header {
  grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr) auto;
}

.job-chat-header-sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-width: 0;
  min-height: 3.5rem;
  padding: 0.625rem 0.625rem;
  overflow: hidden;
  transition:
    border-color 190ms ease,
    padding 190ms cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.job-chat-sidebar-open .job-chat-header-sidebar {
  justify-content: space-between;
  border-right: 1px solid var(--soft-line);
  padding-inline: 0.75rem;
}

.job-chat-header-sidebar-title {
  max-width: 10rem;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 620;
  line-height: 1rem;
  opacity: 1;
  text-overflow: ellipsis;
  transition:
    max-width 190ms cubic-bezier(0.455, 0.03, 0.515, 0.955),
    opacity 150ms ease;
  white-space: nowrap;
}

body:not(.job-chat-sidebar-open) .job-chat-header-sidebar-title {
  max-width: 0;
  opacity: 0;
}

.job-chat-workspace-title {
  display: grid;
  gap: 0.03125rem;
  min-width: 0;
  padding: 0.625rem 0.75rem;
}

.job-chat-workspace-header h2 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 620;
  line-height: 1.125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-chat-workspace-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 0.9375rem;
}

.job-chat-workspace-meta span {
  min-width: 0;
}

/* Only put a "·" between two VISIBLE meta spans — `:not([hidden])` on both
   sides so a hidden status/source span never leaves a dangling leading dot
   (e.g. an entity whose index status span is suppressed shows just the handle). */
.job-chat-workspace-meta span:not([hidden]) ~ span:not([hidden])::before {
  content: "·";
  margin-right: 0.25rem;
  color: var(--ink-faint);
}

.job-chat-sidebar-toggle,
.job-chat-session-copy,
.job-chat-modal-close {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 1.875rem;
  height: 1.875rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--ink-faint);
  padding: 0;
  cursor: pointer;
  transition:
    background 140ms ease,
    color 140ms ease;
}

.job-chat-sidebar-toggle:hover,
.job-chat-sidebar-toggle:focus-visible,
.job-chat-session-copy:hover,
.job-chat-session-copy:focus-visible,
.job-chat-modal-close:hover,
.job-chat-modal-close:focus-visible {
  background: var(--hover-bg);
  color: var(--ink);
}

.job-chat-sidebar-toggle svg,
.job-chat-session-copy svg,
.job-chat-modal-close svg {
  width: 1rem;
  height: 1rem;
}

/* Copy-session-id button: brief green tick after a successful copy. */
.job-chat-session-copy[data-copied="true"],
.job-chat-session-copy[data-copied="true"]:hover {
  color: var(--success);
}

/* Right-hand header actions: the close button plus any dynamically-inserted
   buttons (entity/topic copy-session-id). Grouping them in one grid cell keeps
   them inline on a single row — otherwise the extra button overflows the
   3-column header grid and pushes the close onto a second row. */
.job-chat-workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.125rem;
  padding-right: 0.625rem;
}

.job-chat-sidebar-toggle[aria-expanded="true"] {
  color: var(--ink);
}

/* Persona (entity) chat header: avatar sits to the left of the name + meta. */
.entity-page .job-chat-workspace-title:has(.entity-chat-avatar:not([hidden])) {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  align-items: center;
}
.entity-page .job-chat-workspace-title:has(.entity-chat-avatar:not([hidden])) > h2 {
  grid-column: 2;
  grid-row: 1;
}
.entity-page .job-chat-workspace-title:has(.entity-chat-avatar:not([hidden])) > .job-chat-workspace-meta {
  grid-column: 2;
  grid-row: 2;
}
.entity-page .entity-chat-avatar {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  object-fit: cover;
  background: var(--hover-bg);
}
.entity-page .entity-chat-avatar[hidden] {
  display: none;
}

.job-chat-workspace-body {
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr);
  min-height: 0;
  transition: grid-template-columns 190ms cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.job-chat-sidebar-open .job-chat-workspace-body,
.job-chat-route .job-chat-workspace-body {
  grid-template-columns: 16rem minmax(0, 1fr);
}

.job-chat-sessions,
.job-chat-main {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: var(--warm-panel);
}

.job-chat-sessions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-right: 1px solid transparent;
  padding: 0.875rem 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    border-color 190ms ease,
    opacity 150ms ease,
    padding 190ms cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.job-chat-sidebar-open .job-chat-sessions,
.job-chat-route .job-chat-sessions,
.global-chat-route .job-chat-sessions {
  border-right-color: var(--soft-line);
  padding-inline: 0.625rem;
  overflow-y: auto;
  opacity: 1;
  pointer-events: auto;
}

.job-chat-sessions-header {
  display: grid;
  gap: 0.25rem;
}

.job-chat-sessions-header h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.job-chat-sessions-header .job-inline-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.625rem;
  background: transparent;
  color: var(--ink);
  padding: 0 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
}

.job-chat-sessions-header .job-inline-button:hover {
  background: var(--hover-bg);
  color: var(--ink);
  text-decoration: none;
}

.job-chat-sessions-header .job-inline-button svg {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
}

.job-chat-empty h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 640;
  line-height: 1.5rem;
  letter-spacing: -0.012rem;
}

.job-chat-index-state {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0.25rem 0.75rem;
  color: var(--ink-faint);
  font-size: 0.75rem;
  line-height: 1.125rem;
}

.job-chat-recents-heading {
  margin: 0.875rem 0.625rem 0.25rem;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1rem;
}

.job-chat-session-list {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.job-chat-session-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  min-height: 2.375rem;
  padding: 0.1875rem 0.3125rem 0.1875rem 0.625rem;
  border-radius: 0.625rem;
}

.job-chat-session-row.is-active {
  background: var(--active-bg);
}

.job-chat-session-button {
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.125rem;
  text-align: left;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-chat-session-row.is-active .job-chat-session-button {
  color: var(--ink);
}

.job-chat-session-delete {
  appearance: none;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--ink-faint);
  padding: 0;
  opacity: 0;
  cursor: pointer;
  transition:
    color 140ms ease,
    opacity 140ms ease,
    background 140ms ease;
}

.job-chat-session-delete svg {
  width: 1.125rem;
  height: 1.125rem;
}

.job-chat-session-row:hover .job-chat-session-delete,
.job-chat-session-row:focus-within .job-chat-session-delete {
  opacity: 1;
}

.job-chat-session-delete:hover,
.job-chat-session-delete:focus-visible {
  background: var(--hover-bg);
  color: var(--ink);
}

/* When a Recents row points at another holder it's an <a> rather than a
   <button>; keep it visually identical to the in-place session button (no
   underline, inherited ink, single-line ellipsis). */
a.job-chat-session-button {
  display: block;
  text-decoration: none;
}

a.job-chat-session-button:hover,
a.job-chat-session-button:focus-visible {
  text-decoration: none;
  color: var(--ink);
}

a.job-chat-session-button[aria-disabled="true"] {
  pointer-events: none;
  color: var(--ink-faint);
}

/* Group header for the unified cross-platform Recents list: one small,
   muted label per holder (persona / topic / run), with its sessions beneath. */
.job-chat-session-group {
  margin: 0.5rem 0 0.125rem;
  padding: 0 0.625rem;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-chat-session-group:first-child {
  margin-top: 0;
}

.job-chat-session-notice {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.job-chat-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
  overflow: hidden;
  background: var(--warm-panel);
}

.job-chat-empty {
  grid-row: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.5rem;
  min-height: 18rem;
  padding: 1.25rem 2rem;
  text-align: center;
}

/* Persona portrait above the title, mirroring the modal header avatar but
   sized for the empty-state hero. Hidden (display:none) by JS when the entity
   has no avatar so the title stays vertically centered. */
.job-chat-empty-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  object-fit: cover;
  border: 1px solid var(--soft-line);
  background: var(--warm-surface);
  margin-bottom: 0.375rem;
}

.job-chat-empty p {
  margin: 0;
  max-width: 32rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.375rem;
}

.job-chat-starters {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: min(100% - 2rem, 34rem);
  margin: 1rem auto 0;
}

.job-chat-starter {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--soft-line);
  border-radius: 0.875rem;
  background: var(--warm-surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.875rem 1.0625rem;
  cursor: pointer;
  transition:
    border-color var(--dur-micro) var(--ease-out-soft),
    background-color var(--dur-micro) var(--ease-out-soft),
    color var(--dur-micro) var(--ease-out-soft),
    transform var(--dur-micro) var(--ease-out-soft);
  /* Freshly rendered each time the empty state shows, so the entrance plays
     on open. nth-child below staggers them. */
  animation: job-chat-msg-in var(--dur-entrance) var(--ease-out-soft) backwards;
}

.job-chat-starter:nth-child(1) {
  animation-delay: calc(var(--stagger-step) * 1);
}
.job-chat-starter:nth-child(2) {
  animation-delay: calc(var(--stagger-step) * 2);
}
.job-chat-starter:nth-child(3) {
  animation-delay: calc(var(--stagger-step) * 3);
}
.job-chat-starter:nth-child(4) {
  animation-delay: calc(var(--stagger-step) * 4);
}
.job-chat-starter:nth-child(n + 5) {
  animation-delay: calc(var(--stagger-step) * 5);
}

.job-chat-starter:hover {
  border-color: var(--line-strong);
  background: var(--hover-bg);
  color: var(--ink);
  transform: translateY(-1px);
}

.job-chat-starter:active {
  transform: translateY(0) scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  .job-chat-starter {
    animation: none;
  }
  .job-chat-starter:hover,
  .job-chat-starter:active {
    transform: none;
  }
}

.job-chat-source-context {
  grid-row: 1;
  width: min(100% - 2rem, 50rem);
  margin: 0.875rem auto 0;
}

.job-chat-source-context[hidden] {
  display: none;
}

.job-chat-source-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: 0.625rem;
  background: var(--surface-raised);
  padding: 0.625rem 0.6875rem;
}

.job-chat-source-card-marker {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: var(--hover-bg);
  color: var(--ink-muted);
}

.job-chat-source-card-marker svg {
  width: 1rem;
  height: 1rem;
}

.job-chat-source-card-body {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.job-chat-source-card-kicker,
.job-chat-source-card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 520;
  line-height: 0.9375rem;
}

.job-chat-source-card h3 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 610;
  line-height: 1.125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-chat-source-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
}

.job-chat-source-card-remove {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 1.625rem;
  height: 1.625rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-faint);
  padding: 0;
  cursor: pointer;
}

.job-chat-source-card-remove:hover,
.job-chat-source-card-remove:focus-visible {
  background: var(--hover-bg);
  color: var(--ink);
}

.job-chat-source-card-remove:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.job-chat-source-card-remove svg {
  width: 1rem;
  height: 1rem;
}

.job-chat-messages {
  grid-row: 2;
  display: grid;
  align-content: start;
  gap: 1.375rem;
  min-width: 0;
  overflow-y: auto;
  padding: 1.5rem max(1.5rem, calc((100% - 56rem) / 2)) 10rem;
}

.job-chat-message {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  width: min(100%, 56rem);
  justify-self: center;
}

/* Entrance: new messages fade + rise in. The renderer adds .is-entering only
   to messages it has not shown before (and an inline animation-delay for the
   stagger), so streaming ticks never re-trigger it. */
@keyframes job-chat-msg-in {
  from {
    opacity: 0;
    transform: translateY(0.625rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.job-chat-message.is-entering {
  animation: job-chat-msg-in var(--dur-entrance) var(--ease-out-soft) backwards;
}

@media (prefers-reduced-motion: reduce) {
  .job-chat-message.is-entering {
    animation: none;
  }
}

.job-chat-message-user {
  justify-items: end;
}

.job-chat-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: min(48rem, 100%);
}

.job-chat-message-user .job-chat-message-header {
  width: min(34rem, 88%);
  justify-self: end;
}

.job-chat-message-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 0.9375rem;
}

.job-chat-message-user .job-chat-message-label {
  text-align: right;
}

.job-chat-message-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.1875rem;
  opacity: 1;
  pointer-events: auto;
}

/* The click-to-copy row sits just below the message body and stays visible
   (ChatGPT-style) so it's reachable on touch where there is no hover. */
.job-chat-message-actions-below {
  margin-top: 0.125rem;
}

.job-chat-message-action {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 1.625rem;
  height: 1.625rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.job-chat-message-action:hover,
.job-chat-message-action:focus-visible {
  border-color: var(--line);
  background: var(--hover-bg);
  color: var(--ink);
}

.job-chat-message-action svg {
  width: 0.9375rem;
  height: 0.9375rem;
}

.job-chat-message-phase {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  width: fit-content;
  max-width: min(100%, 48rem);
  color: var(--ink-muted);
  font-size: 0.75rem;
  line-height: 1rem;
}

.job-chat-message-phase-dot {
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--ink-faint);
  animation: job-chat-phase-pulse 1.2s ease-in-out infinite;
}

.job-chat-message-phase-history {
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-chat-message-phase.is-reconnecting .job-chat-message-phase-dot {
  background: var(--warning);
}

/* Chat-shell surface palette. This leaf was a "warm off-white" pilot scoped to
   `.job-chat-workspace`; it read as a different (warmer) surface than the rest
   of the app, so the warm tokens are remapped here to neutral within the chat
   scope only — clean white panels on the app's grey page, matching the nav and
   standard surfaces. The remap neutralizes every `var(--warm-*)` reference in
   the chat shell without touching the app-wide tokens in foundation.css. To
   restore the warm pilot, delete this var block. */
.job-chat-workspace {
  --warm-panel: var(--surface-raised);
  --warm-surface: var(--surface);
  --warm-line: var(--line-faint);
  --warm-ink: var(--ink);
  background: var(--warm-panel);
}

.job-chat-workspace .job-chat-main,
.job-chat-workspace .job-chat-sessions {
  background: var(--warm-panel);
}

.job-chat-workspace .job-chat-workspace-header {
  border-bottom-color: var(--warm-line);
}

.job-chat-workspace .job-chat-starter {
  background: var(--warm-surface);
  border-color: var(--warm-line);
}

.job-chat-workspace .job-chat-starter:hover {
  background: var(--warm-panel);
  border-color: color-mix(in srgb, var(--warm-ink) 16%, transparent);
}

.job-chat-workspace .job-chat-composer {
  background: var(--warm-panel);
  border-color: var(--warm-line);
}

.job-chat-workspace .job-chat-composer textarea {
  background: transparent;
}

.job-chat-workspace .job-chat-scope {
  background: color-mix(in srgb, var(--warm-ink) 4%, transparent);
  border-color: var(--warm-line);
}

/* Keep the source-context card coherent with the warmed surfaces (it defaults
   to a cool near-white). */
.job-chat-workspace .job-chat-source-card {
  background: var(--warm-panel);
  border-color: var(--warm-line);
}

@keyframes job-chat-phase-pulse {
  0%,
  100% {
    opacity: 0.38;
  }
  50% {
    opacity: 1;
  }
}

.job-chat-message-body {
  max-width: 100%;
  min-width: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.job-chat-message-assistant .job-chat-message-body {
  max-width: min(48rem, 100%);
}

.job-chat-message-user .job-chat-message-body {
  justify-self: end;
  max-width: min(34rem, 88%);
  border-radius: 0.875rem;
  background: var(--chat-bubble-user);
  color: var(--ink);
  padding: 0.75rem 0.875rem;
}

.job-chat-message-body p,
.job-chat-message-body ul,
.job-chat-message-body ol {
  margin-top: 0;
  margin-bottom: 0.625rem;
}

.job-chat-message-body ol {
  display: block;
  list-style: decimal outside;
  padding-left: 1.65rem;
}

.job-chat-message-body ol > li {
  display: list-item;
  list-style: decimal outside;
  margin-bottom: 0.625rem;
  padding-left: 0.25rem;
}

.job-chat-message-body ul > li {
  display: list-item;
  list-style: disc outside;
  margin-bottom: 0.625rem;
  padding-left: 0.25rem;
}

.job-chat-message-body li:last-child {
  margin-bottom: 0;
}

.job-chat-message-body li::marker {
  color: var(--ink-faint);
  font-weight: 610;
}

.job-chat-message-body p:last-child,
.job-chat-message-body ul:last-child,
.job-chat-message-body ol:last-child {
  margin-bottom: 0;
}

/* Per-message cost: the fixed consult price charged for this answer, shown as a
   quiet muted line under the message (mirrors the per-message cost on
   automarket). tabular-nums so the digits don't jitter across messages. */
.job-chat-message-cost {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1rem;
  font-variant-numeric: tabular-nums;
}

.job-chat-inline-citation {
  appearance: none;
  display: inline-flex;
  align-items: center;
  max-width: min(12rem, 48vw);
  min-height: 1.45rem;
  margin: 0 0.08em;
  transform: translateY(-0.04em);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--ink-faint);
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1rem;
  padding: 0.16rem 0.42rem;
  vertical-align: baseline;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.job-chat-inline-citation:hover {
  border-color: var(--line-strong);
  background: var(--hover-bg);
  color: var(--ink-muted);
  transform: translateY(-0.06em);
}

.job-chat-inline-citation .job-chat-reference-title {
  display: inline-block;
  max-width: 10.5rem;
}

.job-chat-inline-citation:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.job-chat-selected-citation {
  display: grid;
  gap: 0.625rem;
  max-height: 0;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background:
    linear-gradient(180deg, light-dark(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.05)), light-dark(rgba(250, 250, 250, 0.96), rgba(255, 255, 255, 0.03))),
    var(--surface-raised);
  opacity: 0;
  overflow: hidden;
  padding: 0 0.75rem;
  box-shadow: 0 0.75rem 2rem var(--shadow-color-weak);
  transform: translateY(-0.25rem);
  transition:
    max-height 180ms ease,
    margin-top 180ms ease,
    opacity 160ms ease,
    padding 180ms ease,
    transform 180ms ease;
}

.job-chat-selected-citation[hidden] {
  display: none;
}

.job-chat-selected-citation.is-open {
  max-height: 22rem;
  margin-top: 0.875rem;
  opacity: 1;
  padding: 0.75rem;
  transform: translateY(0);
}

.job-chat-selected-citation-header {
  appearance: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.job-chat-selected-citation-header:disabled {
  cursor: default;
}

.job-chat-selected-citation-marker {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-inverse);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.job-chat-selected-citation-title {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.job-chat-selected-citation-title strong {
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-chat-selected-citation-title span {
  color: var(--ink-faint);
  font-size: 0.75rem;
  line-height: 1rem;
}

.job-chat-selected-citation-excerpt {
  margin: 0;
  border-left: 2px solid var(--line-strong);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  line-height: 1.35rem;
  padding: 0.125rem 0 0.125rem 0.75rem;
}

.job-chat-selected-citation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.job-chat-reference-block {
  display: grid;
  gap: 0;
  max-width: min(48rem, 100%);
}

.job-chat-waiting {
  display: inline-flex;
  align-items: center;
  width: fit-content;

  /* "Thinking" shimmer: the muted "sunrise" palette (from the gradient-shimmer library) sweeps a
     soft band across the glyphs over a muted resting base — pale blue warming through tan and peach
     to coral and pink. Pastel and low-emphasis on purpose: alive but quiet on the Work Surface, and
     warm rather than alarming so it never reads as an error state. */
  --gs-base: var(--ink-faint);
  background: linear-gradient(
    100deg,
    var(--gs-base) 0%,
    var(--gs-base) 34%,
    #b6d3ef 37%,
    #cad1d7 41%,
    #d7cfc8 43.6%,
    #e1cdb9 45.9%,
    #eac6a5 48%,
    #edb185 50.1%,
    #ef9b62 52.2%,
    #f18f60 54.4%,
    #f48d7a 56.7%,
    #f78a94 59.3%,
    #f888a0 63%,
    var(--gs-base) 66%,
    var(--gs-base) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: job-chat-waiting-shimmer 1.6s linear infinite;
}

@keyframes job-chat-waiting-shimmer {
  from {
    background-position: 130% 0;
  }
  to {
    background-position: -130% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .job-chat-waiting {
    animation: none;
    background: none;
    color: var(--ink-muted);
    -webkit-text-fill-color: currentColor;
  }
}

.job-chat-message-status {
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

/* "Composing…" footer shown below a streaming answer while the turn is still
   running (reuses the .job-chat-waiting shimmer). Sits under the answer text as a
   quiet "still working" cue so a slow deep answer never reads as frozen. */
.job-chat-composing {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}

.job-chat-reference-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.job-chat-reference-label {
  flex: 0 0 auto;
  margin-right: 0.125rem;
  color: var(--ink-faint);
  font-size: 0.75rem;
  font-weight: 610;
  line-height: 1rem;
}

.job-chat-reference-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: min(100%, 17rem);
  gap: 0.375rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--ink);
  padding: 0.25rem 0.5rem 0.25rem 0.3125rem;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.job-chat-reference-chip:hover {
  border-color: var(--line-strong);
  background: var(--hover-bg);
  color: var(--ink);
}

.job-chat-reference-chip.is-active {
  border-color: var(--line-strong);
  background: var(--warm-panel);
  color: var(--ink);
}

.job-chat-reference-chip:disabled {
  cursor: default;
  opacity: 0.58;
}

.job-chat-reference-chip:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.job-chat-reference-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-inverse);
  font-size: 0.6875rem;
  font-weight: 650;
  line-height: 1;
}

.job-chat-reference-count {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 650;
  line-height: 1;
}

.job-chat-reference-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-chat-reference-more {
  align-self: center;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1rem;
}

.job-chat-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  max-width: min(48rem, 100%);
  margin-top: 0.125rem;
}

.job-chat-followup-chip {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--ink-faint);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1rem;
  padding: 0.3125rem 0.5625rem;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.job-chat-followup-chip:hover,
.job-chat-followup-chip:focus-visible {
  border-color: var(--line-strong);
  background: var(--warm-panel);
  color: var(--ink);
}

.job-chat-citations {
  width: min(100%, 56rem);
  justify-self: center;
  display: grid;
}

.job-chat-citations-summary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--ink);
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 610;
  line-height: 1rem;
}

.job-chat-citations-summary:hover {
  border-color: var(--line-strong);
  background: var(--hover-bg);
  color: var(--ink);
}

.job-chat-citation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-0.25rem);
  transition:
    max-height 210ms cubic-bezier(0.215, 0.61, 0.355, 1),
    margin-top 210ms cubic-bezier(0.215, 0.61, 0.355, 1),
    opacity 170ms ease-out,
    transform 210ms cubic-bezier(0.215, 0.61, 0.355, 1);
}

.job-chat-citations.is-open .job-chat-citation-grid {
  max-height: 160rem;
  margin-top: 0.75rem;
  opacity: 1;
  transform: translateY(0);
}

.job-chat-citation-grid[hidden] {
  display: none;
}

.job-chat-citation,
.job-chat-gaps,
.job-chat-extension {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: 0.625rem;
  background: var(--warm-panel);
  padding: 0.875rem;
}

.job-chat-citation {
  display: grid;
  gap: 0.625rem;
}

.job-chat-citation-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.625rem;
}

.job-chat-citation-marker {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1;
}

.job-chat-citation-title-block {
  display: grid;
  gap: 0.1875rem;
  min-width: 0;
}

.job-chat-citation h3,
.job-chat-gaps h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 620;
  line-height: 1.125rem;
  overflow-wrap: anywhere;
}

.job-chat-citation-meta,
.job-chat-citation-excerpt,
.job-chat-extension p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.75rem;
  line-height: 1.125rem;
  overflow-wrap: anywhere;
}

.job-chat-citation-meta {
  color: var(--muted);
}

.job-chat-citation-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-chat-citation-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1rem;
}

.job-chat-citation-icon-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3125rem;
  width: 1.75rem;
  max-width: 1.75rem;
  min-height: 1.75rem;
  overflow: hidden;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--ink-muted);
  padding: 0;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 520;
  line-height: 1rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    max-width 170ms ease,
    width 170ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.job-chat-citation-icon-link:hover,
.job-chat-citation-icon-link:focus-visible,
.job-chat-citation-icon-link[data-copied="true"] {
  width: auto;
  max-width: 12rem;
  background: transparent;
  color: var(--ink);
}

.job-chat-citation-icon-link:disabled {
  cursor: default;
  opacity: 0.44;
}

.job-chat-citation-action-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
}

.job-chat-citation-action-icon svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.job-chat-citation-action-icon svg path {
  stroke-width: 1.85;
}

.job-chat-citation-action-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    max-width 170ms ease,
    opacity 120ms ease;
}

.job-chat-citation-icon-link:hover .job-chat-citation-action-label,
.job-chat-citation-icon-link:focus-visible .job-chat-citation-action-label,
.job-chat-citation-icon-link[data-copied="true"] .job-chat-citation-action-label {
  max-width: 9rem;
  opacity: 0.92;
}

.job-chat-action-check-icon,
.job-chat-citation-icon-link[data-copied="true"] .job-chat-action-copy-icon {
  display: none;
}

.job-chat-citation-icon-link[data-copied="true"] .job-chat-action-check-icon {
  display: block;
}

.job-chat-citation-link {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--warm-panel);
  color: var(--ink);
  padding: 0.3125rem 0.625rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 560;
  line-height: 1rem;
  text-decoration: none;
  cursor: pointer;
}

.job-chat-citation-link:hover {
  border-color: var(--line-strong);
  background: var(--hover-bg);
}

.job-chat-citation-link:disabled {
  cursor: default;
  opacity: 0.58;
}

.job-chat-citation-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.job-chat-gaps ul {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding-left: 1rem;
  color: var(--ink-faint);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.job-chat-inference-note {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-style: italic;
  line-height: 1.125rem;
}

.job-chat-extension {
  display: grid;
  gap: 0.625rem;
}

.job-chat-extension-button {
  appearance: none;
  width: fit-content;
  min-height: 1.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--ink);
  padding: 0.3125rem 0.625rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 560;
  line-height: 1rem;
  letter-spacing: 0;
  box-shadow: 0 0.0625rem 0.125rem var(--shadow-color-weak);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.job-chat-extension-button:hover {
  border-color: var(--line-strong);
  background: var(--warm-panel);
  color: var(--ink);
  cursor: url("data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M10.5%2023.5c-2.4-2.3-3.9-5-4.4-8.1l-.4-2.1c-.2-.9.4-1.7%201.3-1.8.7-.1%201.4.3%201.7%201l.6%201.6V6.2c0-.9.7-1.6%201.6-1.6s1.6.7%201.6%201.6v6.3-8c0-.9.7-1.6%201.6-1.6s1.6.7%201.6%201.6v8-6.6c0-.9.7-1.6%201.6-1.6s1.6.7%201.6%201.6v7.2-4.5c0-.9.7-1.6%201.6-1.6s1.6.7%201.6%201.6v7.9c0%204.6-2.8%207.9-7.3%207.9h-4z%22%20fill%3D%22white%22%20stroke%3D%22black%22%20stroke-width%3D%221.4%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22/%3E%3C/svg%3E") 7 2, pointer;
  box-shadow: 0 0.1875rem 0.5rem var(--shadow-color-weak);
  transform: translateY(-0.03125rem);
}

.job-chat-extension-button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.job-chat-composer {
  grid-row: 3;
  width: min(100% - 2rem, 50rem);
  min-height: 3rem;
  margin: 0 auto 0.875rem;
  padding: 0.375rem 0.4375rem 0.375rem 0.8125rem;
}

.job-chat-composer.is-disabled {
  opacity: 0.62;
}

/* Insufficient-balance state: the composer is replaced by this single full-width
   "Deposit to chat" CTA. It shares .job-chat-composer's footprint (grid row,
   width, centering, bottom margin) so it sits exactly where the composer was; no
   input while the wallet can't cover a consult — one tap opens the funding modal. */
.job-chat-deposit-composer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 1.25rem;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.job-chat-deposit-composer:hover {
  background: color-mix(in srgb, var(--accent) 88%, black);
}

/* The composer's author display rules (grid/flex) outrank the UA `[hidden]`
   style, so the `hidden` attribute alone wouldn't hide them. Make it explicit so
   the form ↔ Deposit-button swap actually toggles. (.job-chat-composer is also on
   the deposit button, so this one rule covers both.) */
.job-chat-composer[hidden] {
  display: none;
}

.job-chat-composer-plus,
.job-chat-send-button {
  appearance: none;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  font: inherit;
  padding: 0;
}

.job-chat-composer-plus {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
}

.job-chat-composer-plus:disabled {
  color: var(--ink);
  opacity: 1;
}

.job-chat-composer-plus svg {
  width: 1.25rem;
  height: 1.25rem;
}

.job-chat-composer textarea {
  width: 100%;
  min-height: 1.5rem;
  max-height: 8rem;
  border: 0;
  border-radius: 0;
  background: var(--warm-panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.125rem 0;
  resize: none;
  overflow-y: auto;
}

.job-chat-composer textarea::placeholder {
  color: var(--ink-faint);
}

.job-chat-composer textarea:focus {
  outline: 0;
  box-shadow: none;
}

.job-chat-composer textarea:disabled {
  background: transparent;
  color: var(--ink-faint);
}

.job-chat-composer-controls {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.job-chat-send-button {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-inverse);
  transition:
    transform 140ms ease,
    background 140ms ease,
    opacity 140ms ease;
}

.job-chat-send-button:disabled {
  background: var(--active-bg);
  color: var(--ink-faint);
  opacity: 1;
  cursor: default;
}

.job-chat-composer.has-question .job-chat-send-button:not(:disabled) {
  cursor: pointer;
}

.job-chat-composer.has-question .job-chat-send-button:not(:disabled):hover {
  background: light-dark(#000000, #ffffff);
  transform: translateY(-0.03125rem);
}

.job-chat-composer.has-question .job-chat-send-button:not(:disabled):active {
  transform: scale(0.94);
}

.job-chat-send-button svg {
  position: absolute;
  width: 1.0625rem;
  height: 1.0625rem;
  transition: transform 140ms ease;
}

.job-chat-send-icon {
  transform: translateY(0) scale(1);
}

.job-chat-composer.has-question .job-chat-send-icon {
  transform: translateY(-0.03125rem) scale(1);
}

.job-chat-stop-icon {
  display: none;
}

.job-chat-send-button[data-mode="stop"] {
  background: var(--ink);
  color: var(--ink-inverse);
  cursor: pointer;
}

.job-chat-send-button[data-mode="stop"]:hover {
  background: light-dark(#000000, #ffffff);
}

.job-chat-send-button[data-mode="stop"] .job-chat-send-icon {
  display: none;
}

.job-chat-send-button[data-mode="stop"] .job-chat-stop-icon {
  display: block;
}

.job-chat-main > .job-message {
  grid-row: 4;
  width: min(100% - 2rem, 56rem);
  margin: 0 auto 1rem;
}

/* Scope pill — shows what the chat is bound to, so the user always sees they
   are asking about this run (mirrors Palate's collection chip). */
.job-chat-scope {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  max-width: 100%;
  border: 1px solid var(--soft-line);
  border-radius: 0.5rem;
  background: var(--hover-bg);
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 540;
  line-height: 1rem;
  padding: 0.1875rem 0.4375rem;
}

.job-chat-scope[hidden] {
  display: none;
}

.job-chat-scope svg {
  width: 0.8125rem;
  height: 0.8125rem;
  flex: 0 0 auto;
  opacity: 0.65;
}

.job-chat-scope-label {
  min-width: 0;
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Avatar (e.g. a persona) — replaces the folder glyph when the scope has one.
   Shared across surfaces (entity/run/topic) so the chip looks the same. */
.job-chat-scope-avatar {
  width: 1.0625rem;
  height: 1.0625rem;
  flex: 0 0 auto;
  border-radius: 999px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.06);
}

.job-chat-scope-avatar[hidden] {
  display: none;
}

/* Remove (×) — drops the scope and goes to the general chat. */
.job-chat-scope-remove {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.0625rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.14s ease, background 0.14s ease;
}

.job-chat-scope-remove[hidden] {
  display: none;
}

.job-chat-scope-remove:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}

.job-chat-scope-remove svg {
  /* Override the chip's muted-svg sizing/opacity; the button drives both. */
  width: 0.6875rem;
  height: 0.6875rem;
  opacity: 1;
}

/* When the scope pill is present the composer becomes a two-row rounded
   rectangle (pill on top, input row below). Gated on :has() so the global
   chat composer — which has no scope pill — stays a single-row pill. */
.job-chat-composer:has(.job-chat-scope:not([hidden])) {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  border-radius: 1.25rem;
  row-gap: 0.4375rem;
  padding-top: 0.5rem;
  padding-bottom: 0.4375rem;
}

.job-chat-composer:has(.job-chat-scope:not([hidden])) .job-chat-scope {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: start;
}

.job-chat-composer:has(.job-chat-scope:not([hidden])) .job-chat-composer-plus,
.job-chat-composer:has(.job-chat-scope:not([hidden])) > textarea,
.job-chat-composer:has(.job-chat-scope:not([hidden])) .job-chat-composer-controls {
  grid-row: 2;
}

.global-chat-route {
  margin: 0;
  background: var(--warm-panel);
  overflow: hidden;
}

.global-chat-route #root {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

.global-chat-app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--warm-panel);
}

.global-chat-app.is-embedded,
.global-chat-embedded .global-chat-app {
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.global-chat-embedded .global-chat-nav {
  display: none;
}

.global-chat-nav {
  position: relative;
  z-index: 5;
  width: 100%;
  min-height: 3.75rem;
  padding: 1rem clamp(1rem, 2vw, 2rem);
  border-bottom: 1px solid var(--soft-line);
  background: var(--surface-raised);
}

.global-chat-nav .brand-link {
  width: auto;
  min-width: 0;
  gap: 0.5rem;
  color: var(--ink-muted);
}

.global-chat-nav-brand-text {
  color: inherit;
  font-size: 0.8125rem;
  font-weight: 520;
  line-height: 1.25rem;
}

.global-chat-page {
  display: grid;
  grid-template-columns: minmax(13.5rem, 17rem) minmax(0, 1fr);
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--warm-panel);
}

.global-chat-app.is-embedded .global-chat-page {
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
}

.global-chat-app.is-embedded .global-chat-sidebar {
  padding-top: 0.625rem;
}

.global-chat-app.is-embedded .global-chat-run-thread {
  padding-top: 0.875rem;
}

.global-chat-shell {
  animation: global-chat-shell-in 160ms cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

.global-chat-sidebar {
  border-right: 1px solid var(--soft-line);
  gap: 0.125rem;
  padding: 0.75rem 0.5rem 0.875rem;
  transition: min-width 220ms cubic-bezier(0.25, 0.1, 0.25, 1), max-width 220ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.global-chat-app.is-sidebar-closed .global-chat-page {
  grid-template-columns: auto minmax(0, 1fr);
}

.global-chat-app.is-sidebar-closed .global-chat-sidebar {
  min-width: 3.25rem;
  max-width: 3.25rem;
  overflow: hidden;
}

.global-chat-app.is-sidebar-closed .global-chat-sidebar .job-chat-sessions-header,
.global-chat-app.is-sidebar-closed .global-chat-sidebar .job-chat-recents-heading,
.global-chat-app.is-sidebar-closed .global-chat-sidebar .job-chat-session-list,
.global-chat-app.is-sidebar-closed .global-chat-sidebar .global-chat-run-group,
.global-chat-app.is-sidebar-closed .global-chat-sidebar .global-chat-logout {
  display: none;
}

.global-chat-app.is-sidebar-closed .global-chat-sidebar-brand {
  justify-content: center;
}

.global-chat-app.is-sidebar-closed .global-chat-sidebar-toggle {
  display: none;
}

.global-chat-sidebar-expand {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
}

.global-chat-sidebar-expand:hover {
  opacity: 0.7;
}

.global-chat-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.125rem 0.25rem 0.5rem;
  min-height: 2rem;
}

.global-chat-sidebar-brand .brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: auto;
  height: auto;
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
}

.global-chat-sidebar-brand-text {
  font-size: 0.8125rem;
  font-weight: 620;
  line-height: 1.25rem;
  white-space: nowrap;
}

.global-chat-sidebar-toggle {
  appearance: none;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--ink-faint);
  padding: 0;
  cursor: pointer;
}

.global-chat-sidebar-toggle:hover,
.global-chat-sidebar-toggle:focus-visible {
  background: var(--hover-bg);
  color: var(--ink);
}

.global-chat-sidebar-toggle svg {
  width: 1rem;
  height: 1rem;
}

.global-chat-sidebar .job-chat-sessions-header .job-inline-button {
  gap: 0.625rem;
  min-height: 2.125rem;
  border-radius: 0.5rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 520;
  line-height: 1.125rem;
}

.global-chat-sidebar .job-chat-sessions-header .job-inline-button svg {
  width: 1rem;
  height: 1rem;
}

.global-chat-sidebar .job-chat-sessions-header {
  margin-top: 0;
}

.global-chat-sidebar .job-chat-recents-heading {
  margin: 1rem 0.5rem 0.25rem;
  color: var(--ink-muted);
  font-size: 0.6875rem;
  font-weight: 650;
  line-height: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.global-chat-sidebar .job-chat-session-list {
  gap: 0.0625rem;
}

.global-chat-sidebar .job-chat-session-row {
  min-height: 2rem;
  border-radius: 0.5rem;
  padding: 0.1875rem 0.3125rem 0.1875rem 0.5rem;
}

.global-chat-sidebar .job-chat-session-button {
  color: var(--ink-muted);
  font-size: 0.8125rem;
  line-height: 1.125rem;
}

.global-chat-sidebar .job-chat-session-row.is-active .job-chat-session-button {
  color: var(--ink);
}

.global-chat-sidebar .job-chat-session-delete {
  width: 1.5rem;
  height: 1.5rem;
}

.global-chat-sidebar .job-chat-session-delete svg {
  width: 1rem;
  height: 1rem;
}

.global-chat-main {
  position: relative;
  min-height: 0;
  overflow: visible;
}

.global-chat-run-thread {
  grid-row: 1;
  display: grid;
  align-content: start;
  gap: 1rem;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem max(1.5rem, calc((100% - 56rem) / 2)) 7rem;
}

.global-chat-scroll-jump {
  position: sticky;
  bottom: 6.25rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 0.3125rem;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--ink-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
  padding: 0.375rem 0.625rem;
  box-shadow: 0 0.5rem 1.5rem var(--shadow-color);
}

.global-chat-scroll-jump:hover,
.global-chat-scroll-jump:focus-visible {
  border-color: var(--line-strong);
  color: var(--ink);
}

.global-chat-scroll-jump svg {
  width: 0.875rem;
  height: 0.875rem;
}

.global-chat-run-thread.is-empty {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  padding-bottom: 1rem;
}

.global-chat-run-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  width: min(100%, 56rem);
  justify-self: center;
  border: 1px solid var(--soft-line);
  border-radius: 0.875rem;
  background: var(--surface-sunken);
  color: inherit;
  padding: 0.75rem;
  text-decoration: none;
  view-transition-name: researcher-run-summary;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.global-chat-run-summary:hover {
  border-color: var(--line-strong);
  background: var(--hover-bg);
  transform: translateY(-0.03125rem);
}

.global-chat-run-summary-icon {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--soft-line);
  border-radius: 0.625rem;
  background: var(--warm-panel);
  color: var(--ink-muted);
}

.global-chat-run-summary-icon svg,
.global-chat-run-summary-arrow svg {
  width: 1rem;
  height: 1rem;
}

.global-chat-run-summary-body {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.global-chat-run-summary-kicker,
.global-chat-run-summary-meta {
  color: var(--ink-faint);
  font-size: 0.75rem;
  line-height: 1rem;
}

.global-chat-run-summary strong,
.global-chat-started-run-body strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-chat-run-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.global-chat-run-summary-meta span + span::before {
  content: "·";
  margin-right: 0.375rem;
  color: var(--ink-faint);
}

.global-chat-run-summary-arrow {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  color: var(--ink-faint);
}

.global-chat-run-summary:hover .global-chat-run-summary-arrow {
  color: var(--ink);
}

.global-chat-started-run-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  width: min(100%, 48rem);
  justify-self: center;
  border: 1px solid var(--soft-line);
  border-radius: 0.75rem;
  background: var(--warm-panel);
  color: inherit;
  padding: 0.875rem;
  text-decoration: none;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.global-chat-started-run-card:hover {
  border-color: var(--line-strong);
  background: var(--hover-bg);
  transform: translateY(-0.03125rem);
}

.global-chat-started-run-icon,
.global-chat-started-run-arrow {
  display: inline-grid;
  place-items: center;
  color: var(--ink-muted);
}

.global-chat-started-run-icon {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--soft-line);
  border-radius: 0.625rem;
}

.global-chat-started-run-icon svg,
.global-chat-started-run-arrow svg {
  width: 1rem;
  height: 1rem;
}

.global-chat-started-run-body {
  display: grid;
  min-width: 0;
}

.global-chat-started-run-kicker,
.global-chat-started-run-meta {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1rem;
}

.global-chat-started-run-meta {
  display: flex;
  gap: 0.375rem;
}

.global-chat-started-run-meta span + span::before {
  content: "·";
  margin-right: 0.375rem;
}

.global-chat-run-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  align-self: stretch;
  gap: 0.75rem;
  min-height: 0;
  width: min(100%, 50rem);
  justify-self: center;
  padding: clamp(2rem, 10vh, 7rem) 0;
  text-align: center;
}

.global-chat-run-empty h2,
.global-chat-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.25rem;
}

.global-chat-run-empty .global-chat-composer {
  position: relative;
  bottom: auto;
  width: 100%;
  margin: 0;
}

.global-chat-run-empty .global-chat-attachment-list {
  width: 100%;
  margin: -0.25rem 0 0;
}

.global-chat-run-empty .global-chat-status,
.global-chat-run-empty .global-chat-error {
  width: 100%;
}

.global-chat-run-empty p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.global-chat-run-messages {
  width: min(100%, 56rem);
  justify-self: center;
  overflow: visible;
  padding: 0;
}

.global-chat-thread {
  padding-bottom: 7rem;
}

.global-chat-run-thread .global-chat-run-messages {
  grid-row: auto;
  padding: 0;
}

.global-chat-empty {
  min-height: 100%;
}

.global-chat-composer {
  position: sticky;
  bottom: 1.25rem;
  z-index: 4;
  view-transition-name: researcher-chat-composer;
  contain: layout;
  margin-bottom: 1.25rem;
}

.global-chat-attachment-list {
  grid-row: 3;
  align-self: start;
  margin-top: -0.875rem;
  margin-bottom: 0.75rem;
}

.global-chat-card {
  display: grid;
  gap: 0.625rem;
  width: min(100%, 36rem);
  justify-self: center;
  border: 1px solid var(--soft-line);
  border-radius: 0.75rem;
  background: var(--warm-panel);
  padding: 0.875rem;
}

.global-chat-proposal-card {
  position: relative;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.875rem 1rem;
  width: min(100%, 48rem);
  padding: 0.9375rem 1rem;
  box-shadow: 0 0.0625rem 0.125rem var(--shadow-color-weak);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.global-chat-proposal-card.is-starting {
  border-color: var(--line-strong);
  box-shadow:
    0 0.5rem 1.5rem var(--shadow-color-weak),
    0 0.0625rem 0.125rem var(--shadow-color-weak);
}

.global-chat-proposal-card.is-starting::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 40%;
  height: 0.125rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--ink), transparent);
  animation: global-chat-card-progress 1100ms cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.global-chat-proposal-main {
  display: grid;
  min-width: 0;
  gap: 0.375rem;
}

.global-chat-proposal-side {
  display: grid;
  justify-items: end;
  align-self: start;
  gap: 0.625rem;
  min-width: 12rem;
}

.global-chat-proposal-state {
  margin: 0;
  justify-self: end;
  color: var(--ink-muted) !important;
  font-size: 0.75rem !important;
  font-weight: 600;
  line-height: 1rem !important;
}

.global-chat-proposal-kicker {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 650;
  line-height: 0.9375rem;
}

.global-chat-proposal-title-row {
  display: flex;
  align-items: start;
  min-width: 0;
  gap: 0.375rem;
}

.global-chat-proposal-prompt {
  max-width: 42rem;
  color: var(--ink-muted) !important;
  font-size: 0.8125rem !important;
  line-height: 1.1875rem !important;
  white-space: pre-wrap;
  word-break: break-word;
}

.global-chat-proposal-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: end;
  gap: 0.5rem;
  align-self: end;
}

.global-chat-proposal-card.is-starting .global-chat-proposal-controls,
.global-chat-proposal-card.is-starting .global-chat-options {
  opacity: 0.42;
}

.global-chat-proposal-controls label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 650;
  line-height: 0.875rem;
}

.global-chat-budget-field,
.global-chat-run-count-input {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--warm-panel);
  color: var(--ink-muted);
  padding: 0 0.625rem;
  font-size: 0.8125rem;
  font-weight: 590;
  line-height: 1rem;
}

.global-chat-budget-field {
  gap: 0.125rem;
}

.global-chat-budget-field input,
.global-chat-run-count-input {
  width: 3.25rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 0;
}

.global-chat-run-count-input {
  width: 4rem;
}

.global-chat-budget-field:focus-within,
.global-chat-run-count-input:focus {
  border-color: var(--ink);
}

.global-chat-proposal-starting {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 590;
  line-height: 1rem;
}

.global-chat-starting-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 999px;
  background: var(--ink);
  animation: global-chat-pulse 900ms ease-in-out infinite;
}

.global-chat-starting-detail {
  color: var(--muted);
  font-weight: 500;
}

.global-chat-icon-button {
  appearance: none;
  display: inline-grid;
  flex: 0 0 auto;
  width: 1.625rem;
  height: 1.625rem;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
}

.global-chat-icon-button:hover,
.global-chat-icon-button:focus-visible {
  background: var(--hover-bg);
  color: var(--ink);
}

.global-chat-icon-button svg {
  width: 1rem;
  height: 1rem;
}

.global-chat-proposal-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 0.375rem;
}

.global-chat-proposal-card h2 {
  max-width: 42rem;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.1875rem;
  letter-spacing: 0;
  text-wrap: pretty;
}

.global-chat-card p,
.system-detail p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.global-chat-muted {
  color: var(--muted) !important;
}

.global-chat-address {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--soft-line);
  border-radius: 0.5rem;
  background: var(--surface-sunken);
  padding: 0.5rem 0.625rem;
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.125rem;
}

.global-chat-funding-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1rem;
}

.global-chat-funding-chain strong {
  font-weight: 650;
}

.global-chat-funding-chain span {
  color: var(--muted);
}

.global-chat-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.375rem;
}

.global-chat-address-row .global-chat-address {
  min-width: 0;
}

.global-chat-copy-address {
  border: 1px solid var(--soft-line);
  background: var(--warm-panel);
}

.global-chat-funding-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.global-chat-primary,
.global-chat-secondary,
.global-chat-options button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--warm-panel);
  color: var(--ink);
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 590;
  line-height: 1.125rem;
  cursor: pointer;
}

.global-chat-link-button {
  text-decoration: none;
}

.global-chat-primary {
  gap: 0.375rem;
  background: var(--ink);
  color: var(--ink-inverse);
}

.global-chat-primary.is-busy:disabled {
  cursor: progress;
  opacity: 1;
}

.global-chat-button-spinner {
  width: 0.8125rem;
  height: 0.8125rem;
  border: 0.125rem solid color-mix(in srgb, var(--ink-inverse) 32%, transparent);
  border-top-color: var(--ink-inverse);
  border-radius: 999px;
  animation: global-chat-spin 700ms linear infinite;
}

.global-chat-primary:disabled,
.global-chat-secondary:disabled,
.global-chat-options button:disabled {
  cursor: default;
  opacity: 0.48;
}

.global-chat-options {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.global-chat-options button.is-active {
  border-color: var(--line-strong);
}

@keyframes global-chat-card-progress {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(260%);
  }
}

@keyframes global-chat-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes global-chat-pulse {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-chat-proposal-card.is-starting::before,
  .global-chat-button-spinner,
  .global-chat-starting-dot {
    animation: none;
  }
}

.global-chat-error {
  width: min(100%, 36rem);
  justify-self: center;
}

.global-chat-status {
  width: min(100%, 56rem);
  justify-self: center;
  margin: 0;
}

@media (max-width: 720px) {
  .global-chat-proposal-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .global-chat-proposal-side {
    justify-items: stretch;
    min-width: 0;
  }

  .global-chat-proposal-state {
    justify-self: start;
  }

  .global-chat-proposal-controls {
    justify-content: start;
  }

  .global-chat-proposal-actions {
    justify-content: start;
  }
}

.global-chat-run-group {
  display: grid;
  gap: 0.0625rem;
  min-width: 0;
}

.global-chat-run-header {
  display: grid;
  grid-template-columns: 1.125rem minmax(0, 1fr) 1.25rem;
  align-items: center;
  min-height: 1.875rem;
  border-radius: 0.625rem;
  padding: 0 0.3125rem;
}

.global-chat-run-group.is-active > .global-chat-run-header,
.global-chat-run-header:hover {
  background: var(--hover-bg);
}

.global-chat-run-toggle,
.global-chat-run-new,
.global-chat-run-title {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  cursor: pointer;
}

.global-chat-run-toggle,
.global-chat-run-new {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  padding: 0;
  color: var(--ink-faint);
}

.global-chat-run-new {
  opacity: 0;
}

.global-chat-run-header:hover .global-chat-run-new,
.global-chat-run-header:focus-within .global-chat-run-new,
.global-chat-run-group.is-expanded .global-chat-run-new,
.global-chat-run-group.is-active .global-chat-run-new {
  opacity: 1;
}

.global-chat-run-toggle:hover,
.global-chat-run-new:hover,
.global-chat-run-toggle:focus-visible,
.global-chat-run-new:focus-visible {
  background: var(--active-bg);
  color: var(--ink);
}

.global-chat-run-toggle svg,
.global-chat-run-new svg {
  width: 0.875rem;
  height: 0.875rem;
}

.global-chat-run-group.is-expanded .global-chat-run-toggle svg {
  transform: rotate(90deg);
}

.global-chat-run-spacer {
  display: block;
  width: 1.125rem;
  height: 1.25rem;
}

.global-chat-run-title {
  min-width: 0;
  overflow: hidden;
  padding: 0.21875rem 0.25rem;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  line-height: 1.125rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-chat-run-group.is-active .global-chat-run-title {
  color: var(--ink);
}

.global-chat-run-sessions {
  display: grid;
  gap: 0.0625rem;
  min-width: 0;
  padding: 0 0 0.25rem 1.125rem;
}

.global-chat-run-sessions .job-chat-session-row {
  min-height: 1.875rem;
  border-radius: 0.5rem;
}

.global-chat-run-sessions .job-chat-session-button {
  font-size: 0.78125rem;
  line-height: 1.0625rem;
}

.global-chat-run-session-empty {
  margin: 0.25rem 0.5rem 0.375rem;
}

.global-chat-logout {
  appearance: none;
  width: 100%;
  min-height: 2rem;
  border: 0;
  border-radius: 0.625rem;
  background: transparent;
  color: var(--ink-muted);
  padding: 0.25rem 0.5rem;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.125rem;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-chat-logout:hover {
  background: var(--hover-bg);
  color: var(--ink);
}

.global-chat-logout {
  margin-top: auto;
  color: var(--ink-faint);
  font-size: 0.75rem;
}

@keyframes global-chat-shell-in {
  from {
    opacity: 0.72;
    transform: translateY(0.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes job-chat-modal-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes job-chat-modal-backdrop-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes job-chat-modal-panel-in {
  from {
    opacity: 0;
    transform: translate3d(0, 0.375rem, 0) scale(0.992);
  }
  45% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes job-chat-modal-panel-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(0, 0.25rem, 0) scale(0.996);
  }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-old(researcher-chat-composer),
  ::view-transition-new(researcher-chat-composer) {
    animation-duration: 1ms;
    animation-name: none;
  }

  .global-chat-shell,
  .home-start-composer,
  .home-chat-modal-layer,
  .home-chat-modal,
  .job-chat-citation-grid,
  .job-chat-workspace-header,
  .job-chat-header-sidebar,
  .job-chat-header-sidebar-title,
  .job-chat-workspace-body,
  .job-chat-sessions,
  .job-chat-modal-open .job-chat-view,
  .job-chat-modal-open .job-chat-workspace,
  .job-chat-modal-closing .job-chat-view,
  .job-chat-modal-closing .job-chat-workspace {
    animation: none;
    transition-duration: 1ms;
  }
}

@media (max-width: 760px) {
  .global-chat-nav {
    min-height: 3.25rem;
    gap: 0.625rem;
    padding: 0.8125rem 1rem;
    font-size: 0.75rem;
  }

  .global-chat-nav .brand-mark {
    display: none;
  }

  .global-chat-page {
    grid-template-columns: 1fr;
  }

  .global-chat-app.is-embedded .global-chat-page {
    grid-template-columns: 1fr;
  }

  .global-chat-sidebar {
    display: none;
  }

  .home-chat-modal-layer {
    padding: 0.5rem;
  }

  .home-chat-modal {
    width: 100%;
    height: min(100%, calc(100dvh - 1rem));
    border-radius: 0.625rem;
  }

  .job-run-agent-prompts {
    grid-template-columns: 1fr;
  }

  .job-chat-view {
    padding: 0;
  }

  .job-chat-route .job-shell {
    padding: 0;
  }

  .job-chat-route .job-chat-view {
    min-height: 100vh;
  }

  .job-chat-workspace {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .job-chat-sidebar-open .job-chat-workspace-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .job-chat-header-sidebar {
    min-height: 3.25rem;
    padding: 0.625rem 0.5rem 0.625rem 0.75rem;
  }

  .job-chat-sidebar-open .job-chat-header-sidebar {
    border-right: 0;
  }

  .job-chat-header-sidebar-title {
    display: none;
  }

  .job-chat-route .job-chat-workspace {
    height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .job-chat-workspace-body {
    grid-template-columns: 1fr;
  }

  .job-chat-sessions {
    max-height: 12rem;
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .job-chat-modal-open:not(.job-chat-sidebar-open) .job-chat-sessions {
    display: none;
  }

  /* Persona chat: open the sessions sidebar as a full-cover drawer so the WHOLE
     Recents list is reachable (it was trapped in a ~12rem box). Picking a chat /
     New chat closes the drawer — wired in entity-chat.js. */
  body.entity-page .job-chat-workspace-body {
    position: relative;
  }

  body.entity-page.job-chat-sidebar-open .job-chat-sessions {
    position: absolute;
    inset: 0;
    z-index: 12;
    width: auto;
    max-height: none;
    overflow-y: auto;
    border: 0;
    background: var(--warm-panel);
    padding: 0.875rem 0.875rem calc(env(safe-area-inset-bottom) + 1rem);
  }

  .job-chat-composer,
  .job-chat-source-context,
  .job-chat-main > .job-message {
    width: calc(100% - 1rem);
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }

  .job-chat-source-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .job-chat-source-card-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }

  .job-chat-composer {
    min-height: 2.875rem;
    padding: 0.34375rem 0.40625rem 0.34375rem 0.6875rem;
  }

  .job-chat-composer textarea {
    /* >= 16px stops iOS Safari from zooming the page on focus. */
    font-size: 16px;
    line-height: 1.375rem;
  }

  .job-chat-composer-plus {
    width: 2rem;
    height: 2rem;
  }

  .job-chat-composer-plus svg {
    width: 1.1875rem;
    height: 1.1875rem;
  }

  .job-chat-send-button {
    width: 2.375rem;
    height: 2.375rem;
  }

  /* Full-screen sheet: respect iOS safe areas so the composer clears the home
     indicator and the header clears the notch. */
  .job-chat-workspace {
    position: relative;
  }

  .job-chat-workspace-header {
    padding-top: calc(env(safe-area-inset-top) + 0.625rem);
  }

  .job-chat-composer {
    margin-bottom: max(0.625rem, env(safe-area-inset-bottom));
  }

  .job-chat-route .job-chat-view {
    min-height: 100dvh;
  }

  .job-chat-route .job-chat-workspace {
    height: 100dvh;
  }

  /* Drag handle for swipe-to-dismiss (wired in job/job-chat-swipe-dismiss.js). */
  .job-chat-grabber {
    display: block;
    position: absolute;
    top: calc(env(safe-area-inset-top) + 0.375rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 2.25rem;
    height: 0.25rem;
    border-radius: 999px;
    background: var(--warm-line);
    touch-action: none;
    cursor: grab;
  }
}
