/* cs.css — Swiss Authority case-study detail page styles. Verbatim port of the
   parts of site/_shared/cs.css that the customer detail + index pages need
   beyond the composed components (CtaBand owns `.cs-cta*`; global.css owns the
   `.btn*` + design tokens). Full-bleed hero with overlaid title + metrics →
   centered quote → 2-col article (prose + sticky sidebar) → optional Converge
   setup diagram → CTA. Plain CSS + var(--…) tokens (no Tailwind). */

:root {
  /* Only token missing from global.css; the rest (accent-soft/-mist, grad-2/3)
     already live there and stay the single source of truth. */
  --warm-deep: var(--color-role-warm-deep);
}

/* ── Full-bleed hero ─────────────────────────────────────────────────────── */
.cs-hero {
  position: relative;
  /* Full-bleed photo: sit above the page-frame rails (z-index 5) and margin
     hatching (z-index 0) so they don't draw across the image. Nav is z-index 50. */
  z-index: 6;
  min-height: 600px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  color: #fff;
}
.cs-hero-bg {
  position: absolute;
  inset: 0;
  background-image: var(--cs-img);
  background-size: cover;
  background-position: var(--cs-pos, center);
}
.cs-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14, 16, 20, 0.5) 0%,
    rgba(14, 16, 20, 0.12) 26%,
    rgba(14, 16, 20, 0.18) 52%,
    rgba(14, 16, 20, 0.88) 100%
  );
}
.cs-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-top: 30px;
  padding-bottom: 40px;
}
.cs-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cs-crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
}
.cs-crumb a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s var(--ease);
  white-space: nowrap;
}
.cs-crumb a:hover {
  color: #fff;
}
.cs-crumb-sep {
  color: rgba(255, 255, 255, 0.35);
}
.cs-crumb-current {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .cs-crumb-current,
  .cs-crumb-sep:has(+ .cs-crumb-current) {
    display: none;
  }
}
.cs-hero-logo {
  height: 22px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 1px 8px rgba(0, 0, 0, 0.35));
  opacity: 0.95;
}
.cs-hero-body {
  margin-top: auto;
  padding-top: 56px;
}
.cs-hero-title {
  margin: 0;
  font-size: var(--text-h1);
  font-weight: var(--text-h1--font-weight);
  letter-spacing: var(--text-h1--letter-spacing);
  line-height: var(--text-h1--line-height);
  max-width: none;
  /* This is an <h1>; our global h1 color would override the white it should
     inherit from the dark hero. Re-inherit to match the prototype. */
  color: inherit;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
@media (max-width: 480px) {
  .cs-hero-title {
    font-size: 34px;
  }
}
.cs-metrics {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 880px;
}
.cs-metric {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-metric-line {
  font-size: clamp(25px, 2.6vw, 36px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-wrap: balance;
}
.cs-metric-val {
  font-variant-numeric: tabular-nums;
}
.cs-metric-det {
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.7);
  max-width: 30ch;
}

/* ── Article: body + sticky sidebar ──────────────────────────────────────── */
.cs-article {
  display: grid;
  grid-template-columns: minmax(0, 680px) 300px;
  gap: 72px;
  justify-content: center;
  padding-top: 48px;
  padding-bottom: 56px;
  align-items: start;
}
.cs-body {
  min-width: 0;
}
.cs-intro {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.cs-intro:last-of-type {
  margin-bottom: 0;
}
/* Bridge: the MDX body renders its lede as bare direct-child <p> (the prototype
   authored them with class `.cs-intro`). Direct children only — Challenge/
   Solution prose lives deeper, under `.cs-prose`. Mirrors `.cs-intro`. */
.cs-body > p {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.cs-body > p:last-of-type {
  margin-bottom: 0;
}

.cs-section {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.cs-section > h2 {
  margin: 0 0 28px;
  font-size: var(--text-h2-sm);
  font-weight: var(--text-h2-sm--font-weight);
  letter-spacing: var(--text-h2-sm--letter-spacing);
  line-height: var(--text-h2-sm--line-height);
  color: var(--ink);
}
.cs-cs {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.cs-block {
  padding: 0;
}
.cs-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cs-tag::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--cs-tag-ico) center / contain no-repeat;
  mask: var(--cs-tag-ico) center / contain no-repeat;
}
.cs-block.is-challenge .cs-tag {
  color: var(--warm-deep);
  --cs-tag-ico: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='10'/%3E%3Cpath%20d='M12%2016v-4'/%3E%3Cpath%20d='M12%208h.01'/%3E%3C/svg%3E");
}
.cs-block.is-solution .cs-tag {
  color: var(--accent-deep);
  --cs-tag-ico: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20%206%209%2017l-5-5'/%3E%3C/svg%3E");
}
/* Heading line-height leak fix: the prototype's shell.css sets no global
   heading line-height, so `.cs-block h3` inherits body 1.55; our global.css
   type scale would leave it at h3's 1.15. Pin it to the prototype's effective
   value. */
.cs-block h3 {
  margin: 10px 0 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cs-prose {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.cs-prose p {
  margin: 0 0 12px;
}
.cs-prose p:last-child {
  margin-bottom: 0;
}
/* Lists usually close a block (the Impact bullets), so they carry no bottom
   margin; when prose follows one, give it the paragraph rhythm back. */
.cs-prose ul + p,
.cs-prose ol + p {
  margin-top: 12px;
}
.cs-prose strong {
  font-weight: 600;
  color: var(--ink);
}
.cs-prose ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cs-prose li {
  position: relative;
  padding-left: 22px;
  line-height: 1.5;
}
/* Default bullet for `.cs-prose` outside a Challenge/Solution block (i.e. a
   Prose block). `.cs-prose ul` sets `list-style: none` and the two dot rules
   below are scoped to the `is-*` modifiers, so a plain list would otherwise
   render with no marker at all. Those rules are more specific (0,3,1 vs 0,1,2),
   so they still win inside a Challenge/Solution. `ul > li` rather than `li`
   keeps ordered lists on their decimal marker. */
.cs-prose ul > li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: var(--pill);
  background: var(--ink-subtle);
}
.cs-block.is-solution .cs-prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.cs-block.is-challenge .cs-prose li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--warm-deep);
}
/* Ordered lists render as native numbered lists — no bullet dot. The dot
   ::before and the 22px hanging indent above are for unordered (bulleted)
   items; ordered items keep their decimal marker instead. */
.cs-prose ol {
  margin: 10px 0 0;
  padding-left: 22px;
  list-style: decimal;
}
.cs-prose ol > li {
  padding-left: 6px;
}
.cs-prose ol > li + li {
  margin-top: 8px;
}
.cs-block.is-solution .cs-prose ol > li::before,
.cs-block.is-challenge .cs-prose ol > li::before {
  content: none;
}

/* ── In-body figure (chart / screenshot) ─────────────────────────────────── */
/* Hairline frame + --radius-lg + no shadow, matching the two other in-column
   frames on this page (`.cs-sidebar`, `.cs-setup-canvas`). Margins collapse
   rather than sum in every context `.cs-fig` can appear in (`.cs-prose` and
   `.cs-body` are plain blocks, not flex), so this one rule set covers
   figure-after-p, figure-before-p, and a figure directly under `.cs-body`. */
.cs-fig {
  margin: 18px 0;
}
/* Mirrors `.cs-prose p:last-child` — `.cs-cs` owns the gap between blocks, so a
   trailing figure must not add one. */
.cs-fig:last-child {
  margin-bottom: 0;
}
.cs-fig-frame {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-cool);
  cursor: zoom-in;
  transition: border-color 0.2s var(--ease);
}
.cs-fig-frame:hover {
  border-color: var(--line-strong);
}
/* `height: auto` is load-bearing: the <img> carries width/height attributes, so
   the global `img { max-width: 100% }` alone would squash the aspect ratio. */
.cs-fig-frame img {
  display: block;
  width: 100%;
  height: auto;
}
.cs-fig figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-subtle);
}
/* Charts want more width than the 680px prose measure, so a figure bleeds
   symmetrically out of the body column. 48px is the ceiling: the right side eats
   into the 72px grid gap and must stop clear of the sticky sidebar, and the
   gate is the viewport where the centered grid (680 + 72 + 300 = 1052px) has
   48px of slack on the left too — 1052 + 96 = 1148px of container content, i.e.
   1148 + 2×40px padding. Below that the figure stays at the column width, so it
   can never push past `.container-page`'s gutter. */
