:root {
  --ink: #22312c;
  --muted: #5b6d66;
  --quiet: #7d8f88;
  --line: #dce7e1;
  --soft: #f5f8f6;
  --paper: #ffffff;
  --blue: #2f6e5c;
  --teal: #3c7a68;
  --green: #13865b;
  --red: #c94835;
  --orange: #d97706;
  --violet: #6d5bd0;
  --amber-soft: #fff7e6;
  --green-soft: #ecf8f3;
  --blue-soft: #eef5f0;
  --sage: #8cada1;
  --forest: #2f403b;
  --content: min(1480px, calc(100vw - 36px));
  --shadow: 0 14px 34px rgba(47, 64, 59, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fbfcfd;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.paper-header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #eef5f0 100%);
}

.masthead {
  width: var(--content);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 82px) 0 24px;
  text-align: center;
}

.venue,
.eyebrow,
.cell-kicker {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.masthead h1 {
  max-width: 1100px;
  margin: 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 5.2vw, 72px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: 0;
}

.subtitle {
  max-width: 900px;
  margin: 18px auto 0;
  color: #2f3c49;
  font-size: clamp(18px, 2.1vw, 25px);
}

.author-line,
.affiliation-line {
  max-width: 940px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 16px;
}

.affiliation-line {
  margin-top: 6px;
  font-size: 14px;
}

.resource-row,
.page-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.resource-row {
  margin-top: 24px;
}

.page-nav {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(223, 230, 238, 0.9);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.page-nav a {
  text-decoration: none;
}

.page-nav a:hover {
  color: var(--ink);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid #cbd6e2;
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 750;
  text-decoration: none;
}

.button.primary {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.page-shell {
  width: var(--content);
  margin: 0 auto;
}

.paper-section {
  padding: clamp(28px, 4vw, 48px) 0;
  border-bottom: 1px solid rgba(223, 230, 238, 0.92);
}

.section-head {
  max-width: 920px;
  margin-bottom: 16px;
}

.section-head.centered {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.section-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(23px, 2.3vw, 32px);
  line-height: 1.12;
  letter-spacing: 0;
}

.section-head p:not(.eyebrow),
.lead {
  max-width: 850px;
  color: var(--muted);
  font-size: 15px;
}

.section-head.centered p:not(.eyebrow),
.section-head.centered .lead {
  margin-right: auto;
  margin-left: auto;
}

.metric-grid,
.story-grid,
.visual-grid,
.mini-cell-grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 14px;
}

.story-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.visual-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

.summary-grid {
  margin-top: 4px;
}

.metric-card,
.story-card,
.viz-cell {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 132px;
  padding: 16px;
}

.metric-value {
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1;
  font-weight: 850;
}

.metric-label {
  margin-top: 8px;
  font-weight: 780;
}

.metric-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.story-card {
  padding: 16px;
}

.story-card h3,
.viz-cell h3 {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.2;
}

.story-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.story-card .models {
  margin-top: 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 760;
}

.viz-cell {
  grid-column: span 4;
  padding: 13px;
  overflow: hidden;
}

.viz-cell.wide {
  grid-column: span 8;
}

.viz-cell.half {
  grid-column: span 6;
}

.cell-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.cell-note {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.cell-kicker {
  margin-bottom: 5px;
  font-size: 11px;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 0 0 16px;
}

.control-row.compact {
  gap: 10px;
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 740;
}

label.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: var(--ink);
  font-size: 14px;
}

select,
input[type="search"] {
  min-width: 190px;
  height: 40px;
  border: 1px solid #c6d2df;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.chart-box {
  width: 100%;
  min-height: 320px;
}

.chart-box.large {
  min-height: 420px;
}

svg {
  display: block;
  width: 100%;
  height: auto;
}

.axis text,
.chart-note {
  fill: var(--muted);
  font-size: 12px;
}

.axis line,
.axis path,
.grid-line {
  stroke: #cddcd3;
  stroke-width: 1;
}

.zero-line {
  stroke: #8ba39a;
  stroke-dasharray: 4 4;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th,
td {
  padding: 5px 7px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--forest);
  font-size: 11px;
  text-transform: uppercase;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 96px repeat(var(--heatmap-cols, 6), minmax(48px, 1fr));
  gap: 4px;
  align-items: stretch;
  overflow-x: auto;
}

.heatmap-cell,
.heatmap-label {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 740;
  text-align: center;
}

.heatmap-label {
  color: var(--muted);
  background: var(--blue-soft);
}

.heatmap-cell {
  color: #1f2b26;
}

.heatmap-cell.is-sparse {
  color: var(--quiet);
  background-image: repeating-linear-gradient(135deg, rgba(140, 173, 161, 0.35) 0, rgba(140, 173, 161, 0.35) 1px, transparent 1px, transparent 6px);
}

.rank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  margin-top: 12px;
}

.rank-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.rank-number {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.list-bars,
.delta-list,
.pair-list,
.mini-cell-grid {
  display: grid;
  gap: 6px;
}

.list-row,
.delta-row,
.group-row {
  display: grid;
  gap: 9px;
  align-items: center;
}

.list-row {
  grid-template-columns: minmax(112px, 170px) 1fr 78px;
}

.delta-row {
  grid-template-columns: minmax(170px, 250px) 1fr 76px;
}

.group-row {
  grid-template-columns: minmax(95px, 140px) 1fr 66px;
}

.concept-name,
.list-label,
.pair-label {
  color: var(--ink);
  font-weight: 760;
  line-height: 1.22;
}

.concept-meta,
.list-meta,
.pair-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.bar-track {
  position: relative;
  height: 20px;
  border-radius: 6px;
  background: var(--blue-soft);
  overflow: hidden;
}

.bar-track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(47, 64, 59, 0.28);
}

.delta-bar,
.value-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 4px;
}

