/* Editorial workbench (§18): calm, dense, and aligned with Gift Review.
   Serif is reserved for long-form research and report reading.
   Monospace is reserved for EINs / FEC IDs / dollar amounts only. */

:root {
  color-scheme: light;
  --paper: #f4f2ec;
  --surface: #fbfaf6;
  --surface-subtle: #f1efe7;
  --surface-raised: #ffffff;
  --ink: #23262b;
  --muted: #4f545f;
  --faint: #777b83;
  --accent: #8a6a2e;
  --accent-ink: #6d501d;
  --accent-soft: #eee5d3;
  --amber: #8b5d12;
  --amber-bg: #f7edcf;
  --green: #1f6b48;
  --green-bg: #e3f0e8;
  --red: #9a3d34;
  --red-bg: #f6e4e1;
  --blue: #2a5d8f;
  --blue-bg: #e4ebf2;
  --rule: #e1dcd0;
  --rule-strong: #d0c9b9;
  --shadow: 0 16px 40px rgb(61 51 31 / 0.12);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --cd-navy: oklch(0.185 0.022 255 / 0.98);
  --cd-green: oklch(0.72 0.13 158);
  --cd-masthead-bg: rgb(251 250 246 / 0.97);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1215;
  --surface: #171b1f;
  --surface-subtle: #1d2227;
  --surface-raised: #20262b;
  --ink: #d9d6cd;
  --muted: #aaa798;
  --faint: #858276;
  --accent: #c8a96b;
  --accent-ink: #e0c58e;
  --accent-soft: #342d21;
  --amber: #e3b438;
  --amber-bg: #332b17;
  --green: #68cc94;
  --green-bg: #183326;
  --red: #ef8478;
  --red-bg: #3b211f;
  --blue: #7aa7d4;
  --blue-bg: #1d2c3b;
  --rule: #292e33;
  --rule-strong: #3a4047;
  --shadow: 0 18px 48px rgb(0 0 0 / 0.34);
  --cd-masthead-bg: rgb(23 27 31 / 0.97);
}

* { box-sizing: border-box; }

/* Author-level display rules (for example `.stack { display: grid; }`) can
   otherwise override the browser's default treatment of the hidden
   attribute. Shared-auth forms rely on hidden while JavaScript selects the
   one valid account state. */
[hidden] { display: none !important; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
}

code { font-family: var(--mono); font-size: 0.86em; }

a { color: var(--accent); }

/* ── CD OPS chrome contract v1 ───────────────────────────────────── */