@media (min-width: 1240px) {
  .cs-fig {
    width: calc(100% + 96px);
    margin-left: -48px;
  }
}

/* ── Agent card — <AgentCard> in an .mdx body ────────────────────────────── */
/* A small "what the agent did" card. It keeps the figure margins but not the
   bleed: it's a UI snippet, not a chart, so it sits narrower than the column. */
.cs-agent {
  width: auto;
  margin-left: 0;
}
.cs-agent-card {
  max-width: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow:
    0 1px 2px rgba(14, 16, 20, 0.04),
    0 12px 32px -20px rgba(14, 16, 20, 0.18);
  overflow: hidden;
}
.cs-agent-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
  font-size: 13px;
  line-height: 1.3;
}
.cs-agent-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: var(--pill);
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cs-agent-title {
  font-weight: 600;
  color: var(--ink);
}
.cs-agent-meta {
  margin-left: auto;
  color: var(--ink-subtle);
  white-space: nowrap;
}
.cs-agent-rows {
  margin: 0;
  padding: 4px 16px;
  list-style: none;
}
.cs-agent-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
}
.cs-agent-row + .cs-agent-row {
  border-top: 1px solid var(--line);
}
/* The card's rows are a <ul> inside `.cs-prose`, so undo the prose list
   styling (indent, spacing and the Challenge/Solution dot markers). The
   doubled `.cs-agent` outranks `.cs-block.is-solution .cs-prose li::before`. */
