/* ═══════════════════════════════════════════════════════════════════════════
   Novixon CI — page surfaces (Explore, Pulse, shared tables)
   All colors flow from design tokens in tokens.css → dark-mode aware, brand green.
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

/* ── Shared tables (Watch inbox, competitor events) ──────────────────────── */
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
tbody tr { cursor: pointer; transition: background 0.1s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.read { opacity: 0.45; }
td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }

/* Verdict badges — confidence tiers never use red */
.badge-verdict {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-investigate { background: var(--int-dim); color: var(--int); }
.badge-monitor     { background: var(--mid-dim); color: var(--mid); }
.badge-ignore      { background: var(--lo-dim);  color: var(--lo); }

/* Event-type badge (#289) — a semantic classification, not a triage decision,
   so it deliberately stays neutral (never reuses the verdict tier colors). */
.badge-event-type {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  color: var(--text-2);
}

/* Sub-type chip (#290) — one level below the event-type badge, same neutral
   family (never verdict colors), lighter/smaller since cardinality is higher. */
.badge-sub-type {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
}

/* Impact-score badge (#291) — cross-story priority tie-breaker within a
   verdict tab (event-type weight + corroboration, decayed by recency, scaled
   by portfolio tier). Colored like the confidence/heat scale, not the verdict
   colors, since this is a priority signal, not a triage decision. */
.badge-impact {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.badge-impact-hi  { background: var(--hi-dim);  color: var(--hi); }
.badge-impact-mid { background: var(--mid-dim); color: var(--mid); }
.badge-impact-lo  { background: var(--lo-dim);  color: var(--lo); }

/* Cluster badges (#361 WP-H D3) — regel-basierte Interpretation der
   Aggregate-ATS-Postings (Department/Seniority/Location). Dezent, neutral
   wie badge-sub-type (kein Verdict-Farbschema — das ist eine inhaltliche
   Beobachtung, keine Triage-Entscheidung). */
.cluster-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
}
.badge-cluster {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* Hiring-intensity badge (#361 WP-H D4) — employee-base-normalized signal
   (core/employee_count.py::build_intensity_badge), appended into the same
   cluster-badges row as D3's badges above. Deliberately more muted than
   .badge-cluster (--surface-3/--text-3, this codebase's "input field /
   tertiary text" pair — the closest existing equivalent to the
   --surface-muted/--text-secondary tokens WPH_D4_BRIEF.md names, which
   don't exist in tokens.css) so it reads as secondary/informational, never
   competing visually with the cluster badges. */
.hiring-intensity-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface-3);
  color: var(--text-3);
}

/* Baseline-delta badge (#361 WP-H D5) — rolling-baseline signal
   (core/hiring_baseline.py::build_baseline_badge), appended as a third
   badge into the same row as the cluster/intensity badges above. Unlike
   those two, this one is tone-varianted (hot/warm/cool) since it carries
   a directional above/below-baseline read, not just a neutral
   observation — reuses the existing verdict-tier tokens rather than
   introducing new colors (--danger for "hot"/alert-like, --mid for
   "warm"/elevated, --lo for "cool"/informative — this token set has no
   dedicated blue, so --lo's desaturated neutral stands in for the
   "informative slowdown" read the brief's style hint asks for). */
.hiring-baseline-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hiring-baseline-badge.tone-hot  { background: var(--danger-bg); color: var(--danger); }
.hiring-baseline-badge.tone-warm { background: var(--mid-dim);   color: var(--mid); }
.hiring-baseline-badge.tone-cool { background: var(--lo-dim);    color: var(--lo); }

/* Read button */
.btn-read {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
}
.btn-read:hover { background: var(--surface-2); color: var(--text); }

/* Empty state */
.empty { padding: 3rem 1rem; text-align: center; color: var(--text-3); }

/* Compact inline story-feedback widget (#354 WP-F) — icon-only pills,
   reused on Briefing story-cards + Competitor-detail Recent Signals rows.
   See templates/partials/story_feedback_compact.html. */
.sfc-form { display: inline-flex; gap: 4px; align-items: center; height: 26px; }
.sfc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  font-family: inherit;
}
.sfc-btn svg { width: 11px; height: 11px; pointer-events: none; }
.sfc-btn:hover { border-color: var(--text-3); color: var(--text-2); }
.sfc-btn-active { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }

/* Drawer overlay */
#drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 480px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  z-index: 100;
}
#drawer:empty { display: none; }
.drawer-inner { padding: 1.5rem; }
.drawer-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.drawer-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.drawer-close {
  border: none; background: none; cursor: pointer;
  font-size: 1.25rem; color: var(--text-3); line-height: 1;
}
.drawer-close:hover { color: var(--text); }
.drawer-meta { font-size: 0.8rem; color: var(--text-2); margin-bottom: 1rem; }
.drawer-meta span { margin-right: 1rem; }
.drawer-rationale { font-size: 0.875rem; color: var(--text-2); line-height: 1.6; margin-bottom: 1.25rem; }
.drawer-source { font-size: 0.75rem; color: var(--text-3); margin-bottom: 1rem; }