.suite-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 32px;
  border-bottom: 1px solid oklch(0.3 0.025 255);
  background: var(--cd-navy);
  color: oklch(0.96 0.008 250);
}
.suite-brand {
  color: oklch(0.9 0.1 158);
  font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  text-decoration: none;
  white-space: nowrap;
}
.suite-brand:hover { color: white; text-decoration: none; }
.suite-nav {
  display: flex;
  align-items: stretch;
  min-width: 0;
  height: 42px;
  margin-left: 28px;
  overflow: visible;
  scrollbar-width: thin;
}
.suite-nav a {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  height: 42px;
  padding: 0 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: oklch(0.78 0.015 250);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.suite-nav a:hover { border-color: transparent; color: white; text-decoration: none; }
.suite-nav a[aria-current="page"] { border-bottom-color: var(--cd-green); color: white; }
.suite-menu { position: relative; display: flex; flex: 0 0 auto; }
.suite-menu > button {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: oklch(0.78 0.015 250);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.suite-menu > button::after {
  content: "▾";
  margin-left: 6px;
  color: oklch(0.64 0.02 250);
  font-size: 9px;
}
.suite-menu:hover > button,
.suite-menu:focus-within > button { color: white; }
/* CD OPS Lobbying menu contract v2 */
.suite-submenu {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  z-index: 80;
  display: none;
  width: 220px;
  min-width: 220px;
  padding: 6px;
  border: 1px solid #344154;
  background: #111827;
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.35);
}
.suite-menu:hover .suite-submenu,
.suite-menu:focus-within .suite-submenu,
.suite-menu.is-open .suite-submenu { display: block; }
.suite-menu .suite-submenu a,
.suite-menu .suite-submenu [aria-disabled="true"] {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  height: auto;
  padding: 8px 10px;
  border: 0;
  color: #dce3ea;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
}
.suite-menu .suite-submenu a:hover,
.suite-menu .suite-submenu a:focus-visible {
  border: 0;
  background: #1c2737;
  color: #86efb6;
}
.suite-menu .suite-submenu a[aria-current="page"] { box-shadow: inset 2px 0 #72d9a5; }
.suite-menu .suite-submenu [aria-disabled="true"] { color: #8c98a8; cursor: default; }
.suite-menu .suite-submenu small {
  margin-left: auto;
  color: #8c98a8;
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.suite-account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 42px;
  margin-left: 16px;
  color: oklch(0.8 0.012 250);
  font-size: 11px;
}
.suite-user {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suite-account form { display: flex; margin: 0; }
.suite-account button {
  min-height: 27px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid oklch(0.52 0.02 255);
  border-radius: 4px;
  background: transparent;
  color: oklch(0.88 0.01 250);
  font-size: 11px;
  cursor: pointer;
}
.suite-account button:hover {
  border-color: oklch(0.72 0.02 255);
  background: oklch(0.25 0.045 258);
  color: white;
}

.product-masthead {
  position: sticky;
  top: 42px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(205px, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  height: 62px;
  min-height: 62px;
  padding: 10px 32px;
  border-bottom: 1px solid var(--rule-strong);
  background: var(--cd-masthead-bg);
  backdrop-filter: blur(14px);
}
.product-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}
.product-brand:hover { color: var(--ink); text-decoration: none; }
.product-mark {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--cd-navy);
  color: oklch(0.9 0.1 158);
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.product-title-block { display: block; min-width: 0; }
.product-title {
  display: block;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-status {
  display: block;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-nav { display: flex; align-items: stretch; height: 62px; }
.product-nav a {
  display: flex;
  align-items: center;
  height: 62px;
  padding: 0 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.product-nav a:hover { color: var(--ink); }
.product-nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--ink); }

@media (max-width: 920px) {
  .suite-bar { padding: 0 16px; }
  .suite-nav { margin-left: 16px; }
  .suite-nav a, .suite-menu > button { padding: 0 10px; }
  .suite-submenu { position: fixed; top: 41px; right: 10px; left: auto; }
  .suite-user { display: none; }
  .suite-account { margin-left: 8px; }
  .product-masthead { padding: 10px 16px; }
}

@media (max-width: 640px) {
  .suite-bar { padding: 0 10px; }
  .suite-brand { font-size: 10px; }
  .suite-nav {
    margin-left: 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .suite-nav a, .suite-menu > button { padding: 0 9px; font-size: 11px; }
  .suite-account { margin-left: 4px; }
  .suite-account button { padding: 0 7px; }
  .product-masthead { grid-template-columns: minmax(140px, 1fr) auto; padding: 10px 12px; }
  .product-mark { display: none; }
  .product-title { font-size: 18px; }
  .product-status { display: none; }
  .product-nav a { padding: 0 8px; }
}

main { max-width: 47rem; margin: 0 auto; padding: 2.25rem 1.5rem 4rem; }
.source-main { max-width: 64rem; }
.review-main { max-width: 80rem; }
.revision-main { max-width: 82rem; }

.linklike {
  background: none; border: none; padding: 0;
  font: inherit; cursor: pointer;
  color: var(--accent); text-decoration: underline;
}

.muted { color: var(--muted); }
.error { color: var(--red); }

/* ── Small furniture ─────────────────────────────────────────── */

.crumb { font-size: 0.9rem; margin: 0 0 0.4rem; }
.crumb a { color: var(--accent); text-decoration: none; }
.crumb .sep { color: var(--faint); margin: 0 0.35rem; }
.crumb .here { color: var(--muted); }

h1.display {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 3.1rem;
  line-height: 1.1;
  margin: 0 0 0.7rem;
  letter-spacing: -0.01em;
}

.page-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2rem;
  margin: 0 0 1rem;
}

.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.title-meta {
  display: flex; align-items: center; gap: 0.9rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: 0.5rem;
}
.title-meta .divider { color: var(--rule-strong); }

.poll-status {
  font-size: 0.82rem;
  margin: -0.15rem 0 0.8rem;
}
.poll-status.is-live { color: var(--accent); }
.poll-status.is-paused { color: var(--amber); }
.poll-status.is-complete { color: var(--green); }
.poll-status.is-live::before,
.activity-spinner {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  border: 2px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: activity-spin 0.9s linear infinite;
}
.poll-status.is-live::before {
  content: "";
  margin-right: 0.42rem;
  vertical-align: -0.08rem;
}

.pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.14rem 0.65rem; border-radius: 4px;
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 600;
  background: #eceae5; color: var(--muted);
}
.pill::before { content: "●"; font-size: 0.6em; }
.pill-awaiting, .pill-awaiting_human { background: var(--amber-bg); color: var(--amber); }
.pill-active, .pill-running { background: #e8eefc; color: var(--accent-ink); }
.pill-queued { background: #eceae5; color: var(--muted); }
.pill-failed { background: #fdeceb; color: var(--red); }
.pill-succeeded { background: #e9f6ee; color: var(--green); }
.pill-idle::before, .pill-cancelled::before { content: "○"; }

.flash { padding: 0.6rem 0.9rem; border-radius: 6px; margin: 0.7rem 0; font-size: 0.92rem; }
.flash-success { background: #e9f6ee; color: var(--green); }
.flash-error { background: #fdeceb; color: var(--red); }

/* ── Home: target inbox ──────────────────────────────────────── */

.target-list { list-style: none; padding: 0; margin: 0; }
.target-list li {
  display: flex; align-items: baseline; gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-bottom: none;
  padding: 0.8rem 1.1rem;
}
.target-list li:first-child { border-radius: 8px 8px 0 0; }
.target-list li:last-child { border-bottom: 1px solid var(--rule); border-radius: 0 0 8px 8px; }
.target-list a {
  font-family: var(--serif);
  font-size: 1.12rem;
  text-decoration: none;
  color: var(--ink);
}
.target-list a:hover { color: var(--accent); }
.target-list .pill { margin-left: auto; }

.new-target { margin-top: 1.6rem; }
.new-target summary {
  cursor: pointer; color: var(--accent); font-weight: 500;
}
.new-target form { margin-top: 0.9rem; }
.intake-next {
  max-width: 30rem;
  margin: 0.15rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}
.intake-next strong { color: var(--ink); }

/* ── Forms ───────────────────────────────────────────────────── */

.stack { display: grid; gap: 0.8rem; }
.stack label { display: grid; gap: 0.3rem; font-size: 0.92rem; color: var(--muted); }
.stack input, .stack select, .stack textarea {
  padding: 0.5rem 0.7rem; border: 1px solid var(--rule-strong); border-radius: 6px;
  font: inherit; color: var(--ink); background: var(--surface); max-width: 30rem;
}

.length-picker {
  border: 0;
  padding: 0;
  margin: 0.35rem 0 0.45rem;
}
.length-picker legend {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 600;
  padding: 0;
}
.field-help {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0.1rem 0 0.65rem;
}
.length-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  max-width: 36rem;
}
.length-option {
  position: relative;
  cursor: pointer;
}
.length-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.length-option > span {
  min-height: 4.5rem;
  display: grid;
  align-content: center;
  padding: 0.68rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  transition: border-color 120ms ease, background 120ms ease;
}
.length-option strong { font-size: 0.92rem; color: var(--ink); }
.length-option small { color: var(--muted); font-size: 0.8rem; }
.length-option em {
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 600;
}
.length-option input:checked + span {
  border-color: var(--accent);
  background: #f2f5fd;
  box-shadow: inset 3px 0 0 var(--accent);
}
.length-option input:focus-visible + span {
  outline: 3px solid rgba(30, 79, 216, 0.22);
  outline-offset: 2px;
}
.custom-length {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 10rem));
  gap: 0.65rem;
  margin-top: 0.65rem;
}
.length-picker:has(input[value="custom"]:checked) .custom-length { display: grid; }
.custom-length label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.custom-length input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  font: inherit;
  background: var(--surface);
}

button.primary, .stack button {
  justify-self: start;
  padding: 0.62rem 1.3rem;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  background: var(--accent); color: #fff;
  border: none; border-radius: 8px;
  cursor: pointer;
}
button.primary:hover, .stack button:hover { background: var(--accent-ink); }

button.secondary {
  padding: 0.5rem 1.1rem;
  font: inherit; font-weight: 500; font-size: 0.92rem;
  background: var(--surface); color: var(--accent);
  border: 1px solid var(--rule-strong); border-radius: 8px;
  cursor: pointer;
}
button.secondary:hover { border-color: var(--accent); }

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.52rem 1.05rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.button-link.primary { border: 1px solid var(--accent); background: var(--accent); color: white; }
.button-link.primary:hover { background: var(--accent-ink); }
.button-link.secondary { border: 1px solid var(--rule-strong); background: var(--surface); color: var(--accent); }
.button-link.secondary:hover { border-color: var(--accent); }

/* Human-bound external agent credentials */
.agent-access-main { max-width: 1120px; }
.agent-access-header {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(17rem, 0.7fr);
  align-items: end;
  gap: 2rem;
  padding: 1.1rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.agent-access-header h1 { margin: 0.2rem 0 0.45rem; font: 500 2.15rem/1.12 var(--serif); }
.agent-access-header p { max-width: 42rem; margin: 0; color: var(--muted); }
.agent-access-boundary { display: grid; gap: 0.55rem; margin: 0; }
.agent-access-boundary div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.75rem; }
.agent-access-boundary dt { color: var(--faint); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.agent-access-boundary dd { margin: 0; font-size: 0.84rem; }
.agent-access-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 0.78fr) minmax(0, 1.22fr);
  gap: 1.6rem;
  margin-top: 1.6rem;
}
.agent-access-section { min-width: 0; }
.agent-access-section h2, .credential-secret h2, .agent-access-notice h2 {
  margin: 0 0 0.35rem;
  font: 600 1.2rem/1.3 var(--serif);
}
.agent-access-notice, .credential-secret {
  margin-top: 1.3rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--amber);
  background: var(--amber-bg);
}
.agent-access-notice p, .credential-secret p { margin: 0.3rem 0 0; }
.credential-secret { border-left-color: var(--accent); background: #f2f5fd; }
.credential-secret-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
}
.credential-secret-actions label { display: block; font-size: 0.8rem; font-weight: 700; }
.credential-secret-actions button { padding: 0.38rem 0.68rem; font-size: 0.76rem; }
.credential-secret textarea {
  width: 100%;
  resize: vertical;
  padding: 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: 0.82rem/1.5 var(--mono);
  overflow-wrap: anywhere;
}
.credential-secret-meta { color: var(--muted); font-size: 0.78rem; }
.credential-copy-status { min-height: 1.2em; color: var(--accent-ink); font-size: 0.78rem; }
.desktop-setup {
  display: grid;
  grid-template-columns: minmax(15rem, 0.7fr) minmax(20rem, 1.3fr);
  gap: 1rem 2rem;
  margin-top: 1.3rem;
  padding: 1.2rem 0 1.35rem;
  border-bottom: 1px solid var(--rule);
}
.desktop-setup-copy h2 { margin: 0.2rem 0 0.45rem; font: 600 1.2rem/1.3 var(--serif); }
.desktop-setup-copy p { max-width: 36rem; margin: 0; color: var(--muted); }
.desktop-setup-steps {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding-left: 1.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.desktop-setup-steps strong { color: var(--ink); }
.desktop-download { grid-column: 2; justify-self: start; }
.desktop-setup-note,
.desktop-setup-unavailable {
  grid-column: 2;
  max-width: 42rem;
  margin: -0.45rem 0 0;
  color: var(--faint);
  font-size: 0.76rem;
}
.desktop-setup-unavailable {
  padding: 0.7rem 0.8rem;
  border-left: 3px solid var(--amber);
  background: var(--amber-bg);
  color: var(--muted);
}
.youtube-client-setup {
  display: grid;
  grid-template-columns: minmax(15rem, 0.7fr) minmax(20rem, 1.3fr);
  gap: 1.2rem 2rem;
  margin-top: 1.5rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface-subtle);
}
.youtube-client-intro h2 { margin: 0 0 0.45rem; font: 600 1.2rem/1.3 var(--serif); }
.youtube-client-intro p { max-width: 35rem; margin: 0; color: var(--muted); }
.youtube-client-intro .youtube-approval-note {
  margin-top: 1rem;
  padding-left: 0.8rem;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-size: 0.84rem;
}
.youtube-client-instructions { min-width: 0; }
.youtube-client-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: 0;
  padding-left: 1.4rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}
.youtube-client-steps li { padding-right: 0.35rem; }
.youtube-client-steps strong,
.youtube-client-steps span { display: block; }
.youtube-client-steps strong { margin-bottom: 0.25rem; color: var(--ink); }
.youtube-install-command {
  display: block;
  margin: 0.45rem 0;
  padding: 0.55rem 0.65rem;
  overflow-x: auto;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
}
.youtube-troubleshooting {
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
}
.youtube-troubleshooting summary { color: var(--accent-ink); cursor: pointer; font-weight: 700; }
.youtube-troubleshooting div { max-width: 48rem; padding: 0.35rem 0 0 1rem; }
.youtube-troubleshooting p { margin: 0.45rem 0 0; }
.agent-credential-form { display: grid; gap: 0.42rem; margin-top: 1rem; }
.agent-credential-form > label, .agent-credential-form legend { font-size: 0.8rem; font-weight: 700; }
.agent-credential-form input[type="text"], .agent-credential-form input[type="number"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.agent-credential-form small { margin-bottom: 0.55rem; color: var(--faint); }
.agent-credential-form fieldset { margin: 0.45rem 0 0.85rem; padding: 0; border: 0; }
.agent-credential-form fieldset ul { display: grid; gap: 0.4rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.agent-credential-form fieldset label { display: flex; align-items: start; gap: 0.5rem; font-size: 0.86rem; }
.credential-expiry { display: flex; align-items: center; gap: 0.55rem; }
.credential-expiry input { max-width: 6rem; }
.credential-expiry span { color: var(--muted); font-size: 0.86rem; }
.errorlist { margin: 0 0 0.5rem; padding-left: 1.1rem; color: var(--red); font-size: 0.8rem; }
.form-errors { color: var(--red); }
.credential-list { margin-top: 0.8rem; border-top: 1px solid var(--rule-strong); }
.credential-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.credential-row h3 { margin: 0; font-size: 0.95rem; }
.credential-row p { margin: 0.2rem 0; color: var(--muted); font: 0.74rem/1.4 var(--mono); overflow-wrap: anywhere; }
.credential-row small { display: block; color: var(--faint); font-size: 0.75rem; }
.credential-state { color: var(--muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.empty-state { padding: 1rem 0; color: var(--muted); }
.profile-casefile-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
  gap: 1.25rem 2rem;
  margin: 1rem 0;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
}
.profile-casefile-copy h2 { margin: 0.2rem 0; font-size: 1.2rem; }
.profile-casefile-copy p { max-width: 65ch; margin: 0; color: var(--muted); }
.profile-casefile-status {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}
.profile-casefile-status div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.75rem;
}
.profile-casefile-status dt { color: var(--faint); font-size: 0.78rem; font-weight: 700; }
.profile-casefile-status dd { margin: 0; font-size: 0.86rem; }
.profile-casefile-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  grid-column: 1 / -1;
}
.profile-casefile-actions form { margin: 0; }
.profile-casefile-actions small { max-width: 60rem; color: var(--muted); }

@media (max-width: 760px) {
  .profile-casefile-panel { grid-template-columns: 1fr; }
  .profile-casefile-actions { align-items: flex-start; flex-direction: column; }
  .profile-casefile-status div { grid-template-columns: 1fr; gap: 0; }
  .agent-access-header, .agent-access-layout, .desktop-setup, .youtube-client-setup { grid-template-columns: 1fr; gap: 1rem; }
  .agent-access-boundary div { grid-template-columns: 6.5rem 1fr; }
  .credential-row { grid-template-columns: 1fr; }
  .desktop-download, .desktop-setup-note, .desktop-setup-unavailable { grid-column: 1; }
  .youtube-client-steps { grid-template-columns: 1fr; }
}

/* Authoritative case file: familiar editorial density, no agent-console chrome. */
.casefile-main { max-width: 1240px; }
.casefile-form-main { max-width: 820px; }
.casefile-page-header,
.casefile-case-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  padding: 1rem 0 1.35rem;
  border-bottom: 1px solid var(--rule);
}
.casefile-page-header h1,
.casefile-case-header h1 { margin: 0.12rem 0 0.25rem; font: 500 2.2rem/1.1 var(--serif); }
.casefile-page-header p,
.casefile-case-header p { max-width: 34rem; margin: 0; color: var(--muted); }
.casefile-status-label { margin-right: 0.45rem; color: var(--accent-ink); font-weight: 750; }
.casefile-more-menu { position: relative; }
.casefile-more-menu > summary {
  padding: 0.42rem 0.72rem;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  list-style-position: inside;
}
.casefile-more-menu > div {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 12rem;
  padding: 0.35rem;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}
.casefile-more-menu a,
.casefile-more-menu span { padding: 0.45rem 0.55rem; font-size: 0.75rem; }
.casefile-more-menu a { color: var(--ink); text-decoration: none; }
.casefile-more-menu a:hover { background: var(--surface-subtle); }
.casefile-more-menu span { border-top: 1px solid var(--rule); color: var(--faint); }
.casefile-list-actions { display: grid; justify-items: end; gap: 0.65rem; }
.casefile-header-actions,
.casefile-inline-actions,
.casefile-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }
.casefile-table-wrap { overflow: auto; margin-top: 1.3rem; border: 1px solid var(--rule); border-radius: 5px; background: var(--surface); }
.casefile-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.casefile-table th { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--rule-strong); background: var(--surface-subtle); color: var(--muted); font-size: 0.65rem; text-align: left; text-transform: uppercase; }
.casefile-table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.casefile-table tr:last-child td { border-bottom: 0; }
.casefile-table td:first-child a { display: block; color: var(--ink); font-weight: 700; text-decoration: none; }
.casefile-table small { display: block; color: var(--muted); }
.casefile-empty { margin-top: 1.5rem; padding: 2rem; border: 1px dashed var(--rule-strong); text-align: center; }
.casefile-empty h2 { margin: 0; font: 600 1.25rem/1.3 var(--serif); }
.casefile-empty p { color: var(--muted); }
.casefile-form { display: grid; gap: 0.85rem; margin-top: 1.3rem; padding: 1.2rem; border: 1px solid var(--rule); }
.casefile-form label,
.casefile-action-panel label,
.casefile-guidance-panel label,
.casefile-takeover label { display: grid; gap: 0.22rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.casefile-form input,
.casefile-form select,
.casefile-form textarea,
.casefile-action-panel textarea,
.casefile-guidance-panel select,
.casefile-guidance-panel textarea,
.casefile-takeover textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.casefile-form label > span { color: var(--faint); font-size: 0.67rem; font-weight: 400; }
.casefile-identity-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.casefile-identity-form > label:nth-last-child(-n + 3),
.casefile-identity-form .casefile-form-actions { grid-column: 1 / -1; }
.mono-input { font: 0.72rem/1.45 var(--mono) !important; }
.casefile-form-actions { justify-content: flex-end; margin-top: 0.4rem; }
.casefile-warning { padding: 0.75rem 0.9rem; border-left: 3px solid var(--amber); background: var(--amber-bg); }
.casefile-upload-picker { padding: 1.25rem; border: 1px dashed var(--accent); border-radius: 8px; background: var(--surface-raised); }
.casefile-upload-picker input[type="file"] { padding: 0.8rem; background: var(--surface); }
.casefile-upload-finished { margin-top: 1.3rem; padding: 1.5rem; }
.casefile-explainer { margin: 1rem 0; padding: 0.9rem 1rem; border-left: 3px solid var(--blue); background: var(--surface); }
.casefile-explainer p { max-width: 46rem; margin: 0.25rem 0 0; color: var(--muted); }
.casefile-verified-main { max-width: 1080px; }
.verified-records-header { border-bottom: 1px solid var(--rule); padding-bottom: 1.1rem; }
.verified-records-blocker { display: flex; align-items: center; justify-content: space-between; gap: 1.4rem; margin-top: 1.4rem; padding: 1.2rem; border-left: 3px solid var(--amber); background: var(--surface); }
.verified-records-blocker h2,
.verified-records-review h2,
.verified-record-results h2,
.verified-record-source-list > header h2 { margin: 0; font: 600 1.35rem/1.25 var(--serif); }
.verified-records-blocker p,
.verified-records-review header p,
.verified-record-source-list > header p { max-width: 44rem; margin: 0.3rem 0 0; color: var(--muted); }
.verified-records-summary { display: grid; grid-template-columns: 1.5fr 1fr 1fr; margin: 1.2rem 0; border: 1px solid var(--rule); background: var(--surface); }
.verified-records-summary > div { display: grid; gap: 0.25rem; min-width: 0; padding: 0.9rem 1rem; border-right: 1px solid var(--rule); }
.verified-records-summary > div:last-child { border-right: 0; }
.verified-records-summary span { color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.verified-records-summary strong { overflow-wrap: anywhere; font: 600 1rem/1.25 var(--sans); }
.verified-records-review,
.verified-record-results,
.verified-record-source-list { margin: 1.4rem 0; }
.verified-records-review > header,
.verified-record-source-list > header { margin-bottom: 0.8rem; }
.verified-record-review-list,
.verified-record-candidates { display: grid; gap: 0.8rem; }
.verified-record-review-list > article,
.verified-record-candidate { padding: 1rem; border: 1px solid var(--rule); border-radius: 5px; background: var(--surface); }
.verified-record-review-list > article { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(12rem, 0.7fr); gap: 1rem; }
.verified-record-review-list h3,
.verified-record-candidate h3,
.verified-record-source h3 { margin: 0.15rem 0; font: 650 1rem/1.25 var(--sans); }
.verified-record-review-list p,
.verified-record-candidate p,
.verified-record-source p { margin: 0.3rem 0; color: var(--muted); font-size: 0.8rem; }
.verified-record-review-list dl { margin: 0; }
.verified-record-review-list dt { color: var(--muted); font-size: 0.67rem; font-weight: 700; }
.verified-record-review-list dd { margin: 0.1rem 0 0.55rem; }
.verified-record-review-list form { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; }
.verified-record-review-list form label { display: grid; flex: 1 1 24rem; gap: 0.25rem; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.verified-record-review-list form textarea { width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; }
.verified-record-review-guidance { padding: 0.7rem 0.8rem; border-left: 3px solid var(--accent); background: var(--surface-subtle); color: var(--ink); }
.verified-record-workflow-note { margin: 0 0 1rem; padding: 0.85rem 1rem; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface-subtle); }
.verified-record-workflow-note p { margin: 0.4rem 0 0; max-width: 78ch; }
.verified-record-workflow-note q { font-weight: 650; }
.verified-record-rationale { margin-top: 0.65rem; }
.verified-record-rationale summary { color: var(--accent-ink); cursor: pointer; font-size: 0.78rem; font-weight: 700; }
.verified-record-rationale p { margin-top: 0.55rem; max-height: 12rem; overflow: auto; }
.record-source,
.recommended-label { color: var(--accent-ink); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.verified-record-results > header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; }
.verified-record-results > header p { margin: 0; color: var(--muted); font-size: 0.76rem; }
.verified-record-error,
.verified-record-empty,
.candidate-lead-notice { padding: 0.9rem 1rem; border-left: 3px solid var(--rule-strong); background: var(--surface-subtle); }
.verified-record-error { border-left-color: var(--red); background: var(--red-bg); }
.verified-record-error p,
.verified-record-empty p,
.candidate-lead-notice p { margin: 0.25rem 0; }
.verified-record-candidate-main { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.verified-record-candidate-main code { flex: none; padding: 0.2rem 0.35rem; background: var(--surface-subtle); }
.candidate-confirm-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0.75rem; margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--rule); }
.candidate-confirm-form label,
.verified-record-search-form label { display: grid; gap: 0.25rem; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.candidate-confirm-form textarea,
.verified-record-search-form input { width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; }
.candidate-confirm-form textarea:focus,
.verified-record-search-form input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.verified-record-source-list { display: grid; gap: 0.75rem; }
.verified-record-source-list > header { margin-bottom: 0.1rem; }
.verified-record-source { padding: 1rem; border: 1px solid var(--rule); border-radius: 5px; background: var(--surface); }
.verified-record-source.is-recommended { border-left: 3px solid var(--accent); }
.verified-record-source-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.connection-state { flex: none; padding: 0.22rem 0.42rem; border-radius: 3px; background: var(--surface-subtle); color: var(--muted); font-size: 0.67rem; font-weight: 750; }
.connection-state.is-connected { background: var(--green-bg); color: var(--green); }
.connection-state.is-error { background: var(--red-bg); color: var(--red); }
.verified-binding-list { display: grid; gap: 0.55rem; margin-top: 0.7rem; }
.verified-binding-list > div { display: grid; grid-template-columns: minmax(10rem, 0.8fr) minmax(8rem, 0.5fr) minmax(15rem, 1.3fr); gap: 0.7rem; align-items: baseline; padding: 0.65rem 0; border-top: 1px solid var(--rule); }
.verified-binding-list small { grid-column: 1 / -1; color: var(--faint); }
.verified-record-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0.65rem; margin-top: 0.8rem; }
.last-candidate-search { display: block; margin-top: 0.55rem; color: var(--faint); }
.verified-record-remove { grid-column: 1 / -1; margin-top: 0.2rem; }
.verified-record-remove summary,
.verified-record-manual summary { cursor: pointer; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.verified-record-remove form,
.verified-record-manual form { display: grid; gap: 0.65rem; margin-top: 0.75rem; }
.verified-record-remove label,
.verified-record-manual label { display: grid; gap: 0.25rem; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.verified-record-remove textarea,
.verified-record-manual input,
.verified-record-manual select,
.verified-record-manual textarea { width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; }
.verified-record-remove textarea:focus,
.verified-record-manual input:focus,
.verified-record-manual select:focus,
.verified-record-manual textarea:focus,
.verified-record-review-list form textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.verified-record-manual { margin: 1.2rem 0; padding: 0.8rem 1rem; border: 1px solid var(--rule); background: var(--surface); }
.verified-record-manual > p { max-width: 50rem; color: var(--muted); font-size: 0.78rem; }
.verified-record-history { margin: 1.2rem 0; padding: 0.8rem 1rem; border: 1px solid var(--rule); background: var(--surface); }
.verified-record-history summary { cursor: pointer; font-weight: 700; }
.verified-record-history > div { display: grid; grid-template-columns: 1fr auto auto; gap: 0.8rem; padding: 0.55rem 0; border-top: 1px solid var(--rule); }
.casefile-status-strip { display: grid; grid-template-columns: 1.2fr 0.8fr 1fr 0.8fr; margin: 1rem 0 0; border: 1px solid var(--rule); background: var(--surface); }
.casefile-status-strip > div { display: grid; align-content: start; min-width: 0; padding: 0.62rem 0.8rem; border-right: 1px solid var(--rule); }
.casefile-status-strip > div:last-child { border-right: 0; }
.casefile-status-strip span { color: var(--faint); font-size: 0.62rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.casefile-status-strip strong { overflow: hidden; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.casefile-status-strip small,
.casefile-status-strip a,
.casefile-status-strip .text-button { color: var(--muted); font-size: 0.67rem; }
.casefile-status-strip form { margin: 0.05rem 0 0; }
.casefile-status-strip .text-button { padding: 0; border: 0; background: none; color: var(--accent-ink); cursor: pointer; font-family: inherit; font-weight: 700; text-align: left; }
.casefile-action-panel { display: grid; grid-template-columns: minmax(15rem, 0.7fr) minmax(20rem, 1.3fr); gap: 1.2rem; margin: 1rem 0; padding: 1rem; border-left: 3px solid var(--accent); background: var(--surface); }
.casefile-action-panel h2 { margin: 0.15rem 0; font: 600 1.2rem/1.25 var(--serif); }
.casefile-action-panel p { margin: 0.25rem 0; color: var(--muted); font-size: 0.78rem; }
.casefile-action-panel form,
.casefile-takeover form { display: grid; gap: 0.55rem; }
.casefile-takeover { margin: 1rem 0; padding: 0.8rem 1rem; border: 1px solid var(--rule); }
.casefile-takeover summary { cursor: pointer; font-weight: 700; }
.casefile-takeover form { margin-top: 0.7rem; }
.casefile-guidance-panel { margin: 0.8rem 0 0; border: 1px solid var(--rule); border-left: 3px solid var(--blue); background: var(--surface); }
.casefile-guidance-panel > summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 0.9rem; cursor: pointer; list-style: none; }
.casefile-guidance-panel > summary::-webkit-details-marker { display: none; }
.casefile-guidance-panel > summary > span:first-child { display: grid; gap: 0.05rem; }
.casefile-guidance-panel > summary strong { font-size: 0.86rem; }
.casefile-guidance-action { color: var(--accent); font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.casefile-guidance-panel[open] .casefile-guidance-action { color: var(--faint); }
.casefile-guidance-body { display: grid; grid-template-columns: minmax(14rem, 0.65fr) minmax(22rem, 1.35fr); gap: 1.2rem; padding: 0.9rem; border-top: 1px solid var(--rule); }
.casefile-guidance-body > p { margin: 0; color: var(--muted); font-size: 0.78rem; }
.casefile-guidance-body form { display: grid; gap: 0.55rem; }

.casefile-section-nav { position: sticky; top: 101px; z-index: 10; display: flex; justify-content: space-between; align-items: stretch; gap: 1rem; margin: 1.15rem 0 0; border-block: 1px solid var(--rule-strong); background: var(--paper); }
.casefile-section-nav [role="tablist"] { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.casefile-section-nav [role="tab"] { display: flex; align-items: center; gap: 0.35rem; min-height: 42px; padding: 0.45rem 0.7rem; border-bottom: 2px solid transparent; color: var(--muted); font-size: 0.72rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.casefile-section-nav [role="tab"] > span,
.casefile-records-link > span { color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }
.casefile-section-nav [role="tab"]:hover { color: var(--ink); }
.casefile-section-nav [role="tab"][aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); }
.casefile-section-nav [role="tab"]:focus-visible,
.casefile-records-link:focus-visible,
.case-record-disclosure > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.casefile-records-link { display: flex; align-items: center; gap: 0.35rem; min-height: 42px; padding: 0.45rem 0.7rem; color: var(--accent); font-size: 0.72rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.casefile-nav-utilities { display: flex; align-items: stretch; flex: none; }
.casefile-history-menu { position: relative; display: flex; }
.casefile-history-menu > summary { display: flex; align-items: center; min-height: 42px; padding: 0.45rem 0.7rem; color: var(--muted); cursor: pointer; font-size: 0.72rem; font-weight: 700; list-style-position: inside; white-space: nowrap; }
.casefile-history-menu.is-active > summary { color: var(--ink); }
.casefile-history-menu > div { position: absolute; top: calc(100% + 1px); right: 0; z-index: 20; display: grid; min-width: 13rem; padding: 0.35rem; border: 1px solid var(--rule-strong); background: var(--surface-raised); box-shadow: var(--shadow); }
.casefile-history-menu > div a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.48rem 0.55rem; color: var(--ink); font-size: 0.74rem; font-weight: 650; text-decoration: none; }
.casefile-history-menu > div a:hover,
.casefile-history-menu > div a[aria-current="page"] { background: var(--surface-subtle); color: var(--accent-ink); }
.casefile-history-menu > div span { color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }

.casefile-workspace { min-height: 34rem; margin-top: 1rem; }
.casefile-panel { border: 1px solid var(--rule); background: var(--surface); }
.casefile-panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--rule-strong); }
.casefile-panel-header h2 { margin: 0; font: 600 1.2rem/1.25 var(--serif); }
.casefile-panel-header p { max-width: 64rem; margin: 0.18rem 0 0; color: var(--muted); font-size: 0.76rem; }
.casefile-panel-header > span,
.casefile-panel-actions > span { color: var(--faint); font-size: 0.72rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.casefile-panel-header-muted { background: var(--surface-subtle); }
.casefile-panel-actions { display: flex; align-items: center; gap: 0.75rem; }
.casefile-overview-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr); border-bottom: 1px solid var(--rule-strong); }
.casefile-next-step { padding: 1.15rem 1rem; }
.casefile-next-step h3 { max-width: 34rem; margin: 0.18rem 0; font: 600 1.35rem/1.25 var(--serif); }
.casefile-next-step p { max-width: 44rem; margin: 0.3rem 0 0.85rem; color: var(--muted); font-size: 0.8rem; }
.casefile-next-step form { margin: 0; }
.casefile-intake-context { max-width: 44rem; margin: 0 0 0.9rem; padding: 0.65rem 0.75rem; border-left: 3px solid var(--rule-strong); background: var(--surface-subtle); }
.casefile-intake-context strong { font-size: 0.7rem; }
.casefile-intake-context p { margin: 0.15rem 0 0; }
.casefile-attention { border-left: 1px solid var(--rule-strong); }
.casefile-attention > header { display: flex; justify-content: space-between; align-items: center; padding: 0.58rem 0.8rem; border-bottom: 1px solid var(--rule); background: var(--surface-subtle); }
.casefile-attention h3 { margin: 0; font-size: 0.76rem; }
.casefile-attention header span { color: var(--faint); font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.casefile-attention article { display: grid; grid-template-columns: minmax(7rem, 0.75fr) minmax(0, 1.4fr) auto; gap: 0.65rem; align-items: baseline; padding: 0.58rem 0.8rem; border-bottom: 1px solid var(--rule); }
.casefile-attention article:last-child { border-bottom: 0; }
.casefile-attention article strong,
.casefile-attention article a { font-size: 0.72rem; }
.casefile-attention article p { margin: 0; color: var(--muted); font-size: 0.7rem; }
.casefile-attention article small { display: block; margin-top: 0.18rem; color: var(--faint); font-size: 0.66rem; }
.casefile-related-review-link { display: block; width: fit-content; margin-top: 0.12rem; }
.casefile-clear-state { margin: 0; padding: 1rem 0.8rem; color: var(--muted); font-size: 0.75rem; }
.casefile-latest { border-bottom: 1px solid var(--rule-strong); }
.casefile-latest > header { padding: 0.68rem 1rem; border-bottom: 1px solid var(--rule); }
.casefile-latest > header h3 { margin: 0; font-size: 0.82rem; }
.casefile-latest > header p { margin: 0.12rem 0 0; color: var(--muted); font-size: 0.7rem; }
.casefile-latest > div { display: grid; grid-template-columns: minmax(16rem, 0.8fr) minmax(0, 1.2fr); }
.casefile-latest-draft { min-width: 0; padding: 0.85rem 1rem; border-right: 1px solid var(--rule); }
.casefile-latest-draft h4 { margin: 0.16rem 0; font-size: 0.86rem; line-height: 1.4; }
.casefile-latest-draft p { margin: 0.25rem 0; color: var(--muted); font-size: 0.75rem; }
.casefile-latest-draft small { color: var(--faint); font-size: 0.65rem; }
.casefile-latest-findings article { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr) auto; gap: 0.7rem; align-items: baseline; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--rule); }
.casefile-latest-findings article:last-child { border-bottom: 0; }
.casefile-latest-findings article span { color: var(--accent-ink); font-size: 0.62rem; font-weight: 750; text-transform: uppercase; }
.casefile-latest-findings article a { color: var(--ink); font-size: 0.75rem; font-weight: 650; line-height: 1.35; text-decoration: none; }
.casefile-latest-findings article a:hover { color: var(--accent-ink); text-decoration: underline; }
.casefile-latest-findings article small { color: var(--faint); font-size: 0.64rem; white-space: nowrap; }
.casefile-overview > .casefile-action-panel,
.casefile-overview > .casefile-takeover,
.casefile-overview > .casefile-guidance-panel { margin: 0; border-top: 1px solid var(--rule-strong); }
.casefile-filter-bar { display: grid; grid-template-columns: auto minmax(14rem, 24rem) auto; gap: 0.75rem; align-items: center; padding: 0.55rem 1rem; border-bottom: 1px solid var(--rule); background: var(--surface-subtle); }
.casefile-filter-buttons { display: flex; gap: 0.25rem; }
.casefile-filter-buttons button { padding: 0.3rem 0.55rem; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; font: 650 0.7rem var(--sans); }
.casefile-filter-buttons button:hover { color: var(--ink); }
.casefile-filter-buttons button[aria-pressed="true"] { border-color: var(--rule-strong); background: var(--surface); color: var(--accent-ink); }
.casefile-filter-bar label { display: block; }
.casefile-filter-bar input { width: 100%; padding: 0.38rem 0.55rem; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font: 0.75rem var(--sans); }
.casefile-filter-bar input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.casefile-filter-count { color: var(--faint); font-size: 0.67rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.casefile-source-filter { grid-template-columns: minmax(14rem, 24rem) auto; }
.casefile-record-list { min-width: 0; }
.casefile-record-group { scroll-margin-top: 160px; }
.casefile-record-group + .casefile-record-group { border-top: 1px solid var(--rule-strong); }
.casefile-record-group > header { display: flex; justify-content: space-between; align-items: baseline; padding: 0.55rem 1rem; border-bottom: 1px solid var(--rule); background: var(--surface-subtle); }
.casefile-record-group > header h3 { margin: 0; font-size: 0.75rem; }
.casefile-record-group > header span { color: var(--faint); font-size: 0.7rem; font-variant-numeric: tabular-nums; }

.case-record { border-bottom: 1px solid var(--rule); }
.case-record:last-child { border-bottom: 0; }
.case-record-disclosure > summary { position: relative; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.8rem; padding: 0.7rem 2.3rem 0.7rem 1rem; cursor: pointer; list-style: none; }
.case-record-disclosure > summary::-webkit-details-marker { display: none; }
.case-record-disclosure > summary::after { content: "+"; position: absolute; top: 0.68rem; right: 1rem; color: var(--faint); font-size: 1rem; line-height: 1; }
.case-record-disclosure[open] > summary::after { content: "−"; }
.case-record-disclosure[open] > summary { background: var(--surface-subtle); }
.case-record-summary { display: grid; min-width: 0; gap: 0.14rem; }
.case-record-summary strong { font-size: 0.84rem; line-height: 1.4; }
.case-record-summary small { color: var(--faint); font-size: 0.67rem; font-weight: 400; }
.case-record-kind,
.case-record-status { align-self: start; color: var(--accent); font-size: 0.63rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.case-record-status { color: var(--muted); }
.case-record-body { padding: 0.1rem 2.3rem 0.85rem 8.3rem; }
.case-record-body p { max-width: 100ch; margin: 0.25rem 0; color: var(--ink); font-size: 0.8rem; line-height: 1.65; white-space: pre-line; }
.case-record.compact .case-record-body p { color: var(--muted); }
.case-record-provenance { display: block; margin-top: 0.55rem; color: var(--faint); font-size: 0.65rem; }

.case-source-row,
.case-draft-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 1.2rem; padding: 0.72rem 1rem; border-bottom: 1px solid var(--rule); }
.case-source-row:last-child,
.case-draft-row:last-child { border-bottom: 0; }
.case-source-title,
.case-draft-row > div { display: grid; min-width: 0; gap: 0.14rem; }
.case-source-title strong,
.case-draft-row strong { font-size: 0.84rem; line-height: 1.4; }
.case-source-title small,
.case-draft-row small { color: var(--faint); font-size: 0.67rem; overflow-wrap: anywhere; }
.case-source-meta { display: grid; justify-items: end; gap: 0.1rem; color: var(--faint); font-size: 0.68rem; white-space: nowrap; }
.case-draft-row p { max-width: 90ch; margin: 0.25rem 0 0; color: var(--muted); font-size: 0.78rem; }
.case-draft-review-action { margin: 0; }

.case-activity-row { display: grid; grid-template-columns: minmax(10rem, 1fr) auto minmax(9rem, auto); align-items: baseline; gap: 1rem; padding: 0.55rem 1rem; border-bottom: 1px solid var(--rule); font-size: 0.74rem; }
.case-activity-row:last-child { border-bottom: 0; }
.case-activity-row span,
.case-activity-row small { color: var(--faint); }
.case-activity-row small { text-align: right; }
.casefile-empty-row { margin: 0; padding: 1rem; color: var(--muted); font-size: 0.78rem; }

/* Staff feedback inbox: compact cross-case triage, using the case-file visual language. */
.feedback-inbox-main { max-width: 1060px; }
.feedback-filters {
  display: flex;
  gap: 1.2rem;
  overflow-x: auto;
  margin: 1rem 0 0;
  border-bottom: 1px solid var(--rule-strong);
}
.feedback-filters a {
  padding: 0.65rem 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.feedback-filters a[aria-current="page"] { border-bottom: 3px solid var(--accent); color: var(--ink); }
.feedback-filters span { color: var(--faint); font: 0.7rem var(--mono); }
.feedback-list { margin-top: 0.7rem; }
.feedback-report { padding: 1.2rem 0; border-bottom: 1px solid var(--rule); }
.feedback-report > header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.feedback-report h2 { margin: 0.25rem 0 0; font: 600 1.05rem/1.3 var(--sans); }
.feedback-impact,
.feedback-status { color: var(--muted); font-size: 0.68rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.feedback-impact-blocked { color: var(--red); }
.feedback-impact-slowed { color: var(--amber); }
.feedback-message { max-width: 52rem; margin: 0.75rem 0; font: 1rem/1.55 var(--serif); white-space: pre-wrap; }
.feedback-meta { display: flex; flex-wrap: wrap; gap: 0.55rem 1.2rem; margin: 0; }
.feedback-meta div { display: flex; gap: 0.35rem; min-width: 0; }
.feedback-meta dt { color: var(--faint); font-size: 0.68rem; font-weight: 700; }
.feedback-meta dd { margin: 0; color: var(--muted); font-size: 0.7rem; overflow-wrap: anywhere; }
.feedback-context { margin-top: 0.8rem; color: var(--muted); font-size: 0.78rem; }
.feedback-context summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.feedback-context p { max-width: 52rem; margin: 0.5rem 0 0; white-space: pre-wrap; }
.feedback-triage-form {
  display: grid;
  grid-template-columns: minmax(9rem, 0.35fr) minmax(16rem, 1fr) auto;
  align-items: end;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.8rem;
  background: var(--surface-subtle);
}
.feedback-triage-form label { display: grid; gap: 0.25rem; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.feedback-triage-form input,
.feedback-triage-form select {
  min-height: 2.15rem;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: 0.8rem var(--sans);
}
.feedback-triaged { display: block; margin-top: 0.55rem; color: var(--faint); font-size: 0.68rem; }

@media (max-width: 760px) {
  .casefile-page-header, .casefile-case-header, .casefile-action-panel,
  .casefile-guidance-body { display: grid; grid-template-columns: 1fr; gap: 0.8rem; }
  .casefile-list-actions { justify-items: start; }
  .casefile-more-menu { justify-self: start; }
  .casefile-more-menu > div { right: auto; left: 0; }
  .casefile-status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .casefile-status-strip > div { border-bottom: 1px solid var(--rule); }
  .casefile-status-strip > div:nth-child(2n) { border-right: 0; }
  .casefile-status-strip > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .casefile-identity-form { grid-template-columns: 1fr; }
  .casefile-identity-form > label, .casefile-identity-form .casefile-form-actions { grid-column: auto; }
  .verified-records-blocker,
  .verified-record-results > header,
  .verified-record-candidate-main,
  .verified-record-source-heading { align-items: stretch; flex-direction: column; }
  .verified-records-summary,
  .verified-record-review-list > article,
  .candidate-confirm-form,
  .verified-record-search-form,
  .verified-binding-list > div { grid-template-columns: 1fr; }
  .verified-records-summary > div { border-right: 0; border-bottom: 1px solid var(--rule); }
  .verified-records-summary > div:last-child { border-bottom: 0; }
  .verified-binding-list small { grid-column: auto; }
  .casefile-section-nav { display: grid; gap: 0; }
  .casefile-section-nav [role="tab"] { padding-inline: 0.6rem; }
  .casefile-nav-utilities { justify-content: flex-start; border-top: 1px solid var(--rule); }
  .casefile-records-link { border-left: 1px solid var(--rule); }
  .casefile-history-menu { border-right: 1px solid var(--rule); }
  .casefile-overview-grid,
  .casefile-latest > div { grid-template-columns: 1fr; }
  .casefile-attention { border-top: 1px solid var(--rule-strong); border-left: 0; }
  .casefile-latest-draft { border-right: 0; border-bottom: 1px solid var(--rule); }
  .casefile-attention article { grid-template-columns: minmax(6.5rem, 0.7fr) minmax(0, 1.3fr); }
  .casefile-attention article a { grid-column: 2; }
  .casefile-latest-findings article { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .casefile-latest-findings article small { grid-column: 2; white-space: normal; }
  .casefile-filter-bar,
  .casefile-source-filter { grid-template-columns: 1fr auto; }
  .casefile-filter-buttons { grid-column: 1 / -1; }
  .casefile-panel-header { gap: 0.7rem; }
  .case-record-disclosure > summary { grid-template-columns: 4.8rem minmax(0, 1fr); padding-left: 0.75rem; }
  .case-record-body { padding: 0.1rem 1rem 0.8rem 0.75rem; }
  .case-source-row,
  .case-draft-row,
  .case-activity-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .case-source-meta { justify-items: start; white-space: normal; }
  .case-activity-row small { text-align: left; }
  .case-draft-review-action { margin-top: 0.35rem; }
  .feedback-report > header, .feedback-triage-form { display: grid; grid-template-columns: 1fr; }
  .feedback-triage-form button { justify-self: start; }
}

@media (max-width: 430px) {
  .casefile-filter-bar,
  .casefile-source-filter { grid-template-columns: 1fr; }
  .casefile-filter-count { justify-self: start; }
  .casefile-attention article { grid-template-columns: 1fr; }
  .casefile-attention article a { grid-column: auto; }
}

/* Research guide: an editorial reference page within the existing workbench. */
.research-guide-main { width: min(100%, 72rem); max-width: 72rem; }
.research-guide-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem 0 1.35rem;
  border-bottom: 1px solid var(--rule);
}
.research-guide-header h1 { margin: 0.12rem 0 0.3rem; font: 500 2.45rem/1.08 var(--serif); }
.research-guide-header p { max-width: 35rem; margin: 0; color: var(--muted); }
.research-guide-alert {
  margin: 1.4rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}
.research-guide-layout {
  display: grid;
  grid-template-columns: minmax(11rem, 0.28fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}
.research-guide-index {
  position: sticky;
  top: 126px;
  display: grid;
  gap: 0.36rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  font-size: 0.76rem;
}
.research-guide-index strong { margin-bottom: 0.15rem; color: var(--ink); }
.research-guide-index a { color: var(--muted); text-decoration: none; }
.research-guide-index a:hover { color: var(--accent-ink); text-decoration: underline; }
.research-guide-body { min-width: 0; }
.research-guide-section { padding: 0.2rem 0 2.2rem; scroll-margin-top: 126px; }
.research-guide-section + .research-guide-section { padding-top: 2rem; border-top: 1px solid var(--rule); }
.research-guide-section h2 { margin: 0 0 0.45rem; font: 600 1.55rem/1.2 var(--serif); }
.research-guide-section > p { max-width: 44rem; margin: 0.35rem 0 1rem; color: var(--muted); }
.research-guide-roles { margin: 1.2rem 0 0; border-top: 1px solid var(--rule-strong); }
.research-guide-roles div {
  display: grid;
  grid-template-columns: minmax(9rem, 0.34fr) minmax(0, 1fr);
  gap: 1.2rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.research-guide-roles dt { font-weight: 750; }
.research-guide-roles dd { margin: 0; color: var(--muted); }
.research-guide-sequence { margin: 1rem 0 0; padding: 0; list-style: none; counter-reset: guide-sequence; }
.research-guide-sequence li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(10rem, 0.42fr) minmax(0, 1fr);
  gap: 1.2rem;
  padding: 0.8rem 0 0.8rem 2.25rem;
  border-bottom: 1px solid var(--rule);
  counter-increment: guide-sequence;
}
.research-guide-sequence li::before {
  content: counter(guide-sequence);
  position: absolute;
  top: 0.88rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  color: var(--accent-ink);
  font: 700 0.68rem/1 var(--sans);
}
.research-guide-sequence span { color: var(--muted); }
.research-guide-examples { margin-top: 1rem; border-top: 1px solid var(--rule-strong); }
.research-guide-examples details { border-bottom: 1px solid var(--rule); }
.research-guide-examples summary {
  padding: 0.9rem 1.8rem 0.9rem 0;
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
}
.research-guide-examples blockquote {
  margin: 0 0 0.65rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--blue);
  background: var(--blue-bg);
  color: var(--ink);
  font: 500 0.9rem/1.55 var(--serif);
}
.research-guide-examples details > p { margin: 0 0 1rem; color: var(--muted); font-size: 0.84rem; }
.research-guide-saved-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1.15rem;
}
.research-guide-saved-grid > div { padding-top: 0.9rem; border-top: 3px solid var(--green); }
.research-guide-saved-grid > div + div { border-top-color: var(--faint); }
.research-guide-saved-grid h3 { margin: 0 0 0.55rem; font: 700 0.86rem/1.35 var(--sans); }
.research-guide-saved-grid ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.84rem; }
.research-guide-note {
  margin-top: 1.2rem !important;
  padding: 0.8rem 0.9rem;
  background: var(--surface-subtle);
  color: var(--ink) !important;
}
.research-guide-boundaries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.research-guide-boundaries li { padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.research-guide-trouble dl { margin: 1rem 0; }
.research-guide-trouble dl div {
  display: grid;
  grid-template-columns: minmax(12rem, 0.42fr) minmax(0, 1fr);
  gap: 1.2rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.research-guide-trouble dt { font-weight: 750; }
.research-guide-trouble dd { margin: 0; color: var(--muted); }

@media (max-width: 760px) {
  .research-guide-header,
  .research-guide-layout,
  .research-guide-roles div,
  .research-guide-sequence li,
  .research-guide-saved-grid,
  .research-guide-boundaries,
  .research-guide-trouble dl div { grid-template-columns: 1fr; }
  .research-guide-header { display: grid; align-items: start; gap: 1rem; }
  .research-guide-header .button-link { justify-self: start; }
  .research-guide-layout { gap: 1.4rem; }
  .research-guide-index {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1rem;
  }
  .research-guide-index strong { grid-column: 1 / -1; }
  .research-guide-sequence li { gap: 0.2rem; }
  .research-guide-saved-grid { gap: 1.2rem; }
}

/* Research guide v2: one Claude-centered research session. */
.research-guide-main { width: min(100%, 78rem); max-width: 78rem; }
.research-guide { padding: 0 0 4rem; }
.research-guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 0.65fr);
  gap: clamp(2rem, 5vw, 5.5rem);
  align-items: end;
  padding: clamp(2.6rem, 7vw, 6rem) 0 clamp(2.2rem, 5vw, 4rem);
}
.research-guide-intro h1 {
  max-width: 51rem;
  margin: 0.28rem 0 1.25rem;
  font: 520 clamp(2.7rem, 6vw, 5.3rem)/0.98 var(--serif);
  letter-spacing: -0.035em;
}
.research-guide-intro h1 em { color: var(--accent-ink); font-weight: 450; }
.research-guide-intro > p {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.65;
}
.research-guide-actions { display: flex; align-items: center; gap: 1.2rem; margin-top: 1.6rem; }
.research-guide-actions > a:not(.button-link) { color: var(--muted); font-size: 0.84rem; font-weight: 700; }
.research-guide-memory {
  padding: 1.15rem 0 0;
  border-top: 4px solid var(--accent);
}
.research-guide-memory > span,
.research-receipt > span,
.research-example-strip > strong,
.research-prose-checks article > span {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.research-guide-memory strong { display: block; font: 650 1.25rem/1.38 var(--serif); }
.research-guide-memory p { margin: 0.7rem 0 0; color: var(--muted); font-size: 0.83rem; }
.research-guide-flow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  overflow-x: auto;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  white-space: nowrap;
  scrollbar-width: thin;
}
.research-guide-flow i { flex: 1 0 1.25rem; min-width: 1.25rem; height: 1px; background: var(--rule-strong); }
.research-session { padding-top: clamp(3rem, 7vw, 5.5rem); }
.research-session-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.48fr);
  gap: 2rem;
  align-items: end;
  padding-bottom: 1.5rem;
}
.research-session-heading h2,
.research-guide-checklist h2 { margin: 0.2rem 0 0; font: 540 clamp(2rem, 4vw, 3.3rem)/1.08 var(--serif); letter-spacing: -0.025em; }
.research-session-heading > p { margin: 0 0 0.25rem; color: var(--muted); }
.research-turns { margin: 0; padding: 0; list-style: none; counter-reset: none; }
.research-turn {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: clamp(1.2rem, 4vw, 3.2rem);
  padding: clamp(2.5rem, 5vw, 4.25rem) 0;
  border-top: 1px solid var(--rule-strong);
}
.research-turn-marker { position: relative; align-self: stretch; color: var(--muted); }
.research-turn-marker::after {
  content: "";
  position: absolute;
  top: 2.25rem;
  bottom: -4.3rem;
  left: 0.78rem;
  width: 1px;
  background: var(--rule);
}
.research-turn-final .research-turn-marker::after { display: none; }
.research-turn-marker span {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent-ink);
  font-size: 0.62rem;
  font-weight: 800;
}
.research-turn-marker strong { display: block; margin-top: 0.55rem; font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; }
.research-turn-body > header { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(17rem, 0.6fr); gap: 2rem; align-items: start; }
.research-turn-body > header h3 { margin: 0; font: 600 clamp(1.55rem, 3vw, 2.25rem)/1.13 var(--serif); letter-spacing: -0.015em; }
.research-turn-body > header p { margin: 0.15rem 0 0; color: var(--muted); }
.research-exchange {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(16rem, 0.75fr);
  margin-top: 1.5rem;
  border: 1px solid var(--rule-strong);
  background: var(--surface-raised);
  box-shadow: 0 12px 32px rgb(61 51 31 / 0.06);
}
:root[data-theme="dark"] .research-exchange { box-shadow: 0 14px 34px rgb(0 0 0 / 0.18); }
.research-prompt { min-width: 0; padding: 1rem 1.15rem 1.15rem; }
.research-speaker { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.7rem; }
.research-speaker span { color: var(--blue); font-size: 0.69rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.research-speaker button {
  min-height: 2rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font: 700 0.68rem/1 var(--sans);
  cursor: pointer;
}
.research-speaker button:hover { border-color: var(--blue); color: var(--blue); }
.research-speaker button:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent); outline-offset: 2px; }
.research-prompt blockquote { margin: 0; color: var(--ink); font: 520 1.05rem/1.55 var(--serif); }
.research-receipt {
  padding: 1.05rem 1.15rem;
  border-left: 1px solid var(--rule);
  background: var(--surface-subtle);
}
.research-receipt p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.research-receipt ul { margin: 0; padding-left: 1rem; color: var(--muted); font-size: 0.8rem; }
.research-receipt li + li { margin-top: 0.2rem; }
.research-receipt-saved { background: var(--green-bg); }
.research-receipt-saved > span { color: var(--green); }
.research-receipt-warning { background: var(--amber-bg); }
.research-receipt-warning > span { color: var(--amber); }
.research-example-strip {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.35rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.research-example-strip > strong { margin: 0.16rem 0 0; color: var(--blue); }
.research-example-strip p { margin: 0; color: var(--muted); font-size: 0.87rem; }
.research-principle { margin: 1.1rem 0 0; color: var(--muted); font-size: 0.84rem; }
.research-principle strong { color: var(--ink); }
.research-capture-states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 1.35rem; background: var(--rule); border: 1px solid var(--rule); }
.research-capture-states > div { display: grid; grid-template-columns: auto 1fr; gap: 0.18rem 0.5rem; align-content: start; padding: 0.85rem; background: var(--surface); }
.research-capture-states p { grid-column: 2; margin: 0; color: var(--muted); font-size: 0.75rem; }
.status-dot { width: 0.57rem; height: 0.57rem; margin-top: 0.38rem; border-radius: 50%; background: var(--faint); }
.status-ready { background: var(--green); }
.status-check { background: var(--amber); }
.status-manual { background: var(--red); }
.research-prose-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1.2rem; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); }
.research-prose-checks article { padding: 0.95rem 1.1rem 0.95rem 0; }
.research-prose-checks article + article { padding-left: 1.1rem; border-left: 1px solid var(--rule); }
.research-prose-checks article > span { color: var(--ink); }
.research-prose-checks p { margin: 0; color: var(--muted); font-size: 0.8rem; }
.research-guide-checklist {
  display: grid;
  grid-template-columns: minmax(14rem, 0.65fr) minmax(20rem, 1fr);
  gap: 2rem 4rem;
  margin-top: 1rem;
  padding: clamp(2rem, 5vw, 3.5rem);
  background: var(--cd-navy);
  color: oklch(0.96 0.008 250);
}
.research-guide-checklist .section-label { color: oklch(0.72 0.13 158); }
.research-guide-checklist ul { columns: 2; column-gap: 2.5rem; margin: 0; padding: 0; list-style: none; }
.research-guide-checklist li { position: relative; break-inside: avoid; padding: 0.35rem 0 0.35rem 1.2rem; color: oklch(0.84 0.012 250); font-size: 0.8rem; }
.research-guide-checklist li::before { content: "✓"; position: absolute; left: 0; color: oklch(0.72 0.13 158); font-weight: 800; }
.research-guide-checklist > p { grid-column: 1 / -1; margin: 0; padding-top: 1.15rem; border-top: 1px solid oklch(0.36 0.025 255); color: oklch(0.82 0.012 250); font-size: 0.82rem; }
.research-guide-checklist > p strong { color: white; }
.research-copy-status { position: fixed; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 800px) {
  .research-guide-hero,
  .research-session-heading,
  .research-turn-body > header,
  .research-exchange,
  .research-guide-checklist { grid-template-columns: 1fr; }
  .research-guide-hero { align-items: start; }
  .research-guide-memory { max-width: 31rem; }
  .research-turn { grid-template-columns: 4.2rem minmax(0, 1fr); gap: 1rem; }
  .research-turn-marker::after { bottom: -4.3rem; }
  .research-receipt { border-top: 1px solid var(--rule); border-left: 0; }
  .research-guide-checklist > p { grid-column: auto; }
}

