/* Design and interactive figures for introducing-behaviorgpt-v4.html, ported
   from the unboxai.com/behaviorgpt page (homepage repo: client/behaviorgpt.css).
   Page styles are scoped under body.launch and figure styles under .bgpt, so
   the rest of the research blog is unaffected. The language-vs-behavior figure
   lays out against its own width (container queries), not the viewport,
   because it sits in a narrower column here. */

/* ===== Page ===== */
body.launch {
  --ink: #1a1a1a;
  --ink-2: #3f4147;
  --body-ink: #2b2d31;
  --muted: #6b7280;
  --faint: #9aa0aa;
  --line: #e7e8ec;
  --subtle: #fafbfc;
  --accent: #2f72e6;
  --sans: "Oxygen", "Source Sans Pro", Calibri, Arial, sans-serif;
  --mono: "Oxygen Mono", "SFMono-Regular", Menlo, monospace;
  counter-reset: fig;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.launch h1, .launch h2, .launch h3, .launch h4,
.launch p, .launch li, .launch .caption { font-family: var(--sans); }
.launch .outer-container, .launch .main-container { background: #fff; }
.launch .main-container p,
.launch .main-container li { font-size: 1.0625rem; line-height: 1.75; color: var(--body-ink); }
.launch .main-container p a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(47, 114, 230, 0.45);
  text-underline-offset: 3px;
}
.launch .main-container p a:hover { text-decoration-color: var(--accent); }
.launch b, .launch strong { font-weight: 700; color: var(--ink); }

.launch figure { counter-increment: fig; margin: 0; }
.launch figure > figcaption.caption {
  max-width: 680px;
  margin: 16px auto 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #4b5058;
  text-align: left;
}
@media (max-width: 600px) {
  .launch figure > figcaption.caption { font-size: 0.875rem; }
}
.launch figure > figcaption::before {
  content: "Figure " counter(fig) ". ";
  font-weight: 700;
  color: var(--ink-2);
}
.launch .fig-block { margin: 36px 0 40px; }

/* Hero: the homepage's faint dot grid, fading out down the header. */
.launch .hero-bg { position: relative; background: #fff; overflow: hidden; }
.launch .hero-dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(26, 26, 26, 0.075) 1px, transparent 1.6px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}
.launch .hero-bg > :not(.hero-dots) { position: relative; z-index: 1; }
.launch .post-navbar { background: transparent !important; border-bottom: 0; padding: 14px 0; }
.launch .post-navbar .navbar-brand,
.launch .post-navbar .nav-back { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-2); text-decoration: none; }
.launch .post-navbar .nav-back:hover { color: var(--ink); }
.launch .post-navbar .container { padding-left: 20px; padding-right: 20px; }
.launch .nowrap { white-space: nowrap; }

