/* ============================================================
   EchoAnalyst reports in the EchoGlobal design-system language.
   Tokens mirror the design system (Echo Designs/echo-design-system
   tokens/colors.css + ds-foundation.css); component classes
   translate the Claude Design report explorations into reusable
   view classes. Light-only by brand.
   ============================================================ */
/* Token block is shared with the V2 report shell (ds_report_shell.css) so
   both chromes resolve the same brand values. Only `.ds-report` takes the
   page-level typography/background below. */
.ds-report,
.ds-report-shell {
  /* ---- Brand tokens ---- */
  --echo-cyan: #5DAEE3;
  --wave-cyan: #3DB4E8;
  --wordmark-blue: #55A7DD;
  --ice: #D9E8F8;
  --deep-blue: #0070F8;
  --ink: #203058;
  --slate: #5A6685;
  --steel: #8090A8;
  --cloud: #E6E8EF;
  --mist: #F4F6FA;
  --panel: #F7F9FC;
  --white: #FFFFFF;
  --rose: #F2568B;
  --blush: #FDE1EA;
  --grad-sky: linear-gradient(135deg, #5DAEE3 0%, #3DB4E8 100%);
  --grad-ice-fade: linear-gradient(170deg, #FBFDFF 0%, #D9E8F8 100%);
  --grad-deep: linear-gradient(135deg, #3DB4E8 0%, #0070F8 100%);
  --grad-alert: linear-gradient(135deg, #F2568B 0%, #D63A72 100%);
  --grad-deep-current: var(--grad-deep);
  --shadow-brand: 0 8px 22px rgba(93, 174, 227, 0.35);
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Sticky table headers offset. The rebound layout has no fixed top nav
     (fixed sidebar; content scrolls with the body), so 0 is correct here. */
  --dsr-sticky-top: 0px;
}

/* Page-level treatment stays on `.ds-report` only. `.ds-report-shell` wraps
   report bodies that are still Tailwind, so it must not repaint the page. */
.ds-report {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--mist);
  padding: 28px 20px 64px;
  -webkit-font-smoothing: antialiased;
}
.ds-report * { box-sizing: border-box; }
.dsr-page { max-width: 940px; margin: 0 auto; }

/* ---- Shared control bar ----
   Hosts the report-builder's own filter pickers (report_filters/*) so the
   filter UX matches /report/v2/conversations and a redesign there
   propagates to every Echo Analyst report. The pickers bring their own
   (Tailwind) styling; this bar just lays them out and adds the submit. */
.dsr-controls {
  max-width: 940px; margin: 0 auto 18px;
  display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap;
}
.dsr-controls > div { flex: 1 1 220px; min-width: 200px; }
.dsr-controls-apply {
  flex: 0 0 auto; align-self: stretch;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--white);
  background: var(--grad-sky); border: none; border-radius: 12px;
  padding: 0 22px; cursor: pointer; box-shadow: var(--shadow-brand);
}


/* ---- Controls (date range) ---- */
.dsr-range {
  max-width: 940px; margin: 0 auto 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--slate); font-weight: 600;
}
.dsr-range label { display: inline-flex; align-items: center; gap: 6px; }
.dsr-range input[type="date"] {
  border: 1px solid var(--cloud); border-radius: 10px; padding: 7px 11px;
  font-size: 12.5px; color: var(--ink); background: var(--white); font-family: inherit;
}
.dsr-range button {
  font-family: inherit; font-size: 12px; font-weight: 700; color: var(--white);
  background: var(--grad-sky); border: none; border-radius: 10px;
  padding: 8px 16px; cursor: pointer; box-shadow: var(--shadow-brand);
}

/* ---- Cover ---- */
.dsr-cover { background: var(--grad-ice-fade); border-radius: 34px; padding: 44px 44px 40px; }
.dsr-brand-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 36px; }
.dsr-brand { display: flex; align-items: center; gap: 10px; }
.dsr-brand-mark { display: block; width: 25px; height: 28px; flex: none; }
.dsr-brand-word { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.dsr-brand-word span { color: var(--wordmark-blue); }
.dsr-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--echo-cyan); }
.dsr-h1 { margin: 0 0 14px; font-size: 40px; line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; color: var(--ink); max-width: 560px; text-wrap: balance; }
.dsr-lede { margin: 0 0 28px; font-size: 15px; line-height: 22px; color: var(--slate); max-width: 540px; }
.dsr-cover-meta { display: flex; gap: 24px; font-size: 12px; color: var(--slate); flex-wrap: wrap; }
.dsr-cover-meta strong { font-weight: 700; color: var(--ink); }
.dsr-cover-meta .sep { color: var(--cloud); }