.delta-bar.rising {
  left: 50%;
  background: var(--blue);
}

.delta-bar.falling {
  right: 50%;
  background: var(--orange);
}

.value-bar {
  left: 0;
  background: var(--blue);
}

.delta-value,
.list-value,
.group-value {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 820;
  text-align: right;
}

.sentiment-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.sentiment-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7d8995;
}

.sentiment-dot.positive {
  background: var(--green);
}

.sentiment-dot.neutral,
.sentiment-dot.mixed {
  background: #7d8995;
}

.sentiment-dot.negative {
  background: var(--red);
}

.profile-stat,
.mini-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.profile-stat strong,
.mini-stat strong {
  font-size: 17px;
}

.profile-note {
  margin-top: 14px;
  color: var(--muted);
}

.mini-cell-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-tile {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.mini-value {
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.mini-label {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.concept-bank-row {
  display: grid;
  grid-template-columns: minmax(170px, 260px) 1fr 110px;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.concept-bank-row strong {
  display: block;
  line-height: 1.25;
}

.concept-bank-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.meta-cell-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.meta-cell {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.meta-cell strong {
  line-height: 1.25;
}

.scroll-cap {
  max-height: 620px;
  overflow: auto;
  border-top: 1px solid #e6ecf2;
  padding-top: 10px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: var(--content);
  margin: 0 auto;
  padding: 28px 0 34px;
  color: var(--muted);
  background: #fbfcfd;
}

.site-footer a {
  font-weight: 750;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .story-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viz-cell,
  .viz-cell.wide,
  .viz-cell.half {
    grid-column: span 6;
  }
}

@media (max-width: 820px) {
  :root {
    --content: min(100vw - 24px, 1480px);
  }

  .masthead {
    padding-top: 34px;
  }

  .metric-grid,
  .story-grid,
  .mini-cell-grid,
  .rank-list {
    grid-template-columns: 1fr;
  }

  .viz-cell,
  .viz-cell.wide,
  .viz-cell.half {
    grid-column: 1 / -1;
  }

  .cell-head {
    display: block;
  }

  .cell-note {
    display: block;
    margin-top: 5px;
  }

  .list-row,
  .delta-row,
  .group-row,
  .concept-bank-row {
    grid-template-columns: 1fr;
  }

  .delta-value,
  .list-value,
  .group-value {
    text-align: left;
  }

  .heatmap-grid {
    grid-template-columns: 78px repeat(var(--heatmap-cols, 6), minmax(44px, 1fr));
  }

  select,
  input[type="search"] {
    width: 100%;
    min-width: 0;
  }

  label {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .resource-row,
  .page-nav {
    justify-content: stretch;
  }

  .resource-row .button,
  .page-nav a {
    flex: 1 1 auto;
  }

  .metric-card,
  .story-card,
  .viz-cell {
    padding: 13px;
  }

  .chart-box {
    min-height: 260px;
  }
}


/* Dense dashboard refinements */
body {
  font-size: 14px;
}

:root {
  --content: min(1540px, calc(100vw - 32px));
}

.masthead {
  padding-top: clamp(32px, 5vw, 62px);
}

.paper-section {
  padding: clamp(34px, 5vw, 62px) 0;
}

.section-head {
  margin-bottom: 18px;
}

.section-head p:not(.eyebrow),
.lead {
  font-size: 15px;
}

.metric-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.metric-card,
.story-card,
.viz-cell {
  box-shadow: 0 8px 20px rgba(24, 32, 42, 0.06);
}

.metric-card {
  min-height: 104px;
  padding: 12px;
  text-decoration: none;
  cursor: pointer;
}

.metric-card:hover,
.story-card:hover,
.story-card.active {
  border-color: #8fb2d8;
  box-shadow: 0 12px 26px rgba(40, 100, 176, 0.13);
}

.metric-value {
  font-size: clamp(22px, 2.8vw, 34px);
}

.metric-label {
  font-size: 13px;
}

.metric-note {
  font-size: 11px;
}

.story-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.story-card {
  width: 100%;
  padding: 13px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.story-card h3,
.viz-cell h3 {
  font-size: 15px;
}

.story-card p {
  font-size: 12px;
}

.visual-grid {
  gap: 12px;
}

.viz-cell {
  padding: 13px;
}

.viz-cell.full-width-cell {
  grid-column: 1 / -1;
}

.full-span {
  width: 100%;
}

.summary-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  gap: 12px;
  align-items: stretch;
}

.summary-workbench > .viz-cell {
  /* Override the generic .viz-cell{grid-column:span 4} rule (meant for the
     12-column .visual-grid layout) which otherwise forces this 2-column
     grid to push the item onto its own row, leaving column 2 empty. */
  grid-column: auto;
  display: flex;
  flex-direction: column;
}

.stacked-column {
  display: grid;
  gap: 12px;
}

.summary-control {
  justify-content: center;
}

.chart-box.compact-chart {
  min-height: 265px;
}

.chart-box.small-chart {
  min-height: 285px;
}

.line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e6ecf2;
}

.line-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 730;
}

.line-swatch {
  width: 18px;
  height: 3px;
  border-radius: 99px;
  background: #2f6e5c;
}

.delta-list.two-sided {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.delta-group-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.delta-row.compact-delta {
  grid-template-columns: minmax(135px, 220px) 1fr 62px;
  gap: 8px;
}

.delta-row.compact-delta .concept-meta {
  font-size: 11px;
}

#summary-release-deltas {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.delta-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.delta-list.micro {
  gap: 4px;
}

.delta-row.micro-delta {
  grid-template-columns: minmax(0, 1fr) 108px 42px;
  gap: 7px;
  font-size: 12px;
  line-height: 1.15;
}

.delta-row.micro-delta .bar-track {
  height: 15px;
  border-radius: 4px;
}

.delta-row.micro-delta .concept-meta {
  display: none;
}

.delta-row.micro-delta .delta-value {
  font-size: 11.5px;
}

.tooltip-note {
  color: var(--quiet);
  font-size: 11px;
}

.heatmap-grid {
  font-size: 10px;
}

.heatmap-cell,
.heatmap-label {
  min-height: 34px;
  font-size: 10px;
}

.concept-bank-list,
.annotation-list {
  max-height: 620px;
  overflow: auto;
  border-top: 1px solid #e6ecf2;
}

.concept-bank-row {
  grid-template-columns: minmax(170px, 250px) minmax(240px, 1fr) 90px 100px;
  padding: 9px 0;
}

.annotation-row {
  display: grid;
  grid-template-columns: minmax(190px, 300px) 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.annotation-row strong,
.concept-bank-row strong {
  font-size: 13px;
}

.annotation-row p,
.concept-bank-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.data-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid #d8e1ea;
  border-radius: 999px;
  color: #465565;
  background: #f7fafc;
  font-size: 10px;
  font-weight: 760;
}

.paper-focus {
  color: var(--blue);
  font-weight: 800;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-workbench {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .story-grid {
    grid-template-columns: 1fr;
  }

  .delta-list.two-sided {
    grid-template-columns: 1fr;
  }

  .annotation-row,
  .concept-bank-row {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Guided story (scrollytelling) styles
   ══════════════════════════════════════════════════════════════════ */

.story-shell {
  background: linear-gradient(180deg, #f8fbf8 0%, #ffffff 60%);
  border-bottom: 1px solid var(--line);
}

.story-intro {
  width: var(--content);
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) 0 8px;
  text-align: center;
}

.story-intro h2 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3.4vw, 40px);
  color: var(--forest);
}

.story-intro p {
  color: var(--muted);
  font-size: 17px;
  margin: 0 auto 10px;
  max-width: 720px;
}

.scroll-hint {
  margin: 26px auto 8px;
  color: var(--sage);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.scroll-hint::after {
  content: "";
  display: block;
  width: 1px;
  height: 42px;
  margin: 10px auto 0;
  background: linear-gradient(180deg, var(--sage), transparent);
}

.story-chapter {
  position: relative;
  width: var(--content);
  margin: 0 auto;
  padding: clamp(30px, 4vw, 56px) 0;
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: clamp(20px, 3vw, 48px);
  align-items: start;
}

.story-chapter + .story-chapter {
  border-top: 1px dashed var(--line);
}

.chapter-steps {
  display: flex;
  flex-direction: column;
  gap: 46vh;
  padding: 18vh 0 30vh;
}

.chapter-kicker {
  color: var(--teal);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.story-step {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sage);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 8px 22px rgba(47, 64, 59, 0.06);
  opacity: 0.45;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}

.story-step.active {
  opacity: 1;
  transform: none;
  border-left-color: var(--blue);
}

.story-step h3 {
  margin: 0 0 8px;
  font-size: 19px;
  color: var(--forest);
}

.story-step p {
  margin: 0;
  color: #41544c;
  font-size: 15.5px;
  line-height: 1.62;
}

.story-step .step-stat {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--blue);
  font-weight: 700;
  font-size: 13.5px;
}

.chapter-sticky {
  position: sticky;
  top: 6vh;
  align-self: start;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chapter-viz-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 20px 14px;
}

.chapter-viz-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.chapter-viz-head h4 {
  margin: 0;
  font-size: 16px;
  color: var(--forest);
}

.chapter-viz-head .viz-note {
  color: var(--quiet);
  font-size: 12.5px;
}

.chapter-stage {
  position: relative;
  width: 100%;
}

.stage-view {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
  position: absolute;
  inset: 0;
  z-index: 1;
}

.stage-view.visible {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s ease;
  z-index: 2;
  background: var(--paper);
}

.stage-view svg {
  display: block;
  width: 100%;
  height: auto;
}

.delta-readout {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.delta-chip {
  flex: 1 1 130px;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.delta-chip .chip-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.delta-chip .chip-value {
  font-size: 21px;
  font-weight: 800;
  margin-top: 2px;
}

.delta-chip.pos .chip-value { color: var(--green); }
.delta-chip.neg .chip-value { color: var(--red); }
.delta-chip.vol .chip-value { color: var(--blue); }
.delta-chip .chip-sub { font-size: 12px; color: var(--quiet); margin-top: 2px; }

.story-concept-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.3s ease;
}

.story-concept-row:hover { background: var(--soft); }

.story-concept-row.dimmed { opacity: 0.32; }

.story-concept-row.highlighted {
  background: var(--green-soft);
  outline: 1px solid rgba(47, 110, 92, 0.35);
}

.story-concept-name {
  flex: 0 0 205px;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-concept-track {
  flex: 1;
  position: relative;
  height: 16px;
}

.story-concept-track .zero-line {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: var(--line);
}

.story-concept-bar {
  position: absolute;
  top: 2px;
  height: 12px;
  border-radius: 6px;
}

.story-concept-value {
  flex: 0 0 76px;
  text-align: right;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.story-concept-value.rising { color: var(--blue); }
.story-concept-value.falling { color: var(--orange); }

.concept-prompt-pin {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--soft);
  border: 1px dashed var(--sage);
  border-radius: 10px;
  color: #41544c;
  font-size: 13.5px;
  line-height: 1.55;
}

.concept-prompt-pin strong { color: var(--forest); }

.story-tooltip {
  position: fixed;
  z-index: 60;
  max-width: 300px;
  padding: 10px 13px;
  background: var(--forest);
  color: #f0f6f2;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  box-shadow: 0 10px 26px rgba(24, 38, 32, 0.35);
}

.story-tooltip.visible { opacity: 1; transform: none; }

.story-tooltip .tip-title { font-weight: 800; margin-bottom: 3px; }
.story-tooltip .tip-sub { color: #b9cfc4; font-size: 12px; }

.lessons-band {
  width: var(--content);
  margin: 0 auto;
  padding: clamp(38px, 5vw, 64px) 0;
}

.lessons-band h2 {
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--forest);
  font-size: clamp(24px, 3vw, 34px);
  margin: 0 0 8px;
}

.lessons-band > p {
  text-align: center;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 30px;
}

.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.lesson-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--sage);
  border-radius: 12px;
  padding: 18px 18px 16px;
  box-shadow: 0 8px 20px rgba(47, 64, 59, 0.05);
}

.lesson-card h3 { margin: 0 0 8px; font-size: 16px; color: var(--forest); }
.lesson-card p { margin: 0; color: #41544c; font-size: 14px; line-height: 1.58; }
.lesson-card .lesson-evidence {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--teal);
  font-weight: 700;
}

.appendix-divider {
  width: var(--content);
  margin: 0 auto;
  padding: clamp(30px, 4vw, 48px) 0 8px;
  text-align: center;
}

.appendix-divider h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--forest);
  font-size: clamp(24px, 3vw, 34px);
  margin: 0 0 8px;
}

.appendix-divider p { color: var(--muted); max-width: 700px; margin: 0 auto; }

.appendix-loading {
  text-align: center;
  color: var(--quiet);
  padding: 22px 0 8px;
  font-size: 14px;
}

@media (max-width: 900px) {
  .story-chapter {
    grid-template-columns: 1fr;
  }
  .chapter-sticky {
    position: relative;
    top: 0;
    min-height: 0;
    order: -1;
  }
  .chapter-steps {
    gap: 26px;
    padding: 10px 0 20px;
  }
  .story-step { opacity: 1; transform: none; }
  .story-concept-name { flex-basis: 130px; }
}

.updated-banner {
  width: 100%;
  padding: 6px 12px;
  text-align: center;
  background: var(--forest);
  color: #eaf3ee;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════════════════════════════════════════
   Appendix navigation: sticky sub-navbar + intra-section widget TOC
   ══════════════════════════════════════════════════════════════════ */

.paper-section {
  scroll-margin-top: 96px;
}

.appendix-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.appendix-nav[hidden] {
  display: none;
}

.appendix-nav-inner {
  width: var(--content);
  margin: 0 auto;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 0;
}

.appendix-nav-inner::-webkit-scrollbar {
  display: none;
}

.appendix-nav a {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 740;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.appendix-nav a:hover {
  background: var(--soft);
  color: var(--ink);
}

.appendix-nav a.is-current {
  background: var(--green-soft);
  color: var(--blue);
}

.widget-toc {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 35;
  width: 186px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  font-size: 12px;
}

.widget-toc[hidden] {
  display: none;
}

.widget-toc-toggle {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: none;
  color: var(--quiet);
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  padding: 3px;
}

.widget-toc-toggle:hover {
  color: var(--ink);
}

.widget-toc-title {
  margin: 0 22px 6px 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal);
}

.widget-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.widget-toc.is-collapsed .widget-toc-title,
.widget-toc.is-collapsed .widget-toc-list {
  display: none;
}

.widget-toc-list a {
  display: block;
  padding: 4px 6px;
  border-radius: 5px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.25;
}

.widget-toc-list a:hover {
  background: var(--soft);
  color: var(--ink);
}

.widget-toc-list a.is-current {
  background: var(--green-soft);
  color: var(--blue);
  font-weight: 780;
}

@media (max-width: 1400px) {
  .widget-toc {
    display: none;
  }
}

@media (max-width: 820px) {
  .appendix-nav-inner {
    width: calc(100vw - 24px);
  }
}

/* Masthead author / affiliation links */
.author-line {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.author-line a.author,
.affiliation-line a.affiliation {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(47, 110, 92, 0.28);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.author-line a.author:hover,
.affiliation-line a.affiliation:hover {
  color: var(--forest);
  border-bottom-color: var(--forest);
}