/* #301 WP-13 — Story-Drawer insight sections */
.drawer-impact-breakdown {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-size: 11px; color: var(--text-3); font-family: var(--font-mono);
  margin: 6px 0 0;
}
.drawer-impact-breakdown strong { color: var(--text-2); font-weight: 600; }

.drawer-narrative {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-2);
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); margin: 14px 0; cursor: pointer;
}
.drawer-narrative svg { flex: none; color: var(--text-3); }
.drawer-narrative strong { color: var(--text); }

.drawer-timeline { margin: 14px 0; }
.drawer-timeline-row { display: flex; gap: 3px; }
.drawer-timeline-cell {
  width: 20px; height: 20px; border-radius: 4px; flex: none;
  transition: transform 0.08s ease, filter 0.08s ease;
}
.drawer-timeline-cell[data-clickable] { cursor: pointer; }
.drawer-timeline-cell[data-clickable]:hover { transform: scale(1.12); filter: brightness(1.1); }
.drawer-timeline-cell.is-current { box-shadow: 0 0 0 2px var(--accent); }

.drawer-source-families { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.drawer-family-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0.15rem 0.55rem; border-radius: var(--radius-sm);
  font-size: 0.7rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-2);
}
.drawer-family-chip .mono { color: var(--text-3); font-weight: 400; }

/* ═══════════════════════════════════════════════════════════════════════════
   EXPLORE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hero / input phase ──────────────────────────────────────────────────── */
.explore-hero-card {
  max-width: 560px;
  width: 100%;
  padding: 30px 32px 32px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.explore-form { width: 100%; }
.explore-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 52px;
  padding: 0 6px 0 6px;
  border: 1px solid var(--border-2);
  border-radius: 13px;
  background: var(--bg-elev);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.explore-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.explore-input {
  flex: 1;
  height: 100%;
  padding: 0 10px;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--text);
  outline: none;
  font-family: var(--font-mono);
}
.explore-input::placeholder { color: var(--text-3); }
.explore-chips {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.explore-chip-label { font-size: 12.5px; color: var(--text-3); }
.explore-chip {
  padding: 4px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  font-family: var(--font-mono);
}
.explore-chip:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ── Report phase ────────────────────────────────────────────────────────── */
.explore-report { max-width: 720px; }

.explore-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.explore-card-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.explore-card-icon { font-size: 15px; line-height: 1; }
.explore-card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 0;
}
.explore-card-body { padding: 18px; }

/* AI-synthesis surface (Strategic Take / CTA) — accent-tinted */
.explore-card-cta {
  border: 1px solid var(--ai-border);
  background: var(--ai-tint);
}

/* Section enter animation (driven from explore.html JS) */
.section-entering { opacity: 0; transform: translateY(10px); transition: opacity 0.35s ease, transform 0.35s ease; }
.section-visible  { opacity: 1; transform: translateY(0); }