.cs-prose .cs-agent .cs-agent-rows {
  margin: 0;
  padding: 4px 16px;
}
.cs-prose .cs-agent .cs-agent-row {
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}
.cs-prose .cs-agent.cs-agent .cs-agent-row::before {
  content: none;
}
.cs-agent-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.cs-agent-label {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--ink);
}
.cs-agent-detail {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-muted);
}
.cs-agent-chip {
  flex: none;
  padding: 2px 9px;
  border-radius: var(--pill);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
  white-space: nowrap;
}
.cs-agent-chip--pos {
  color: var(--accent);
  background: var(--accent-mist);
}
.cs-agent-chip--warn {
  color: var(--amber-ink);
  background: var(--amber-soft);
}
.cs-agent-chip--info {
  color: var(--ink-soft);
  background: var(--paper-cool);
}
.cs-agent-bar {
  display: block;
  height: 6px;
  margin-top: 4px;
  border-radius: var(--pill);
  background: var(--paper-sunken);
  overflow: hidden;
}
.cs-agent-fill {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: var(--accent);
}
.cs-agent-fill--warn {
  background: var(--amber-ink);
}
.cs-agent-fill--info {
  background: var(--ink-subtle);
}
.cs-agent-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--accent-mist);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--accent);
}
/* ── Pacing + calls — <PacingCalls> ─────────────────────────────────────── */
/* Three pacing cards (one track each: filled to "now", a lighter run to the
   projected landing point, a tick at target) above the agent's calls. It keeps
   the figure bleed, since three cards need the width. */
.cs-agent.cs-pace {
  width: auto;
}
@media (min-width: 1240px) {
  .cs-agent.cs-pace {
    width: calc(100% + 96px);
    margin-left: -48px;
  }
}
.cs-pace-meta {
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-subtle);
}
/* One frame: a header with the replay button, the pacing cards, the calls. */
.cs-pace-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow:
    0 1px 2px rgba(14, 16, 20, 0.04),
    0 12px 32px -20px rgba(14, 16, 20, 0.18);
}
.cs-pace-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}
.cs-pace-title {
  flex: auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.cs-pace-replay {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--pill);
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
}
.cs-pace-replay:hover {
  background: var(--paper-sunken);
  color: var(--ink);
}
.cs-pace-replay:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
@media (prefers-reduced-motion: reduce) {
  .cs-pace-replay {
    visibility: hidden;
  }
}
.cs-pace-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
}
@media (min-width: 600px) {
  .cs-pace-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.cs-pace-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}
.cs-pace-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cs-pace-label {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--ink);
}
.cs-pace-value {
  margin: 10px 0 14px;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cs-pace-track {
  position: relative;
  height: 6px;
  border-radius: var(--pill);
  background: var(--paper-sunken);
}
.cs-pace-fill,
.cs-pace-ahead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
}
.cs-pace-fill {
  width: var(--now);
  background: var(--accent);
  z-index: 1;
}
.cs-pace-ahead {
  width: var(--proj2);
  background: var(--accent-soft);
}
.cs-pace-tick {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: var(--target);
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  z-index: 3;
}
.cs-pace-dot {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: var(--pill);
  border: 2px solid var(--paper);
  z-index: 2;
}
.cs-pace-dot--now {
  left: var(--now);
  background: var(--accent);
}
.cs-pace-dot--proj {
  left: var(--proj2);
  background: var(--p-on-dark);
}
/* Guardrails: no fill; a dotted link from now to the projection, and the
   side of the target that breaks the guardrail washed in amber (right of a
   ceiling like CAC, left of a floor like aMER). */
.cs-pace-track.is-max {
  background: linear-gradient(
    to right,
    var(--paper-sunken) var(--target),
    var(--amber-soft) var(--target)
  );
}
.cs-pace-track.is-min {
  background: linear-gradient(
    to right,
    var(--amber-soft) var(--target),
    var(--paper-sunken) var(--target)
  );
}
.cs-pace-track.is-guardrail .cs-pace-fill,
.cs-pace-track.is-guardrail .cs-pace-ahead {
  display: none;
}
.cs-pace-link {
  display: none;
}
.cs-pace-track.is-guardrail .cs-pace-link {
  display: block;
  position: absolute;
  top: 50%;
  left: var(--from2);
  width: var(--span2);
  border-top: 2px dotted var(--accent);
  margin-top: -1px;
  z-index: 1;
}
.cs-pace-card {
  position: relative;
}
.cs-pace-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-muted);
}
.cs-pace-legend b {
  font-weight: 600;
  color: var(--ink);
}
.cs-pace-key {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: var(--pill);
  background: var(--p-on-dark);
  vertical-align: 0;
}
.cs-pace-key--tick {
  width: 2px;
  height: 10px;
  border-radius: 0;
  background: var(--ink);
  vertical-align: -1px;
}
/* Calls: the Instant Hydration plan pattern. An action pill, the ad set and
   why, and an Approve button that turns into an Approved pill. */