@media (max-width: 560px) {
  .research-guide-intro h1 { font-size: clamp(2.45rem, 13vw, 3.5rem); }
  .research-guide-actions { align-items: flex-start; flex-direction: column; gap: 0.7rem; }
  .research-turn { grid-template-columns: 1fr; }
  .research-turn-marker { display: flex; align-items: center; gap: 0.6rem; }
  .research-turn-marker strong { margin: 0; }
  .research-turn-marker::after { display: none; }
  .research-example-strip,
  .research-capture-states,
  .research-prose-checks { grid-template-columns: 1fr; }
  .research-example-strip { gap: 0.35rem; }
  .research-capture-states { gap: 1px; }
  .research-prose-checks article { padding: 0.9rem 0; }
  .research-prose-checks article + article { padding-left: 0; border-top: 1px solid var(--rule); border-left: 0; }
  .research-guide-checklist { margin-right: -1rem; margin-left: -1rem; padding-right: 1rem; padding-left: 1rem; }
  .research-guide-checklist ul { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .research-speaker button { transition: none; }
}

/* Research checkpoint */
.checkpoint-actions { display: flex; align-items: center; gap: 0.85rem; margin: 1rem 0; }
.checkpoint-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(14rem, 0.75fr); gap: 1.25rem; margin: 1.25rem 0; }
.checkpoint-grid h3, .materials-grid h3, .finding-columns > div > h3 {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 0.55rem; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.count { color: var(--faint); font-size: 0.75rem; font-weight: 500; }
.request-list, .supplied-source-list { display: grid; gap: 0.5rem; }
.source-request {
  padding: 0.8rem 0.9rem; border: 1px solid var(--rule); border-radius: 7px; background: var(--surface);
}
.source-request-resolved, .source-request-dismissed { background: #f8f7f4; }
.request-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }
.request-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.request-type, .request-blocking {
  color: var(--muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.request-blocking { color: var(--red); }
.source-request h4 { margin: 0.2rem 0 0; font: 600 1rem/1.35 var(--serif); }
.source-request-speculative { border-style: dashed; background: #faf9f6; }
.source-request p { margin: 0.35rem 0; font-size: 0.86rem; }
.source-byline { color: var(--muted); }
.request-ratings { display: flex; flex-wrap: wrap; gap: 0.45rem 0.9rem; margin: 0.55rem 0; color: var(--muted); font-size: 0.76rem; }
.request-ratings strong { color: var(--ink); text-transform: capitalize; }
.request-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem 0.9rem; margin: 0.7rem 0 0; }
.request-details div { min-width: 0; }
.request-details dt { margin-bottom: 0.12rem; color: var(--faint); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.request-details dd { margin: 0; overflow-wrap: anywhere; font-size: 0.82rem; line-height: 1.45; }
.request-details dd span { display: block; color: var(--muted); font-size: 0.76rem; }
.request-gaps { margin-top: 0.65rem; padding: 0.6rem 0.7rem; border-left: 3px solid var(--amber); background: var(--amber-bg); font-size: 0.8rem; }
.request-gaps ul { margin: 0.25rem 0 0; padding-left: 1rem; }
.request-gaps li + li { margin-top: 0.15rem; }
.request-context-saved {
  margin-top: 0.7rem;
  padding: 0.6rem 0.7rem;
  border-left: 3px solid var(--accent);
  background: #f2f5fd;
}
.request-context-saved strong {
  color: var(--accent-ink);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.request-context-saved p {
  margin: 0.2rem 0 0;
  color: var(--ink);
  white-space: pre-wrap;
}
.request-context-entry {
  margin-top: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--rule));
  border-radius: 7px;
  background: #f7f9ff;
}
.request-context-entry > summary {
  padding: 0.55rem 0.7rem;
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 650;
}
.request-context-entry[open] > summary {
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 18%, var(--rule));
}
.request-context-entry > p {
  margin: 0;
  padding: 0.65rem 0.75rem 0;
  color: var(--muted);
  line-height: 1.45;
}
.request-context-entry form {
  display: grid;
  gap: 0.35rem;
  padding: 0.6rem 0.75rem 0.75rem;
}
.request-context-entry label {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 650;
}
.request-context-entry textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
  padding: 0.52rem 0.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: 400 0.86rem/1.45 var(--sans);
}
.request-context-entry textarea:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(30, 79, 216, 0.18);
  outline-offset: 1px;
}
.request-context-entry button { justify-self: start; margin-top: 0.2rem; }
.request-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rule);
}
.request-supply {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}
.request-manage { position: relative; }
.request-manage > summary {
  padding: 0.35rem 0.15rem;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}