/* ---- Stat tiles ---- */
.dsr-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
@media (max-width: 720px) { .dsr-tiles { grid-template-columns: 1fr 1fr; } }
.dsr-tile { background: var(--panel); border-radius: 16px; padding: 18px 20px; }
.dsr-tile-val { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
/* Labels are sentence case by design — no uppercase/letter-spacing. */
.dsr-tile-lbl { font-size: 11px; font-weight: 600; color: var(--steel); margin-top: 3px; }
/* Period-over-period delta under a tile value. No prior data renders nothing
   rather than a confident zero. */
.dsr-tile-delta { font-size: 11px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dsr-tile-delta.up { color: #2E9E63; }
.dsr-tile-delta.dn { color: var(--rose); }
.dsr-tile-delta.flat { color: var(--steel); }
/* Lift figure on the What Works lever board. */
.dsr-lift { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dsr-lift.up { color: #2E9E63; }
.dsr-lift.dn { color: var(--rose); }
.dsr-lift.flat { color: var(--steel); }

/* ---- Top priority banner ---- */
.dsr-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 14px;
  background: var(--grad-deep); border-radius: 18px; padding: 22px 28px;
  color: var(--white); flex-wrap: wrap;
}
.dsr-banner-main { flex: 1; min-width: 220px; }
.dsr-banner-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; margin-bottom: 4px; }
.dsr-banner-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; max-width: 480px; text-wrap: balance; }
.dsr-banner-stat { text-align: right; }
.dsr-banner-stat-val { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dsr-banner-stat-lbl { font-size: 11px; opacity: 0.85; max-width: 220px; }

/* ---- Sections ---- */
.dsr-section { margin-top: 36px; }
.dsr-section-eyebrow { display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--echo-cyan); margin-bottom: 4px; }
/* Echo-mark glyph before every section eyebrow (masked so it inherits the eyebrow color). */
.dsr-section-eyebrow::before {
  content: ""; width: 10px; height: 12px; flex: none; background-color: var(--echo-cyan);
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 29 36' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='3.5' cy='18' r='3.5'/%3E%3Crect x='11' y='7.5' width='7' height='21' rx='3.5'/%3E%3Crect x='22' y='0.5' width='7' height='35' rx='3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 29 36' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='3.5' cy='18' r='3.5'/%3E%3Crect x='11' y='7.5' width='7' height='21' rx='3.5'/%3E%3Crect x='22' y='0.5' width='7' height='35' rx='3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dsr-h2 { margin: 0 0 6px; font-size: 26px; line-height: 32px; letter-spacing: -0.03em; font-weight: 800; color: var(--ink); }
.dsr-h3 { margin: 26px 0 10px; font-size: 16px; line-height: 22px; letter-spacing: -0.01em; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.dsr-section-lede { margin: 0 0 18px; font-size: 14px; line-height: 20px; color: var(--slate); max-width: 580px; }

/* ---- Matrix (teams down the side, one column per training theme) ----
   Teams can number in the dozens, so they run as rows and the table grows
   vertically; the ~5 theme columns fit without horizontal scroll because
   their headers wrap instead of forcing column width. */
.dsr-matrix-wrap { background: var(--white); border: 1px solid var(--cloud); border-radius: 20px; padding: 8px 12px; }
.dsr-matrix { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.dsr-matrix th {
  text-align: center; padding: 12px 8px; border-bottom: 1px solid var(--cloud); vertical-align: bottom;
}
.dsr-matrix th.team-col { text-align: left; width: 17%; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel); }
.dsr-matrix .theme-name { display: block; font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.dsr-matrix .metric { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--steel); margin-top: 3px; }
.dsr-matrix td { text-align: center; padding: 11px 8px; border-bottom: 1px solid var(--cloud); color: var(--slate); font-variant-numeric: tabular-nums; font-size: 14.5px; font-weight: 600; }
.dsr-matrix tr:last-child td { border-bottom: none; }
.dsr-matrix td:first-child { text-align: left; font-size: 13px; }
.dsr-matrix td:first-child strong { font-weight: 700; color: var(--ink); }
.dsr-matrix td:first-child .count { color: var(--steel); font-size: 12px; }
.dsr-matrix td.worst { font-weight: 800; color: var(--rose); }
.dsr-note { margin: 10px 2px 0; font-size: 11px; line-height: 16px; color: var(--steel); }

/* ---- Theme cards ---- */
.dsr-card { background: var(--white); border: 1px solid var(--cloud); border-radius: 24px; padding: 32px 34px; margin-top: 20px; }
.dsr-card-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.dsr-num {
  width: 44px; height: 44px; border-radius: 16px; background: var(--ice);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: var(--echo-cyan); flex-shrink: 0;
}
.dsr-num.primary { background: var(--grad-sky); box-shadow: var(--shadow-brand); color: var(--white); }
.dsr-card-titles { flex: 1; min-width: 220px; }
.dsr-focus { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel); margin-bottom: 2px; }
.dsr-card-title { margin: 0; font-size: 23px; line-height: 29px; letter-spacing: -0.02em; font-weight: 800; color: var(--ink); }
.dsr-priority { background: var(--blush); color: var(--rose); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.dsr-stat { font-size: 14px; font-weight: 700; color: var(--echo-cyan); margin-bottom: 10px; }
.dsr-desc { margin: 0 0 20px; font-size: 14px; line-height: 21px; color: var(--slate); max-width: 580px; }
.dsr-sub { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel); margin-bottom: 10px; }

/* ---- Distribution ----
   Below baseline (needs training) reads red, at baseline neutral, strong
   blue — so the bar sweeps left-to-right from need to strength. */
.dsr-dist-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin-bottom: 10px; background: var(--mist); }
.dsr-dist-seg.below { background: var(--rose); }
.dsr-dist-seg.at { background: var(--cloud); }
.dsr-dist-seg.strong { background: var(--grad-sky); }
.dsr-dist-legend { display: flex; gap: 22px; font-size: 12px; color: var(--slate); margin-bottom: 22px; flex-wrap: wrap; }
.dsr-dist-key { display: inline-flex; align-items: center; gap: 6px; }
.dsr-dist-key strong { font-weight: 700; color: var(--ink); }
.dsr-dist-dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; }
.dsr-dist-dot.below { background: var(--rose); }
.dsr-dist-dot.at { background: var(--cloud); }
.dsr-dist-dot.strong { background: var(--wave-cyan); }

/* ---- Verbatim quote panel ---- */
.dsr-quote { background: var(--panel); border-radius: 14px; padding: 16px 20px; margin-bottom: 12px; }
.dsr-quote-text { font-style: italic; margin: 0 0 8px; color: var(--ink); }
.dsr-quote-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--slate); }
.dsr-quote-moment { margin: 0 0 8px; font-size: 14px; line-height: 21px; font-style: italic; color: var(--ink); }
.dsr-quote-opp { margin: 0; font-size: 13px; line-height: 19px; color: var(--slate); }
.dsr-quote-opp strong { font-weight: 700; color: var(--ink); }

