/* ==========================================================================
   fig-profits — corporate profits as a share of GDP, against the paper's
   predicted range. Colour logic: the firm side of the ledger is --c-nominal,
   the paper's prediction is --c-accent, the old normal is --c-muted.
   ========================================================================== */

.readout--profits { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }

/* ---- the line ------------------------------------------------------------ */

.profits__line { stroke: var(--c-nominal); stroke-width: 2.4px; }

/* ---- period levels ------------------------------------------------------- */

.profits__level {
  stroke-width: 2.5px;
  shape-rendering: crispEdges;
  stroke-linecap: butt;
}
.profits__level-ghost {
  stroke-width: 1px;
  stroke-dasharray: 2 4;
  opacity: .5;
  shape-rendering: crispEdges;
}
.profits__level.is-pre,
.profits__level-ghost.is-pre { stroke: var(--c-muted); }
.profits__level.is-post,
.profits__level-ghost.is-post { stroke: var(--c-loss); }

/* the level captions sit over a busy line on narrow screens; a halo in the
   card colour keeps them readable without a boxed background */
.profits__level-label,
.profits__band-label,
.profits__band-sub,
.profits__rise-label {
  paint-order: stroke fill;
  stroke: var(--card);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}
.profits__level-label { font-size: 12.5px; }
.profits__level-label.is-pre { fill: var(--ink-2); }
.profits__level-label.is-post { fill: var(--c-loss); }

/* ---- the predicted band -------------------------------------------------- */

.profits__band { fill: var(--c-accent); opacity: .14; }
.profits__band-edge {
  stroke: var(--c-accent);
  stroke-width: 1;
  stroke-dasharray: 5 4;
  opacity: .75;
}
.profits__band-label {
  fill: var(--c-accent);
  font-size: 11.5px;
  font-weight: 620;
}
.profits__band-sub { fill: var(--ink-3); }

/* ---- the measured rise --------------------------------------------------- */

.profits__rise {
  stroke: var(--ink);
  stroke-width: 1.4px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.profits__rise-label { fill: var(--ink); font-size: 13px; }

.sw-marker.profits__jump line { stroke: var(--ink-3); stroke-dasharray: 4 4; }
.sw-marker.profits__jump text { fill: var(--ink-2); }

/* ---- cursor -------------------------------------------------------------- */

.profits__cursor {
  stroke: var(--ink-3);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.profits__cursor-dot {
  fill: var(--c-nominal);
  stroke: var(--card);
  stroke-width: 2;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.sw-layer--cursor.is-on .profits__cursor,
.sw-layer--cursor.is-on .profits__cursor-dot { opacity: 1; }

/* ---- the arithmetic behind the prediction -------------------------------- */

.profits__check {
  margin-top: var(--sp-5);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-md);
  background: var(--paper-2);
}
.band--dark .profits__check { background: color-mix(in srgb, var(--dark-3) 55%, transparent); }

.profits__eq {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .5rem .9rem;
  font-family: var(--font-ui);
}
.profits__step {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  min-width: 0;
}
.profits__term {
  display: grid;
  gap: .1rem;
  min-width: 0;
  flex: 0 1 auto;
}
.profits__term b {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 620;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-num;
  line-height: 1.15;
  color: var(--ink);
}
.profits__term small {
  font-size: var(--fs-micro);
  line-height: 1.3;
  color: var(--ink-3);
  max-width: 11rem;
}
.profits__term.is-pred b { color: var(--c-accent); }
.profits__op {
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--ink-3);
  padding-top: .05rem;
}

.profits__verdict {
  margin: var(--sp-3) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--rule-soft);
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.profits__verdict b {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 640;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-num;
  color: var(--c-loss);
}

/* ---- the authors' caveat, on the figure and not under it ----------------- */

.profits__caveat {
  margin: var(--sp-4) 0 0;
  padding-left: var(--sp-4);
  border-left: 3px solid var(--c-accent);
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}
.profits__caveat-key {
  display: block;
  font-size: var(--fs-micro);
  font-weight: 620;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: .2rem;
}

@media (max-width: 700px) {
  .profits__check { padding: var(--sp-3); }
  /* one step per line: the arithmetic reads down instead of wrapping mid-term */
  .profits__eq { display: grid; grid-template-columns: 1fr; gap: .6rem; }
  .profits__step { align-items: baseline; }
  .profits__op { width: .8rem; text-align: center; flex: none; }
  .profits__step:first-child { padding-left: 1.35rem; }
  .profits__term small { max-width: none; }
}