.request-manage[open] > summary { color: var(--accent); }
.request-manage-menu {
  display: grid;
  min-width: 13rem;
  margin-top: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(39, 42, 49, 0.1);
}
.request-manage-menu form { display: block; margin: 0; }
.request-manage-menu a,
.request-manage-menu button {
  display: block;
  width: 100%;
  padding: 0.43rem 0.5rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: 500 0.8rem/1.3 var(--sans);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.request-manage-menu a:hover,
.request-manage-menu button:hover {
  background: #f2f5fd;
  color: var(--accent-ink);
}
.request-manage-menu a:focus-visible,
.request-manage-menu button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.speculative-leads { margin-top: 0.8rem; padding-top: 0.65rem; border-top: 1px solid var(--rule); }
.speculative-leads summary { color: var(--accent); cursor: pointer; font-size: 0.85rem; font-weight: 600; }
.speculative-leads summary .count { margin-left: 0.25rem; }
.add-request-link { margin-top: 0.8rem; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 0.55rem; font-size: 0.84rem; }
.inline-actions form { display: inline-flex; margin: 0; }
.supplied-source-list a, .material-row a {
  display: grid; padding: 0.7rem 0.8rem; border: 1px solid var(--rule); border-radius: 7px;
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.supplied-source-list a:hover, .material-row a:hover { border-color: var(--accent); }
.supplied-source-list span, .material-row span { color: var(--muted); font-size: 0.8rem; }
.manual-request { margin: 1rem 0; border-top: 1px solid var(--rule); padding-top: 0.75rem; }
.manual-request summary { color: var(--accent); cursor: pointer; font-weight: 600; }
.compact-form { margin-top: 0.8rem; padding: 1rem; border: 1px solid var(--rule); background: var(--surface); }
.checkpoint-continue { margin-top: 1.3rem; padding: 1.1rem; border-left: 3px solid var(--accent); background: #f6f8fd; }
.checkpoint-continue .hint { margin-bottom: 0; }
.checkpoint-complete { color: var(--green); }
.checkpoint-blocked {
  padding: 0.8rem 0.9rem;
  border-left: 4px solid var(--red);
  background: #fff7f6;
}
.checkpoint-blocked strong { color: var(--red); }
.checkpoint-blocked p { margin: 0.2rem 0 0.4rem; color: var(--muted); }
.checkpoint-blocked ul { margin: 0; padding-left: 1.15rem; font-size: 0.86rem; }

/* Private source intake and detail */
.page-intro, .review-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem;
  padding-bottom: 1.2rem; margin-bottom: 1.3rem; border-bottom: 1px solid var(--rule-strong);
}
.page-intro .page-title, .review-header .page-title { margin-bottom: 0.35rem; }
.page-intro .lede, .review-header .lede { max-width: 50rem; margin: 0; }
.privacy-mark {
  flex: none; padding: 0.28rem 0.6rem; border: 1px solid var(--amber); border-radius: 4px;
  color: var(--amber); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.source-request-context { margin: 0 0 1.2rem; padding: 0.9rem 1rem; border-left: 3px solid var(--amber); background: var(--amber-bg); }
.source-request-context strong { display: block; }
.source-request-context p { margin: 0.35rem 0 0; }
.source-form { display: grid; gap: 1rem; }
.form-section { border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); overflow: hidden; }
.form-section-heading { display: flex; gap: 0.8rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--rule); background: #faf9f6; }
.form-section-heading > span { display: grid; place-items: center; flex: 0 0 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--accent); color: white; font-size: 0.78rem; font-weight: 700; }
.form-section-heading h2 { margin: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 500; }
.form-section-heading p { margin: 0.05rem 0 0; color: var(--muted); font-size: 0.82rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1rem; }
.form-section > .form-grid { padding: 1.1rem; }
.field { display: grid; align-content: start; gap: 0.25rem; min-width: 0; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.field input, .field select, .field textarea, .compact-form input, .compact-form select, .compact-form textarea,
.decision-form input, .decision-form select, .signoff-form input, .signoff-form select, .signoff-form textarea {
  width: 100%; min-width: 0; padding: 0.5rem 0.6rem; border: 1px solid var(--rule-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink); font: 400 0.9rem/1.4 var(--sans);
}
.field input[type="checkbox"] { width: auto; justify-self: start; }
.field-title, .field-canonical_url, .field-supplied_text, .field-original_file, .field-why_material, .field-researcher_notes,
.field-document_description, .field-existence_basis, .field-confirmation_criteria, .field-difficulty_basis,
.field-acquisition_route, .field-expected_support, .field-instructions, .field-citation { grid-column: 1 / -1; }
.field-supplied_text textarea { min-height: 22rem; resize: vertical; font-family: var(--serif); line-height: 1.6; }
.field small { color: var(--muted); font-weight: 400; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--red); }
.optional-request-details summary { padding: 0.85rem 1.1rem; cursor: pointer; color: var(--accent); font-weight: 600; }
.optional-request-details[open] summary { border-bottom: 1px solid var(--rule); }
.sticky-form-actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 1rem;
  margin-top: 0.25rem; padding: 0.8rem 1rem; border: 1px solid var(--rule-strong); border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
}
.source-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 1.4rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); overflow: hidden; }
.source-metadata div { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--rule); }
.source-metadata div:nth-child(odd):not(.wide) { border-right: 1px solid var(--rule); }
.source-metadata .wide { grid-column: 1 / -1; }
.source-metadata dt { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.source-metadata dd { margin: 0.15rem 0 0; overflow-wrap: anywhere; }
.source-note { margin: 1rem 0; }
.source-note h2 { margin-bottom: 0.3rem; font-family: var(--serif); font-size: 1.15rem; }
.source-note p { margin-top: 0; }
.file-strip { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1.2rem 0; padding: 0.8rem 1rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.file-strip div { display: grid; }
.file-strip span { color: var(--muted); font-size: 0.8rem; }
.private-text { margin-top: 1.4rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); overflow: hidden; }
.section-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--rule); }
.section-bar h2 { margin: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 500; }
.section-bar > span { color: var(--muted); font-size: 0.8rem; }
.private-text pre, .evidence-preview pre { margin: 0; padding: 1rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 0.88rem/1.6 var(--serif); }