/* ---- Highest-leverage rows ---- */
.dsr-lev { display: grid; gap: 10px; }
.dsr-lev-row { display: grid; grid-template-columns: 200px 1fr 190px; align-items: center; gap: 14px; }
@media (max-width: 720px) { .dsr-lev-row { grid-template-columns: 1fr; gap: 4px; } }
.dsr-lev-name { font-size: 13px; color: var(--ink); }
.dsr-lev-name strong { font-weight: 700; }
.dsr-lev-name .set { color: var(--steel); font-size: 12px; }
.dsr-lev-track { height: 8px; border-radius: 999px; background: var(--mist); }
.dsr-lev-fill { height: 8px; border-radius: 999px; background: var(--rose); }
.dsr-lev-detail { font-size: 14px; font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.dsr-lev-detail .unit { font-size: 11px; font-weight: 600; color: var(--steel); margin-left: 4px; }
@media (max-width: 720px) { .dsr-lev-detail { text-align: left; } }
.dsr-more { margin: 12px 0 0; font-size: 11px; color: var(--steel); }

/* ---- Footer / empty state ---- */
.dsr-foot { margin: 24px 0 0; font-size: 11px; line-height: 17px; color: var(--steel); text-align: center; }
.dsr-empty { background: var(--white); border: 1px solid var(--cloud); border-radius: 24px; padding: 48px 24px; text-align: center; margin-top: 14px; }
.dsr-empty-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.dsr-empty-sub { font-size: 13px; color: var(--slate); }

/* ============================================================
   Legacy token bridge — shared components authored against the
   navy report palette (Journey Arc SVG, movement dots) inherit
   design-system colors when rendered inside .ds-report.
   ============================================================ */
.ds-report {
  --navy: var(--ink);
  --blue-700: var(--wave-cyan);
  --blue-600: var(--echo-cyan);
  --blue-200: var(--ice);
  --blue-100: var(--ice);
  --blue-50: var(--panel);
  --g50: var(--panel);
  --g100: var(--mist);
  --g200: var(--cloud);
  --g300: var(--cloud);
  --g400: var(--steel);
  --g500: var(--steel);
  --g600: var(--slate);
  --g700: var(--slate);
  --g900: var(--ink);
  --green: #22B07D;
  --green-lt: #DFF6EC;
  --red: #F0407C;
  --red-lt: #FDE1EA;
  --amber: #C98A00;
  --amber-lt: #FEF3D8;
}

/* ---- Generic data table (shares the matrix rules) ----
   Tables should fit the column: long text wraps (.dsr-td-wrap) and rows grow
   taller; overflow-x stays only as a last-resort fallback for extreme cases. */
.dsr-table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--cloud); border-radius: 14px; }
.dsr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dsr-table th {
  text-align: center; padding: 12px 14px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel);
  border-bottom: 1px solid var(--cloud); background: var(--panel); white-space: nowrap;
}
.dsr-table th:first-child, .dsr-table th.l { text-align: left; }
.dsr-table td { text-align: center; padding: 11px 14px; border-bottom: 1px solid var(--mist); color: var(--slate); font-variant-numeric: tabular-nums; }
.dsr-table tr:last-child td { border-bottom: none; }
.dsr-table td:first-child, .dsr-table td.l { text-align: left; }
.dsr-table td strong { font-weight: 700; color: var(--ink); }
.dsr-table td .sub { font-size: 11.5px; color: var(--steel); }
.dsr-table td.hl { background: var(--ice); font-weight: 700; color: var(--ink); }
/* Wrap-friendly cell for long text and URLs — prefer this over horizontal scroll. */
.dsr-td-wrap { white-space: normal; word-break: break-word; overflow-wrap: break-word; }
.dsr-best {
  margin-left: 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; background: var(--ice); color: var(--wave-cyan);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}