.cs-pace-calls {
  border-top: 1px solid var(--line);
}
.cs-pace-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "act stat"
    "txt txt";
  align-items: center;
  gap: 8px 14px;
  padding: 12px 14px;
}
@media (min-width: 600px) {
  .cs-pace-row {
    grid-template-columns: 112px minmax(0, 1fr) auto;
    grid-template-areas: "act txt stat";
    padding: 12px 18px;
  }
}
.cs-pace-row + .cs-pace-row {
  border-top: 1px solid var(--line);
}
.cs-pace-act {
  grid-area: act;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--pill);
  background: var(--paper-sunken);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.cs-pace-row.is-pos .cs-pace-act {
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.cs-pace-txt {
  grid-area: txt;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 14px;
  line-height: 1.4;
}
.cs-pace-name {
  font-weight: 600;
  color: var(--ink);
}
.cs-pace-reason {
  font-size: 13px;
  color: var(--ink-muted);
}
/* Approve and Approved share one cell; the row flips once the figure is in
   view, one row after the other. Static: Approved only. */
.cs-pace-status {
  grid-area: stat;
  justify-self: end;
  display: inline-grid;
  align-items: center;
  justify-items: end;
}
.cs-pace-status > * {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  border-radius: var(--pill);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.cs-pace-approve {
  padding: 0 14px;
  background: var(--btn-fill);
  color: #fff;
  visibility: hidden;
}
.cs-pace-done {
  padding: 0 11px 0 9px;
  background: var(--accent-soft);
  color: var(--accent-deep);
}
/* Projected label: before/after values share a cell (static: after only). */
.cs-pace-swap {
  display: inline-grid;
}
.cs-pace-swap > * {
  grid-area: 1 / 1;
}
.cs-pace-chips {
  justify-items: end;
}
.cs-pace-before {
  visibility: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .cs-pace .cs-pace-card {
    opacity: 0;
    transform: translateY(6px);
    transition:
      opacity 0.5s var(--ease),
      transform 0.5s var(--ease);
    transition-delay: calc(var(--i) * 0.15s);
  }
  .cs-pace .cs-pace-fill,
  .cs-pace .cs-pace-ahead {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s var(--ease);
    transition-delay: calc(var(--i) * 0.15s + 0.3s);
  }
  .cs-pace .cs-pace-ahead {
    transition-delay: calc(var(--i) * 0.15s + 0.6s);
  }
  .cs-pace .cs-pace-dot,
  .cs-pace .cs-pace-tick,
  .cs-pace .cs-pace-link {
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    transition-delay: calc(var(--i) * 0.15s + 0.9s);
  }
  .cs-pace.is-in .cs-pace-card {
    opacity: 1;
    transform: none;
  }
  .cs-pace.is-in .cs-pace-fill,
  .cs-pace.is-in .cs-pace-ahead {
    transform: none;
  }
  .cs-pace.is-in .cs-pace-dot,
  .cs-pace.is-in .cs-pace-tick,
  .cs-pace.is-in .cs-pace-link {
    opacity: 1;
  }
  /* After the last approval, the projections move toward target. */
  .cs-pace .cs-pace-track .cs-pace-ahead {
    width: var(--proj);
    transition:
      transform 1s var(--ease) calc(var(--i) * 0.15s + 0.6s),
      width 0.9s var(--ease) 3.6s;
  }
  .cs-pace .cs-pace-track .cs-pace-dot--proj {
    left: var(--proj);
    transition:
      opacity 0.4s var(--ease) calc(var(--i) * 0.15s + 0.9s),
      left 0.9s var(--ease) 3.6s;
  }
  .cs-pace .cs-pace-track.is-guardrail .cs-pace-link {
    left: var(--from);
    width: var(--span);
    transition:
      opacity 0.4s var(--ease) calc(var(--i) * 0.15s + 0.9s),
      left 0.9s var(--ease) 3.6s,
      width 0.9s var(--ease) 3.6s;
  }
  .cs-pace.is-done .cs-pace-track .cs-pace-ahead {
    width: var(--proj2);
  }
  .cs-pace.is-done .cs-pace-track .cs-pace-dot--proj {
    left: var(--proj2);
  }
  .cs-pace.is-done .cs-pace-track.is-guardrail .cs-pace-link {
    left: var(--from2);
    width: var(--span2);
  }
  .cs-pace .cs-pace-before {
    visibility: visible;
    transition: opacity 0.3s var(--ease) 3.8s;
  }
  .cs-pace .cs-pace-after {
    opacity: 0;
    transition: opacity 0.3s var(--ease) 3.8s;
  }
  .cs-pace.is-done .cs-pace-before {
    opacity: 0;
  }
  .cs-pace.is-done .cs-pace-after {
    opacity: 1;
  }
  .cs-pace .cs-pace-approve {
    visibility: visible;
    transition:
      opacity 0.12s var(--ease),
      transform 0.25s var(--ease);
    transition-delay: calc(var(--j) * 0.7s + 1.4s);
  }
  .cs-pace .cs-pace-done {
    opacity: 0;
    transform: scale(0.9);
    transition:
      opacity 0.25s var(--ease),
      transform 0.25s var(--ease);
    transition-delay: calc(var(--j) * 0.7s + 1.52s);
  }
  .cs-pace.is-done .cs-pace-approve {
    opacity: 0;
    transform: scale(0.94);
  }
  .cs-pace.is-done .cs-pace-done {
    opacity: 1;
    transform: none;
  }
  /* The approve-and-move beat loops (the check runs every hour): the script
     drops `is-done` under `is-reset`, which snaps these back without
     animating, then adds `is-done` again to replay. The repeated class
     outranks every transition rule above without !important. */
  .cs-pace.is-reset.is-reset.is-reset .cs-pace-track *,
  .cs-pace.is-reset.is-reset.is-reset .cs-pace-status *,
  .cs-pace.is-reset.is-reset.is-reset .cs-pace-swap * {
    transition: none;
  }
}

/* Entrance: rows and footer rise in one by one, bars fill behind them. Only
   when motion is allowed and JS has marked the card in view; otherwise the
   card renders in its final state. */
@media (prefers-reduced-motion: no-preference) {
  .cs-agent .cs-agent-row,
  .cs-agent .cs-agent-foot {
    opacity: 0;
    transform: translateY(6px);
    transition:
      opacity 0.5s var(--ease),
      transform 0.5s var(--ease);
    transition-delay: calc(var(--i) * 0.35s + 0.15s);
  }
  .cs-agent .cs-agent-fill {
    width: 0;
    transition: width 1s var(--ease);
    transition-delay: calc(var(--i) * 0.35s + 0.35s);
  }
  .cs-agent.is-in .cs-agent-row,
  .cs-agent.is-in .cs-agent-foot {
    opacity: 1;
    transform: none;
  }
  .cs-agent.is-in .cs-agent-fill {
    width: var(--w);
  }
}

/* ── Launch flow — <LaunchFlow> ──────────────────────────────────────────── */
/* Four equal step cards, always left to right, joined by arrows. Every line
   in a card has a fixed height and truncates, so the cards keep one size
   while the run changes their text. Below the flow's min width it scrolls
   sideways inside the frame. While the script plays (`is-live`) links start
   grey and the working part lights up; without it the figure shows its
   final state. A card's `data-state` (idle / busy / done) drives its dot and
   glow. */
.cs-lf-scroll {
  position: relative;
  overflow-x: auto;
}
.cs-lf-flow {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr) 22px
    minmax(0, 1fr);
  min-width: 600px;
  padding: 16px;
}
.cs-lf-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 12px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  transition:
    border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}