/* Evidence review workspace */
.review-header-actions { display: grid; justify-items: end; gap: 0.7rem; flex: none; }
.review-jump { position: sticky; top: 104px; z-index: 10; display: flex; gap: 0.25rem; margin: -1.3rem 0 1rem; padding: 0.55rem 0; overflow-x: auto; border-bottom: 1px solid var(--rule); background: var(--paper); }
.review-jump a { flex: none; padding: 0.25rem 0.55rem; color: var(--muted); font-size: 0.78rem; font-weight: 600; text-decoration: none; }
.review-jump a:hover { color: var(--accent); }
.review-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0 0 1.2rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); overflow: hidden; }
.review-metrics > div { display: grid; padding: 0.7rem 0.85rem; border-right: 1px solid var(--rule); }
.review-metrics > div:last-child { border-right: 0; }
.review-metrics strong { font: 500 1.4rem/1 var(--serif); }
.review-metrics span { margin-top: 0.3rem; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; }
.review-metrics .metric-alert { box-shadow: inset 0 3px 0 var(--amber); }
.review-section { scroll-margin-top: 160px; margin: 0 0 1.2rem; padding: 1.1rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.review-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.9rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--rule); }
.review-section-head h2 { margin: 0; font-family: var(--serif); font-size: 1.45rem; font-weight: 500; }
.review-section-head > span { color: var(--muted); font-size: 0.8rem; }
.must-resolve { border-left: 4px solid var(--amber); }
.clear-state { margin: 0; color: var(--green); }
.resolve-row { display: grid; grid-template-columns: 6.5rem minmax(10rem, 0.6fr) minmax(12rem, 1fr) auto; align-items: center; gap: 0.7rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.resolve-row:last-child { border-bottom: 0; }
.resolve-row > span:last-of-type { color: var(--muted); font-size: 0.82rem; }
.grade { display: inline-flex; width: fit-content; padding: 0.16rem 0.45rem; border-radius: 4px; background: #eceae5; color: var(--muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.grade-supported { background: #e9f6ee; color: var(--green); }
.grade-partial { background: var(--amber-bg); color: var(--amber); }
.grade-unsupported,
.grade-not_supported,
.grade-cannot_verify,
.grade-cannot_check,
.grade-scope_unstated,
.grade-no_citation,
.grade-filing_unresolved { background: #fdeceb; color: var(--red); }
.review-article { max-width: 49rem; margin: 0 auto; }
.citation-review-list { display: grid; gap: 0.8rem; }
.citation-review { scroll-margin-top: 160px; padding: 0.9rem; border: 1px solid var(--rule); border-radius: 7px; background: #fcfbf8; }
.citation-review.review-decision-resolved {
  border-color: color-mix(in srgb, var(--green) 38%, var(--rule));
  background: color-mix(in srgb, var(--green-bg) 42%, #fcfbf8);
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--green) 72%, transparent);
}
.citation-review.review-decision-open {
  border-color: color-mix(in srgb, var(--amber) 35%, var(--rule));
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--amber) 62%, transparent);
}
.citation-review > header { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 0.75rem; }
.citation-review > header div { display: grid; min-width: 0; }
.citation-review > header a { overflow: hidden; color: var(--muted); font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.review-decision-state {
  display: grid;
  grid-template-columns: auto auto minmax(12rem, 1fr);
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 5px;
  font-size: 0.78rem;
}
.review-decision-state > span:first-child {
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.review-decision-state.is-resolved {
  background: var(--green-bg);
  color: var(--green);
}
.review-decision-state.is-open {
  background: var(--amber-bg);
  color: var(--amber);
}
.review-decision-state.is-recorded {
  background: var(--surface-subtle);
  color: var(--ink);
}
.review-decision-note {
  color: var(--muted);
  font-weight: 400;
}
.citation-columns { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1rem; margin: 0.8rem 0; }
.citation-columns h3, .evidence-preview h3 { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.citation-columns p { margin: 0; }
.x-review-layers { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.x-review-layers > div { min-width: 0; }
.x-review-layers h3 { margin: 0 0 0.55rem; font: 500 1rem/1.25 var(--serif); }
.x-context-post { margin: 0.75rem 0; padding: 0.75rem; border-left: 3px solid var(--rule-strong); background: var(--surface-subtle); }
.x-context-post > span { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.78rem; }
.x-context-post blockquote { margin: 0.65rem 0; }
.x-source-review .materials-list > .material-row { display: grid; gap: 0.2rem; padding: 0.65rem 0; border-bottom: 1px solid var(--rule); }
.x-source-review .materials-list > .material-row:last-child { border-bottom: 0; }
.passage { padding: 0.55rem 0.7rem; border-left: 3px solid var(--rule-strong); background: white; white-space: pre-wrap; font-family: var(--serif); }
.evidence-excerpt { margin-top: 0.75rem; }
.evidence-excerpt > span {
  display: block;
  margin-bottom: 0.22rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.evidence-excerpt blockquote {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid var(--rule-strong);
  background: white;
  color: var(--ink);
  font-family: var(--serif);
}
.evidence-excerpt-item + .evidence-excerpt-item { margin-top: 0.55rem; }
.evidence-excerpt-item > strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.finding-sources {
  margin-top: 0.8rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rule);
}
.finding-source-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.28rem 0;
  font-size: 0.78rem;
}
.finding-source-row > span:first-child {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finding-source-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.finding-source-actions a { font-weight: 600; }
.evidence-preview { margin: 0.7rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0.55rem 0; }
.evidence-preview summary { color: var(--accent); cursor: pointer; font-size: 0.84rem; font-weight: 600; }
.evidence-preview pre { max-height: 22rem; margin-top: 0.55rem; border: 1px solid var(--rule); background: white; }
.decision-form { display: grid; grid-template-columns: minmax(10rem, 0.35fr) minmax(14rem, 1fr) auto; align-items: end; gap: 0.65rem; }
.decision-form label, .signoff-form label { display: grid; gap: 0.22rem; color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.finding-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.finding-review { scroll-margin-top: 160px; margin-bottom: 0.7rem; padding: 0.75rem; border: 1px solid var(--rule); border-radius: 7px; background: #fcfbf8; }
.finding-review.review-decision-recorded {
  border-color: var(--rule-strong);
  background: var(--surface-subtle);
}
.finding-review > p { margin: 0.35rem 0; color: var(--muted); font-size: 0.84rem; }
.finding-meta { display: flex; gap: 0.45rem; color: var(--faint); font-size: 0.68rem; text-transform: uppercase; }
.finding-citations { margin: 0.4rem 0; padding-left: 1rem; font-size: 0.75rem; }
.compact-decision { grid-template-columns: minmax(8rem, 0.7fr) minmax(8rem, 1fr) auto; margin-top: 0.55rem; }
.materials-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.materials-grid > div { min-width: 0; }
.materials-grid ul { margin: 0; padding-left: 1.1rem; }
.material-row { margin-bottom: 0.45rem; }
.signoff-section { border-top: 4px solid var(--accent); }
.signoff-form { display: grid; grid-template-columns: minmax(12rem, 0.35fr) minmax(16rem, 1fr) auto; align-items: end; gap: 0.8rem; }
.redraft-callout { margin-top: 1rem; padding: 0.9rem 1rem; border-left: 3px solid var(--amber); background: var(--amber-bg); }
.redraft-callout h3 { margin: 0; font-size: 1rem; }
.redraft-callout p { margin: 0.3rem 0 0.7rem; }

@media (max-width: 780px) {
  .checkpoint-grid, .form-grid, .source-metadata, .finding-columns, .materials-grid, .citation-columns, .request-details, .x-review-layers { grid-template-columns: 1fr; }
  .source-metadata .wide, .field-title, .field-canonical_url, .field-supplied_text, .field-original_file, .field-why_material, .field-researcher_notes,
  .field-document_description, .field-existence_basis, .field-confirmation_criteria, .field-difficulty_basis,
  .field-acquisition_route, .field-expected_support, .field-instructions, .field-citation { grid-column: 1; }
  .source-metadata div:nth-child(odd):not(.wide) { border-right: 0; }
  .review-metrics { grid-template-columns: repeat(2, 1fr); }
  .finding-source-row { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .finding-source-row > span:first-child { max-width: 100%; white-space: normal; }
  .review-decision-state { grid-template-columns: 1fr; }
  .review-metrics > div { border-bottom: 1px solid var(--rule); }
  .resolve-row { grid-template-columns: auto 1fr; }
  .resolve-row > span:last-of-type { grid-column: 1 / -1; }
  .decision-form, .compact-decision, .signoff-form { grid-template-columns: 1fr; }
  .page-intro, .review-header { display: grid; gap: 0.75rem; }
  .review-header-actions { justify-items: start; }
}

.login-card {
  max-width: 22rem; margin: 3rem auto;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; padding: 1.8rem;
}
.login-card h1 { font-family: var(--serif); font-weight: 500; margin-top: 0; }
.login-intro { color: var(--muted); margin: -0.25rem 0 1.2rem; }
.auth-status { min-height: 1.5rem; margin: 0 0 0.8rem; color: var(--muted); }
.auth-status:empty { display: none; }
.stack button:disabled { cursor: wait; opacity: 0.62; }

/* ── Stepper ─────────────────────────────────────────────────── */

.stepper { margin-top: 0.5rem; }

.step { min-width: 0; padding: 1.15rem 0; border-bottom: 1px solid var(--rule-strong); }
.step:last-child { border-bottom: none; }

.step-head { display: flex; align-items: center; gap: 0.85rem; }
.step-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 0;
}
.step-head .pill { margin-left: auto; }

.step-num {
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.9rem; font-weight: 600;
  background: #dddbd4; color: var(--muted);
  flex: none;
}
.step-active .step-num { background: var(--accent); color: #fff; }
.step-done .step-num { background: #e9f6ee; color: var(--green); }
.step-locked { opacity: 0.55; }

.step-body { min-width: 0; max-width: 100%; margin: 0.9rem 0 0 2.6rem; }
.step-body > :first-child { margin-top: 0; }

/* The active step's working panel */
.panel {
  background: #faf9f6;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.15rem 1.3rem 1.3rem;
}
.panel > .lede { margin: 0 0 1rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--rule); }

.group-label {
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  margin: 1.15rem 0 0.45rem;
}
.panel .group-label:first-of-type { margin-top: 0; }

.campaign-finance-panel {
  display: grid;
  grid-template-columns: minmax(12rem, 0.82fr) minmax(18rem, 1.18fr);
  gap: 1.4rem;
  margin-top: 0.9rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #faf9f6;
}
.campaign-finance-intro {
  padding-right: 1.2rem;
  border-right: 1px solid var(--rule);
}
.campaign-finance-intro .group-label { margin: 0 0 0.35rem; }
.campaign-finance-intro h3 {
  margin: 0;
  font: 500 1.18rem/1.3 var(--serif);
}
.campaign-finance-intro p:not(.group-label) {
  margin: 0.45rem 0 0.65rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}
.campaign-finance-intro a {
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}
.campaign-finance-intro a:hover { text-decoration: underline; }
.campaign-finance-form {
  display: grid;
  align-content: start;
  gap: 0.7rem;
}
.campaign-finance-form label {
  display: grid;
  gap: 0.25rem;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
}
.campaign-finance-form input {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: 0.86rem/1.35 var(--mono);
}
.campaign-finance-form input:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(30, 79, 216, 0.18);
  outline-offset: 1px;
}
.campaign-finance-form small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
}
.campaign-finance-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.15rem;
}
.campaign-finance-actions button.primary {
  padding: 0.48rem 0.85rem;
  font-size: 0.84rem;
}
.campaign-finance-pinned {
  margin: -0.15rem 0 0;
  color: var(--green);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.rows {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}
.row {
  display: flex; align-items: baseline; gap: 0.7rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.rows .row:last-child { border-bottom: none; }
.row input[type="checkbox"] { accent-color: var(--accent); transform: translateY(1px); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 500; }
.row-title .star { color: var(--amber); }
.row-sub { display: block; font-size: 0.85rem; color: var(--muted); }
.row-side { flex: none; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.row-compact { padding: 0.42rem 0.9rem; }
.row-compact .row-title { font-weight: 400; font-size: 0.92rem; }

.court-candidates {
  display: grid;
  gap: 0.7rem;
}
.court-candidate {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}
.court-candidate-main {
  display: grid;
  gap: 0.2rem;
}
.court-decision {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin: 0.7rem 0 0;
  padding: 0.65rem 0 0;
  border: 0;
  border-top: 1px solid var(--rule);
}
.court-decision label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.court-decision input { accent-color: var(--accent); }
.court-coverage {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.conf-high { color: var(--green); }
.conf-medium { color: var(--amber); }
.conf-low { color: var(--red); }

.no-signal { margin-top: 0.7rem; font-size: 0.9rem; }
.no-signal summary { cursor: pointer; color: var(--muted); }
.no-signal ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

.lead-inventory { margin-top: 0.8rem; }
.lead-inventory summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.9rem;
}
.lead-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.7rem;
}
.lead-item {
  padding: 0.75rem 0.85rem;
  background: var(--surface);
  border-left: 3px solid var(--rule-strong);
}
.lead-item > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.lead-item p { margin: 0.25rem 0; font-size: 0.9rem; }
.lead-item small { color: var(--muted); }
.lead-meta {
  flex: none;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-actions {
  display: flex; align-items: center; gap: 1.2rem;
  margin-top: 1.25rem;
}
.panel-actions .also { font-size: 0.92rem; text-decoration: none; }
.panel-actions .also:hover { text-decoration: underline; }

/* Research-stage rows (step 2) */
.run-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; }
.run-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.7rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--rule);
}
.run-list li:last-child { border-bottom: none; }
.run-main { display: grid; gap: 0.18rem; min-width: 0; }
.run-actions { display: flex; align-items: center; gap: 0.65rem; }
.run-list .run-name { font-weight: 500; line-height: 1.35; }
.run-list .run-note { font-size: 0.85rem; color: var(--faint); }
.web-pass-receipt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.75rem;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.74rem;
}
.web-pass-receipt strong {
  color: var(--green);
  font-weight: 650;
}
.web-pass-receipt span + span {
  position: relative;
}
.web-pass-receipt span + span::before {
  position: absolute;
  left: -0.43rem;
  color: var(--rule-strong);
  content: "·";
}
.web-pass-receipt-warning {
  display: grid;
  justify-items: start;
  gap: 0.15rem;
  max-width: 38rem;
  padding: 0.45rem 0.55rem;
  border-left: 3px solid var(--amber);
  background: var(--amber-bg);
}
.web-pass-receipt-warning strong { color: #8a4c00; }
.web-pass-receipt-warning span + span::before { content: none; }
.run-list .run-error {
  max-width: 48rem;
  color: var(--red);
  font-size: 0.82rem;
  line-height: 1.42;
}
.run-list .report-link { flex: none; font-size: 0.9rem; text-decoration: none; }
.run-control-form { display: inline-flex; margin: 0; }
.run-control {
  min-height: 1.8rem;
  padding: 0.2rem 0.58rem;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font: 600 0.75rem/1.2 var(--sans);
  cursor: pointer;
}
.run-control:hover { border-color: var(--accent); color: var(--accent); }
.run-control:active { transform: translateY(1px); }
.run-control:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.run-control-retry { border-color: color-mix(in srgb, var(--accent) 38%, var(--rule)); color: var(--accent); }
.run-control-cancel:hover { border-color: var(--red); color: var(--red); }
.run-failure {
  margin: 0.45rem 0;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--red);
  background: #fff7f6;
  color: var(--ink);
  font-size: 0.84rem;
}
.run-failure strong { display: block; color: var(--red); }
.run-failure p { margin: 0.15rem 0 0; color: var(--muted); }
.run-failure details { margin-top: 0.35rem; color: var(--muted); }
.run-failure summary { cursor: pointer; font-size: 0.75rem; }
.run-failure code { display: block; margin-top: 0.25rem; white-space: normal; overflow-wrap: anywhere; color: var(--muted); }

.run-live {
  display: grid;
  grid-template-columns: 0.8rem minmax(0, 1fr);
  gap: 0.48rem;
  align-items: start;
  color: var(--muted);
  margin-top: 0.18rem;
}
.activity-spinner { margin-top: 0.3rem; }
.run-live-copy { display: grid; gap: 0.04rem; min-width: 0; }
.activity-message { color: var(--accent-ink); font-size: 0.86rem; font-weight: 500; }
.activity-detail {
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  color: var(--faint);
  font-size: 0.76rem;
}
.package-phase { color: var(--ink); font-weight: 600; margin-bottom: 0.2rem; }

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

@media (prefers-reduced-motion: reduce) {
  .poll-status.is-live::before,
  .activity-spinner { animation: none; }
}

.step-cta { margin-top: 0.9rem; display: grid; gap: 0.35rem; justify-items: start; }
.step-cta .hint { font-size: 0.88rem; color: var(--muted); margin: 0; }

.article-builder {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 0.9rem;
  padding: 1.05rem 1.15rem 1.15rem;
  background: #faf9f6;
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-top: 1rem;
}
.article-builder > button { justify-self: start; }
.article-plan {
  min-width: 0;
  max-width: 100%;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--surface);
}
.article-plan-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.article-plan-head > div { min-width: 0; }
.article-plan-head h3 {
  max-width: 38rem;
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  font: 500 1.2rem/1.35 var(--serif);
}
.article-plan-head > span {
  flex: none;
  color: var(--muted);
  font-size: 0.78rem;
}
.article-outline {
  display: grid;
  gap: 0;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: outline;
}
.article-outline li {
  display: grid;
  min-width: 0;
  grid-template-columns: 1.35rem minmax(10rem, 0.45fr) minmax(14rem, 1fr);
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  counter-increment: outline;
}
.article-outline li::before {
  content: counter(outline);
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: 1.35rem;
  color: var(--faint);
  font: 500 0.74rem/1.5 var(--mono);
}
.article-outline strong {
  grid-column: 2;
}
.article-outline span {
  grid-column: 3;
  color: var(--muted);
  font-size: 0.84rem;
}
.coverage-details { margin-top: 0.75rem; }
.coverage-details > summary,
.editorial-direction > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.coverage-findings { display: grid; gap: 0.55rem; margin-top: 0.8rem; }
.coverage-findings > div {
  padding-left: 0.8rem;
  border-left: 2px solid var(--rule-strong);
}
.coverage-findings span {
  display: block;
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}
.coverage-findings p,
.coverage-note {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.editorial-direction {
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
}
.editorial-direction > summary span {
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}
.direction-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1rem;
  margin-top: 0.8rem;
}
.direction-fields label {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.direction-fields label:first-child,
.direction-fields label:nth-child(2),
.direction-fields label:nth-child(4) { grid-column: 1 / -1; }
.direction-fields textarea {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  resize: vertical;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: 400 0.9rem/1.45 var(--sans);
}
.direction-fields textarea:focus-visible {
  outline: 3px solid rgba(30, 79, 216, 0.2);
  outline-offset: 1px;
  border-color: var(--accent);
}
.direction-fields small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
}
.revision-form { display: grid; gap: 1rem; margin-top: 0.9rem; }
.revision-form > button { justify-self: start; }
.direction-used {
  padding: 0.55rem 0.7rem;
  border-left: 3px solid var(--accent);
  background: #f6f8fd;
  color: var(--muted);
  font-size: 0.84rem;
}
.revision-header { margin-bottom: 1rem; }
.revision-state {
  display: grid;
  gap: 0.1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--amber);
  background: var(--amber-bg);
}
.revision-state span { color: var(--muted); font-size: 0.84rem; }
.revision-state-active { border-left-color: var(--accent); background: #f0f4ff; }
.revision-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(22rem, 0.8fr);
  grid-template-areas: "draft controls";
  align-items: start;
  gap: 1rem;
}
.revision-current-draft {
  grid-area: draft;
  min-width: 0;
  padding: 1.2rem 1.35rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}
.revision-current-draft > header,
.revision-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.revision-current-draft > header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.revision-current-draft h2,
.revision-panel h2 {
  margin: 0;
  font: 500 1.35rem/1.3 var(--serif);
}
.revision-current-draft > header a,
.revision-panel-head a { flex: none; font-size: 0.82rem; }
.revision-controls {
  grid-area: controls;
  display: grid;
  min-width: 0;
  gap: 1rem;
}
.revision-panel {
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}
.revision-panel > p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.86rem; }
.revision-source-list { display: grid; margin-top: 0.8rem; border-top: 1px solid var(--rule); }
.revision-source-list a {
  display: grid;
  gap: 0.05rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}
.revision-source-list a:hover strong { color: var(--accent); }
.revision-source-list span { color: var(--muted); font-size: 0.76rem; }
@media (max-width: 780px) {
  .campaign-finance-panel { grid-template-columns: 1fr; gap: 0.9rem; }
  .campaign-finance-intro {
    padding: 0 0 0.85rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .article-plan-head { display: grid; gap: 0.4rem; }
  .article-outline li { grid-template-columns: 1.35rem minmax(0, 1fr); gap: 0.2rem 0.45rem; }
  .article-outline strong { grid-column: 2; }
  .article-outline span { grid-column: 2; }
  .direction-fields { grid-template-columns: 1fr; }
  .direction-fields label:first-child,
  .direction-fields label:nth-child(2),
  .direction-fields label:nth-child(4) { grid-column: 1; }
  .revision-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "controls" "draft";
  }
  .revision-current-draft,
  .revision-panel { padding: 0.9rem; }
  .revision-current-draft > header,
  .revision-panel-head { display: grid; gap: 0.35rem; }
}
.article-result {
  padding: 0.95rem 1.05rem;
  background: var(--surface);
  border-left: 3px solid var(--accent);
}
.article-result p { margin: 0; }
.article-result .final-link { display: inline-block; margin: 0.2rem 0; }
.result-label {
  color: var(--muted);
  font-size: 0.82rem;
}
.range-warning { color: var(--amber); font-weight: 600; }

.research-materials { margin-top: 1.1rem; }
.research-materials > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
}
.materials-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}
.materials-list > a {
  display: grid;
  gap: 0.1rem;
  padding: 0.7rem 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.materials-list > a:last-of-type { border-bottom: 0; }
.materials-list > a:hover strong { color: var(--accent); }
.materials-list span { color: var(--muted); font-size: 0.84rem; }
.rebuild-form { margin-top: 0.7rem; }

.final-link {
  font-family: var(--serif); font-size: 1.15rem;
  text-decoration: none;
}
.final-link:hover { text-decoration: underline; }

.spinner { color: var(--muted); }
.spinner::before { content: "⟳ "; color: var(--accent); }

details.step-summary summary { cursor: pointer; color: var(--muted); }

/* ── Report reader (§18: the most designed screen) ───────────── */

.report { max-width: 43rem; margin: 0 auto; }
.report-meta {
  display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center;
  margin: 0.3rem 0 1.6rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule-strong);
}
.report-meta .kicker { letter-spacing: 0.11em; }
.report-meta .copy-md { margin-left: auto; }