/* ---- Journey timeline ---- */
.dsr-tl { display: flex; flex-direction: column; }
.dsr-tl-row { display: flex; gap: 18px; }
.dsr-tl-rail { display: flex; flex-direction: column; align-items: center; width: 34px; flex-shrink: 0; }
.dsr-tl-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.dsr-tl-num.missed { background: var(--white); color: var(--steel); border: 2px solid var(--cloud); }
.dsr-tl-line { width: 2px; flex: 1; background: var(--cloud); margin: 6px 0; }
.dsr-tl-body { flex: 1; padding-bottom: 28px; }
.dsr-tl-row:last-child .dsr-tl-body { padding-bottom: 0; }
.dsr-tl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dsr-tl-date { font-size: 14px; font-weight: 700; color: var(--ink); }
.dsr-tl-type { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); }
.dsr-score {
  margin-left: auto; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  background: var(--panel); color: var(--slate); font-variant-numeric: tabular-nums;
}
.dsr-score.good { background: #DFF6EC; color: #1E7A54; }
.dsr-score.ok { background: #FEF3D8; color: #C98A00; }
.dsr-score.missed {
  background: var(--mist); color: var(--steel);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
}
.dsr-tl-summary { margin: 10px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--slate); }
.dsr-tl-gap {
  margin: 0 0 0 9px; padding: 2px 0 14px 25px;
  border-left: 2px dashed var(--cloud);
  font-size: 11px; font-weight: 600; color: var(--steel);
}
.dsr-tl-foot { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dsr-tl-facts { font-size: 12px; color: var(--slate); flex: 1 1 auto; }
.dsr-tl-facts strong { color: var(--ink); }
.dsr-tl-move { font-weight: 600; }
.dsr-tl-move.toward { color: var(--wave-cyan); }
.dsr-tl-move.strong-toward { color: var(--ink); }
.dsr-tl-move.away { color: var(--rose); }
.dsr-tl-move.none { color: var(--steel); }
.dsr-decision {
  font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  background: var(--ink); color: var(--white); white-space: nowrap;
}

/* ---- Journey barriers ---- */
.dsr-barrier { display: grid; grid-template-columns: 120px 1fr 150px; align-items: center; gap: 14px; padding: 8px 0; }
@media (max-width: 640px) { .dsr-barrier { grid-template-columns: 1fr; gap: 6px; } }
.dsr-barrier-type { font-size: 13px; font-weight: 600; color: var(--ink); text-align: right; }
@media (max-width: 640px) { .dsr-barrier-type { text-align: left; } }
.dsr-barrier-bar { display: flex; gap: 4px; height: 26px; }
.dsr-barrier-seg {
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0 8px; white-space: nowrap; overflow: hidden;
}
.dsr-barrier-seg.addressed { background: var(--grad-deep-current); color: var(--white); }
.dsr-barrier-seg.unaddressed { background: #FEF3D8; color: #C98A00; }
.dsr-flag {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: #FEF3D8; color: #C98A00; white-space: nowrap;
}
.dsr-ok {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--mist); color: var(--steel); white-space: nowrap;
}
.dsr-good {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--ice); color: var(--deep-blue); white-space: nowrap;
}

/* ---- Alert banner variant: serious findings must not look reassuring ---- */
.dsr-banner.alert { background: var(--grad-alert); }

/* ---- Stacked spiritual-movement cell (when addressed / when not) ---- */
.dsr-mvcell { display: grid; gap: 6px; min-width: 240px; }
.dsr-mvcell-row { display: grid; grid-template-columns: 96px 1fr 44px; gap: 8px; align-items: center; }
.dsr-mvcell-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel); text-align: right; }
.dsr-mvcell-track { background: var(--mist); border-radius: 5px; height: 14px; overflow: hidden; }
.dsr-mvcell-fill { height: 100%; border-radius: 5px; background: var(--grad-deep-current); min-width: 2px; }
.dsr-mvcell-fill.muted { background: var(--cloud); }
.dsr-mvcell-val { font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- Horizontal funnel (mirrors the narrative reports' funnel design) ---- */
.dsr-funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 6px; }
@media (max-width: 720px) { .dsr-funnel { grid-template-columns: 1fr 1fr; } }
.dsr-funnel-stage { background: var(--panel); border-radius: 16px; padding: 16px 18px; position: relative; }
.dsr-funnel-stage::after { content: "→"; position: absolute; right: -12px; top: 50%; transform: translateY(-50%); color: var(--steel); font-weight: 800; }
.dsr-funnel-stage:last-child::after { content: none; }
.dsr-funnel-val { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.dsr-funnel-lbl { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel); margin-top: 3px; }
.dsr-funnel-pct { font-size: 11px; font-weight: 700; color: var(--echo-cyan); margin-top: 6px; }

/* ---- Guide link chip beside section headers ---- */
.dsr-guide-link { font-size: 11px; font-weight: 700; color: var(--deep-blue); background: var(--ice); padding: 4px 12px; border-radius: 999px; text-decoration: none; white-space: nowrap; }

/* ---- Standard conversation-open icon (rightmost cell of any row) ---- */
.dsr-open {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--ice); color: var(--deep-blue);
}
.dsr-open svg { width: 14px; height: 14px; fill: currentColor; }
.dsr-open:hover { box-shadow: var(--shadow-brand); }

