:root {
  color-scheme: light;
  --wb-bg: #f6f2e8;
  --wb-panel: rgba(255, 253, 248, 0.96);
  --wb-plot-fill: rgba(255, 253, 248, 0.92);
  --wb-plot-grid-color: rgba(82, 102, 138, 0.12);
  --wb-plot-axis-color: rgb(82, 102, 138);
  --wb-ink: #2a241d;
  --wb-muted: #7a6d5e;
  --wb-border: rgba(70, 52, 35, 0.14);
  --wb-shadow: 0 10px 22px rgba(56, 36, 21, 0.08);
  --wb-accent: rgba(200, 154, 74, 0.65);
  --wb-transition-ms: 3400ms;
  --wb-fade-ms: 1300ms;
  --wb-exit-ms: 1200ms;
  --wb-media-max-height: 50vh;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--wb-ink);
  background: radial-gradient(circle at top, #fffefb 0%, var(--wb-bg) 72%);
}

body {
  padding: 20px 24px 10px;
}

html,
body {
  height: 100%;
}

button,
input,
output {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.wb-page {
  max-width: 1240px;
  min-height: calc(100vh - 30px);
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 80px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 14px;
}

#wb-root {
  position: relative;
  min-height: 620px;
  overflow: visible;
}

#wb-live,
#wb-ghost-layer,
#wb-arrow-overlay {
  position: absolute;
  inset: 0;
}

#wb-live {
  z-index: 2;
  padding: 4px 2px 8px;
}

#wb-ghost-layer {
  z-index: 3;
  pointer-events: none;
}

#wb-arrow-overlay {
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.wb-board {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 16px;
  align-content: start;
}

.wb-row {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  justify-content: center;
}

.wb-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.wb-anim-child {
  transform-origin: top left;
  will-change: transform, opacity;
}

.wb-item {
  transition:
    box-shadow var(--wb-fade-ms) ease,
    border-color var(--wb-fade-ms) ease;
}

.wb-card {
  background: var(--wb-panel);
  border: 0;
  border-radius: 18px;
  padding: 14px 16px 16px;
  box-shadow: var(--wb-shadow);
  min-width: 0;
  overflow: clip;
  position: relative;
  transition:
    height var(--wb-transition-ms) cubic-bezier(0.18, 0.82, 0.22, 1),
    box-shadow var(--wb-fade-ms) ease,
    border-color var(--wb-fade-ms) ease;
}

.wb-card[data-has-color="true"] {
  border-style: solid;
  border-width: 2px;
  border-color: var(--wb-card-accent, var(--wb-accent));
}

.wb-link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  padding: 16px 18px;
  border: 1px solid rgba(122, 109, 94, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(249, 243, 230, 0.98) 100%),
    var(--wb-panel);
  box-shadow: var(--wb-shadow);
  color: var(--wb-ink);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: clip;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition:
    box-shadow var(--wb-fade-ms) ease,
    border-color var(--wb-fade-ms) ease,
    outline-color 180ms ease,
    background-color var(--wb-fade-ms) ease;
}

.wb-link-button:visited {
  color: var(--wb-ink);
}

.wb-link-button:hover {
  border-color: rgba(42, 36, 29, 0.55);
  outline-color: rgba(0, 0, 0, 0.35);
  box-shadow: 0 14px 28px rgba(67, 46, 22, 0.1);
}

.wb-link-button:focus-visible {
  outline-width: 3px;
  outline-color: rgba(0, 0, 0, 0.45);
  outline-offset: 3px;
}

.wb-link-button-body {
  min-width: 0;
  text-align: center;
}

.wb-link-button-caption {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-align: center;
}

.wb-narrator-video {
  aspect-ratio: 4 / 3;
  max-height: var(--wb-media-max-height);
  background: var(--wb-panel);
  border: 0;
  border-radius: 18px;
  box-shadow: var(--wb-shadow);
  min-width: 0;
  overflow: clip;
  padding: 0;
  position: relative;
}

.wb-narrator-video-slot {
  width: 100%;
  height: 100%;
  background: rgba(255, 252, 245, 0.72);
}