.abstract {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-style: italic;
  color: #43464d;
  margin: 0 0 1.8rem;
}

.artifact-note {
  display: grid;
  gap: 0.1rem;
  margin: -0.6rem 0 1.35rem;
  padding: 0.75rem 0.9rem;
  background: #f2f5fd;
  border-left: 3px solid var(--accent);
  font-size: 0.88rem;
}
.artifact-note span { color: var(--muted); }
.artifact-note-secondary {
  background: #eae8e2;
  border-left-color: var(--muted);
}

.report-body {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.78;
}
.report-body h1 { font-size: 1.75rem; font-weight: 500; line-height: 1.25; }
.report-body h2 {
  font-size: 1.3rem; font-weight: 500; margin-top: 2.2rem;
  padding-top: 1.1rem; border-top: 1px solid var(--rule);
}
.report-body h3 { font-size: 1.08rem; }
.report-body table { border-collapse: collapse; font-family: var(--sans); font-size: 0.9rem; margin: 1rem 0; }
.report-body th, .report-body td { border: 1px solid var(--rule-strong); padding: 0.35rem 0.7rem; }
.report-body th { background: #faf9f6; text-align: left; }
.report-body td:last-child { font-family: var(--mono); font-size: 0.85rem; }
.report-body code { background: #eceae5; padding: 0 0.3rem; border-radius: 3px; }
.report-body blockquote { border-left: 3px solid var(--rule-strong); margin-left: 0; padding-left: 1rem; color: var(--muted); }

@media (max-width: 640px) {
  .length-options { grid-template-columns: 1fr; }
  .custom-length { grid-template-columns: 1fr 1fr; }
  .step-body { margin-left: 0; }
  .lead-item > div { display: grid; gap: 0.15rem; }
  .run-list li { grid-template-columns: 1fr; }
  .run-actions { justify-content: space-between; }
}

/* ── Profile queue and handoff workflow ─────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.product-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  min-width: 0;
}
.product-search input {
  width: min(24vw, 18rem);
  min-height: 34px;
  padding: 0.38rem 0.7rem;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: 0.82rem/1.2 var(--sans);
}
.product-new,
.theme-toggle {
  min-height: 34px;
  border-radius: 5px;
  font: 650 0.78rem/1 var(--sans);
  cursor: pointer;
}
.product-new {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 0.85rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.product-new:hover { background: var(--accent-ink); }
.product-admin,
.product-back {
  padding: 0.45rem 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.product-admin:hover,
.product-back:hover { color: var(--ink); }
.theme-toggle {
  width: 34px;
  padding: 0;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--muted);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--ink); }

.queue-main {
  width: min(100%, 94rem);
  max-width: 94rem;
  padding-top: 1.65rem;
}
.queue-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}
.queue-title > div {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}
.queue-title .page-title {
  margin: 0;
  font: 700 1.65rem/1.2 var(--sans);
  letter-spacing: -0.025em;
}
.queue-title span { color: var(--muted); font-size: 0.8rem; }

.queue-views {
  display: flex;
  align-items: stretch;
  gap: 1.35rem;
  min-width: 0;
  margin-bottom: 0.85rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--rule-strong);
  scrollbar-width: thin;
}
.queue-views a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  padding: 0.48rem 0 0.58rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.queue-views a:hover { color: var(--ink); }
.queue-views a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--ink);
}
.queue-views strong {
  min-width: 1.5rem;
  padding: 0.08rem 0.36rem;
  border-radius: 3px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
  text-align: center;
}
.queue-views a[aria-current="page"] strong {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.queue-filters {
  display: grid;
  grid-template-columns:
    minmax(8rem, 0.85fr)
    minmax(8rem, 0.85fr)
    minmax(9rem, 1fr)
    minmax(9rem, 1fr)
    auto;
  align-items: end;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}
.queue-filters label {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.queue-filters label > span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.queue-filters select {
  width: 100%;
  min-height: 34px;
  padding: 0.35rem 1.7rem 0.35rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: 0.78rem/1.2 var(--sans);
}
.queue-filters > a {
  min-height: 34px;
  padding: 0.42rem 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.queue-filters > a:hover { color: var(--ink); }
.queue-search-note {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.profile-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(40 34 24 / 0.04);
}
.profile-table {
  width: 100%;
  min-width: 64rem;
  border-collapse: collapse;
  table-layout: fixed;
}
.profile-table th {
  padding: 0;
  border-bottom: 1px solid var(--rule-strong);
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-align: left;
  text-transform: uppercase;
}
.profile-sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0.5rem 0.72rem;
  color: inherit;
  text-decoration: none;
}
.profile-sort:hover {
  background: color-mix(in srgb, var(--accent-soft) 35%, transparent);
  color: var(--ink);
}
.profile-sort:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.profile-sort-indicator {
  margin-left: 0.35rem;
  color: color-mix(in srgb, var(--muted) 62%, transparent);
  font-size: 0.72rem;
  line-height: 1;
}
.profile-sort-indicator.is-active {
  color: var(--accent-ink);
}
.profile-table td {
  padding: 0.68rem 0.72rem;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.35;
  vertical-align: middle;
}
.profile-table tr:last-child td { border-bottom: 0; }
.profile-table tbody tr:hover { background: var(--surface-subtle); }
.profile-table th:nth-child(1) { width: 21%; }
.profile-table th:nth-child(2) { width: 25%; }
.profile-table th:nth-child(3) { width: 14%; }
.profile-table th:nth-child(4) { width: 15%; }
.profile-table th:nth-child(5) { width: 13%; }
.profile-table th:nth-child(6) { width: 12%; }
.profile-table td:first-child > *,
.profile-table td:nth-child(4) > * { display: block; }
.profile-table td:first-child > * + *,
.profile-table td:nth-child(4) > * + * { margin-top: 0.15rem; }
.profile-name,
.profile-need {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.profile-name { font-size: 0.87rem; }
.profile-name:hover,
.profile-need:hover { color: var(--accent); }
.profile-need { color: var(--accent-ink); font-weight: 650; }
.profile-table small { color: var(--red); font-size: 0.67rem; }

.state-label,
.handoff-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.2rem 0.46rem;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 0.64rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}
.state-attention,
.state-awaiting {
  border-color: color-mix(in srgb, var(--amber) 32%, transparent);
  background: var(--amber-bg);
  color: var(--amber);
}
.state-working,
.state-active {
  border-color: color-mix(in srgb, var(--blue) 30%, transparent);
  background: var(--blue-bg);
  color: var(--blue);
}
.state-failed {
  border-color: color-mix(in srgb, var(--red) 30%, transparent);
  background: var(--red-bg);
  color: var(--red);
}
.state-complete {
  border-color: color-mix(in srgb, var(--green) 30%, transparent);
  background: var(--green-bg);
  color: var(--green);
}
.state-neutral,
.state-idle {
  border-color: var(--rule-strong);
  background: var(--surface-subtle);
  color: var(--muted);
}
.handoff-neutral {
  border-color: var(--rule-strong);
  background: transparent;
  color: var(--muted);
}
.handoff-ready,
.handoff-ready_to_publish {
  border-color: color-mix(in srgb, var(--amber) 30%, transparent);
  background: var(--amber-bg);
  color: var(--amber);
}
.handoff-sent,
.handoff-sent_for_review {
  border-color: color-mix(in srgb, var(--blue) 30%, transparent);
  background: var(--blue-bg);
  color: var(--blue);
}
.handoff-published {
  border-color: color-mix(in srgb, var(--green) 30%, transparent);
  background: var(--green-bg);
  color: var(--green);
}

.queue-empty {
  padding: 4rem 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--surface);
  text-align: center;
}
.queue-empty h2 {
  margin: 0;
  font: 700 1.05rem/1.3 var(--sans);
}
.queue-empty p { margin: 0.35rem 0 1rem; color: var(--muted); }
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.8rem;
  padding-top: 0.8rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.new-profile-dialog {
  width: min(calc(100% - 2rem), 34rem);
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.new-profile-dialog::backdrop { background: rgb(15 18 21 / 0.55); }
.new-profile-dialog form { gap: 0.75rem; padding: 1.15rem; }
.new-profile-dialog header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
}
.new-profile-dialog h2 {
  margin: 0;
  font: 700 1.1rem/1.3 var(--sans);
}
.new-profile-dialog header p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.dialog-close {
  align-self: start;
  padding: 0.1rem 0.35rem !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 1.35rem !important;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-top: 0.25rem;
}
.dialog-actions button { justify-self: auto; }

.target-main {
  width: min(100%, 72rem);
  max-width: 72rem;
  padding-top: 1.45rem;
}
.profile-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule-strong);
}
.profile-header .crumb { margin-bottom: 0.55rem; }
.profile-title-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}
.profile-title-line h1.display {
  margin: 0 0 0.3rem;
  font: 750 clamp(1.8rem, 4vw, 2.55rem)/1.08 var(--sans);
  letter-spacing: -0.035em;
}
.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.profile-statuses {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  padding-top: 0.15rem;
}
.profile-settings { margin-top: 0.75rem; }
.profile-settings > summary {
  width: fit-content;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 650;
}
.profile-settings form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.55rem;
  margin-top: 0.55rem;
  padding: 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface-subtle);
}
.profile-settings label {
  display: grid;
  gap: 0.18rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}
.profile-settings select,
.handoff-form input {
  min-height: 34px;
  padding: 0.38rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: 0.78rem/1.2 var(--sans);
}
.next-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  margin: 1rem 0 0.8rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  background: var(--surface);
}
.section-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}
.next-action h2 {
  margin: 0.08rem 0 0;
  font: 700 0.98rem/1.35 var(--sans);
}
.next-action p {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}
.target-main .step-head h2 { font-family: var(--sans); font-weight: 700; }
.target-main .step-num { border-radius: 4px; }
.target-main .panel { background: var(--surface); }
.profile-financial-link { margin-top: 0.75rem; }

/* Financial source room */
.financial-main { width: min(100%, 92rem); max-width: 92rem; padding-top: 1.45rem; }
.financial-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule-strong); }
.financial-header h1 { margin: 0.2rem 0; font: 750 clamp(1.8rem, 4vw, 2.55rem)/1.08 var(--sans); letter-spacing: -0.035em; }
.financial-header p { margin: 0; color: var(--muted); font-size: 0.84rem; }
.financial-header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.55rem; }
.financial-header-actions form { margin: 0; }
.financial-status-ready, .financial-disposition-confirmed { background: var(--green-bg); color: var(--green); }
.financial-status-partial, .financial-disposition-candidate { background: var(--amber-bg); color: var(--amber); }
.financial-status-error, .financial-disposition-excluded { background: var(--red-bg); color: var(--red); }
.financial-empty { max-width: 46rem; margin: 2rem 0; padding: 1.4rem; border: 1px solid var(--rule-strong); border-left: 3px solid var(--accent); border-radius: 6px; background: var(--surface); }
.financial-empty h2 { margin: 0.15rem 0 0.5rem; font-size: 1.15rem; }
.financial-empty p { color: var(--muted); }
.financial-start-form { display: grid; grid-template-columns: minmax(14rem, 1fr) auto; align-items: end; gap: 0.55rem; max-width: 38rem; }
.financial-start-form label { grid-column: 1 / -1; color: var(--muted); font-size: 0.72rem; font-weight: 650; }
.financial-start-form select, .financial-form select, .financial-form textarea, .evidence-row input[type="text"] { width: 100%; padding: 0.5rem 0.65rem; border: 1px solid var(--rule-strong); border-radius: 5px; background: var(--surface); color: var(--ink); font: inherit; }
.financial-warning { margin: 1rem 0; padding: 0.8rem 1rem; border-left: 3px solid var(--red); background: var(--red-bg); color: var(--red); font-size: 0.84rem; }
.financial-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 1rem 0; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface); overflow: hidden; }
.financial-metrics > div { display: grid; gap: 0.12rem; min-width: 0; padding: 0.75rem 0.85rem; border-right: 1px solid var(--rule); }
.financial-metrics > div:last-child { border-right: 0; }
.financial-metrics span, .financial-metrics small { color: var(--muted); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.financial-metrics strong { overflow: hidden; text-overflow: ellipsis; font-size: 1.05rem; }
.financial-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(17rem, 1fr); align-items: start; gap: 1rem; }
.financial-primary, .financial-sidebar { display: grid; gap: 1rem; }
.financial-sidebar { position: sticky; top: 8rem; }
.financial-section { min-width: 0; padding: 1rem; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface); }
.financial-section h2 { margin: 0.12rem 0 0; font-size: 1rem; }
.financial-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.7rem; }
.financial-section-head > span { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.financial-section-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.55rem 0.8rem; color: var(--muted); font-size: 0.72rem; }
.financial-section-actions a { font-weight: 650; }
.financial-method, .coverage-note, .financial-none { margin: 0.45rem 0 0.8rem; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.financial-table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 5px; }
.financial-table { width: 100%; min-width: 42rem; border-collapse: collapse; font-size: 0.76rem; }
.financial-table th { padding: 0.5rem 0.62rem; border-bottom: 1px solid var(--rule-strong); background: var(--surface-subtle); color: var(--muted); font-size: 0.62rem; letter-spacing: 0.05em; text-align: left; text-transform: uppercase; }
.financial-table td { padding: 0.55rem 0.62rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.financial-table tr:last-child td { border-bottom: 0; }
.financial-table .is-superseded td, .financial-table tr.is-superseded td { color: var(--muted); opacity: 0.72; }
.financial-table small { display: block; margin-top: 0.12rem; color: var(--muted); font-size: 0.65rem; }
.financial-data-warning { color: var(--red) !important; font-weight: 700; }
.filing-role { display: inline-block; color: var(--ink); font-size: 0.7rem; font-weight: 650; }
.filing-role-original_superseded, .filing-role-amended_superseded { color: var(--muted); }
.document-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.7rem; }
.document-actions a { white-space: nowrap; }
.document-link-primary { font-weight: 700; }
.document-link-secondary { color: var(--muted); font-size: 0.7rem; }
.document-link-secondary:hover { color: var(--accent); }
.funder-tools { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(11rem, 0.55fr) auto; align-items: end; gap: 0.65rem; margin: 0.8rem 0; padding: 0.7rem; border: 1px solid var(--rule); border-radius: 5px; background: var(--surface-subtle); }
.funder-tools label { display: grid; gap: 0.22rem; color: var(--muted); font-size: 0.68rem; font-weight: 650; }
.funder-tools input, .funder-tools select { width: 100%; padding: 0.48rem 0.6rem; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; }
.funder-tools input:focus-visible, .funder-tools select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.funder-tools > span { align-self: center; min-width: 4.5rem; color: var(--muted); font-size: 0.7rem; text-align: right; }
.funder-filter-empty { margin: 1rem 0; padding: 1rem; border: 1px dashed var(--rule-strong); text-align: center; }
.funder-list { display: grid; gap: 0.6rem; }
.funder-card[hidden] { display: none; }
.funder-card { border: 1px solid var(--rule); border-left: 3px solid var(--rule-strong); border-radius: 5px; }
.funder-confirmed { border-left-color: var(--green); }
.funder-excluded { border-left-color: var(--red); opacity: 0.78; }
.funder-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1rem; padding: 0.75rem 0.85rem; }
.funder-summary h3 { margin: 0; font-size: 0.9rem; }
.funder-summary p, .funder-total span { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.68rem; }
.funder-total { display: grid; text-align: right; }
.funder-card details { border-top: 1px solid var(--rule); }
.funder-card summary { padding: 0.55rem 0.85rem; color: var(--muted); cursor: pointer; font-size: 0.72rem; font-weight: 650; }
.funder-review-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(13rem, 1fr); gap: 1rem; padding: 0.85rem; border-top: 1px solid var(--rule); background: var(--surface-subtle); }
.financial-form { display: grid; gap: 0.55rem; }
.financial-form label, .evidence-row label { display: grid; gap: 0.2rem; color: var(--muted); font-size: 0.68rem; font-weight: 650; }
.financial-form button { justify-self: start; }
.funder-source-summary dl, .coverage-list { margin: 0; }
.funder-source-summary dl > div, .coverage-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--rule); font-size: 0.72rem; }
.funder-source-summary dt, .coverage-list dt { color: var(--muted); }
.funder-source-summary dd, .coverage-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.funder-yearly { padding: 0 0.85rem 0.85rem; border-top: 1px solid var(--rule); background: var(--surface-subtle); }
.funder-yearly h4 { margin: 0; padding: 0.75rem 0 0.45rem; font-size: 0.72rem; }
.compact-financial-table { min-width: 36rem; background: var(--surface); font-size: 0.7rem; }
.compact-financial-table th, .compact-financial-table td { padding: 0.4rem 0.5rem; }
.confirmed-sources { padding: 0.85rem; border-top: 1px solid var(--rule); }
.confirmed-sources h4 { margin: 0.3rem 0 0.5rem; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
.confirmed-sources ul { display: grid; gap: 0.35rem; margin: 0 0 0.85rem; padding: 0; list-style: none; }
.confirmed-sources li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); font-size: 0.72rem; }
.confirmed-sources li:last-child { border-bottom: 0; }
.confirmed-sources li > div:first-child { display: grid; gap: 0.1rem; }
.confirmed-sources li span { color: var(--muted); font-size: 0.65rem; overflow-wrap: anywhere; }
.evidence-list { display: grid; gap: 0.45rem; }
.evidence-row { display: grid; grid-template-columns: auto minmax(15rem, 1.3fr) minmax(12rem, 1fr) auto; align-items: end; gap: 0.65rem; padding: 0.65rem; border: 1px solid var(--rule); border-radius: 4px; }
.evidence-row > div { display: grid; font-size: 0.72rem; }
.evidence-row > div span { color: var(--muted); }
.evidence-summary { gap: 0.18rem; min-width: 0; }
.evidence-summary code { display: block; overflow: hidden; margin: 0.12rem 0; padding: 0.22rem 0.35rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--surface-subtle); color: var(--muted); font-size: 0.62rem; text-overflow: ellipsis; white-space: nowrap; }
.evidence-check { align-self: center; grid-template-columns: auto auto !important; }
.event-list { display: grid; gap: 0.5rem; margin: 0.7rem 0 0; padding: 0; list-style: none; }
.event-list li { display: grid; padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule); font-size: 0.72rem; }
.event-list span { color: var(--muted); font-size: 0.65rem; }

