/* ============================================================
   Personal Analyst page (Phase 3). Tokens come from style.css —
   stay on the design system. .an- prefix throughout.

   Typography rule (plan §3.1): a monospaced face is reserved for
   anything the engine computed — n, windows, dates, medians. Prose
   stays on the body font. style.css's --font-mono is actually
   aliased to Inter (not a real monospace), so .an-mono defines its
   own system-monospace stack rather than pulling in a webfont.
   ============================================================ */

.an-page {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.an-mono {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', monospace;
  font-variant-numeric: tabular-nums;
}

.an-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* ── Hero ───────────────────────────────────────────────── */
.an-hero { margin-bottom: 20px; }
.an-hero-inner {
  padding: 18px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.an-hero-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.an-hero-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.an-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.an-info-btn:hover { color: var(--accent-cyan); border-color: var(--accent-orange-border); }
/* Iter 25CI — Phase 9b: link to the Monitor page, styled as a pill rather
   than the circular icon-button the base .an-info-btn rule is sized for. */
.an-monitor-link { width: auto; padding: 0 10px; font-size: 11px; font-weight: 600; text-decoration: none; }
/* Plan §3.6: "If the panel is closed while a run is in progress, the header
   ⓘ carries a small progress ring." Simplified to a pulsing ring rather
   than a literal progress arc — the point (something is running) survives
   without the full SVG machinery. */
.an-info-btn.an-running { position: relative; border-color: var(--accent-cyan); }
.an-info-btn.an-running::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--accent-cyan);
  animation: an-pulse-ring 1.2s ease-out infinite;
}
@keyframes an-pulse-ring {
  0% { opacity: 0.8; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.35); }
}
@media (prefers-reduced-motion: reduce) {
  .an-info-btn.an-running::after { animation: none; opacity: 0.6; }
}
.an-hero-sub {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 760px;
}
.an-hero-status {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 760px;
  padding: 10px 12px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.an-hero-status strong { color: var(--text-secondary); }

/* ── Event clock (static rule — plan §3.1 signature element,
     full shared-cursor interaction deferred past Phase 3) ──── */
.an-eventclock {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  padding: 0 4px;
}
.an-eventclock-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.an-eventclock-label, .an-eventclock-t0 {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.an-eventclock-t0 { color: var(--accent-cyan); font-weight: 600; }

/* ── Spec section ───────────────────────────────────────── */
.an-spec-section {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.an-spec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.an-spec-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.an-preset-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.an-preset-chip {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card-inner);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.an-preset-chip:hover { border-color: var(--accent-orange-border); color: var(--text-primary); }

.an-spec-json {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-card-inner);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 12px;
  resize: vertical;
}
.an-spec-json:focus { outline: none; border-color: var(--accent-orange-border); }

.an-spec-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.an-spec-error {
  font-size: 12px;
  color: var(--red);
  flex: 1;
}
.an-run-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-orange-border);
  background: var(--accent-orange-dim);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.an-run-btn:hover { background: var(--accent-cyan); color: var(--bg-primary); }
.an-run-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Spec card ──────────────────────────────────────────── */
.an-spec-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.an-spec-card-row { display: flex; flex-direction: column; gap: 3px; }
.an-spec-card-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.an-spec-card-row .an-mono { font-size: 13px; color: var(--text-primary); }

/* ── Cohort chips ───────────────────────────────────────── */
.an-cohort-section { margin-bottom: 20px; }
.an-cohort-section h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.an-cohort-n { color: var(--text-muted); font-size: 12px; }
.an-cohort-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.an-cohort-chip {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card-inner);
  color: var(--text-secondary);
}
.an-cohort-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--yellow);
}