/* Content elements */
.explore-summary { font-size: 14.5px; color: var(--text); margin-bottom: 10px; line-height: 1.6; }
.explore-dim { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.explore-unavailable { font-size: 13px; color: var(--text-3); font-style: italic; }
.explore-meta-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.explore-meta-tag {
  padding: 3px 11px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text-2);
}
.tech-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tech-chip {
  padding: 3px 11px;
  background: var(--accent-dim);
  border: 1px solid var(--ai-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}
.explore-jobs { font-size: 13px; margin-top: 12px; color: var(--text-2); }
.explore-jobs a { color: var(--accent); text-decoration: none; font-weight: 500; }
.explore-jobs a:hover { text-decoration: underline; }
.explore-list { margin-top: 8px; padding-left: 20px; font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.explore-list li { margin-bottom: 3px; }
.move-list { display: flex; flex-direction: column; gap: 12px; }
.move-item { display: flex; align-items: flex-start; gap: 10px; }
.move-icon { font-size: 14px; margin-top: 2px; flex-shrink: 0; }
.move-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.move-text { font-size: 13.5px; color: var(--text); }
.move-text a { color: var(--accent); text-decoration: none; }
.move-text a:hover { text-decoration: underline; }
.move-meta { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.explore-analysis { font-size: 14.5px; color: var(--text); line-height: 1.68; }

/* CTA card */
.cta-headline { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text); letter-spacing: -0.01em; }
.cta-body { font-size: 13.5px; color: var(--text-2); margin-bottom: 16px; line-height: 1.55; }
.btn-primary {
  padding: 9px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s;
  font-family: inherit;
}
.btn-primary:hover { filter: brightness(1.06); }

/* Progress indicator */
.report-progress {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 0 24px;
  color: var(--text-2);
  font-size: 13.5px;
}
.progress-dots { display: flex; gap: 5px; }
.progress-dots span {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulsedot 1.2s ease-in-out infinite;
}
.progress-dots span:nth-child(2) { animation-delay: 0.2s; }
.progress-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulsedot {
  0%, 100% { opacity: 0.3; transform: scale(0.75); }
  50%       { opacity: 1;   transform: scale(1); }
}
.progress-label { font-family: var(--font-mono); font-size: 12.5px; }
.explore-error { color: var(--text-2); font-size: 13.5px; }
.explore-error a { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   PULSE
   ═══════════════════════════════════════════════════════════════════════════ */

.pulse-section { margin: 24px 0; }
.pulse-filter-bar {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}
.pulse-filter-bar label { display: grid; gap: 5px; }
.pulse-filter-bar label > span {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-3);
}
.pulse-filter-bar select {
  height: 36px;
  min-width: 170px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 12.5px var(--font-ui);
}
.pulse-filter-bar a {
  height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--text-2);
  font-size: 12px;
  text-decoration: none;
}
.pulse-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-3);
  margin-bottom: 12px;
}