/* ---- Rules-based insight strip (computed reports; no AI) ----
   White card + round icon chip; never a colored left stripe (standing rule). */
.dsr-insights { display: grid; gap: 10px; margin-top: 14px; }
.dsr-insight {
  display: flex; gap: 14px; align-items: center;
  background: var(--white); border: 1px solid var(--cloud);
  border-radius: 14px; padding: 14px 18px;
}
.dsr-insight p { margin: 0; font-size: 13px; line-height: 19px; color: var(--slate); }
.dsr-insight p strong { font-weight: 700; color: var(--ink); }
.dsr-insight-ic {
  flex: none; width: 34px; height: 34px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
.dsr-insight.watch .dsr-insight-ic { background: #FFF3D9; color: #E89923; }
.dsr-insight.win .dsr-insight-ic { background: var(--ice); color: var(--deep-blue); }
.dsr-insight-ic svg { width: 16px; height: 16px; }
.dsr-insight-kind {
  font-size: 10px; font-weight: 800; letter-spacing: 0.15em;
  text-transform: uppercase; margin-bottom: 3px;
}
.dsr-insight.watch .dsr-insight-kind { color: #B57506; }
.dsr-insight.win .dsr-insight-kind { color: var(--deep-blue); }

/* ---- Suite home: report catalog cards (mockup .catalog* anatomy) ---- */
.dsr-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.dsr-catalog-card {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--cloud); border-radius: 18px;
  padding: 20px 22px; text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.dsr-catalog-card:hover { box-shadow: var(--shadow-brand); transform: translateY(-2px); }
.dsr-catalog-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dsr-catalog-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--ice); color: var(--deep-blue); flex: none;
}
.dsr-catalog-icon svg { width: 18px; height: 18px; }
.dsr-catalog-kind { font-size: 9.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--echo-cyan); }
.dsr-catalog-title { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 5px; }
.dsr-catalog-question { font-size: 12.5px; line-height: 18px; color: var(--slate); }
.dsr-catalog-open {
  margin-top: auto; padding-top: 12px; font-size: 12px; font-weight: 700; color: var(--deep-blue);
  opacity: 0; transform: translateX(-4px); transition: opacity 0.15s ease, transform 0.15s ease;
}
.dsr-catalog-card:hover .dsr-catalog-open { opacity: 1; transform: translateX(0); }
.dsr-catalog-guide { background: var(--panel); border-style: dashed; }