.cs-lf-top {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 18px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
}
.cs-lf-doing {
  flex: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-lf-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
}
.cs-lf-cardhead {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 22px;
  margin: 8px 0 6px;
  padding-bottom: 8px;
  box-sizing: content-box;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.cs-lf-cardhead img,
.cs-lf-cardhead svg {
  flex: none;
  display: block;
  width: 18px;
  height: 18px;
}
.cs-lf-cardhead svg {
  color: var(--ink-muted);
}
img.cs-lf-mark {
  width: 20px;
  height: 20px;
}
.cs-lf-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 3px;
  height: 42px;
  margin: 0 -6px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: background 0.3s var(--ease);
}
.cs-lf-txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cs-lf-sub {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.35;
  color: var(--ink-muted);
}
.cs-lf-row--inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.cs-lf-row--src {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
}
.cs-lf-row--src img {
  flex: none;
  width: 14px;
  height: 14px;
}
.cs-lf-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-soft);
}
/* Airtable-style single-select pill: In review, Ready, Launched. */
.cs-lf-pill {
  flex: none;
  padding: 0 8px;
  border-radius: var(--pill);
  background: var(--amber-soft);
  color: var(--amber-ink);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 17px;
  white-space: nowrap;
}
.cs-lf-pill[data-pill="ready"] {
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.cs-lf-pill[data-pill="launched"] {
  background: var(--paper-cool);
  color: var(--ink-soft);
}
.cs-lf-chip {
  flex: none;
  padding: 0 6px;
  border-radius: var(--pill);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 17px;
  white-space: nowrap;
}
.cs-lf-chip--pos {
  background: var(--accent-mist);
  color: var(--accent);
}
.cs-lf-chip--warn {
  background: var(--amber-soft);
  color: var(--amber-ink);
}
.cs-lf-chip--info {
  background: var(--paper-cool);
  color: var(--ink-soft);
}
/* Arrow between cards, on the cards' centre line. */
.cs-lf-link {
  position: relative;
  color: var(--accent);
  transition: color 0.3s var(--ease);
}
.cs-lf-link::before {
  content: "";
  position: absolute;
  top: calc(50% - 1px);
  left: 3px;
  right: 3px;
  height: 2px;
  background: currentColor;
}
.cs-lf-link::after {
  content: "";
  position: absolute;
  top: calc(50% - 5px);
  right: 1px;
  border: 5px solid transparent;
  border-right: 0;
  border-left: 6px solid currentColor;
}
/* Card states: busy glows with a spinning ring, done fills the dot. */
.cs-lf-card[data-state="busy"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cs-lf-card[data-state="busy"] .cs-lf-doing {
  color: var(--accent-deep);
}
.cs-lf-card[data-state="busy"] .cs-lf-dot {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: cs-lf-spin 0.8s linear infinite;
}
.cs-lf-card[data-state="done"] .cs-lf-dot {
  border-color: var(--accent);
  background: var(--accent);
}
.cs-lf-row.is-on {
  background: var(--accent-mist);
}
@keyframes cs-lf-spin {
  to {
    transform: rotate(360deg);
  }
}
/* While the run plays: links grey until used. Hudson's approval pill (the
   <PacingCalls> one) is hidden, then Approve, then Approved. */
.cs-lf.is-live .cs-lf-link {
  color: var(--line-strong);
}
.cs-lf.is-live .cs-lf-link.is-on {
  color: var(--accent);
}

.cs-lf-row--approve {
  justify-content: center;
}
.cs-lf .cs-pace-status {
  justify-items: start;
}
.cs-lf [data-approval="none"] > *,
.cs-lf [data-approval="asking"] .cs-pace-done {
  visibility: hidden;
}
.cs-lf [data-approval="asking"] .cs-pace-approve {
  visibility: visible;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── Creative read — <CreativeRead> ──────────────────────────────────────── */
/* One concept as the agent reads it. Weight runs top-down: verdict badge and
   concept name, a light metrics strip (a weak step in amber), then the
   reasoning: muted thinking steps, why it worked, the iteration
   idea. The creative fills the left side (200px, full height) under an ad
   page bar; below 560px of figure width it sits on top. */
.cs-cr {
  container-type: inline-size;
}
.cs-cr-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow:
    0 1px 2px rgba(14, 16, 20, 0.04),
    0 12px 32px -20px rgba(14, 16, 20, 0.18);
}
@container (min-width: 560px) {
  .cs-cr-card {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}
.cs-cr-creative {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}
.cs-cr-adbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--paper);
}
.cs-cr-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
}
.cs-cr-avatar img {
  display: block;
  width: 20px;
  height: auto;
}
.cs-cr-brand {
  flex: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.cs-cr-brand b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.cs-cr-brand span {
  font-size: 10.5px;
  color: var(--ink-muted);
}
.cs-cr-more {
  flex: none;
  color: var(--ink-subtle);
}
.cs-cr-media {
  position: relative;
  flex: auto;
  min-height: 220px;
}
.cs-cr-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cs-cr-play {
  position: absolute;
  inset: 0;
  margin: auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--pill);
  background: rgba(14, 16, 20, 0.55);
  color: #fff;
}
.cs-cr-read {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 18px;
}
.cs-cr-concept {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.cs-cr-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-muted);
}
.cs-cr-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@container (min-width: 640px) {
  .cs-cr-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.cs-cr-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.cs-cr-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.cs-cr-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}