.handoff-compact {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
}
.handoff-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.65rem;
}
.handoff-head > div { display: grid; gap: 0.08rem; }
.handoff-head strong { font-size: 0.86rem; }
.handoff-head span,
.handoff-note,
.handoff-warning p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}
.handoff-head > a { font-size: 0.75rem; font-weight: 650; }
.handoff-form {
  display: grid;
  grid-template-columns: minmax(12rem, 1.1fr) minmax(10rem, 0.9fr) auto;
  align-items: end;
  gap: 0.55rem;
}
.handoff-form label {
  display: grid;
  gap: 0.18rem;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 650;
}
.handoff-form input { width: 100%; }
.handoff-form button,
.handoff-inline-action button {
  min-height: 34px;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
}
.handoff-inline-action { margin: 0; }
.handoff-back-form { margin: 0.55rem 0 0; }
.handoff-back-form .linklike { font-size: 0.72rem; }
.handoff-warning {
  padding: 0.7rem 0.8rem;
  border-left: 3px solid var(--amber);
  background: var(--amber-bg);
}
.handoff-history { margin-top: 0.55rem; }
.handoff-history summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
}
.handoff-history ol {
  display: grid;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
  padding-left: 1.3rem;
}
.handoff-history li { font-size: 0.74rem; }
.handoff-history li span { display: block; color: var(--muted); }

