:root {
  --series-ink: #18212f;
  --series-muted: #5d6877;
  --series-paper: #fbfaf6;
  --series-line: #d8dde6;
  --series-blue: #235f9e;
  --series-gold: #b0820f;
  --series-gold-soft: #fff1bd;
  --series-purple: #7862b2;
  --series-green: #4f8f62;
  --series-rust: #b05f3b;
  --series-nuisance: #6aaed6;
  --series-nuisance-soft: #e7f4fb;
}

/* Shared mathematical notation. KaTeX is vendored locally, so these remain
   available from file:// and without a network connection. */
[data-tex] {
  font-family: KaTeX_Main, "Times New Roman", serif;
  letter-spacing: 0;
  text-transform: none;
}

[data-tex]:not([data-tex-display]) {
  display: inline-block;
  line-height: 1;
  /* The inline-block's baseline is KaTeX's own baseline, so no offset is needed:
     any nudge here shifts every formula below the surrounding text. */
  vertical-align: baseline;
}

/* Labels inside SVG figures were positioned with the earlier nudge in place; keep them put. */
.svg-katex-label > [data-tex]:not([data-tex-display]) {
  vertical-align: -0.08em;
}

/* Added by the typesetter around a formula and the punctuation that follows it. */
.tex-keep { white-space: nowrap; }