.cs-cr-value.is-weak {
  color: var(--amber-ink);
}

.cs-cr-side {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cs-cr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cs-cr-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px 0 8px;
  border-radius: var(--pill);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Reply in the shadcn/ui Reasoning style. The answer always holds its final
   height; the reasoning opens over that space, so the card never resizes. */
.cs-cr-reply {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cs-cr-trace {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--ink-muted);
  cursor: pointer;
}
.cs-cr-trace:hover {
  color: var(--ink);
}
.cs-cr-trace:focus {
  outline: none;
}
.cs-cr-trace:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-radius: 4px;
}
.cs-cr-chev {
  transition: transform 0.2s var(--ease);
}
.cs-cr.is-open .cs-cr-chev {
  transform: rotate(90deg);
}
.cs-cr-trace-body {
  position: absolute;
  top: 28px;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: none;
  overflow: auto;
  background: var(--paper);
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.cs-cr.is-open .cs-cr-trace-body {
  display: block;
}
/* While thinking, the title shimmers like chat tools do. */
.cs-cr.is-thinking .cs-cr-trace-title {
  background: linear-gradient(
    90deg,
    var(--ink-subtle) 0%,
    var(--ink-subtle) 35%,
    var(--ink) 50%,
    var(--ink-subtle) 65%,
    var(--ink-subtle) 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: cs-cr-shimmer 1.6s linear infinite;
}
@keyframes cs-cr-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -150% 0;
  }
}
.cs-cr-answer {
  position: relative;
}
.cs-cr-ghost,
.cs-cr-live {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.cs-cr-ghost b,
.cs-cr-live b {
  color: var(--ink);
  font-weight: 600;
}
.cs-cr-gap {
  display: block;
  height: 8px;
}
.cs-cr-ghost {
  visibility: hidden;
}
.cs-cr-live {
  position: absolute;
  inset: 0;
}

/* ── Lift result — <LiftResult> ──────────────────────────────────────────── */
/* One card that plays a lift test in place: setup rows (actual value, warning
   in amber, then struck through with the fix in green), experiment numbers
   that count up, and a result box that fills in green at the end. Every line
   is one line, so the card keeps its size. Shares head, label and metric
   styles with <CreativeRead>. */
.cs-lr {
  container-type: inline-size;
}
.cs-lr-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow:
    0 1px 2px rgba(14, 16, 20, 0.04),
    0 12px 32px -20px rgba(14, 16, 20, 0.18);
}
.cs-lr-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.cs-lr-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--paper-soft);
  font-size: 13px;
}
.cs-lr-rowlabel {
  color: var(--ink-muted);
}
.cs-lr-rowvalue {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
}
.cs-lr-old {
  display: none;
  font-weight: 500;
  color: var(--ink-subtle);
}
.cs-lr-row[data-state="fixed"] .cs-lr-old {
  display: inline;
}
.cs-lr-note {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 600;
}
.cs-lr-note [data-note] {
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-lr-ico {
  flex: none;
  display: none;
}
.cs-lr-row[data-state="issue"] .cs-lr-rowvalue,
.cs-lr-row[data-state="issue"] .cs-lr-note {
  color: var(--amber-ink);
}
.cs-lr-row[data-state="fixed"] [data-val] {
  color: var(--accent);
}
.cs-lr-row[data-state="issue"] .cs-lr-ico--issue {
  display: block;
}
.cs-lr-row[data-state="fixed"] .cs-lr-note {
  color: var(--accent);
}
.cs-lr-row[data-state="fixed"] .cs-lr-ico--fixed {
  display: block;
}
@container (max-width: 559px) {
  .cs-lr-row {
    grid-template-columns: 64px minmax(0, 1fr);
    height: auto;
    padding: 6px 10px;
  }
  .cs-lr-note {
    grid-column: 2;
  }
  /* No room for the struck-through old value next to the fix on a phone;
     the note under it already says what changed. */
  .cs-lr-row[data-state="fixed"] .cs-lr-old {
    display: none;
  }
}
.cs-lr-blockhead {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 16px;
}
.cs-lr-busy {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
}
.cs-lr[data-phase="analyzing"] .cs-lr-busy--analyze,
.cs-lr[data-phase="checking"] .cs-lr-busy--setup,
.cs-lr[data-phase="fixing"] .cs-lr-busy--setup,
.cs-lr[data-phase="running"] .cs-lr-busy--run {
  display: inline-flex;
}
.cs-lr-spin {
  animation: cs-lr-spin 0.9s linear infinite;
}
@keyframes cs-lr-spin {
  to {
    transform: rotate(360deg);
  }
}
.cs-lr-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 20px;
}
@container (min-width: 560px) {
  .cs-lr-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.cs-lr-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.cs-lr-outcome {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-md);
  background: var(--accent-mist);
}
.cs-lr-verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.cs-lr-big {
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  color: var(--accent-deep);
}
.cs-lr-wait {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: var(--ink-subtle);
}
.cs-lr[data-result="pending"] .cs-lr-outcome,
.cs-lr[data-result="collecting"] .cs-lr-outcome,
.cs-lr[data-result="measured"] .cs-lr-outcome {
  border-color: var(--line);
  background: var(--paper-soft);
}
.cs-lr[data-result="pending"] .cs-lr-outcome > :not(.cs-lr-wait),
.cs-lr[data-result="collecting"] .cs-lr-outcome > :not(.cs-lr-wait),
.cs-lr[data-result="measured"] .cs-lr-outcome > :not(.cs-lr-wait) {
  visibility: hidden;
}
.cs-lr[data-result="pending"] .cs-lr-wait,
.cs-lr[data-result="collecting"] .cs-lr-wait,
.cs-lr[data-result="measured"] .cs-lr-wait {
  display: flex;
}
.cs-lr-value {
  font-size: 18px;
  line-height: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.cs-lr[data-result="pending"] .cs-lr-value {
  color: var(--ink-subtle);
}
.cs-lr-ci {
  min-height: 16px;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.cs-lr[data-result="pending"] .cs-lr-ci,
.cs-lr[data-result="collecting"] .cs-lr-ci {
  visibility: hidden;
}

/* ── Pull quote — markdown `> …` inside a Prose block ────────────────────── */
/* Deliberately quieter than the centered `.cs-quote` band above the article:
   20px on a 2px accent rule, not 24–32px centered. Author convention is the
   quote paragraph(s) first, attribution as the last one (`> **Name**`), with a
   bare `>` separator line between them. */
.cs-prose blockquote {
  margin: 24px 0;
  padding-left: 22px;
  border-left: 2px solid var(--accent);
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cs-prose blockquote:last-child {
  margin-bottom: 0;
}
/* Attribution line. `:not(:only-child)` so a single-paragraph quote doesn't
   shrink itself. The name's <strong> already picks up 600/--ink from
   `.cs-prose strong`. */
.cs-prose blockquote p:last-child:not(:only-child) {
  margin-top: 14px;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--ink-muted);
}

/* ── Figure lightbox ─────────────────────────────────────────────────────── */
/* The overlay element is built by the script in Figure.astro, so it never gets
   Astro's scope attribute — these rules have to live in this page stylesheet
   rather than a scoped \3c style> block. z-index clears the nav's 50. */
.cs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(14, 16, 20, 0.86);
}
.cs-lightbox[hidden] {
  display: none;
}
/* Fits the viewport rather than showing the original at 1:1 — these are wide
   charts, and 100dvh keeps the mobile toolbars from clipping the bottom. */
.cs-lightbox-img {
  max-width: 100%;
  max-height: calc(100dvh - 96px);
  width: auto;
  height: auto;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 40px 80px -32px rgba(14, 16, 20, 0.6);
}
.cs-lightbox-cap {
  margin: 0;
  max-width: 900px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}
.cs-lightbox-cap[hidden] {
  display: none;
}
/* X drawn with a mask, matching how `.cs-tag::before` does its icon — no inline
   SVG needed in the script. */
.cs-lightbox-x {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.cs-lightbox-x::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: 0 auto;
  background: #fff;
  -webkit-mask: var(--cs-x-ico) center / contain no-repeat;
  mask: var(--cs-x-ico) center / contain no-repeat;
  --cs-x-ico: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M18%206%206%2018'/%3E%3Cpath%20d='m6%206%2012%2012'/%3E%3C/svg%3E");
}
.cs-lightbox-x:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}
/* Scroll lock while the overlay is up. */
.cs-lightbox-open {
  overflow: hidden;
}