/* ── Charts ─────────────────────────────────────────────── */
.an-charts-section { margin-bottom: 24px; }
.an-chart-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}
.an-chart-toolbar select {
  background: var(--bg-card-inner);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 5px 8px;
  font-size: 12.5px;
}
.an-chart-block {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.an-chart-block h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.an-chart-sub {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-left: 6px;
}
.an-chart-canvas-wrap { position: relative; height: 280px; }

.an-heatmap-wrap { overflow-x: auto; }
.an-heatmap {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.an-heatmap th, .an-heatmap td {
  padding: 7px 10px;
  text-align: right;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.an-heatmap th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
}
.an-heatmap td:first-child, .an-heatmap th:first-child { text-align: left; }
.an-heatmap-cell-value {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', monospace;
}
.an-heatmap-cell-n {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Empty / no-analogs / sign-in states ────────────────── */
.an-empty-state, .an-no-analogs, .an-signin-gate {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.an-no-analogs { border-style: solid; }
.an-muted { color: var(--text-muted); font-size: 12px; margin-top: 6px; }

/* ── How-this-works slide-over panel (plan §3.6) ───────────
   Static in Phase 3: stages render pending, no live run-state
   animation (that's Phase 4). Motion here is limited to the slide
   itself and respects prefers-reduced-motion. ─────────────── */
.an-how-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 500;
}
.an-how-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 90vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 501;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.an-how-panel[data-closed] { transform: translateX(100%); }
@media (prefers-reduced-motion: reduce) {
  .an-how-panel { transition: opacity 100ms linear; transform: none; }
  .an-how-panel[data-closed] { opacity: 0; pointer-events: none; }
}
@media (max-width: 640px) {
  .an-how-panel { width: 100%; max-width: 100vw; top: auto; height: 90vh; border-left: none; border-top: 1px solid var(--border); }
}
.an-how-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.an-how-header h2 { margin: 0; font-size: 16px; font-weight: 700; }
.an-how-close {
  width: 28px; height: 28px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.an-how-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.an-how-thesis {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0 0 18px;
}
.an-how-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 22px 0 10px;
}
/* Iter 25CO — "Beyond a single study" section (Phase 8/9 additions:
   synthetic mode, monitor/tripwires, news-to-candidate). Smaller/muted
   variant of .an-how-thesis so it doesn't compete with the main thesis
   line, and the sub-diagram gets a bit more breathing room between its
   three independent flows than the main single-pipeline diagram needs. */
.an-how-thesis--sub { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); margin-bottom: 14px; }
.an-how-diagram--sub .an-how-flow-group { margin-bottom: 14px; }
.an-how-diagram--sub .an-how-flow-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

/* Diagram — stack of stage boxes with connectors. Code stages (Quant
   Engine / Flow & Index) get a solid border + mono type, matching the
   code-vs-prose distinction used throughout the page (plan §3.6). */
.an-how-diagram { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.an-how-node {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}
.an-how-connector {
  align-self: center;
  width: 1px;
  height: 16px;
  background: var(--border);
}
.an-how-gate {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 2px double var(--accent-orange-border);
  background: var(--accent-orange-dim);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.an-how-parallel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.an-how-stage-box {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  opacity: 0.6;
}
.an-how-stage-box.an-how-code {
  border-style: solid;
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', monospace;
}
.an-how-stage-box .an-how-stage-num { font-size: 10px; color: var(--text-muted); }
.an-how-stage-box .an-how-stage-name { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.an-how-stage-box .an-how-stage-type {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.an-how-boundary {
  padding: 8px 12px;
  border-top: 2px solid var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 4px 0;
}

/* Seven expandable rows */
.an-how-stages { display: flex; flex-direction: column; gap: 6px; }
.an-how-stage-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.an-how-stage-row summary {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}
.an-how-stage-row summary::-webkit-details-marker { display: none; }
.an-how-stage-row summary .an-how-stage-badge {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  font-weight: 500;
}
.an-how-stage-row p {
  margin: 0;
  padding: 0 12px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.an-how-cant {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Ask (Router) — Iter 25BV ───────────────────────────────── */
.an-ask-section {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.an-ask-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.an-ask-row { display: flex; gap: 8px; }
.an-ask-input {
  flex: 1;
  background: var(--bg-card-inner);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 13.5px;
}
.an-ask-input:focus { outline: none; border-color: var(--accent-orange-border); }
.an-ask-hint { margin: 8px 0 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

.an-spec-header-note { font-weight: 400; font-size: 11.5px; color: var(--text-muted); margin-left: 8px; }
.an-spec-warnings {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--yellow);
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

/* ── Analogs (Librarian) / regime delta / brief — Iter 25BV ─── */
.an-brief-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.an-brief-btn { white-space: nowrap; }

.an-analogs-section, .an-regime-section, .an-brief-section, .an-flow-section,
.an-policy-section, .an-vuln-section {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.an-analogs-section h3, .an-regime-section h3, .an-brief-section h3, .an-flow-section h3,
.an-policy-section h3, .an-vuln-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
/* ── Policy Reaction / Vulnerability (Phase 7) — Iter 25BZ ──────── */
.an-policy-body p, .an-vuln-body p { margin: 0 0 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.an-policy-body p:last-child, .an-vuln-body p:last-child { margin-bottom: 0; }
.an-analogs-list { display: flex; flex-direction: column; gap: 8px; }

/* ── Flow & Index (Phase 6) — Iter 25BX ──────────────────────── */
.an-flow-list { display: flex; flex-direction: column; gap: 10px; }
.an-flow-item {
  padding: 10px 12px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.an-flow-item-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.an-flow-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.an-flow-row { display: flex; flex-direction: column; gap: 2px; }
.an-flow-row-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.an-flow-row-value { font-size: 13px; color: var(--text-primary); }
.an-flow-note {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Mega-IPO clustering signal (plan §10.5) — Iter 25BY ────────── */
.an-ipo-section {
  margin: 0 0 20px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.an-ipo-section h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.an-ipo-intro { margin: 0 0 10px; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.an-ipo-error { margin: 8px 0 0; font-size: 11.5px; color: var(--red); }
.an-ipo-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0;
  padding: 10px 12px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.an-ipo-summary-stat { display: flex; flex-direction: column; gap: 2px; }
.an-ipo-summary-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.an-ipo-summary-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.an-ipo-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.an-ipo-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.an-ipo-row-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); flex: 1 1 160px; }
.an-ipo-row-detail { font-size: 11px; color: var(--text-muted); }
.an-ipo-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.an-ipo-badge-true_positive { background: rgba(14,179,91,0.16); color: var(--green); }
.an-ipo-badge-false_positive { background: rgba(194,74,74,0.16); color: var(--red); }
.an-ipo-badge-false_negative { background: rgba(187,101,59,0.16); color: #BB653B; }
.an-ipo-badge-true_negative { background: rgba(138,138,142,0.16); color: var(--text-muted); }
.an-ipo-badge-no_data { background: rgba(138,138,142,0.1); color: var(--text-muted); }

.an-analog-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.an-analog-score {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  color: var(--accent-cyan);
  min-width: 42px;
}
.an-analog-body { flex: 1; }
.an-analog-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.an-analog-note { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.45; }

.an-regime-wrap { overflow-x: auto; }
.an-regime-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.an-regime-table th, .an-regime-table td {
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  text-align: right;
  white-space: nowrap;
}
.an-regime-table th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: 11px; }
.an-regime-table td:first-child, .an-regime-table th:first-child { text-align: left; }
.an-regime-warning {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--yellow);
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.an-brief-body h4, .an-critic-body h4 {
  margin: 14px 0 6px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.an-brief-body h4:first-child { margin-top: 0; }
.an-brief-body p, .an-critic-body p { margin: 0 0 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.an-brief-body ul, .an-critic-body ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.an-critic-body { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.an-critic-body h4 { color: var(--red); opacity: 0.8; }

/* ── Synthetic analog mode (Phase 8f) — Iter 25CF ────────────────
   Deliberately visually distinct from every observed-study section
   above: a dashed amber-tinted border throughout (not the plain solid
   border every other panel uses), so a synthetic panel never reads as
   "just another section" at a glance — reinforcing the persistent header
   band inside .an-synth-result, not relying on it alone. */
.an-synth-offer, .an-synth-decompose, .an-synth-result {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px dashed var(--yellow);
  border-radius: var(--radius-md);
}
.an-synth-offer p { margin: 0 0 12px; font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.an-synth-decompose h3, .an-synth-result h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.an-synth-decompose > .an-muted { margin: 0 0 12px; font-size: 11.5px; }

.an-synth-components { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.an-synth-component-row {
  padding: 10px 12px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.an-synth-component-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.an-synth-component-rationale { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; margin-bottom: 8px; }
.an-synth-component-weight-row { display: flex; align-items: center; gap: 10px; }
.an-synth-component-weight-row input[type="range"] { flex: 1; accent-color: var(--yellow); }
.an-synth-component-weight-value { font-size: 12px; font-weight: 600; color: var(--text-primary); min-width: 42px; text-align: right; }
.an-synth-weight-total { font-size: 11.5px; color: var(--text-muted); margin-bottom: 12px; }
.an-synth-weight-total.an-synth-weight-invalid { color: var(--red); font-weight: 600; }

.an-synth-interaction-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12.5px; color: var(--text-secondary); }

.an-synth-missing { margin: 0 0 12px; padding: 10px 12px; background: var(--bg-card-inner); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.an-synth-missing h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.an-synth-missing ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }

.an-synth-actions { display: flex; align-items: center; gap: 12px; }

/* Persistent, non-dismissible header band (plan §7) — no close button by
   design. */
.an-synth-header-band {
  margin: -14px -16px 14px;
  padding: 10px 16px;
  background: rgba(224, 168, 0, 0.14);
  border-bottom: 1px dashed var(--yellow);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 0.01em;
}
.an-synth-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 12px; font-size: 11.5px; color: var(--text-muted); }
.an-synth-recompose-btn { font-size: 11.5px; padding: 4px 10px; }

.an-synth-contribution-section { margin-top: 16px; }
.an-synth-contribution { display: flex; flex-direction: column; gap: 8px; }
.an-synth-contribution-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.an-synth-contribution-label { width: 70px; flex-shrink: 0; color: var(--text-muted); font-family: var(--font-mono, monospace); }
.an-synth-contribution-bar { flex: 1; display: flex; height: 16px; border-radius: 3px; overflow: hidden; background: var(--bg-card-inner); }
.an-synth-contribution-segment { height: 100%; min-width: 2px; }
.an-synth-contribution-value { width: 90px; flex-shrink: 0; text-align: right; font-family: var(--font-mono, monospace); color: var(--text-secondary); }

.an-synth-reweight { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.an-synth-reweight h3 { margin: 0 0 10px; }
.an-synth-reweight-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.an-synth-reweight-row label { width: 160px; flex-shrink: 0; color: var(--text-secondary); }
.an-synth-reweight-row input[type="range"] { flex: 1; accent-color: var(--yellow); }
.an-synth-reweight-row .an-synth-component-weight-value { min-width: 42px; }

/* Composed-range chart legend badges (disagreement / backtest error /
   no-data), colorblind-safe by design: hatching + a text label do the
   distinguishing, not hue alone (plan §7: "must be distinguishable in
   greyscale and to colourblind users"). */
.an-synth-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(224, 168, 0, 0.16);
  color: var(--yellow);
  margin-left: 6px;
}
.an-synth-backtest-error { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--text-muted); margin-left: 6px; }

.an-synth-brief-trigger { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
#anSynthBriefBody, #anSynthCriticBody { margin-top: 10px; }

/* Iter 25CI — Phase 9f2 "watch this condition" loop-closure form */
.an-watch-propose { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.an-watch-propose h4 { margin: 0 0 4px; font-size: 13px; }
.an-watch-propose-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.an-watch-select, .an-watch-input {
  font-family: inherit; font-size: 12.5px; color: var(--text-primary);
  background: var(--bg-card-inner); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px;
}
.an-watch-input { width: 110px; }
.an-watch-status { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; min-height: 14px; }
.an-watch-status.an-watch-status--ok { color: var(--accent-cyan); }
.an-watch-status.an-watch-status--err { color: #C24A4A; }

/* ── How-panel live stage states (Phase 4) ───────────────────
   Simplified per Phase 3's own note ("wire live stage states in Phase 4")
   — functional pending/running/done/failed/skipped states with a plain
   opacity/border-color transition (already declared on .an-how-stage-box),
   not the full perimeter-trace/pulse-travel motion system from plan §3.6.
   That remains a deferred polish item — see docs/PERSONAL-ANALYST.md. */
.an-how-stage-box[data-state="pending"] { opacity: 0.3; }
.an-how-stage-box[data-state="running"] { opacity: 1; border-color: var(--accent-cyan); }
.an-how-stage-box[data-state="done"] { opacity: 1; border-color: var(--green); }
.an-how-stage-box[data-state="failed"] { opacity: 1; border-color: var(--red); }
.an-how-stage-box[data-state="skipped"] { opacity: 0.35; text-decoration: line-through; }
.an-how-stage-elapsed {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', monospace;
  font-size: 9.5px;
  color: var(--text-muted);
  margin-left: 4px;
}
