/* Methodology walkthrough. Scoped under .mth; uses the app's tokens when present. */
.mth {
  --m-canvas: var(--canvas, #FAF9F6); --m-white: var(--white, #fff); --m-ink: var(--ink, #141413); --m-ink-2: var(--ink-2, #3B3A36);
  --m-muted: var(--muted, #5F5C55); --m-faint: var(--faint, #716D65); --m-line: var(--line, #E5E2DC); --m-line-2: var(--line-2, #D2CEC5);
  --m-stone: var(--stone, #EFEDE8); --m-accent: var(--crimson, #A61C1C); --m-accent-tint: var(--crimson-tint, #F7ECEA);
  --m-ochre: #A8721A; --m-ochre-tint: #F3E7CF;
  --m-serif: var(--serif, "Newsreader", Georgia, serif); --m-sans: var(--sans, "Inter", system-ui, sans-serif); --m-mono: var(--mono, "IBM Plex Mono", ui-monospace, monospace);
  --m-ease: cubic-bezier(.22, .61, .36, 1);
  display: block; color: var(--m-ink); font-family: var(--m-sans); outline: none;
}
.mth *, .mth *::before, .mth *::after { box-sizing: border-box; }
.mth-loading, .mth-error { padding: 48px 0; color: var(--m-muted); font-size: 15px; }
.mth-error strong { color: var(--m-ink); }

.mth-head { max-width: 52em; margin-bottom: 22px; }
.mth-eyebrow { margin: 0 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--m-muted); }
.mth-title { margin: 0 0 8px; font-family: var(--m-serif); font-weight: 400; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.12; letter-spacing: -.012em; }
.mth-lede { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--m-ink-2); }

.mth-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--m-line-2); }
.mth-steps li { min-width: 0; }
.mth-step { appearance: none; width: 100%; display: grid; grid-template-rows: auto auto; text-align: left; gap: 2px; background: none; border: 0; padding: 10px 12px 12px 0; cursor: pointer; color: var(--m-faint); position: relative; font: inherit; }
.mth-step-no { font-family: var(--m-mono); font-size: 11.5px; letter-spacing: .04em; }
.mth-step-name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.mth-step-bar { position: absolute; left: 0; right: 10px; top: -1px; height: 2px; background: transparent; overflow: hidden; }
.mth-step-bar i { display: block; height: 100%; width: 0; background: var(--m-ink); }
.mth-step:hover { color: var(--m-ink-2); }
.mth-step.is-done { color: var(--m-muted); }
.mth-step.is-done .mth-step-bar i { width: 100%; background: var(--m-line-2); }
.mth-step.is-on { color: var(--m-ink); }
.mth-step.is-on .mth-step-no { color: var(--m-accent); }
.mth-step.is-on .mth-step-bar i { width: 100%; }
.mth.is-ticking .mth-step.is-on .mth-step-bar i { width: 0; animation: mth-fill var(--mth-stage-ms, 9000ms) linear forwards; }
@keyframes mth-fill { to { width: 100%; } }

.mth-body { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 28px; align-items: start; }
.mth-figure { margin: 0; background: var(--m-white); border: 1px solid var(--m-line); padding: 8px; }
.mth-svg { display: block; width: 100%; height: auto; overflow: visible; }