/* Set by series-shell.js on figure boxes that overflow sideways. */
.is-scrollable { box-shadow: inset -18px 0 18px -18px rgba(35, 95, 158, 0.45); }
.scroll-hint { margin: 6px 0 0; color: #235f9e; font-size: 0.74rem; font-weight: 800; }
[data-scroll-access]:focus-visible { outline: 3px solid #235f9e; outline-offset: 2px; }
.series-live-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.blog-state-notice { padding: .7rem 1rem; border-left: 3px solid #b05f3b; background: #fff5ef; color: #6b3421; overflow-wrap: anywhere; }
.blog-state-host { position: relative; }
/* Background restore status must not move the reading position when it clears. */
.blog-state-notice[data-failed="false"] { position: absolute; inset: 0 0 auto; z-index: 12; margin: 0; pointer-events: none; }
[data-blog-share-status] { font-size: .85rem; overflow-wrap: anywhere; }
[data-blog-share-status]:empty { display: none; }

/* Darker text in the same chart colors; drawn curves keep their original palette. */
svg text[fill="#4f8f62"], svg text[style*="#4f8f62"] { fill: #386944 !important; }
svg text[fill="#c69218"], svg text[style*="#c69218"], svg text[fill="#b98712"], svg text[fill="#b0820f"], svg text[style*="#b0820f"] { fill: #886214 !important; }
svg text[fill="#b05f3b"], svg text[style*="#b05f3b"] { fill: #944b2c !important; }
svg text[fill="#617084"], svg text[fill="#6f8fa3"] { fill: #526070 !important; }
.function-legend > span[style*="#c77d2b"] { color: #98591c !important; }
.function-legend > span[style*="#c77d2b"] > .line-key { color: #c77d2b; }
.function-legend > span[style*="#c69218"], .function-legend > span[style*="#b0820f"] { color: #886214 !important; }
.function-legend > span[style*="#c69218"] > .line-key, .function-legend > span[style*="#b0820f"] > .line-key { color: #b0820f; }

[data-tex][data-tex-display] {
  display: block;
  max-width: 100%;
  margin: 0.85rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.14rem 0 0.24rem;
}

[data-tex] .katex {
  font-size: 1em;
}

[data-tex][data-tex-display] .katex-display {
  margin: 0;
  text-align: left;
}

.math-hero [data-tex] .katex,
.window-formula[data-tex] .katex,
.theorem-badge .big[data-tex] .katex {
  font-size: inherit;
}

/* Legacy formula classes once supplied their own Times/Unicode typesetting.
   When KaTeX is present, let it own the metrics instead. */
.equation[data-tex],
.mx[data-tex] {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  white-space: normal;
}

.equation[data-tex] .katex,
.mx[data-tex] .katex {
  font-size: 1em;
}

.svg-katex-label {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  color: var(--series-muted);
  font: 700 13px/1.15 ui-sans-serif, system-ui, sans-serif;
}

.svg-katex-label.center { text-align: center; }
.svg-katex-label.right { text-align: right; }
.svg-katex-label.ink { color: var(--series-ink); }
.svg-katex-label.purple { color: var(--series-purple); }
.svg-katex-label.rust { color: var(--series-rust); }
.svg-katex-label.green { color: var(--series-green); }
.svg-katex-label .katex { font-size: 1.02em; }
.svg-katex-label .math-prefix {
  margin-right: 0.32em;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-style: normal;
}

.svg-math-inline {
  font-family: KaTeX_Math, KaTeX_Main, "Times New Roman", serif !important;
  font-size: 1.08em;
  font-style: italic;
  font-weight: 400;
}

.math-typeset-error {
  text-decoration: underline wavy #a23b45;
  text-decoration-thickness: 1px;
}

@media (max-width: 640px) {
  [data-tex][data-tex-display] .katex { font-size: 0.96em; }
}

.explainer-link {
  color: inherit;
  font-weight: 650;
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-color: var(--series-blue);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

.explainer-link:hover,
.explainer-link:focus-visible {
  color: var(--series-blue);
  text-decoration-style: solid;
}

.series-rail {
  position: relative;
  z-index: 40;
  color: var(--series-ink);
  background: rgba(251, 250, 246, 0.97);
  border-bottom: 1px solid var(--series-line);
}

/* The rail also appears on pages without the articles' global box-sizing reset. */
.series-rail, .series-rail *, .series-rail *::before, .series-rail *::after {
  box-sizing: border-box;
}

/* Actual controls make overflow discoverable even when a platform hides scrollbars.
   Keep the original scroller intact for native focus and article navigation. */
.nav-scroll-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  max-width: 1180px;
  margin: 2px auto 0;
  padding: 0 10px 4px;
  box-sizing: border-box;
  flex: 0 0 100%;
}
.nav-scroll-controls[hidden] { display: none; }
.nav-scroll-controls button {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #b8cadb;
  border-radius: 5px;
  background: #fff;
  color: var(--series-blue);
  font: 750 12px/1.5 system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.nav-scroll-controls button[aria-disabled="true"] { color: #647182; border-color: transparent; cursor: default; }
.nav-scroll-controls button:focus-visible { outline: 3px solid var(--series-blue); outline-offset: 1px; }
.series-rail-inner.has-nav-overflow { flex-wrap: wrap; row-gap: 0; }
.series-rail-inner.has-nav-overflow > .series-links { flex-basis: calc(100% - 190px); }
.act-nav > .nav-scroll-controls { width: min(1180px, calc(100% - 40px)); }
.act-nav > .nav-scroll-controls.has-gold-thread { justify-content: space-between; gap: 4px; padding-inline: 0; }
.act-nav > .nav-scroll-controls.has-gold-thread > button { padding-inline: 6px; }
.act-nav > .nav-scroll-controls.has-gold-thread > .gold-route-toggle { display: block; margin: 0; border: 1px solid var(--gold, #c69218); border-radius: 5px; background: var(--gold-soft, #fff1bd); }
.act-nav > .nav-scroll-controls.has-gold-thread > .gold-route-toggle strong { font: inherit; }
.act-nav > .nav-scroll-controls.has-gold-thread > .gold-route-toggle small { display: none; }
.context-local-nav > .nav-scroll-controls { width: min(1120px, calc(100% - 40px)); }
.sensor-part-nav-frame { position: sticky; top: 0; z-index: 30; margin: 24px 0; background: rgba(251,250,246,.98); }
.sensor-part-nav-frame > .sensor-part-nav { position: static; margin: 0; }

.series-rail-inner {
  width: min(1180px, calc(100vw - 40px));
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.series-brand {
  flex: 0 0 auto;
  color: var(--series-ink);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.series-links {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 4px;
  overflow: visible;
  min-width: 0;
  flex: 1 1 auto;
}

.series-links a {
  position: relative;
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 11px;
  color: var(--series-muted);
  font-size: 0.875rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.series-links a:hover,
.series-links a:focus-visible {
  color: var(--series-blue);
}

.series-links a[aria-current="page"] {
  color: var(--series-ink);
}

.series-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 11px;
  bottom: 0;
  left: 11px;
  height: 3px;
  background: var(--series-gold);
}

.series-page-hero {
  padding: 68px 0 54px;
  color: var(--series-ink);
  background:
    linear-gradient(135deg, rgba(231, 244, 251, 0.9), rgba(255, 241, 189, 0.62)),
    var(--series-paper);
  border-bottom: 1px solid var(--series-line);
}

.series-page-hero .series-hero-inner {
  width: min(980px, calc(100vw - 40px));
  margin: 0 auto;
}

.series-page-hero h1 {
  max-width: 900px;
  margin-top: 14px;
  font-size: clamp(2.8rem, 7vw, 6.2rem);
}

.series-page-hero .lede {
  max-width: 820px;
}

.series-primer {
  max-width: 840px;
  margin: 20px 0 0;
  padding: 15px 17px;
  color: var(--series-ink);
  background: rgba(255, 255, 255, 0.74);
  border-left: 5px solid var(--series-blue);
  border-radius: 6px;
}

.series-page-note {
  max-width: 790px;
  margin: 24px 0 0;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.68);
  border-left: 5px solid var(--series-gold);
}

.lab-tour {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
}

.lab-tour p {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--series-line);
}

.lab-tour strong {
  display: block;
  margin-bottom: 3px;
  color: var(--series-ink);
}

.series-local-nav {
  position: sticky;
  z-index: 30;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--series-line);
  backdrop-filter: blur(10px);
}

.series-local-nav .series-local-inner {
  width: min(980px, calc(100vw - 40px));
  margin: 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.series-local-nav a {
  flex: 0 0 auto;
  padding: 14px 10px;
  color: var(--series-muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.series-local-nav a:hover,
.series-local-nav a:focus-visible {
  color: var(--series-blue);
}

.series-pointer {
  width: min(1180px, calc(100vw - 40px));
  margin: 32px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.78fr);
  gap: 28px;
  align-items: center;
  padding: 28px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--series-line);
  border-left: 6px solid var(--series-purple);
  border-radius: 8px;
}

.series-pointer h2,
.series-pointer h3 {
  margin-top: 8px;
}

.series-pointer p {
  color: #354154;
}

.series-pointer-art {
  min-width: 0;
}

.series-pointer-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.span-objection-facts {
  display: grid;
  gap: 0;
  border-top: 2px solid var(--series-ink);
  border-bottom: 1px solid var(--series-line);
}

.span-objection-facts > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--series-line);
}

.span-objection-facts > div:first-child {
  border-top: 0;
}

.span-objection-facts > div > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--series-purple);
  border-radius: 50%;
  font-weight: 900;
}

.span-objection-facts p {
  margin: 2px 0 0;
}

.span-objection-facts strong {
  display: block;
  color: var(--series-ink);
}

.series-cta {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--series-blue);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.series-cta:hover,
.series-cta:focus-visible {
  color: #fff;
  background: #194a7b;
}

.series-preview-band {
  padding: 70px 0;
  border-top: 1px solid var(--series-line);
  border-bottom: 1px solid var(--series-line);
  background: #fff;
}

.series-preview-inner {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
}

.series-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 26px;
}

.series-preview-card {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: center;
  min-width: 0;
  padding: 20px;
  color: var(--series-ink);
  background: var(--series-paper);
  border: 1px solid var(--series-line);
  border-radius: 8px;
  text-decoration: none;
}

.series-preview-card:hover,
.series-preview-card:focus-visible {
  border-color: var(--series-blue);
  box-shadow: 0 10px 26px rgba(24, 33, 47, 0.1);
}

.series-preview-card canvas,
.series-preview-card svg,
.series-preview-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--series-line);
  border-radius: 6px;
}

.series-inline-link {
  width: min(1180px, calc(100vw - 40px));
  margin: 28px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
  color: var(--series-ink);
  background: var(--series-nuisance-soft);
  border: 1px solid #b9d7e9;
  border-radius: 8px;
  text-decoration: none;
}

.series-inline-link strong {
  display: block;
  font-size: 1.05rem;
}

.series-inline-link span {
  color: var(--series-muted);
}

.series-inline-link b {
  flex: 0 0 auto;
  color: var(--series-blue);
}

.series-preview-card h3 {
  margin: 6px 0 8px;
  font-size: clamp(1.3rem, 2vw, 1.85rem);
}

.series-preview-card p {
  margin: 0;
  color: var(--series-muted);
}

.series-preview-kicker {
  color: var(--series-blue);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.series-page-footer {
  color: #d9e2ef;
  background: var(--series-ink);
}

.series-page-footer-inner {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 32px 0;
}

.series-page-footer a {
  color: #fff;
  font-weight: 800;
}

.series-page-footer p {
  margin: 0;
}

/* Shared author and development credit, including the Preprints page. */
.series-footer-about {
  min-width: 0;
  flex: 1;
  grid-column: 1 / -1;
}

.site-footer .series-footer-credit,
.series-page-footer .series-footer-credit {
  margin-top: .75em;
}

@media (max-width: 920px) {
  .lab-tour {
    grid-template-columns: 1fr;
  }

  .series-rail-inner {
    width: 100%;
    min-height: auto;
    display: block;
    padding: 10px 16px 0;
  }

  .series-brand {
    display: block;
    padding: 2px 2px 7px;
  }

  .series-links {
    margin: 0 -6px;
  }

  .series-links a {
    min-height: 44px;
    padding: 0 9px;
    font-size: 0.875rem;
  }

  .series-links a[aria-current="page"]::after {
    right: 9px;
    left: 9px;
  }

  .series-pointer,
  .series-preview-card {
    grid-template-columns: 1fr;
  }

  .series-preview-grid {
    grid-template-columns: 1fr;
  }

  .series-page-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .series-inline-link {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .series-preview-card,
  .series-cta {
    scroll-behavior: auto;
    transition: none;
  }
}

.experiment-unavailable-notice {
  box-sizing: border-box;
  grid-column: 1 / -1;
  flex-basis: 100%;
  width: 100%;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #b9c4d2;
  border-left: 4px solid #465a73;
  border-radius: 6px;
  background: #f4f6f9;
  color: #253142;
  font: 600 0.9rem/1.5 system-ui, sans-serif;
  overflow-wrap: anywhere;
}

[data-experiment-stale] {
  display: none !important;
}

[data-experiment-unavailable] [aria-disabled="true"] {
  cursor: not-allowed;
}