.wb-narrator-video-slot > video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

.wb-card-title {
  color: var(--wb-card-title-color, rgba(0, 0, 0, 0.5));
  font-size: 0.64rem;
  line-height: 1;
  position: absolute;
  top: 7px;
  left: 8px;
  right: 8px;
  z-index: 1;
  pointer-events: none;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-card-contents {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.wb-card-content {
  min-width: 0;
  position: relative;
}

.wb-card-content-body {
  min-width: 0;
}

.wb-card .katex-display,
.wb-card-content .katex-display {
  margin: 0;
}

.wb-card .katex,
.wb-card-content .katex {
  white-space: normal;
}

.wb-card .katex-display > .katex,
.wb-card-content .katex-display > .katex {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.wb-prose {
  white-space: pre-wrap;
  line-height: 1.5;
}

.wb-inline-math .katex {
  font-size: 1.04em;
}

.wb-parameter-editor {
  background: rgba(255, 252, 245, 0.9);
  border: 1px solid rgba(84, 61, 36, 0.14);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 8px 18px rgba(67, 46, 22, 0.06);
}

.wb-email-entry {
  background: var(--wb-panel);
  border: 1px solid rgba(84, 61, 36, 0.14);
  border-radius: 18px;
  padding: 14px 16px 16px;
  box-shadow: var(--wb-shadow);
  min-width: 0;
}

.wb-email-entry-form {
  display: grid;
  gap: 10px;
}

.wb-email-entry-label {
  font-weight: 800;
}

.wb-email-entry-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.wb-email-entry-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(84, 61, 36, 0.18);
  background: rgba(255, 255, 255, 0.95);
  color: var(--wb-ink);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

.wb-email-entry-input:focus {
  border-color: rgba(200, 154, 74, 0.88);
  box-shadow: 0 0 0 3px rgba(200, 154, 74, 0.18);
}

.wb-email-entry-submit {
  border: 1px solid rgba(84, 61, 36, 0.18);
  background: rgba(200, 154, 74, 0.16);
  color: var(--wb-ink);
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.wb-email-entry-submit:hover:not(:disabled) {
  background: rgba(200, 154, 74, 0.24);
}

.wb-email-entry-submit:disabled,
.wb-email-entry-input:disabled {
  opacity: 0.72;
  cursor: wait;
}

.wb-email-entry-status {
  min-height: 1.3em;
  color: var(--wb-muted);
  font-size: 0.92rem;
}

.wb-email-entry-status[data-state="submitted"] {
  color: rgb(54, 117, 70);
}

.wb-email-entry-status[data-state="error"] {
  color: rgb(160, 63, 48);
}

.wb-parameter-label {
  font-weight: 800;
  margin-bottom: 10px;
}

.wb-parameter-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.wb-parameter-input {
  width: 100%;
}

.wb-parameter-readout {
  display: inline-flex;
  min-width: 3ch;
  justify-content: end;
  color: var(--wb-muted);
  font-weight: 700;
}

.wb-plot-canvas {
  background: var(--wb-plot-fill, rgba(255, 253, 248, 0.92));
  border: 1px solid var(--wb-plot-grid-color, rgba(82, 102, 138, 0.07));
  border-radius: 18px;
  box-shadow: var(--wb-shadow);
  overflow: clip;
  min-width: 0;
}

.wb-plot-stage {
  position: relative;
  width: 100%;
  max-height: var(--wb-media-max-height);
  aspect-ratio: var(--wb-plot-aspect-ratio, 1 / 1);
}

.wb-plot-layer-host,
.wb-plot-layer,
.wb-plot-layer-svg,
.wb-plot-stamp-canvas {
  position: absolute;
  inset: 0;
}

.wb-plot-layer-host {
  z-index: 0;
}

.wb-plot-layer {
  pointer-events: none;
}

.wb-plot-layer[data-enabled="false"],
.wb-plot-layer[data-transparent="true"] {
  opacity: 0;
}

.wb-plot-layer-svg,
.wb-plot-stamp-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.is-highlighted {
  border-color: rgba(200, 154, 74, 0.75);
  box-shadow: 0 0 0 3px rgba(200, 154, 74, 0.15), 0 14px 28px rgba(67, 46, 22, 0.08);
}

.is-transparent {
  opacity: 0;
}

.wb-entering:not([data-enter-effect="draw"]):not([data-enter-effect="none"]) {
  opacity: 0;
}

.wb-ghost {
  position: absolute;
  margin: 0;
  pointer-events: none;
  opacity: var(--wb-ghost-start-opacity, 1);
  transform: none;
  filter: blur(0);
  transition:
    opacity var(--wb-exit-ms) ease,
    filter var(--wb-exit-ms) ease;
}

.wb-ghost,
.wb-ghost * {
  animation: none !important;
}

.wb-ghost.is-exiting {
  opacity: 0;
  filter: blur(2px);
}

.lp-footer {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.lp-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.lp-section-dot {
  --lp-section-progress: 0%;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: width 180ms ease;
}

.lp-section-dot-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  overflow: clip;
  background: rgba(91, 68, 45, 0.22);
}

.lp-section-dot-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--lp-section-progress);
  border-radius: inherit;
  background: rgba(200, 154, 74, 0.9);
  transition: width 110ms linear;
}

.lp-section-dot.is-active {
  width: 56px;
}

.lp-section-dot:focus-visible {
  outline: 2px solid rgba(200, 154, 74, 0.9);
  outline-offset: 3px;
}

.lp-subtitles {
  width: min(860px, 100%);
  min-height: 3.2rem;
  display: grid;
  align-items: center;
  background: rgba(255, 252, 245, 0.9);
  border: 1px solid rgba(84, 61, 36, 0.14);
  border-radius: 18px;
  padding: 8px 12px;
  box-shadow: 0 10px 22px rgba(56, 36, 21, 0.06);
}

.lp-subtitle-line {
  text-align: center;
  line-height: 1.55;
  font-size: clamp(0.88rem, 0.56vw + 0.78rem, 1.08rem);
  white-space: pre-wrap;
}

.lp-token {
  opacity: 0.34;
  transition: opacity 140ms ease;
}

.lp-token.is-current,
.lp-token.is-spoken {
  opacity: 1;
}

.lp-token-body .katex {
  font-size: 1.02em;
}

.lp-footer,
.wb-navigation {
  align-self: end;
}

.lp-footer {
  display: grid;
  gap: 10px;
}

.wb-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.wb-navigation-center {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
}

.wb-nav-button {
  border: 1px solid rgba(84, 61, 36, 0.18);
  background: rgba(255, 252, 245, 0.96);
  color: var(--wb-ink);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.wb-nav-button:hover {
  background: white;
}

.wb-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 760px;
}

.wb-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 0;
  background: rgba(91, 68, 45, 0.22);
  cursor: pointer;
}

.wb-dot.is-active {
  background: rgba(200, 154, 74, 0.9);
  transform: scale(1.16);
}

.wb-status {
  min-height: 1.2em;
  color: var(--wb-muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.wb-arrow-path {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
  transition: opacity var(--wb-fade-ms) ease;
}

.wb-arrow-path.is-entering,
.wb-arrow-path.is-exiting {
  opacity: 0;
}

#wb-measure-root {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 380px;
  visibility: hidden;
  pointer-events: none;
  contain: layout style paint;
}

.wb-measure-root-card {
  width: 100%;
}

@media (max-width: 900px) {
  body {
    padding: 16px 16px 8px;
  }

  .wb-page {
    min-height: calc(100vh - 24px);
  }

  #wb-live {
    padding: 2px 0 8px;
  }

  .wb-page {
    padding-inline: 0;
  }

  .wb-navigation {
    flex-direction: column;
  }

  .wb-navigation-center {
    width: 100%;
  }

  .wb-email-entry-body {
    grid-template-columns: 1fr;
  }

  .lp-subtitles {
    min-height: 2.9rem;
    padding: 7px 10px;
  }

  .lp-section-dot.is-active {
    width: 44px;
  }
}