/* Existing workflow panels inherit the same light/dark surface system. */
.panel,
.campaign-finance-panel,
.article-result,
.revision-current-draft,
.revision-panel,
.login-card { background: var(--surface); }
.source-request-resolved,
.source-request-dismissed { background: var(--surface-subtle); }
.length-option input:checked + span,
.artifact-note,
.direction-used,
.revision-state-active { background: var(--accent-soft); }
.pill { background: var(--surface-subtle); }
.pill::before { display: none; }
.pill-awaiting,
.pill-awaiting_human { background: var(--amber-bg); }
.pill-active,
.pill-running { background: var(--blue-bg); color: var(--blue); }
.pill-failed,
.flash-error { background: var(--red-bg); }
.pill-succeeded,
.flash-success,
.step-done .step-num { background: var(--green-bg); }
.step-num { background: var(--surface-subtle); }
.report-body th { background: var(--surface-subtle); }
.report-body code,
.artifact-note-secondary { background: var(--surface-subtle); }
.abstract { color: var(--muted); }

@media (max-width: 980px) {
  .queue-filters {
    grid-template-columns: repeat(3, minmax(8rem, 1fr));
  }
  .queue-filters > a { align-self: end; }
  .financial-layout { grid-template-columns: 1fr; }
  .financial-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .financial-metrics > div { border-bottom: 1px solid var(--rule); }
  .financial-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .financial-sidebar .financial-section:last-child { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .product-masthead {
    position: relative;
    top: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
    height: auto;
    min-height: 58px;
    padding-bottom: 0;
  }
  .product-actions {
    width: 100%;
    gap: 0.35rem;
    justify-content: stretch;
  }
  .product-nav {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }
  .product-nav a {
    flex: 0 0 auto;
    height: 44px;
  }
  .theme-toggle { flex: 0 0 34px; }
  .product-search { display: none; }
  .product-admin { display: none; }
  .product-guide { display: inline-flex; }
  .product-new { padding-inline: 0.65rem; }
  main,
  .queue-main,
  .target-main { padding: 1.1rem 0.75rem 3rem; }
  .queue-views { gap: 1rem; }
  .queue-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-table-wrap {
    margin-right: -0.75rem;
    margin-left: -0.75rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .profile-title-line,
  .next-action,
  .handoff-head { align-items: flex-start; }
  .profile-title-line,
  .next-action { display: grid; }
  .financial-header, .financial-section-head { display: grid; }
  .financial-header-actions { justify-content: flex-start; }
  .financial-section-actions { justify-content: flex-start; }
  .financial-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .financial-metrics > div { border-bottom: 1px solid var(--rule); }
  .financial-sidebar { grid-template-columns: 1fr; }
  .financial-sidebar .financial-section:last-child { grid-column: auto; }
  .funder-tools, .funder-summary, .funder-review-grid, .evidence-row { grid-template-columns: 1fr; }
  .funder-tools > span { text-align: left; }
  .funder-total { text-align: left; }
  .confirmed-sources li { display: grid; }
  .profile-statuses { justify-content: flex-start; }
  .handoff-form { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .queue-filters { grid-template-columns: 1fr; }
  .queue-title > div { align-items: flex-start; flex-direction: column; gap: 0.1rem; }
  .profile-settings form { display: grid; }
  .dialog-actions { display: grid; }
  .dialog-actions button { width: 100%; }
  .financial-start-form { grid-template-columns: 1fr; }
}
/* Live research map: an editorial outline checkpoint, not a completion score. */
.research-map-main {
  max-width: 1500px;
}

.research-map-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin: 1.5rem 0 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.research-map-header h1 {
  margin: .2rem 0 .5rem;
  font-size: clamp(2.15rem, 5vw, 4rem);
  letter-spacing: -.045em;
}

.research-map-header p,
.research-map-workbench > header p,
.research-map-limits > header p {
  max-width: 65ch;
  margin: 0;
  color: var(--muted);
}

.research-map-state {
  min-width: 13rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  background: var(--surface);
}

.research-map-state span,
.research-map-state small,
.research-map-state strong {
  display: block;
}

.research-map-state span,
.research-map-state small {
  color: var(--muted);
  font-size: .78rem;
}

.research-map-state strong {
  margin: .25rem 0;
  font-size: 1.05rem;
}

.research-map-state--outline_ready {
  border-top-color: #4d7d63;
}

.research-map-state--outline_ready_with_cautions,
.research-map-state--needs_research {
  border-top-color: #ae7b2d;
}

.research-map-scope,
.research-map-coverage {
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--muted);
}

.research-map-coverage {
  margin-top: 1rem;
  border-left-color: #ae7b2d;
}

.research-map-coverage strong {
  color: var(--text);
}

.research-map-counts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.research-map-counts article {
  padding: 1rem;
  border-right: 1px solid var(--border);
}

.research-map-counts article:last-child {
  border-right: 0;
}

.research-map-counts strong,
.research-map-counts span {
  display: block;
}

.research-map-counts strong {
  font-size: 1.5rem;
}

.research-map-counts span {
  margin-top: .15rem;
  color: var(--muted);
  font-size: .78rem;
}

.research-map-workbench {
  margin-top: 2.5rem;
}

.research-map-workbench > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1rem;
}

.research-map-workbench h2,
.research-map-limits h2,
.research-map-claude h2 {
  margin: .2rem 0 0;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  letter-spacing: -.025em;
}

.research-map-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.research-map-lane {
  border: 1px solid var(--border);
  border-top: 4px solid var(--border-strong);
  background: var(--surface-subtle);
}

.research-map-lane--ready {
  border-top-color: #4d7d63;
}

.research-map-lane--attention {
  border-top-color: #ae7b2d;
}

.research-map-lane--open {
  border-top-color: #9b4b46;
}

.research-map-lane > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem .5rem;
}

.research-map-lane > header div {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.research-map-lane > header span {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: .75rem;
}

.research-map-lane h3,
.research-map-lane h4 {
  margin: 0;
}

.research-map-lane > header h3 {
  font-size: 1rem;
}

.research-map-lane > p {
  min-height: 3.2rem;
  margin: 0;
  padding: 0 1rem 1rem;
  color: var(--muted);
  font-size: .82rem;
}

.research-map-cards {
  display: grid;
  gap: .65rem;
  padding: .65rem;
  border-top: 1px solid var(--border);
}

.research-map-cards article,
.research-map-empty {
  padding: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.research-map-cards article > span {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.research-map-cards h4 {
  margin-top: .35rem;
  font-size: .95rem;
  line-height: 1.3;
}

.research-map-cards p,
.research-map-cards li,
.research-map-empty p {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}

.research-map-cards ul {
  margin: .75rem 0 0;
  padding-left: 1rem;
}

.research-map-card--action {
  border-left: 3px solid #9b4b46 !important;
}

.research-map-limits {
  display: grid;
  grid-template-columns: minmax(14rem, .75fr) minmax(0, 2fr);
  gap: 2rem;
  margin-top: 2.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.research-map-limits > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.research-map-limits article {
  padding: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.research-map-limits h3 {
  margin: 0;
  font-size: .95rem;
}

.research-map-limits article p,
.research-map-limits article small {
  display: block;
  margin: .65rem 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}

.research-map-claude {
  margin: 2.5rem 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.research-map-claude p {
  max-width: 75ch;
  margin: .75rem 0 0;
  color: var(--muted);
}

@media (max-width: 1000px) {
  .research-map-counts {
    grid-template-columns: repeat(3, 1fr);
  }

  .research-map-counts article:nth-child(3) {
    border-right: 0;
  }

  .research-map-counts article:nth-child(-n+3) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 760px) {
  .research-map-header,
  .research-map-workbench > header {
    display: block;
  }

  .research-map-state {
    margin-top: 1rem;
  }

  .research-map-board,
  .research-map-limits,
  .research-map-limits > div {
    grid-template-columns: 1fr;
  }

  .research-map-lane > p {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .research-map-counts {
    grid-template-columns: repeat(2, 1fr);
  }

  .research-map-counts article:nth-child(2n) {
    border-right: 0;
  }

  .research-map-counts article:nth-child(3) {
    border-right: 1px solid var(--border);
  }

  .research-map-counts article:nth-child(-n+4) {
    border-bottom: 1px solid var(--border);
  }
}