.mth-dot { transition: transform .9s var(--m-ease), opacity .5s ease, fill .5s ease, stroke .5s ease; fill: var(--m-ink); stroke: none; }
.mth-instant .mth-dot, .mth-instant .mth-labels, .mth-instant .mth-evt { transition: none !important; animation: none !important; }
.mth-instant .mth-labels, .mth-instant .mth-evt { opacity: 1; }
.mth-dot:hover { stroke: var(--m-accent); stroke-width: 2; }
.d-sps { fill: var(--m-accent); }
.d-comp { fill: var(--m-ink); }
.d-dim { fill: var(--m-line-2); }
.d-warn { fill: var(--m-ochre); }
.d-reject { fill: none; stroke: var(--m-accent); stroke-width: 1.3; }
.d-carried { fill: var(--m-ochre); }
.d-hollow { fill: var(--m-white); stroke: var(--m-faint); stroke-width: 1.2; }
.d-t1 { fill: var(--m-ink); }
.d-t2 { fill: #57544D; }
.d-t3 { fill: #A29E95; }
.d-raise { fill: var(--m-accent); }
.d-hold { fill: #A29E95; }

.mth-labels { opacity: 0; }
.mth-labels.is-in { animation: mth-in .6s ease .15s forwards; }
@keyframes mth-in { to { opacity: 1; } }
.mth-evt { opacity: 0; }
.mth-labels.is-in .mth-evt { animation: mth-in .35s ease forwards; animation-delay: calc(300ms + var(--d, 0) * var(--replay-ms, 0ms)); }
.mth-t { font-family: var(--m-sans); font-size: 11.5px; fill: var(--m-ink-2); }
.mth-t-strong { font-weight: 600; fill: var(--m-ink); }
.mth-t-muted { fill: var(--m-faint); }
.mth-t-small { font-size: 10px; }
.mth-t-accent { fill: var(--m-accent); font-weight: 500; }
.mth-mono { font-family: var(--m-mono); font-variant-numeric: tabular-nums; }
.mth-rule { stroke: var(--m-line-2); stroke-width: 1; }
.mth-rule-faint { stroke: var(--m-line); }
.mth-rule-accent { stroke: var(--m-accent); stroke-width: 1; }
.mth-rule-gate { stroke: var(--m-ink); stroke-width: 2; stroke-dasharray: 3 3; }
.mth-rule-play { stroke: var(--m-ink); stroke-width: 1; }
.mth-evt-bg { fill: var(--m-white); opacity: .92; }
.mth-ring { fill: none; stroke: var(--m-line-2); }
.mth-ring-0 { fill: var(--m-stone); }
.mth-ring-1 { stroke-dasharray: 2 3; }
.mth-ring-2 { stroke-dasharray: 1 4; }

.mth-panel { min-width: 0; }
.mth-panel-no { margin: 0 0 6px; font-family: var(--m-mono); font-size: 11.5px; color: var(--m-accent); letter-spacing: .04em; }
.mth-panel-title { margin: 0 0 10px; font-family: var(--m-serif); font-weight: 500; font-size: 24px; line-height: 1.15; }
.mth-panel-body { margin: 0 0 18px; font-size: 14.5px; line-height: 1.6; color: var(--m-ink-2); }
.mth-figs { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--m-line); }
.mth-fig { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "v l" "s s"; column-gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--m-line); align-items: baseline; }
.mth-fig dd, .mth-fig dt { margin: 0; }
.mth-fig > dd:first-of-type { grid-area: v; font-family: var(--m-mono); font-size: 19px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mth-fig dt { grid-area: l; font-size: 13.5px; color: var(--m-ink-2); line-height: 1.35; }
.mth-fig .mth-src { grid-area: s; margin-top: 3px; }
.mth-src { font-family: var(--m-mono); font-size: 10.5px; color: var(--m-faint); line-height: 1.4; overflow-wrap: anywhere; margin: 0; }
.mth-kind { display: inline-block; margin-right: 6px; padding: 0 5px; border: 1px solid var(--m-line-2); border-radius: 2px; text-transform: uppercase; letter-spacing: .06em; font-size: 9.5px; color: var(--m-muted); }
.mth-fig-setting .mth-kind { border-color: var(--m-line-2); background: var(--m-stone); }
.mth-fig-model .mth-kind { border-color: var(--m-ochre); color: var(--m-ochre); }
.mth-fig-model > dd:first-of-type { color: var(--m-ink-2); }
.mth-limits { margin: 16px 0 0; font-size: 13px; line-height: 1.5; color: var(--m-muted); }
.mth-limits span { display: inline-block; margin-right: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--m-ink); }

.mth-hist { margin-top: 16px; }
.mth-hist-h { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--m-ink-2); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mth-key { font-weight: 400; color: var(--m-faint); font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.mth-key i { display: inline-block; width: 8px; height: 8px; margin-left: 6px; }
.mth-hist ol { list-style: none; margin: 0 0 4px; padding: 0; display: flex; gap: 6px; align-items: flex-end; height: 64px; }
.mth-hist li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; }
.mth-bar { flex: 1; width: 100%; display: flex; flex-direction: column-reverse; justify-content: flex-start; background: var(--m-stone); }
.mth-bar i { display: block; width: 100%; }
.mth-bar-x { font-family: var(--m-mono); font-size: 9.5px; color: var(--m-faint); }
.b-live { background: var(--m-ink); }
.b-carried { background: var(--m-ochre); }
.b-bench { background: var(--m-line-2); }

.mth-controls { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 0 6px 6px; flex-wrap: wrap; }
.mth-btn { appearance: none; min-width: 40px; min-height: 34px; padding: 4px 14px; background: transparent; border: 1px solid var(--m-line-2); border-radius: 2px; color: var(--m-ink); font: 600 13.5px var(--m-sans); cursor: pointer; }
.mth-btn:hover { border-color: var(--m-ink); background: var(--m-white); }
.mth-btn:focus-visible, .mth-step:focus-visible { outline: 2px solid var(--m-accent); outline-offset: 2px; }
.mth-btn-play { min-width: 76px; }
.mth-stamp { margin: 0 0 0 auto; font-family: var(--m-mono); font-size: 11px; color: var(--m-faint); }
.mth-warn { color: var(--m-ochre); }

.mth-caption { min-height: 2.6em; padding: 8px 6px 2px; font-size: 12.5px; line-height: 1.45; color: var(--m-ink-2); overflow-wrap: anywhere; }
.mth-caption-hint { color: var(--m-faint); }
.mth-caption a { color: var(--m-ink); text-decoration: underline; text-decoration-color: var(--m-line-2); text-underline-offset: 3px; font-family: var(--m-mono); font-size: 11.5px; }
.mth-dot.is-sel { stroke: var(--m-accent); stroke-width: 2.5; }
.mth-fig-missing .mth-kind { border-color: var(--m-accent); color: var(--m-accent); }
.mth-fig-missing > dd:first-of-type { color: var(--m-accent); font-size: 16px; }
.mth-win { fill: var(--m-stone); opacity: .7; }
.mth-win-after { fill: var(--m-accent-tint); }
.mth-spark { fill: none; stroke: var(--m-ink); stroke-width: 1.6; }
.mth-spark-off { stroke: var(--m-faint); stroke-dasharray: 3 3; }

/* Phone and narrow embeds (container under 640 px; toggled by JS, independent of viewport). */
.mth-compact .mth-title { font-size: 26px; }
.mth-compact .mth-lede { font-size: 14.5px; }
.mth-compact .mth-steps { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 0 14px; padding: 0; border-top: 0; }
.mth-compact .mth-steps::-webkit-scrollbar { display: none; }
.mth-compact .mth-steps li { flex: 0 0 auto; scroll-snap-align: start; }
.mth-compact .mth-step { min-height: 52px; width: auto; max-width: 168px; padding: 10px 18px 8px 0; border-top: 1px solid var(--m-line-2); }
.mth-compact .mth-step-bar { right: 18px; }
.mth-compact .mth-body { grid-template-columns: 1fr; gap: 18px; }
.mth-compact .mth-figure { padding: 4px; margin: 0 -6px; max-width: 560px; }
.mth-compact .mth-body { justify-items: start; }
.mth-compact .mth-panel { max-width: 560px; }
.mth-compact .mth-t { font-size: 12px; }
.mth-compact .mth-t-small { font-size: 10.5px; }
.mth-compact .mth-panel-title { font-size: 22px; }
.mth-compact .mth-fig { grid-template-columns: 1fr; grid-template-areas: "v" "l" "s"; row-gap: 2px; }
.mth-compact .mth-fig > dd:first-of-type { white-space: normal; font-size: 18px; }
.mth-compact .mth-controls { margin-top: 6px; }
.mth-compact .mth-btn { min-height: 44px; min-width: 52px; }
.mth-compact .mth-btn-play { flex: 1; }
.mth-compact .mth-stamp { margin-left: 0; width: 100%; font-size: 10.5px; }

@media (max-width: 960px) {
  .mth-body { grid-template-columns: 1fr; }
  .mth-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mth-stamp { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .mth-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mth-figure { padding: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .mth-dot, .mth-labels, .mth-evt, .mth-step-bar i { transition: none !important; animation: none !important; }
  .mth-labels, .mth-evt { opacity: 1; }
}