/* ---- Horizontal coverage bars (gospel elements etc.) ---- */
.dsr-bars { display: flex; flex-direction: column; gap: 10px; }
.dsr-bar-row { display: grid; grid-template-columns: 170px 1fr 110px; gap: 14px; align-items: center; }
@media (max-width: 640px) { .dsr-bar-row { grid-template-columns: 1fr; gap: 4px; } }
.dsr-bar-lbl { font-size: 13px; font-weight: 600; color: var(--ink); text-align: right; }
@media (max-width: 640px) { .dsr-bar-lbl { text-align: left; } }
.dsr-bar-track { height: 22px; background: var(--mist); border-radius: 6px; overflow: hidden; }
.dsr-bar-fill {
  height: 100%; border-radius: 6px; background: var(--grad-deep-current);
  display: flex; align-items: center; padding-left: 10px; min-width: 44px;
}
.dsr-bar-fill span { font-size: 11px; font-weight: 700; color: var(--white); white-space: nowrap; }
.dsr-bar-fill.zero { background: none; min-width: 0; }
.dsr-bar-fill.zero span { color: var(--steel); }
.dsr-bar-fill.warn { background: linear-gradient(135deg, #F2568B 0%, #D63A72 100%); }
.dsr-bar-meta { font-size: 12px; font-weight: 600; color: var(--slate); }

/* ---- Callout (insight-style panel) ---- */
.dsr-callout { background: var(--ice); border-radius: 16px; padding: 18px 22px; margin-top: 22px; }
.dsr-callout-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wave-cyan); margin-bottom: 8px; }
.dsr-callout p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--ink); }

/* ---- Tile grid variants ---- */
.dsr-tiles.cols-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 860px) { .dsr-tiles.cols-5 { grid-template-columns: 1fr 1fr; } }

/* ---- Journey Arc (shared component, recolored via the token bridge) ---- */
.ds-report .sj-arc-wrap { margin-top: 4px; }
.ds-report .sj-arc { width: 100%; height: auto; display: block; }
.ds-report .sj-arc-legend {
  display: flex; gap: 20px; flex-wrap: wrap; justify-content: center;
  margin-top: 12px; font-size: 11px; color: var(--steel); font-weight: 600;
}
.ds-report .sj-arc-key { display: inline-flex; align-items: center; gap: 6px; }
.ds-report .sj-arc-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--white);
  border: 3px solid var(--steel); display: inline-block;
}
/* A 3px dashed border on a 10px circle renders as broken chunks; a thinner
   ring on a slightly larger dot reads as the dashed no-reply marker. */
.ds-report .sj-arc-dot.dashed { width: 12px; height: 12px; border-width: 2px; border-style: dashed; }
.ds-report .sj-arc-dot.filled { background: var(--ink); border-color: var(--ink); }

/* ---- AI journey summary (Seeker Journey "overall picture" card) ---- */
.dsr-btn {
  font-family: inherit; font-size: 12px; font-weight: 700; color: var(--white);
  background: var(--grad-sky); border: none; border-radius: 10px;
  padding: 8px 16px; cursor: pointer; box-shadow: var(--shadow-brand);
}
.dsr-btn.ghost {
  color: var(--deep-blue); background: var(--white);
  border: 1px solid var(--cloud); box-shadow: none;
}
.dsr-ai-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.dsr-ai-cta p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--slate); max-width: 560px; }
.dsr-ai-loading { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--slate); }
.dsr-spinner {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--cloud); border-top-color: var(--deep-blue);
  animation: dsr-spin 0.8s linear infinite;
}
@keyframes dsr-spin { to { transform: rotate(360deg); } }
.dsr-ai-progress { margin-top: 12px; font-size: 12px; color: var(--slate); max-height: 180px; overflow-y: auto; }
.dsr-ai-prose { font-size: 13.5px; line-height: 1.7; color: var(--ink); }
.dsr-ai-block { margin-top: 18px; }
.dsr-theme {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 7px 0; border-top: 1px solid var(--ice); font-size: 13px; line-height: 1.6;
}
.dsr-theme-name { font-weight: 700; color: var(--ink); white-space: nowrap; }
.dsr-theme-count { font-size: 11px; font-weight: 700; color: var(--wave-cyan); }
.dsr-theme-text { color: var(--slate); flex: 1; min-width: 200px; }
.dsr-ai-error { margin: 0 0 14px; font-size: 13px; line-height: 1.6; color: var(--red); }
.dsr-ai-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--ice);
  font-size: 11.5px; color: var(--steel);
}

/* ---- Standalone with/without-movement card (Scripture Impact) ----
   Wrap .dsr-mv rows in the existing .dsr-mvcell stack for row spacing. */