/* Sidebar */
.cs-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-cool);
}
.cs-meta-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin-bottom: 5px;
}
/* `display: block` is what makes the declared 1.45 actually apply. As inline
   <span>s these values took their leading from the wrapper's strut (1.55 × 18px
   ≈ 28px) instead, so any value that wrapped to a second line rendered looser
   than its own line-height — and looser than a blockified sibling, which is
   visible as two different rhythms inside one field. */
.cs-meta-val {
  display: block;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
}
/* `painPoint` accepts `string | string[]` and SidebarMeta renders each array
   item as its own `.cs-meta-val`, so siblings need a gap; without one, two pain
   points run together mid-sentence. */
.cs-meta-val + .cs-meta-val {
  margin-top: 8px;
}
.cs-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cs-sidebar ul a {
  font-size: 14px;
  color: var(--accent);
  transition: color 0.2s var(--ease);
}
.cs-sidebar ul a:hover {
  color: var(--accent-deep);
}

/* ── Quote band ──────────────────────────────────────────────────────────── */
.cs-quote {
  border-top: 1px solid var(--line);
  background: transparent;
}
.cs-quote-inner {
  max-width: 820px;
  margin: 0 auto;
  padding-top: 64px;
  padding-bottom: 64px;
  text-align: center;
}
.cs-quote blockquote {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
}
.cs-quote-attr {
  margin-top: 28px;
  font-size: 15px;
  color: var(--ink-muted);
}
.cs-quote-attr b {
  color: var(--ink);
  font-weight: 600;
}