.launch .post-header { padding: 56px 0 0; }
.launch .eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.launch .post-header h1 {
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.launch .post-sub {
  max-width: 560px;
  margin: 16px auto 0;
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--muted);
}
.launch .post-meta { margin-top: 18px; font-family: var(--mono); font-size: 0.75rem; color: var(--faint); }
.launch .post-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 26px 0 44px; }
.launch .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 999px;
  background: #eeeeee;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: background-color 0.18s ease;
}
.launch .pill:hover, .launch .pill:focus { background: #e2e2e2; color: var(--ink); text-decoration: none; }
.launch .pill-dark { background: #131313; color: #fff; }
.launch .pill-dark:hover, .launch .pill-dark:focus { background: #333; color: #fff; }
.launch .arr { display: inline-block; transition: transform 0.18s ease; }
.launch .pill:hover .arr, .launch a.cta-card:hover .arr { transform: translateX(4px); }
@media (max-width: 640px) { .launch .pill { min-height: 44px; } }

.launch .lead-pitch {
  max-width: 640px;
  margin: 12px auto 0;
  font-weight: 300;
  font-size: 1.25rem !important;
  line-height: 1.6 !important;
  text-align: center;
  color: var(--ink-2) !important;
}

.launch .stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 40px 0 36px; }
.launch .stat-tile { padding: 18px 18px 16px; background: var(--subtle); border: 1px solid var(--line); border-radius: 12px; }
.launch .stat-tile .num { font-family: var(--mono); font-size: 1.9rem; line-height: 1; color: var(--ink); }
.launch .stat-tile .lbl { margin-top: 10px; font-size: 0.8125rem; line-height: 1.4; color: var(--muted); }
@media (max-width: 600px) { .launch .stat-tiles { grid-template-columns: repeat(2, 1fr); } }

.launch .key-results {
  margin: 32px 0 8px;
  padding: 22px 26px 12px;
  background: var(--subtle);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.launch .key-results ul { list-style: none; margin: 0; padding: 0; }
.launch .key-results li { position: relative; padding-left: 20px; margin: 0 0 12px; font-size: 1rem; line-height: 1.6; }
.launch .key-results li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* Sections: a blue mono eyebrow over a mono title, separated by space. */
.launch .eyebrow.sec { margin-top: 96px; }
.launch .main-container h2 {
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(1.45rem, 3.4vw, 1.8rem);
  line-height: 1.22;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 20px;
}
.launch h3.result { font-weight: 700; font-size: 1.2rem; line-height: 1.35; color: var(--ink); margin: 2.4em 0 0.55em; }
.launch .main-container ol { padding-left: 1.3em; }
.launch .main-container ol li { margin-bottom: 6px; }

.launch figure.wide { width: min(1140px, 94vw); position: relative; left: 50%; transform: translateX(-50%); }
.launch figure.wide.hero-fig { width: min(1080px, 94vw); }
.launch figure.wide.chart-fig { width: min(920px, 94vw); }
/* The every-method table has 14 columns, so it gets the full width. */
.launch figure.wide.chart-fig.table-fig { width: min(1140px, 94vw); }

.launch .fig-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 600px) {
  .launch .fig-pair { grid-template-columns: 1fr; }
}
.launch .fig-pair a, .launch figure a.img-link { display: block; }
.launch .screenshot {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.06);
}
.launch .sublabel {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
}

.launch .table-scroll { overflow-x: auto; margin: 22px 0 10px; }
.launch table.ab { width: 100%; border-collapse: collapse; }
.launch table.ab th, .launch table.ab td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.launch table.ab thead th {
  border-bottom: 1px solid #cfd3da;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.launch table.ab td { font-size: 0.9375rem; line-height: 1.45; color: var(--body-ink); }
.launch table.ab td.gain, .launch table.ab th.gain { text-align: right; white-space: nowrap; }
.launch table.ab td.gain { font-family: var(--mono); color: var(--accent); }
.launch table.ab tbody tr:hover td { background: var(--subtle); }
.launch .main-container p.table-note { font-size: 0.8125rem; line-height: 1.6; color: var(--muted); }
@media (max-width: 600px) {
  .launch table.ab th, .launch table.ab td { padding: 9px 6px; }
  .launch table.ab td { font-size: 0.82rem; }
  .launch table.ab td.gain { white-space: normal; }
}

.launch .cta-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0 8px; }
@media (max-width: 600px) { .launch .cta-row { grid-template-columns: 1fr; } }
.launch a.cta-card {
  display: block;
  padding: 18px 20px 20px;
  background: var(--subtle);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}
.launch a.cta-card:hover { border-color: #cfd3da; background: #fff; transform: translateY(-2px); text-decoration: none; }
.launch .cta-title { font-family: var(--mono); font-size: 0.9375rem; color: var(--ink); }
.launch .cta-desc { margin-top: 8px; font-size: 0.8125rem; line-height: 1.5; color: var(--muted); }

/* Citation, as the homepage's light code window. */
.launch .terminal {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fbfbfc;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}
.launch .terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: #f1f2f5;
  border-bottom: 1px solid var(--line);
}
.launch .terminal-dot { width: 9px; height: 9px; border-radius: 50%; }
.launch .terminal-dot:nth-child(1) { background: #ec6a5e; }
.launch .terminal-dot:nth-child(2) { background: #f4bf4f; }
.launch .terminal-dot:nth-child(3) { background: #61c554; }
.launch .terminal-title { margin-left: 8px; font-family: var(--mono); font-size: 0.6875rem; color: var(--muted); }
.launch .terminal-copy {
  margin-left: auto;
  padding: 2px 8px;
  border: 0;
  border-radius: 5px;
  background: none;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
  cursor: pointer;
}
.launch .terminal-copy:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.launch .terminal-body {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.55;
  color: #383a42;
  white-space: pre;
}
.launch .terminal-body code { font-family: inherit; color: inherit; }

.launch .site-footer { margin-top: 96px; padding: 28px 0; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 0.75rem; color: var(--faint); }

/* ===== Figures ===== */
.bgpt {
  --font-sans: "Oxygen", "Source Sans Pro", Calibri, Arial, sans-serif;
  --font-mono: "Oxygen Mono", "SFMono-Regular", Consolas, Menlo, monospace;
  --fs-2xs: 0.625rem;
  --fs-xs: 0.6875rem;
  --fs-sm: 0.8125rem;
  --fs-md: 1rem;

  --text: #1a1a1a;
  --text-secondary: #3f4147;
  --text-muted: #6b7280;
  --text-faint: #9aa0aa;
  --bg-subtle: #fafbfc;
  --border: #e7e8ec;
  --black: #131313;

  --accent: #2f72e6;
  --blue-dark: #16266c;   --blue-pastel: #d7effb;
  --orange-dark: #6b3d14; --orange-bright: #e2893c; --orange-pastel: #f7e4cd;
  --green-dark: #2f6b1e;  --green-pastel: #daf3cc;
  --purple-dark: #3d1e8e; --purple-pastel: #e6ddf7;

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-io: cubic-bezier(0.45, 0, 0.2, 1);
  --t-reveal: 0.65s;
}
.bgpt li { margin-top: 0; font-family: inherit; }
.bgpt ol { margin-bottom: 0; }

/* ===== Language vs behavior ===== */
.lob-wrap { container-type: inline-size; }
.lob {
  padding: 26px 30px 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  text-align: left;
}
.lob-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px 224px;
  grid-template-areas: "head head head" "main arrow panel";
  align-items: center;
  gap: 12px 14px;
}
.lob-row--beh {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.lob-head { grid-area: head; display: flex; align-items: baseline; gap: 10px; }
.lob-head b { font-family: var(--font-sans); font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.lob-head span { font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--text-muted); }
.lob-tokens, .lob-beh { grid-area: main; }
.lob-row > .lob-arrow { grid-area: arrow; }
.lob-panel { grid-area: panel; }
.lob-row--beh > .lob-arrow { visibility: hidden; }

.lob-seq { list-style: none; margin: 0; padding: 0; }
.lob-tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.lob-tokens li {
  padding: 5px 9px;
  border: 1px solid #d6d8dc;
  border-radius: 6px;
  background: #f4f4f5;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  white-space: nowrap;
}
.lob-tokens .lob-q { border: 1.5px dashed var(--text-faint); background: #fff; font-weight: 700; color: var(--text-muted); }

.lob-beh { position: relative; }
.lob-events {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  width: 87%;
}
.lob-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding-bottom: 9px;
  border: 1px solid #d6d8dc;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  text-align: center;
}
.lob-card img { display: block; width: 100%; height: auto; aspect-ratio: 316 / 200; object-fit: cover; margin: 0; }
.lob-card small {
  margin-top: 7px;
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.lob-card b { font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 700; color: var(--text); line-height: 1.3; }
.lob-chip {
  display: inline-block;
  margin-top: 5px;
  max-width: calc(100% - 6px);
  padding: 2px 5px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.lob-chip--text  { color: var(--blue-dark); background: var(--blue-pastel); }
.lob-chip--price { color: var(--orange-dark); background: var(--orange-pastel); }
.lob-chip--place { color: var(--green-dark); background: var(--green-pastel); }
.lob-chip--time  { color: var(--purple-dark); background: var(--purple-pastel); }
.lob-chip--meta  { color: var(--text-secondary); background: #eceef1; }
.lob-date { display: none; }

.lob-timeline {
  position: relative;
  height: 30px;
  margin-top: 36px;
  border-top: 1px solid #cfd2d7;
}
.lob-month {
  position: absolute;
  left: var(--x);
  top: 7px;
  padding-left: 3px;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.lob-month::before {
  content: '';
  position: absolute;
  left: 0;
  top: -10px;
  width: 1px;
  height: 7px;
  background: #cfd2d7;
}
.lob-dot {
  position: absolute;
  left: var(--x);
  top: -5px;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: var(--text-secondary);
}
.lob-holiday {
  position: absolute;
  left: var(--x);
  top: 7px;
  transform: translateX(-50%);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--orange-bright);
}
.lob-holiday::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -12px;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  background: var(--orange-bright);
  transform: rotate(45deg);
}
.lob-leaders {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.lob-leaders line { stroke: #d3d6db; stroke-width: 1; }

.lob-now {
  position: absolute;
  left: var(--x);
  right: -68px;
  top: 0;
  bottom: 30px;
}
.lob-now::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-left: 1.5px dashed var(--accent);
}
.lob-now::after {
  content: '';
  position: absolute;
  left: -5px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: var(--accent);
}
.lob-now-label {
  position: absolute;
  left: 7px;
  top: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.2;
  color: var(--accent);
}
.lob-now-arrow {
  position: absolute;
  left: 0;
  right: 0;
  top: 42%;
  height: 1.5px;
  background: var(--accent);
}
.lob-now-arrow::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -4px;
  border: 4.75px solid transparent;
  border-left: 7px solid var(--accent);
  border-right: 0;
}
.lob-now-m { display: none; }

.lob-arrow {
  position: relative;
  height: 1px;
  background: var(--text-faint);
  transform-origin: left center;
}
.lob-arrow::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -4px;
  border: 4.5px solid transparent;
  border-left: 7px solid var(--text-faint);
  border-right: 0;
}

.lob-panel {
  --c: var(--text-secondary);
  padding: 12px 12px 10px;
  border: 1px solid #d5dee6;
  border-radius: 12px;
  background: #f7f9fb;
}
.lob-panel--beh { --c: var(--accent); }
.lob-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 2px 8px; }
.lob-panel-head b { font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 700; color: var(--c); }
.lob-badge {
  padding: 2px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--c);
  white-space: nowrap;
}
.lob-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lob-rank li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 5px 6px;
  border-radius: 8px;
}
.lob-rank--thumbs li { grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; }
.lob-rank img { display: block; width: 40px; height: 40px; margin: 0; border-radius: 6px; border: 1px solid #d5d5d5; object-fit: cover; }
.lob-rank-name { display: block; font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lob-bar { display: block; height: 4px; margin-top: 5px; border-radius: 2px; background: #e4e8ec; overflow: hidden; }
.lob-bar i { display: block; height: 100%; width: var(--w); background: #c3c8d0; }
.lob-rank-p { font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lob-rank .is-top .lob-rank-name { font-weight: 700; color: var(--text); }
.lob-rank--thumbs .lob-rank-name { white-space: normal; line-height: 1.25; }
.lob-rank .is-top .lob-bar i { background: var(--c); }
.lob-rank .is-top .lob-rank-p { font-weight: 700; color: var(--c); }
.lob-panel--beh .is-top { background: color-mix(in srgb, var(--accent) 9%, transparent); }

.lob-foot { display: flex; justify-content: center; min-height: 32px; margin-top: 8px; }
.lob-replay {
  border: none;
  background: none;
  padding: 4px 8px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--accent);
  cursor: pointer;
}
.lob-replay:hover { text-decoration: underline; }
.lob-replay[hidden] { display: none; }

/* Playback: hidden until .is-on, with no transitions while hidden so a
   replay snaps back instead of un-staggering. */
.lob--anim .lob-tokens li,
.lob--anim .lob-events li,
.lob--anim .lob-dot,
.lob--anim .lob-leaders line,
.lob--anim .lob-now,
.lob--anim .lob-now-m,
.lob--anim .lob-arrow,
.lob--anim .lob-panel {
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.lob--anim .lob-bar i { transition: width 0.55s var(--ease-out); }
.lob--anim .lob-tokens li { transition-delay: calc(var(--i) * 70ms); }
.lob--anim .lob-row--lang .lob-arrow { transition-delay: 0.95s; }
.lob--anim .lob-row--lang .lob-panel { transition-delay: 1.05s; }
.lob--anim .lob-row--lang .lob-bar i { transition-delay: calc(1.2s + var(--i) * 120ms); }
.lob--anim .lob-events li { transition-delay: calc(1.7s + var(--i) * 240ms); }
.lob--anim .lob-dot,
.lob--anim .lob-leaders line { transition-delay: calc(1.8s + var(--i) * 240ms); }
.lob--anim .lob-now,
.lob--anim .lob-now-m,
.lob--anim .lob-row--beh .lob-arrow { transition-delay: 3.2s; }
.lob--anim .lob-row--beh .lob-panel { transition-delay: 3.4s; }
.lob--anim .lob-row--beh .lob-bar i { transition-delay: calc(3.55s + var(--i) * 150ms); }
.lob--anim:not(.is-on) .lob-tokens li,
.lob--anim:not(.is-on) .lob-events li,
.lob--anim:not(.is-on) .lob-dot,
.lob--anim:not(.is-on) .lob-leaders line,
.lob--anim:not(.is-on) .lob-now,
.lob--anim:not(.is-on) .lob-now-m,
.lob--anim:not(.is-on) .lob-arrow,
.lob--anim:not(.is-on) .lob-panel { opacity: 0; transition: none; }
.lob--anim:not(.is-on) .lob-tokens li { transform: translateY(6px); }
.lob--anim:not(.is-on) .lob-events li { transform: translateY(8px); }
.lob--anim:not(.is-on) .lob-arrow { transform: scaleX(0); }
.lob--anim:not(.is-on) .lob-bar i { width: 0; transition: none; }

/* Stacked: sequence, a down arrow, then the panel. */
@container (max-width: 950px) {
  .lob { padding: 22px 20px; }
  .lob-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "main" "arrow" "panel"; }
  .lob-row > .lob-arrow { justify-self: center; width: 1px; height: 22px; transform-origin: top center; }
  .lob-row--beh > .lob-arrow { visibility: visible; background: var(--accent); }
  .lob-row > .lob-arrow::after { right: auto; left: -4px; top: auto; bottom: -1px; border: 4.5px solid transparent; border-top: 7px solid var(--text-faint); border-bottom: 0; }
  .lob-row--beh > .lob-arrow::after { border-top-color: var(--accent); }
  .lob--anim:not(.is-on) .lob-arrow { transform: scaleY(0); }
  .lob-panel { justify-self: center; width: min(100%, 340px); }
  .lob-now { right: 0; }
  .lob-now-arrow { display: none; }
  .lob-holiday { transform: translateX(calc(-100% + 4px)); }
  .lob-holiday::before { left: auto; right: 0; margin-left: 0; }
}
/* Narrow: cards in a 3x2 grid, each with its date; the calendar is dropped. */
@container (max-width: 600px) {
  .lob-events { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
  .lob-card b { font-size: var(--fs-xs); }
  .lob-chip { font-size: var(--fs-2xs); }
  .lob-date { display: block; margin-top: 4px; font-family: var(--font-sans); font-size: var(--fs-2xs); color: var(--text-muted); }
  .lob-timeline, .lob-leaders, .lob-now { display: none; }
  .lob-now-m {
    display: block;
    margin: 12px 0 0;
    text-align: center;
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
  }
}

/* ===== Results charts ===== */
.rs-stage {
  position: relative;
  padding: 18px 18px 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}
.rs-plot { width: 100%; min-height: 300px; }
.rs-svg { display: block; overflow: visible; margin: 0; }
.rs-svg text { font-family: var(--font-sans); }
.rs-grid line { stroke: #eef0f3; stroke-width: 1; }
.rs-tick { font-size: 11.5px; fill: var(--text-faint); }
.rs-axis { font-size: 12px; fill: var(--text-muted); }
.rs-head { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--text-muted); }
.rs-strip { fill: var(--bg-subtle); }
.rs-ref { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 5 4; opacity: 0.6; }
.rs-ref-label { font-size: 11.5px; fill: var(--accent); }
.rs-rule { stroke: #b9bec7; stroke-width: 1.3; stroke-dasharray: 2 3; }
.rs-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rs-hit { fill: none; stroke: transparent; stroke-width: 12; pointer-events: stroke; }
.rs-note { font-size: 11.5px; }
.rs-end { font-size: 12.5px; }
.rs-end.is-bold, .rs-pt-label.is-bold { font-weight: 700; }
.rs-band { fill: var(--accent); fill-opacity: 0.08; }
.rs-step--base { fill: none; stroke: #9aa0aa; stroke-width: 1.3; stroke-dasharray: 5 3; }
.rs-ann { color: var(--text-secondary); }
.rs-ann line { stroke: currentColor; stroke-width: 1.1; }
.rs-ann-big { font-size: 20px; fill: var(--text); }
.rs-ann-text { font-size: 12px; fill: var(--text-secondary); }
.rs-pt-label { font-size: 11.5px; }
.rs-dot, .rs-pt { cursor: default; }

/* Draw-in when the chart first comes into view. */
.rs-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.rs-fade { opacity: 0; }
.rs-stage.is-drawn .rs-draw {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.4s var(--ease-io);
}
.rs-stage.is-drawn .rs-fade {
  opacity: 1;
  transition: opacity var(--t-reveal) var(--ease-out) 0.5s;
}
@media (prefers-reduced-motion: reduce) {
  .rs-draw { stroke-dashoffset: 0; }
  .rs-fade { opacity: 1; }
  .rs-stage.is-drawn .rs-draw,
  .rs-stage.is-drawn .rs-fade { transition: none; }
}

/* Every method on every dataset: a heatmap table whose cells fade in row by
   row on first view. Scrolls sideways on narrow screens, method column pinned. */
.rk-cell { opacity: 0; }
.rs-stage.is-drawn .rk-cell {
  opacity: 1;
  transition: opacity 0.4s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 22ms);
}
@media (prefers-reduced-motion: reduce) {
  .rk-cell { opacity: 1; }
  .rs-stage.is-drawn .rk-cell { transition: none; }
}
.rk-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rk {
  border-collapse: separate;
  border-spacing: 3px;
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.rk th { font-weight: 400; }
.rk-groups th span {
  display: block;
  padding-bottom: 6px;
  border-bottom: 1px solid #e4e6ea;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rk-cols th {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  padding: 6px 0 8px;
  vertical-align: bottom;
  line-height: 1.25;
  color: var(--text-muted);
  font-size: 10px;
  hyphens: manual;
}
.rk-cols th.rk-name, .rk-cols th.rk-med { width: auto; min-width: 0; max-width: none; }
.rk .rk-name {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  text-align: right;
  white-space: nowrap;
  padding-right: 10px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
}
.rk tr.is-ours .rk-name { font-weight: 700; color: var(--text); }
.rk-tag {
  display: inline-block;
  min-width: 1.4em;
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  text-align: center;
}
.rk-cell {
  height: 30px;
  border-radius: 5px;
  background: var(--cell, #fff);
  text-align: center;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.rk-cell.is-dark { color: #fff; }
.rk .rk-gap { width: 8px; min-width: 8px; max-width: 8px; padding: 0; }
.rk .rk-med {
  padding-left: 6px;
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.rk tr.is-ours .rk-med { font-weight: 700; color: var(--accent); }
@media (max-width: 600px) {
  .rk .rk-name {
    white-space: normal;
    min-width: 112px;
    max-width: 124px;
    font-size: var(--fs-xs);
    line-height: 1.25;
  }
}

.rs-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  transform: translateY(-100%);
  max-width: 280px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--black);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  line-height: 1.4;
}
.rs-tip[hidden] { display: none; }

@media (max-width: 600px) {
  .rs-stage { padding: 12px 8px 4px; }
}

/* ===== Milk: description vs behavior similarity ===== */
/* Each panel plays in order: clusters, items, the solid link, the dashed link,
   then what the model sees. The right panel starts after the left (--p). */
.milk { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 10px 8px 14px; }
.milk-panel { --p: 0; min-width: 0; }
.milk-panel + .milk-panel { --p: 1; }
.milk-head b { display: block; font-family: var(--font-sans); font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.milk-head span { display: block; margin-top: 2px; font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--text-muted); }
.milk-svg { display: block; width: 100%; height: auto; margin: 10px 0 0; overflow: visible; }
.milk-svg text { font-family: var(--font-sans); }
.mk-cluster ellipse { fill: #f3f4f6; stroke: #dfe1e5; stroke-width: 1; }
.mk-cluster text { font-size: 13px; font-style: italic; fill: var(--text-muted); }
.mk-pt circle { fill: #b9bdc4; }
.mk-pt text { font-size: 13px; fill: var(--text-secondary); }
.mk-pt.is-key circle { stroke: #fff; stroke-width: 2; }
.mk-pt.is-key text { font-size: 15px; font-weight: 700; }
.mk-pt--milk circle { fill: #2b2d31; }
.mk-pt--milk text { fill: #2b2d31; }
.mk-pt--lf circle { fill: var(--accent); }
.mk-pt--lf text { fill: var(--accent); }
.mk-pt--gf circle { fill: #d27c12; }
.mk-pt--gf text { fill: #c06f0c; }
.mk-link { fill: none; stroke: #2b2d31; stroke-width: 2.6; stroke-linecap: round; }
.mk-link--dash { stroke: #9aa0aa; stroke-width: 1.6; stroke-dasharray: 5 4; }
.mk-tag { font-size: 13px; fill: var(--text-secondary); paint-order: stroke; stroke: #fff; stroke-width: 6px; stroke-linejoin: round; }
.mk-tag--dash { fill: var(--text-muted); }

.milk-sees { margin-top: 14px; }
.milk-sees-label { display: block; margin-bottom: 8px; font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--text-muted); }
.milk-quote {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-style: italic;
  text-align: center;
  color: var(--text-secondary);
}
.milk-seq { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.mchip {
  padding: 6px 12px;
  border: 1px solid #d6d8dc;
  border-radius: 8px;
  background: #fff;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}
.mchip--lf { border-color: var(--accent); background: var(--accent); color: #fff; }
.mchip--gf { border-color: #d27c12; background: #d27c12; color: #fff; }
.marr { width: 18px; height: 1px; background: var(--text-faint); position: relative; }
.marr::after { content: ''; position: absolute; right: -1px; top: -4px; border: 4.5px solid transparent; border-left: 6px solid var(--text-faint); border-right: 0; }

.milk [data-item] { transition: opacity 0.2s var(--ease-out); }
.milk.has-hl [data-item]:not(.is-hl) { opacity: 0.28; }

.milk--anim .mk-cluster,
.milk--anim .mk-pt,
.milk--anim .mk-tag,
.milk--anim .mk-link--dash,
.milk--anim .milk-sees,
.milk--anim .mchip,
.milk--anim .marr { opacity: 0; }
.milk--anim .mk-link--solid { stroke-dasharray: 1; stroke-dashoffset: 1; }
.milk--anim .mk-pt { transform: scale(0.4); transform-box: fill-box; transform-origin: center; }
.is-drawn .milk--anim .mk-cluster { opacity: 1; transition: opacity 0.5s var(--ease-out) calc(var(--p) * 1.6s + var(--i, 0) * 120ms); }
.is-drawn .milk--anim .mk-pt { opacity: 1; transform: none; transition: opacity 0.35s var(--ease-out), transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); transition-delay: calc(var(--p) * 1.6s + 0.3s + var(--i) * 55ms); }
.is-drawn .milk--anim .mk-link--solid { stroke-dashoffset: 0; transition: stroke-dashoffset 0.5s var(--ease-io) calc(var(--p) * 1.6s + 0.85s); }
.is-drawn .milk--anim .mk-link--dash { opacity: 1; transition: opacity 0.5s var(--ease-out) calc(var(--p) * 1.6s + 1.15s); }
.is-drawn .milk--anim .mk-tag { opacity: 1; transition: opacity 0.4s var(--ease-out) calc(var(--p) * 1.6s + 1s + var(--i, 0) * 250ms); }
.is-drawn .milk--anim .milk-sees { opacity: 1; transition: opacity 0.4s var(--ease-out) calc(var(--p) * 1.6s + 1.3s); }
.is-drawn .milk--anim .mchip,
.is-drawn .milk--anim .marr { opacity: 1; transition: opacity 0.35s var(--ease-out) calc(var(--p) * 1.6s + 1.4s + var(--i) * 140ms); }
.milk-panel .milk-sees, .milk-panel .mchip, .milk-panel .marr { --i: 0; }

@media (max-width: 680px) {
  .milk { grid-template-columns: 1fr; gap: 34px; }
  .milk-panel + .milk-panel { --p: 0; }
  .mk-cluster text, .mk-pt text, .mk-tag { font-size: 15px; }
  .mk-pt.is-key text { font-size: 17px; }
}

/* ===== Breadth: one checkpoint against the best baseline, every cell ===== */
.bx-wrap { max-width: 700px; margin: 0 auto; padding: 6px 4px 8px; }
.bx-title { margin-bottom: 14px; font-family: var(--font-sans); font-size: var(--fs-md); font-weight: 700; text-align: center; color: var(--text); }
.bx {
  display: grid;
  grid-template-columns: minmax(84px, max-content) repeat(5, minmax(0, 1fr));
  gap: 3px;
  align-items: stretch;
}
.bx-col {
  align-self: end;
  padding-bottom: 4px;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  line-height: 1.25;
  text-align: center;
  color: var(--text-secondary);
}
.bx-band {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding-bottom: 3px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.bx-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.2;
  text-align: right;
  color: var(--text);
}
.bx-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 5px;
  background: var(--cell);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  cursor: default;
}
.bx-cell.is-dark { color: #fff; }
.bx-cell.is-absent { background: #f5f6f8; cursor: auto; }
.bx-cell:not(.is-absent):hover { outline: 2px solid var(--text); outline-offset: 1px; z-index: 1; }
.bx-paycol { align-self: end; padding: 8px 0 4px; font-family: var(--font-sans); font-size: var(--fs-xs); text-align: center; color: var(--text-secondary); }

.bx-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 20px; }
.bx-scale { flex: 1 1 280px; max-width: 400px; }
.bx-scale-bar { height: 8px; border-radius: 4px; }
.bx-scale-ticks { position: relative; height: 16px; margin-top: 4px; }
.bx-scale-ticks span { position: absolute; transform: translateX(-50%); font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.bx-scale-ticks span:first-child { transform: none; }
.bx-scale-ticks span:last-child { transform: translateX(-100%); }
.bx-key { display: flex; align-items: center; gap: 7px; font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--text-muted); }
.bx-key i { width: 16px; height: 12px; border-radius: 3px; background: #f5f6f8; border: 1px solid #e3e5e9; }

.bx--anim .bx-cell { opacity: 0; transform: scale(0.7); }
.is-drawn .bx--anim .bx-cell {
  opacity: 1;
  transform: none;
  transition: opacity 0.35s var(--ease-out), transform 0.45s var(--ease-out);
  transition-delay: calc(var(--d) * 40ms);
}

@media (max-width: 560px) {
  .bx { grid-template-columns: minmax(70px, max-content) repeat(5, minmax(0, 1fr)); gap: 2px; }
  .bx-row { padding-right: 6px; font-size: var(--fs-xs); }
  .bx-cell { min-height: 30px; font-size: 0.66rem; border-radius: 4px; }
  .bx-col { font-size: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .milk--anim *, .bx--anim .bx-cell { transition: none !important; }
}