.dsr-mv-standalone { background: var(--white); border: 1px solid var(--cloud); border-radius: 20px; padding: 20px 24px; max-width: 560px; }
.dsr-mv-head { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--steel); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--cloud); }
.dsr-mv { display: grid; grid-template-columns: 92px 1fr 38px; gap: 8px; align-items: center; }
.dsr-mv-lbl { font-size: 10.5px; font-weight: 600; color: var(--steel); text-align: right; }
.dsr-mv-track { background: var(--mist); border-radius: 5px; height: 12px; overflow: hidden; }
.dsr-mv-fill { height: 100%; border-radius: 5px; background: var(--grad-deep); min-width: 2px; }
.dsr-mv-fill.muted { background: var(--cloud); }
.dsr-mv-val { font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; text-align: left; }
.dsr-mv-standalone .dsr-mv { grid-template-columns: 120px 1fr 52px; }
.dsr-mv-standalone .dsr-mv-track { height: 18px; border-radius: 7px; }
.dsr-mv-standalone .dsr-mv-val { font-size: 15px; }

/* ---- Status pills (aliases of the mockup pill idiom; .dsr-flag/.dsr-ok/
   .dsr-good above stay for existing views) ---- */
.dsr-pill-good, .dsr-pill-flag, .dsr-pill-bad, .dsr-pill-ok {
  font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.dsr-pill-good { background: var(--ice); color: var(--deep-blue); }
.dsr-pill-flag { background: #FEF3D8; color: #C98A00; }
.dsr-pill-bad { background: var(--blush); color: var(--rose); }
.dsr-pill-ok { background: var(--mist); color: var(--steel); }

/* ---- Drill-downs: plain details/summary inside a report ---- */
.ds-report details { background: var(--white); border: 1px solid var(--cloud); border-radius: 14px; padding: 0 16px; margin: 10px 0; }
.ds-report summary { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; color: var(--ink); cursor: pointer; padding: 13px 0; list-style: none; }
.ds-report summary::-webkit-details-marker { display: none; }
.ds-report summary::before {
  content: ""; width: 7px; height: 7px; flex: none;
  border-right: 2px solid var(--steel); border-bottom: 2px solid var(--steel);
  transform: rotate(-45deg); transition: transform 0.15s ease;
}
.ds-report details[open] > summary::before { transform: rotate(45deg); }
.ds-report details[open] > summary { border-bottom: 1px solid var(--mist); margin-bottom: 12px; }
.ds-report details > *:last-child { margin-bottom: 14px; }
.ds-report summary .dsr-pill-good, .ds-report summary .dsr-pill-flag,
.ds-report summary .dsr-pill-bad, .ds-report summary .dsr-pill-ok,
.ds-report summary .dsr-flag, .ds-report summary .dsr-ok, .ds-report summary .dsr-good { margin-left: 2px; }
.ds-report details .dsr-table-wrap { background: var(--white); }

/* ---- Shared flowing funnel inside a ds report (Harvest) ----
   Mirrors ai_narrative_reports.css so HorizontalFunnelComponent's SVG
   fills the column when rendered inside .ds-report. */
.ds-report .funnel-svg { width: 100%; display: block; overflow: visible; }
.ds-report .dsr-funnel-wrap { margin: 14px 0 26px; }

/* ---- Funnel stat strip (Harvest; mirrors HorizontalFunnelComponent's row) ---- */
.dsr-funnel-stats { display: flex; margin-top: 16px; border-radius: 8px; overflow: hidden; border: 1px solid var(--cloud); }
.dsr-funnel-stat { flex: 1; padding: 12px 8px; text-align: center; border-right: 1px solid var(--cloud); }
.dsr-funnel-stat:last-child { border-right: none; }
.dsr-funnel-stat-val { font-size: 1.25rem; font-weight: 800; line-height: 1; color: var(--deep-blue); }
.dsr-funnel-stat-lbl { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--steel); margin-top: 4px; font-weight: 500; }

/* ---- Sticky table headers (long tables) ---- */
.dsr-sticky-head th { position: sticky; top: var(--dsr-sticky-top, 0); z-index: 2; }
/* Matrix headers are otherwise transparent; sticky ones need a solid
   background so scrolled rows don't show through. */
.ds-report .dsr-matrix.dsr-sticky-head th { background: var(--panel); }

/* ---- Client-side table controls: sortable headers, pager, search ---- */
/* Row hosting the search box (and any future controls) above a table. */
.dsr-table-controls { display: flex; gap: 8px; margin-bottom: 10px; }
th.dsr-sortable { cursor: pointer; user-select: none; }
th.dsr-sortable::after { content: "↕"; margin-left: 5px; font-size: 9px; color: var(--cloud); }
th.dsr-sortable:hover::after { color: var(--steel); }
th.dsr-sorted-asc::after { content: "↑"; color: var(--deep-blue); }
th.dsr-sorted-desc::after { content: "↓"; color: var(--deep-blue); }
.dsr-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.dsr-pager button {
  font-family: inherit; font-size: 12px; font-weight: 600; color: var(--ink);
  background: var(--white); border: 1px solid var(--cloud); border-radius: 10px;
  padding: 7px 14px; cursor: pointer;
}
.dsr-pager button:hover:not(:disabled) { background: var(--ice); color: var(--deep-blue); }
.dsr-pager button:disabled { opacity: 0.45; cursor: default; }
.dsr-pager-status { font-size: 12px; color: var(--slate); font-variant-numeric: tabular-nums; }
.dsr-search {
  font-family: inherit; font-size: 12.5px; color: var(--ink);
  background: var(--white); border: 1px solid var(--cloud); border-radius: 10px;
  padding: 7px 12px;
}
.dsr-search::placeholder { color: var(--steel); }
.dsr-search:focus { outline: none; border-color: var(--echo-cyan); }

/* ---- Verse popover triggers (Scripture Impact passages) ----
   A dotted underline marks the reference as hoverable; the -inverse
   variant keeps it legible on the gradient banner. */
.ds-report .dsr-verse {
  cursor: help;
  text-decoration: underline dotted;
  text-decoration-color: var(--echo-cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.ds-report .dsr-verse-inverse { color: var(--white); text-decoration-color: var(--white); }

/* ---- Channel icon chip (Prayer "By channel" table) ----
   Sizes the svg directly because some icon partials (e.g. tiktok) ignore
   the style local render_icon passes through. */
.ds-report .dsr-channel-ic { display: inline-flex; align-items: center; color: var(--slate); }
.ds-report .dsr-channel-ic svg { width: 16px; height: 16px; }

/* ---- Reviewed checkbox (Resource Governance incident rows) ----
   A leader ticks a row once it has been looked at. The cell stays narrow
   and the label carries the state, so a reviewed row reads as handled
   without needing colour alone to say so. */
.ds-report .dsr-review { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ds-report .dsr-review input { accent-color: var(--deep-blue); width: 14px; height: 14px; cursor: pointer; margin: 0; }
.ds-report .dsr-review input:disabled { cursor: progress; opacity: 0.5; }
.ds-report .dsr-review-lbl { font-size: 11px; color: var(--steel); white-space: nowrap; }
.ds-report .dsr-review input:checked ~ .dsr-review-lbl { color: var(--deep-blue); font-weight: 600; }
.ds-report tr.dsr-reviewed td { background: var(--mist); color: var(--slate); }


/* ============================================================
   Run-status overlay — SHARED

   One loading state for every report that runs asynchronously, Echo
   Analyst and classic V2 alike. Deliberately not scoped to .ds-report or
   .ds-report-shell: both chromes render it, and duplicating the rules per
   scope is how they drift.

   Markup: report/v2/shared/_report_run_overlay.
   ============================================================ */
/* ---- Run-status overlay ---- */
.dsr-runoverlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(32, 48, 88, 0.45);
}
.dsr-runoverlay[hidden] { display: none; }
.dsr-runcard {
  background: var(--white); border-radius: 20px; padding: 30px 34px;
  width: 420px; max-width: 100%; box-shadow: 0 24px 60px rgba(32, 48, 88, 0.25);
  text-align: center; margin: 0 auto;
}
.dsr-runcard .dsr-brand-mark { width: 40px; height: 46px; margin: 0 auto; }
.dsr-runcard-title { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin: 12px 0 16px; }
.dsr-runsteps { list-style: none; margin: 0; padding: 0; text-align: left; display: grid; gap: 9px; }
.dsr-runsteps li { position: relative; padding-left: 26px; font-size: 12.5px; color: var(--steel); }
.dsr-runsteps li::before {
  content: ""; position: absolute; left: 4px; top: 4px; width: 10px; height: 10px;
  border-radius: 999px; border: 2px solid var(--cloud); background: var(--white);
}
.dsr-runsteps li.done { color: var(--slate); }
.dsr-runsteps li.done::before { border-color: var(--wave-cyan); background: var(--wave-cyan); }
.dsr-runsteps li.active { color: var(--ink); font-weight: 600; }
.dsr-runsteps li.active::before { border-color: var(--echo-cyan); }
.dsr-runstep-time { color: var(--steel); font-size: 11px; margin-left: 4px; }