/* ── Converge setup diagram ──────────────────────────────────────────────── */
.cs-setup {
  padding-top: 8px;
  padding-bottom: 64px;
}
.cs-setup-title {
  margin: 0 0 22px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}
.cs-setup-canvas {
  background: var(--paper-cool);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  overflow: hidden;
}
.cs-setup-canvas svg {
  display: block;
  width: 100%;
  height: auto;
}
.cs-setup-rail {
  fill: none;
  stroke: var(--accent);
}
@keyframes cs-setup-sweep {
  from {
    x: -100%;
  }
  to {
    x: 100%;
  }
}
.cs-setup-sweep {
  animation: cs-setup-sweep 3s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .cs-setup-sweep {
    animation: none;
  }
}
.cs-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cs-node-tile {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 1px 2px rgba(14, 16, 20, 0.05);
}
.cs-node-tile img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.cs-node-tile.is-icon {
  border-radius: 999px;
  color: var(--accent);
}
.cs-node-tile.is-icon svg {
  width: 19px;
  height: 19px;
}
.cs-node-cap {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
}
.cs-node.is-text {
  height: 100%;
  justify-content: center;
}
.cs-node-orb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(14, 16, 20, 0.05);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .cs-quote-inner {
    padding-bottom: 8px;
  }
  body > section.cs-article::before {
    display: none;
  }
  .cs-article {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 8px;
  }
  .cs-sidebar {
    position: static;
    order: -1;
  }
  .cs-metrics {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .cs-hero {
    min-height: 520px;
  }
  .cs-hero-scrim {
    background: linear-gradient(
      180deg,
      rgba(14, 16, 20, 0.55) 0%,
      rgba(14, 16, 20, 0.45) 35%,
      rgba(14, 16, 20, 0.62) 65%,
      rgba(14, 16, 20, 0.9) 100%
    );
  }
  .cs-hero-title,
  .cs-metric-line,
  .cs-metric-det {
    text-shadow:
      0 1px 2px rgba(14, 16, 20, 0.45),
      0 2px 14px rgba(14, 16, 20, 0.35);
  }
  .cs-metric-det {
    color: rgba(255, 255, 255, 0.88);
  }
}