/* Hero strip */
.pulse-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}
.pulse-hero-tile {
  padding: 18px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.pulse-hero-number {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.05;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pulse-hero-label { font-size: 12.5px; color: var(--text-2); }
.pulse-hero-sub { font-size: 11.5px; color: var(--text-3); margin-left: 6px; font-family: var(--font-mono); }

/* Heatmap */
.pulse-heatmap-wrap { overflow-x: auto; }
.pulse-heatmap { border-collapse: separate; border-spacing: 3px; width: auto; }
.pulse-heatmap thead th {
  padding: 0 0 4px;
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: none;
}
.pulse-heatmap-name-col { min-width: 150px; }
.pulse-heatmap-day-col { width: 26px; }
.pulse-heatmap-total-col { width: 40px; }
.pulse-heatmap-name { padding: 2px 10px 2px 0; font-size: 12.5px; white-space: nowrap; border-bottom: none; }
.pulse-heatmap-name a { color: var(--text-2); text-decoration: none; }
.pulse-heatmap-name a:hover { color: var(--accent); }
.pulse-heatmap-cell { width: 22px; height: 18px; border-radius: 3px; cursor: default; border-bottom: none; padding: 0; }
.pulse-heatmap-total { padding: 2px 0 2px 10px; font-size: 12px; color: var(--text-3); text-align: right; border-bottom: none; font-family: var(--font-mono); }

/* Heat intensity — green severity ramp (never orange/red) */
.heat-0 { background: var(--surface-2); }
.heat-1 { background: #c6e7d3; }
.heat-2 { background: #6fc593; }
.heat-3 { background: var(--accent); }
[data-theme="dark"] .heat-0 { background: #1b1e19; }
[data-theme="dark"] .heat-1 { background: #234a31; }
[data-theme="dark"] .heat-2 { background: #2f8a52; }
[data-theme="dark"] .heat-3 { background: var(--accent); }

/* Semantic timeline (#298, WP-10) — replaces the volumetric 14-day heatmap.
   Same grid shell as .pulse-heatmap, but cells carry a dominant-event-type
   icon and the heat scale is impact-driven (hi/mid/lo/empty), not a count. */
.pulse-timeline { border-collapse: separate; border-spacing: 3px; width: auto; }
.pulse-timeline thead th {
  padding: 0 0 4px;
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: none;
}
.pulse-timeline-week-col { width: 40px; font-size: 11px; color: var(--text-3); font-family: var(--font-mono); text-align: center; padding: 4px 2px; }
.pulse-timeline-cell {
  width: 36px; height: 34px;
  border-radius: 4px;
  text-align: center;
  vertical-align: middle;
  border-bottom: none;
  padding: 0;
  color: var(--text-2);
  transition: transform 0.08s ease, filter 0.08s ease;
}
.pulse-timeline-cell:hover { transform: scale(1.08); filter: brightness(1.1); }
.pulse-timeline-cell svg { display: inline-block; vertical-align: middle; }

.timeline-heat-empty { background: var(--surface-2); }
.timeline-heat-lo    { background: #c6e7d3; color: #2f8a52; }
.timeline-heat-mid   { background: #6fc593; color: #1b5e35; }
.timeline-heat-hi    { background: var(--accent); color: #fff; }
[data-theme="dark"] .timeline-heat-empty { background: #1b1e19; }
[data-theme="dark"] .timeline-heat-lo    { background: #1a3d28; color: #6fc593; }
[data-theme="dark"] .timeline-heat-mid   { background: #235c38; color: #a8ddb9; }
[data-theme="dark"] .timeline-heat-hi    { background: var(--accent); color: #fff; }

.pulse-timeline-legend {
  display: flex; flex-wrap: wrap; gap: 12px 18px;
  margin-top: 12px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); font-size: 11px; color: var(--text-3);
}
.pulse-timeline-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.pulse-timeline-legend-item svg { color: var(--text-2); }

/* Cards (mini-cards + charts) */
.pulse-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.pulse-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pulse-card-header {
  padding: 12px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
}
.pulse-card-body { padding: 16px; flex: 1; }

/* Leaderboard */
.pulse-leaderboard { list-style: none; display: flex; flex-direction: column; gap: 11px; margin: 0; padding: 0; }
.pulse-lb-row { display: flex; align-items: center; gap: 9px; }
.pulse-lb-rank { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text-3); width: 16px; text-align: right; flex-shrink: 0; }
.pulse-lb-name { font-size: 13px; color: var(--text); text-decoration: none; flex-shrink: 0; min-width: 72px; }
.pulse-lb-name:hover { color: var(--accent); }
.pulse-lb-bar-wrap { flex: 1; background: var(--surface-2); border-radius: var(--radius-pill); height: 6px; overflow: hidden; }
.pulse-lb-bar { height: 100%; background: var(--accent); border-radius: var(--radius-pill); min-width: 2px; }
.pulse-lb-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); font-weight: 600; flex-shrink: 0; width: 28px; text-align: right; }

/* Signal mix */
.pulse-mix-list { display: flex; flex-direction: column; gap: 12px; }
.pulse-mix-row { display: grid; grid-template-columns: 92px 1fr 30px 36px; align-items: center; gap: 8px; }
.pulse-mix-label { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.pulse-mix-bar-wrap { background: var(--surface-2); border-radius: var(--radius-pill); height: 6px; overflow: hidden; }
.pulse-mix-bar { height: 100%; background: var(--accent); border-radius: var(--radius-pill); min-width: 2px; }
.pulse-mix-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); text-align: right; }
.pulse-mix-pct { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); text-align: right; }

/* Event-Type-Mix window toggle (#302 WP-14) */
.pulse-window-toggle { display: flex; gap: 6px; }
.pulse-window-btn {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 4px 11px; cursor: pointer;
}
.pulse-window-btn:hover { border-color: var(--accent); color: var(--text); }
.pulse-window-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* Recent alerts */
.pulse-alerts-list { list-style: none; display: flex; flex-direction: column; gap: 13px; margin: 0; padding: 0; }
.pulse-alert-row { border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.pulse-alert-row:last-child { border-bottom: none; padding-bottom: 0; }
.pulse-alert-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; flex-wrap: wrap; }
.pulse-alert-comp { font-size: 12.5px; font-weight: 600; color: var(--text); }
.pulse-alert-type { font-size: 10.5px; background: var(--accent-dim); color: var(--accent); padding: 1px 7px; border-radius: var(--radius-sm); font-family: var(--font-mono); }
.pulse-alert-age { font-size: 11px; color: var(--text-3); margin-left: auto; font-family: var(--font-mono); }
.pulse-alert-msg { font-size: 12.5px; color: var(--text-2); line-height: 1.5; margin: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   RETROSPECTIVE (#295 WP-7, Progressive Reveal)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Start form — scope radio pills */
.retro-scope-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.retro-scope-pill:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.retro-scope-pill input { accent-color: var(--accent); }
.retro-scope-pill span:first-of-type { font-size: 13.5px; font-weight: 600; color: var(--text); }
.retro-scope-pill__hint { font-size: 11.5px; color: var(--text-3); margin-left: auto; }

.retro-form-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--danger);
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 12.5px;
}
.retro-form-error a { color: inherit; text-decoration: underline; margin-left: auto; flex: none; }

/* Skeleton (fetch/classify/cluster) */
.retro-skeleton { padding: 8px 0 4px; }
.retro-skeleton__head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.retro-phase-track { display: flex; gap: 18px; margin-bottom: 18px; }
.retro-phase-step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.retro-phase-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hairline); flex: none; }
.retro-phase-step.is-active { color: var(--text-1); font-weight: 600; }
.retro-phase-step.is-active .retro-phase-dot { background: var(--accent); animation: nx-pulse 1.2s ease-in-out infinite; }
.retro-phase-step.is-done { color: var(--text-2); }
.retro-phase-step.is-done .retro-phase-dot { background: var(--accent); }
.retro-source-row { display: flex; gap: 8px; flex-wrap: wrap; }
.retro-source-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 12px;
  animation: nx-shimmer 1.6s ease-in-out infinite;
}
.retro-source-chip.is-done { color: var(--text-2); animation: none; }

/* Per-source fetch progress (#296 WP-7c) — 3-state icon chips driven off
   Retrospective.current_source (routers/retrospective_ui.py's
   _source_chip_states). --pending is the default shimmering look above;
   --active/--done override it once fetch is under way. */
.retro-source-chip.retro-source--pending { color: var(--text-3); }
.retro-source-chip.retro-source--active {
  color: var(--text-1);
  font-weight: 600;
  background: var(--accent-dim);
  animation: nx-pulse 1.2s ease-in-out infinite;
}
.retro-source-chip.retro-source--done {
  color: var(--text-2);
  animation: none;
}
.retro-source-chip.retro-source--done svg { color: var(--accent); }
.retro-source-chip.retro-source--done::after {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  margin-left: 2px;
}

/* Live bucket-progress bar (#295 WP-7b, streaming) */
.retro-bucket-progress { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.retro-bucket-progress__bar { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.retro-bucket-progress__fill { height: 100%; background: var(--accent); transition: width 0.4s ease; }
.retro-bucket-progress .mono { font-size: 11px; color: var(--text-3); flex: none; }

/* Reveal — section headers, story cards, narratives */
.retro-section-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
}
.retro-stories { margin-top: 4px; }
.retro-narratives { margin-top: 22px; }
.retro-story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.retro-story-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  animation: nx-fade 0.35s ease both;
}
.retro-story-card__top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.retro-story-card__comp { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.retro-story-card__title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.4; margin-bottom: 5px; }
.retro-story-card__highlight { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
/* Append-only reveal (#295 WP-7b) — set by result.html's htmx:afterSwap
   listener on any card whose data-story-id was already rendered in a
   previous poll, so only genuinely new cards play the nx-fade entrance. */
.retro-story-card--no-anim { animation: none; }
.retro-scanning-note { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 11.5px; color: var(--text-3); }
.retro-narrative-list { display: flex; flex-direction: column; gap: 4px; }
.retro-narrative-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  animation: nx-fade 0.35s ease both;
}
.retro-narrative-row:hover { background: var(--surface-2); }
.retro-narrative-row__title { font-size: 13px; font-weight: 600; color: var(--text); }
.retro-narrative-row__meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* Terminal states */
.retro-done-bar { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.retro-cost-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
.retro-failed { padding: 32px 0; text-align: center; }
.retro-failed pre { text-align: left; max-width: 480px; margin-left: auto; margin-right: auto; }

/* WP-11 Narrative-Dashboard (#299) */
.narratives-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.narratives-hero-tile { padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.narratives-hero-number { font-family: var(--font-mono); font-size: 28px; color: var(--text-1); line-height: 1; }
.narratives-hero-label { font-size: 12px; color: var(--text-3); margin-top: 8px; }

.narratives-filter-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 20px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.narratives-filter-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-3); }
.narratives-filter-bar select, .narratives-filter-bar input { min-width: 130px; }

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

.narrative-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.narrative-card-head { display: flex; align-items: center; gap: 8px; }
.narrative-card-icon { color: var(--text-2); display: inline-flex; align-items: center; }
.narrative-card-event { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.4px; }
.narrative-card-title { margin: 0; font-size: 15px; font-weight: 500; color: var(--text-1); }
.narrative-card-title:hover { color: var(--accent); }
.narrative-card-desc { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.narrative-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; }
.narrative-card-comp { color: var(--accent); text-decoration: none; }
.narrative-card-tier { color: var(--text-3); font-family: var(--font-mono); }
.narrative-card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 10px; }
.narrative-card-members { padding-top: 8px; border-top: 1px solid var(--border); }

/* Narrative-expand story rows (#371) — the members list rendered inside
   .narrative-card-members via narrative_detail.html. */
.nx-narrative-members {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 400px;
  overflow-y: auto;
}
.nx-narrative-member {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.nx-narrative-member:last-child { border-bottom: none; }
.nx-narrative-member:hover { background: var(--bg-elev); }
.nx-narrative-member-title {
  color: var(--text-1);
  font-weight: 500;
  cursor: pointer;
  flex: 1;
  line-height: 1.4;
}
.nx-narrative-member-title:hover { color: var(--accent); }
.nx-narrative-member-meta {
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.narrative-pill { padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.5px; }
.narrative-pill-active { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.narrative-pill-dormant { background: var(--surface-2); color: var(--text-3); }
.narrative-pill-closed { background: var(--surface-2); color: var(--text-3); font-style: italic; }

.narratives-empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 13px; border: 1px dashed var(--border); border-radius: var(--radius-md); }

/* Event-Type Playbook-Library (#304 WP-16) — card grid, analog narrative-card above. */
.playbooks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.playbook-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; }
.playbook-card:hover { border-color: var(--accent); }
.playbook-card-head { display: flex; align-items: center; gap: 8px; }
.playbook-card-icon { color: var(--text-2); display: inline-flex; align-items: center; }
.playbook-card-label { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.playbook-card-snippet { margin: 0; font-size: 12px; color: var(--text-2); line-height: 1.5; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.playbook-card-placeholder { margin: 0; font-size: 12px; color: var(--text-3); font-style: italic; }
.playbook-card-foot { font-size: 10.5px; color: var(--text-3); font-family: var(--font-mono); border-top: 1px solid var(--border); padding-top: 8px; }

/* Markdown-rendered playbook body (routers/playbooks.py _render_md) — detail page + drawer widget. */
.playbook-body p { margin: 0 0 10px; }
.playbook-body ol, .playbook-body ul { margin: 0 0 10px; padding-left: 22px; }
.playbook-body li { margin-bottom: 6px; }
.playbook-body li:last-child { margin-bottom: 0; }
.playbook-body p:last-child, .playbook-body ol:last-child, .playbook-body ul:last-child { margin-bottom: 0; }
.playbook-body strong { color: var(--text-1); }

/* Info-Overlay — "About CI-Tool" modal, auto-open once per session (#372) */
.ci-info-overlay { position: fixed; inset: 0; z-index: 9999; display: none; }
.ci-info-overlay.is-open { display: block; }
.ci-info-scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.ci-info-modal {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--surface); color: var(--text-1);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg, 0 10px 40px rgba(0,0,0,0.3));
  width: min(720px, 92vw); max-height: 85vh; overflow-y: auto;
  padding: 24px 28px;
}
.ci-info-close {
  position: absolute; top: 12px; right: 14px;
  background: transparent; border: none; color: var(--text-2);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.ci-info-close:hover { color: var(--text-1); }
.ci-info-body h2 { margin: 0 0 12px; font-size: 18px; }
.ci-info-body h3 { margin: 18px 0 8px; font-size: 14px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.4px; }
.ci-info-body p { font-size: 13px; line-height: 1.55; color: var(--text-1); margin: 0 0 12px; }
.ci-info-body ul { padding-left: 18px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.ci-info-body ul li { margin-bottom: 4px; }
.ci-info-sources { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 6px; }
.ci-info-sources th, .ci-info-sources td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.ci-info-sources th { font-weight: 600; color: var(--text-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.3px; }

.ci-info-trigger {
  background: transparent; border: none; padding: 2px 4px;
  color: var(--text-3); cursor: pointer; display: inline-flex; align-items: center;
  margin-right: 6px;
}
.ci-info-trigger:hover { color: var(--accent); }

/* ── Guided onboarding (#393) ────────────────────────────────────────────── */
.onboard-check {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: 8px;
}
.onboard-check-icon { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.onboard-check-label { font-size: 13px; font-weight: 600; color: var(--text); }
.onboard-check-detail { flex: 1; font-size: 12px; color: var(--text-2); text-align: right; }
.onboard-check-mark { width: 15px; height: 15px; flex: none; }
.onboard-check-mark.ok { color: var(--accent); }
.onboard-check-mark.miss { color: var(--text-3); }

.onboard-src {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.onboard-src:last-child { border-bottom: none; }
.onboard-src-icon { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.onboard-src.dim .onboard-src-icon, .onboard-src.dim .onboard-src-label { color: var(--text-3); }
.onboard-src-label { font-size: 13px; font-weight: 600; color: var(--text); }
.onboard-src-detail { flex: 1; font-size: 12px; color: var(--text-2); text-align: right; }
.onboard-chip {
  padding: 2px 9px; border-radius: var(--radius-pill);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap;
}
.onboard-chip.track { background: var(--accent-dim); color: var(--accent); }
.onboard-chip.prio { background: var(--ai-tint); color: var(--accent); border: 1px solid var(--ai-border); }
.onboard-chip.off { background: var(--surface-2); color: var(--text-3); }
