@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap");

:root {
  color-scheme: only light;
  --ink: #203933;
  --muted: #61756d;
  --cream: #fffdf7;
  --sand: #f6efe2;
  --sage: #d8e8d3;
  --mint: #eff7ed;
  --forest: #1f5a4e;
  --deep-forest: #15483e;
  --coral: #ec8069;
  --line: #d9dfd3;
  --shadow: 0 14px 35px rgba(28, 65, 53, 0.12);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
a {
  color: var(--deep-forest);
  text-decoration-color: #9ccca4;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--coral);
}
button {
  font: inherit;
}
.site-header {
  max-width: 1220px;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: auto;
  padding: 1rem 2rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.02;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.brand strong {
  font-size: 1rem;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  color: #fff;
  background: var(--coral);
  border-radius: 9px;
  transform: rotate(-8deg);
  font-size: 1.35rem;
}
nav {
  display: flex;
  gap: 1.6rem;
  font-size: 0.92rem;
  font-weight: 600;
}
nav a {
  text-decoration: none;
  color: var(--ink);
}
.hero {
  max-width: 1220px;
  min-height: 500px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 3rem;
  padding: 3.7rem 2rem 4.6rem;
  margin: auto;
}
.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
h1,
h2,
h3 {
  line-height: 1.12;
}
h1,
h2 {
  font-family: Fraunces, Georgia, serif;
}
h1 {
  max-width: 690px;
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.6rem);
  letter-spacing: -0.055em;
}
h2 {
  max-width: 710px;
  margin: 0;
  font-size: clamp(2.25rem, 4vw, 3.75rem);
  letter-spacing: -0.04em;
}
h3 {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
}
.hero-text {
  max-width: 610px;
  color: var(--muted);
  font-size: 1.12rem;
  margin: 1.4rem 0 1.8rem;
}
.hero-safety-note {
  max-width: 610px;
  padding: 0.9rem 1rem;
  margin: -0.5rem 0 1.8rem;
  color: #436055;
  background: #fff6db;
  border-radius: 9px;
  font-size: 0.92rem;
}
.hero-print-note {
  max-width: 610px;
  margin: -1rem 0 1.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.language-picker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: -0.85rem 0 1.45rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}
.language-picker a,
.language-picker strong {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  text-decoration: none;
}
.language-picker strong {
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
}
.hero-actions,
.step-controls {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.67rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}
.button:hover {
  transform: translateY(-2px);
}
.button-primary {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 8px 18px rgba(31, 90, 78, 0.19);
}
.button-primary:hover {
  color: #fff;
  background: var(--deep-forest);
}
.button-quiet {
  color: var(--deep-forest);
  background: transparent;
  border-color: var(--line);
}
.button-quiet:hover {
  color: var(--deep-forest);
  background: var(--mint);
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  transform: none;
}
.hero-art {
  position: relative;
  width: min(100%, 440px);
  min-height: 355px;
  margin: 0 auto;
  padding: 70px 40px 40px;
  background: #e7f0e2;
  border-radius: 50% 50% 40% 40% / 41% 42% 50% 50%;
  overflow: hidden;
}
.box {
  position: relative;
  min-height: 180px;
  padding: 30px;
  background: #e4ac6e;
  border: 12px solid #b8753f;
  border-top: 0;
  border-radius: 6px 6px 27px 27px;
  box-shadow:
    inset 0 14px rgba(255, 255, 255, 0.13),
    0 15px 0 rgba(86, 57, 29, 0.09);
}
.box-lid {
  position: relative;
  z-index: 1;
  height: 40px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 24px;
  background: #c98449;
  border: 9px solid #a96735;
  border-bottom-width: 6px;
  border-radius: 12px 12px 4px 4px;
  transform: rotate(-5deg) translate(7px, 8px);
}
.box-lid span {
  width: 12px;
  height: 12px;
  background: #f1c690;
  border-radius: 50%;
}
.die {
  position: absolute;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #274f43;
  background: #fff8df;
  box-shadow: 0 7px 0 rgba(115, 69, 28, 0.17);
  font-size: 3.9rem;
  line-height: 1;
}
.die-a {
  left: 15%;
  top: 43px;
  transform: rotate(-13deg);
}
.die-b {
  left: 43%;
  top: 27px;
  transform: rotate(7deg);
}
.die-c {
  right: 9%;
  top: 62px;
  transform: rotate(17deg);
}
.spark {
  position: absolute;
  color: var(--coral);
  font-size: 1.5rem;
}
.spark-one {
  top: 55px;
  right: 60px;
}
.spark-two {
  bottom: 45px;
  left: 45px;
  color: var(--forest);
}
.art-caption {
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--forest);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.notice {
  max-width: 1160px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  margin: 0 auto;
  color: #295246;
  background: var(--sage);
  border-radius: 12px;
}
.notice p {
  margin: 0;
}
.section {
  padding: 6.5rem 2rem;
}
.setup {
  background: var(--sand);
  margin-top: 5rem;
}
.setup-grid {
  max-width: 1160px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: auto;
}
.supply-card {
  min-height: 220px;
  padding: 1.4rem;
  background: #fffaf1;
  border: 1px solid #eadfcf;
  border-radius: 16px;
}
.supply-card p {
  color: var(--muted);
  font-size: 0.95rem;
}
.supply-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  color: #fff;
  background: var(--forest);
  border-radius: 11px;
  font-size: 1.5rem;
}
.toggle-group {
  display: flex;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.toggle {
  min-width: 135px;
  padding: 0.7rem 0.8rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}
.toggle + .toggle {
  border-left: 1px solid var(--line);
}
.toggle small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 500;
}
.toggle.is-selected {
  color: #fff;
  background: var(--forest);
}
.guide {
  max-width: 1220px;
  margin: auto;
}
.step-stage {
  max-width: 1040px;
  margin: 2.8rem auto 0;
}
.guide-step {
  display: none;
  grid-template-columns: 1fr 0.9fr;
  align-items: center;
  gap: 4.2rem;
  min-height: 420px;
}
.guide-step.is-active {
  display: grid;
}
.step-number {
  margin: 0 0 0.6rem;
  color: var(--coral);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.step-copy > p:not(.step-number) {
  color: var(--muted);
}
.step-copy h3 {
  font-family: Fraunces, Georgia, serif;
  font-size: 2.3rem;
  letter-spacing: -0.035em;
}
.step-visual {
  min-height: 290px;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: var(--mint);
  border-radius: 28px;
}
.step-controls {
  justify-content: center;
  margin-top: 1rem;
}
.encoding-tabs {
  display: flex;
  gap: 0;
  width: 100%;
  overflow: hidden;
  margin: 1.5rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.encoding-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font-weight: 700;
}
.encoding-tab + .encoding-tab {
  border-left: 1px solid var(--line);
}
.encoding-tab.is-selected {
  color: #fff;
  background: var(--forest);
}
.encoding-explanation {
  display: none;
  padding: 0.85rem 1rem;
  background: #fffdf7;
  border-left: 4px solid var(--coral);
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
}
.encoding-explanation.is-visible {
  display: block;
}
.encoding-explanation p {
  margin: 0.15rem 0 0.5rem;
}
.encoding-explanation .quiet {
  color: var(--muted);
  margin-bottom: 0;
}
.die-grid {
  display: grid;
  grid-template-columns: repeat(3, 86px);
  gap: 12px;
}
.die-grid div {
  display: grid;
  place-items: center;
  height: 86px;
  color: #fff;
  background: var(--forest);
  border: 1px solid #315d50;
  border-radius: 9px;
  box-shadow: none;
}
.die-grid b {
  font-family: "DejaVu Sans", sans-serif;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
}
.die-grid span {
  font-family: "DM Mono", monospace;
  font-size: 0.8rem;
}
.die-grid .rejected {
  color: #8c7864;
  background: #eee5d8;
  border-color: #cbbfae;
  box-shadow: none;
}
.visual-label {
  align-self: end;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.instruction-list {
  display: grid;
  gap: 0.8rem;
  padding: 0;
  margin: 1.3rem 0;
  list-style: none;
}
.instruction-list li {
  position: relative;
  min-height: 27px;
  padding-left: calc(27px + 0.7rem);
}
.instruction-list > li > span:first-child {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: #fff;
  background: var(--forest);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
}
.callout {
  padding: 0.9rem 1rem;
  color: #436055 !important;
  background: #fff6db;
  border-radius: 9px;
  font-size: 0.92rem;
}
.paper {
  position: relative;
  width: 205px;
  height: 236px;
  padding: 21px;
  background: #fffdf7;
  box-shadow: 12px 13px 0 #dcead8;
  transform: rotate(4deg);
}
.finish-visual {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}
.checklist {
  max-width: 790px;
  display: grid;
  gap: 0.8rem;
  margin: auto;
}
.checklist label {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: #fffaf1;
  border-radius: 9px;
  cursor: pointer;
}
.small-note {
  max-width: 790px;
  margin: 1.5rem auto 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem max(2rem, calc((100vw - 1156px) / 2));
  color: #dcece0;
  background: var(--deep-forest);
  font-size: 0.9rem;
}
footer div {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
}
footer .brand-mark {
  width: 1.9rem;
  height: 1.9rem;
  font-size: 1rem;
}
footer p {
  margin: 0;
  color: #b8d1c1;
}
@media (max-width: 800px) {
  body {
    font-size: 16px;
  }
  .site-header {
    padding: 1rem 1.2rem;
  }
  nav {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 2.4rem 1.2rem 3.5rem;
  }
  .hero-art {
    width: min(100%, 370px);
    min-height: 310px;
  }
  .section {
    padding: 4.3rem 1.2rem;
  }
  .notice {
    margin: 0 1.2rem;
  }
  .setup-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .toggle-group {
    width: 100%;
  }
  .toggle {
    flex: 1;
  }
  .guide-step.is-active {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .step-copy h3 {
    font-size: 2rem;
  }
  .step-visual {
    min-height: 240px;
  }
  .step-controls {
    margin-top: 2rem;
  }
  footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1.2rem;
  }
}
@media (max-width: 450px) {
  h1 {
    font-size: 3.2rem;
  }
  .setup-grid {
    grid-template-columns: 1fr;
  }
  .die-grid {
    grid-template-columns: repeat(3, 72px);
  }
  .die-grid div {
    height: 72px;
  }
}

/* Single-path wizard overrides */
.plain-guide-link {
  color: var(--deep-forest);
  font-size: 0.88rem;
  font-weight: 700;
}
.wizard {
  display: none;
  min-height: calc(100vh - 88px);
  max-width: 1140px;
  padding: 2rem;
  margin: 0 auto;
}
.wizard-active .intro {
  display: none;
}
.wizard-active .wizard {
  display: block;
}
.wizard-progress {
  max-width: 1000px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  margin: 0 auto 1.5rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}
.progress-label {
  white-space: nowrap;
  color: var(--forest);
}
.progress-track {
  height: 7px;
  overflow: hidden;
  background: var(--sage);
  border-radius: 99px;
}
.progress-track span {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--coral);
  border-radius: inherit;
  transition: width 0.25s ease;
}
.wizard .step-stage {
  margin-top: 0;
}
.wizard .guide-step {
  min-height: 580px;
}
.wizard .step-copy h2 {
  font-size: clamp(2.1rem, 4vw, 3.3rem);
}
.wizard .step-visual {
  min-height: 350px;
}
.compact {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  margin: 1.4rem 0;
}
.compact .supply-card {
  min-height: 0;
  padding: 1rem;
  text-align: center;
}
.compact .supply-card h3 {
  font-size: 1.18rem;
}
.compact .supply-card p {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
}
.compact .supply-icon {
  width: 2.65rem;
  height: 2.65rem;
  margin: 0 auto 0.6rem;
  font-size: 1.35rem;
}
.compact .supply-icon svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}
.rolling-setup-icon svg {
  width: 2.15rem !important;
  height: 2.15rem !important;
  stroke-width: 1.5;
}
.printer-icon {
  font-size: 1.5rem !important;
}
.offline-icon .offline-slash {
  stroke: #fff;
  stroke-width: 4;
}
.private-room-icon {
  font-size: 1.8rem !important;
}
.wizard .prepare-step {
  grid-template-columns: 1fr;
  min-height: 0;
}
.prepare-step .compact {
  grid-template-columns: repeat(3, 1fr);
}
.choice-heading {
  margin: 1.45rem 0 0.55rem;
  font-size: 1.05rem;
}
.wizard .toggle-group {
  margin-bottom: 0.4rem;
}
.checkpoint {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  margin-top: 1.2rem;
  background: #fff6db;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.92rem;
}
.checkpoint input {
  flex: 0 0 1.2rem;
  width: 1.2rem;
  min-width: 1.2rem;
  height: 1.2rem;
  min-height: 1.2rem;
  margin: 0;
  accent-color: var(--forest);
}
.checkpoint input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}
.binary-grid:not([hidden]),
.die-grid:not([hidden]) {
  display: grid;
}
.wizard .small-note {
  max-width: 900px;
  margin: 1.4rem auto 0;
}
.wizard + footer {
  display: none;
}
.wizard-active footer {
  display: flex;
}
.wizard-active main > .hero + .wizard ~ footer {
  display: flex;
}

.setup-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.setup-choices .choice-heading {
  margin-top: 0.4rem;
  min-height: 1.35em;
}
.compact-checklist {
  grid-template-columns: repeat(2, calc((100% - 1.1rem) / 3));
  gap: 0.55rem;
  width: 100%;
  margin-top: 1.4rem;
}
.compact-checklist.has-box-clearance {
  grid-template-columns: repeat(3, 1fr);
}
.compact-checklist label {
  padding: 0.6rem 0.75rem;
  font-size: 0.86rem;
}
.compact-checklist [data-container-check="box"] {
  grid-column: 3;
  grid-row: 1 / span 3;
  align-self: start;
}
.selection-warning {
  padding: 0.8rem 1rem;
  margin: 1rem 0 0;
  color: #7d2e21;
  background: #ffebe6;
  border-left: 4px solid var(--coral);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
}
.decision-checkpoints {
  display: grid;
  gap: 0.8rem;
}
.decision-checkpoints .checkpoint {
  margin-top: 0;
}
.step-checkpoints {
  display: grid;
  gap: 0.8rem;
}
.step-checkpoints .checkpoint {
  margin-top: 0;
}
.wizard .guide-step[data-step-panel="2"] .toggle-group {
  width: 100%;
}
.wizard .guide-step[data-step-panel="2"] .toggle {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
@media (min-width: 801px) {
  .wizard .guide-step[data-step-panel="2"] {
    grid-template-areas:
      "copy visual"
      "checkpoints visual";
    grid-template-rows: auto auto;
    column-gap: 4.2rem;
    row-gap: 0.8rem;
    align-content: center;
  }
  .wizard .guide-step[data-step-panel="2"] > .step-copy {
    grid-area: copy;
  }
  .wizard .guide-step[data-step-panel="2"] > .step-visual {
    grid-area: visual;
  }
  .decision-checkpoints {
    grid-area: checkpoints;
  }
  .wizard .guide-step[data-step-panel="3"],
  .wizard .guide-step[data-step-panel="4"],
  .wizard .guide-step[data-step-panel="5"] {
    grid-template-areas:
      "copy visual"
      "checkpoints visual";
    grid-template-rows: auto auto;
    column-gap: 4.2rem;
    row-gap: 0.8rem;
    align-content: center;
  }
  .wizard .guide-step[data-step-panel="3"] > .step-copy,
  .wizard .guide-step[data-step-panel="4"] > .step-copy,
  .wizard .guide-step[data-step-panel="5"] > .step-copy {
    grid-area: copy;
  }
  .wizard .guide-step[data-step-panel="3"] > .step-visual,
  .wizard .guide-step[data-step-panel="4"] > .step-visual,
  .wizard .guide-step[data-step-panel="5"] > .step-visual {
    grid-area: visual;
  }
  .step-checkpoints {
    grid-area: checkpoints;
  }
}
[hidden] {
  display: none !important;
}
.rolling-visual {
  grid-template-rows: none;
}
.box-method,
.cup-method {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
}
.box-method p,
.cup-method p {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
  color: var(--forest);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
}
.mini-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  transform: none;
}
.mini-box span,
.aligned-dice span,
.tray-dice span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--forest);
  background: #fff8df;
  border: 1px solid #c8b47e;
  border-radius: 5px;
  font-size: 1.7rem;
}
.aligned-dice {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cup-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 110px;
  color: #fff;
  background: var(--forest);
  border-radius: 12px 12px 40px 40px;
  font-size: 2.5rem;
}
.tray-dice {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: auto;
  height: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.finish-visual {
  grid-template-rows: auto auto 120px auto;
}
.final-bits {
  display: flex;
  overflow: hidden;
  border-radius: 7px;
  font-family: "DM Mono", monospace;
  font-size: 0.82rem;
}
.final-bits span {
  padding: 0.5rem 0.7rem;
}
.checksum-bits {
  color: #7d2e21;
  background: #ffc5b9;
}

.setup-choices > div {
  display: flex;
  flex-direction: column;
}
.setup-choices .toggle-group {
  width: 100%;
  min-height: 56px;
  align-items: stretch;
}
.setup-choices .toggle {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
}
.lookup-visual {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 0.9rem;
}
.lookup-visual figure {
  margin: 0;
}
.lookup-visual figcaption,
.lookup-stage span {
  display: block;
  margin-top: 0.35rem;
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}
.lookup-stage b {
  position: absolute;
  top: -8px;
  left: -7px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #fff;
  background: var(--coral);
  border-radius: 50%;
  font-size: 0.75rem;
}
.finish-visual {
  grid-template-rows: auto 1fr auto;
}
.final-candidate {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.final-candidate span {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  padding: 0.3rem 0.45rem;
  color: #7d2e21;
  background: #ffe4a5;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}
.candidate-12::after {
  position: absolute;
  top: 8%;
  left: 8%;
  width: 12%;
  height: 68%;
  border: 3px solid var(--coral);
  background: rgba(255, 213, 105, 0.28);
  content: "";
  pointer-events: none;
}
.candidate-24::after {
  position: absolute;
  inset: 8%;
  border: 3px solid var(--coral);
  background: rgba(255, 213, 105, 0.18);
  content: "";
  pointer-events: none;
}
.no-wrap {
  white-space: nowrap;
}

.wizard .toggle-group {
  width: fit-content;
}
.face-mapping {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
  width: 100%;
  margin-top: 0.8rem;
}
.face-mapping div {
  display: grid;
  place-items: center;
  min-height: 60px;
  color: #fff;
  background: var(--forest);
  border-radius: 8px;
}
.face-mapping b {
  font-size: 1.1rem;
}
.face-mapping span {
  font-family: "DM Mono", monospace;
  font-size: 0.76rem;
}
.face-mapping .skip {
  color: #8c7864;
  background: #eee5d8;
}
.face-mapping small {
  grid-column: 1 / -1;
  color: var(--forest);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.boundary-shot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.5rem;
  background: #fff;
  border: 2px solid #e3bc5f;
  border-radius: 8px;
}
.boundary-shot img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  object-position: center;
}
.boundary-shot span {
  padding: 0.35rem;
  color: #7d2e21;
  background: #ffe4a5;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}
.boundary-shot small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}
.lookup-stage span {
  margin: 0;
  font-size: 0.8rem;
  text-align: left;
}

.compact-checklist .checkpoint {
  min-height: 0;
  margin: 0;
  background: #fff6db;
}
.forward-note {
  min-height: 1.4em;
  margin: 0.7rem auto 0;
  color: #7d2e21;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}
.forward-note.is-hidden {
  visibility: hidden;
}
.repeat-instruction {
  position: relative;
  padding: 0.8rem 0.9rem;
  padding-left: 3rem;
  margin: 1rem 0;
  color: var(--forest) !important;
  background: var(--mint);
  border-left: 4px solid var(--forest);
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
}
.visual-step-number {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: #fff;
  background: var(--forest);
  border-radius: 50%;
  font-size: 0.8rem;
}
.box-method,
.cup-method {
  position: relative;
}
.box-method > .visual-step-number:first-child,
.cup-method > .visual-step-number:first-child {
  align-self: start;
}
.face-mapping {
  grid-template-columns: 1fr;
  gap: 0.25rem;
  margin-top: 1rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
}
.face-mapping div {
  min-height: 0;
  color: inherit;
  background: transparent;
  border-radius: 0;
}
.mapping-heading {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  color: var(--forest) !important;
  font-size: 0.8rem;
  font-weight: 700;
}
.mapping-row {
  display: grid !important;
  grid-template-columns: repeat(6, 38px);
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
}
.mapping-row > * {
  display: grid;
  place-items: center;
  width: 38px;
  min-height: 38px;
  border-radius: 5px;
}
.mapping-row.arrows span {
  color: var(--coral);
  font-size: 1.2rem;
}
.mapping-row.results span {
  color: #fff;
  background: var(--forest);
  border: 1px solid #315d50;
  font-family: "DM Mono", monospace;
  font-size: 0.8rem;
}
.mapping-row.results .skip {
  color: #8c7864;
  background: #eee5d8;
  border-color: #cbbfae;
}
.boundary-shot {
  position: relative;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}
.boundary-shot > .visual-step-number {
  align-self: center;
}
.boundary-shot small {
  grid-column: 1 / -1;
}

.die-grid div {
  height: auto;
  color: var(--forest);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  gap: 0.4rem;
}
.die-grid .rejected {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.die-grid b,
.mapping-row.faces b,
.mini-box span,
.aligned-dice span,
.tray-dice span {
  display: block;
  width: 38px;
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  color: transparent;
  background-color: #fffdf7 !important;
  background-image: var(--pips);
  background-repeat: no-repeat;
  border: 2px solid var(--forest) !important;
  border-radius: 5px;
  font-size: 0;
}
.mini-box {
  width: 130px;
  height: 90px;
  background: #d49155;
  border: 3px solid #ae6834;
  border-radius: 8px 8px 18px 18px;
  transform: rotate(-5deg);
}

.compact .supply-card {
  position: relative;
}
.tooltip-wrap {
  position: relative;
  display: inline;
}
.tooltip-trigger {
  display: inline;
  padding: 0;
  color: var(--deep-forest);
  background: transparent;
  border: 0;
  border-bottom: 2px dotted var(--coral);
  cursor: help;
  font: inherit;
  font-weight: 700;
}
.tooltip-trigger span {
  margin-left: 0.18rem;
  color: var(--coral);
  font-size: 0.78em;
}
.tooltip-content {
  position: absolute;
  z-index: 4;
  left: 0;
  bottom: calc(100% + 0.55rem);
  display: block;
  width: min(320px, 72vw);
  padding: 0.85rem 0.9rem;
  color: #fff;
  background: var(--deep-forest);
  border-radius: 9px;
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  line-height: 1.42;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}
.tooltip-content::after {
  position: absolute;
  bottom: -7px;
  left: 1.2rem;
  width: 14px;
  height: 14px;
  background: var(--deep-forest);
  content: "";
  transform: rotate(45deg);
}
.tooltip-wrap:hover .tooltip-content,
.tooltip-wrap:focus-within .tooltip-content {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.dice-quality-note {
  max-width: 295px;
  padding: 0.55rem 0.7rem;
  margin: 0.6rem 0 0;
  color: #536552;
  background: #f4eed8;
  border-radius: 7px;
  font-size: 0.78rem;
  line-height: 1.35;
}
.dice-quality-note strong {
  color: var(--forest);
}

.die-grid div:nth-child(1) b,
.mapping-row.faces b:nth-child(1),
.mini-box span:nth-child(3),
.aligned-dice span:nth-child(3),
.tray-dice span:nth-child(3) {
  --pips: radial-gradient(
    circle 4px at 50% 50%,
    var(--forest) 99%,
    transparent 100%
  );
}
.die-grid div:nth-child(2) b,
.mapping-row.faces b:nth-child(2) {
  --pips:
    radial-gradient(circle 4px at 28% 28%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 72% 72%, var(--forest) 99%, transparent 100%);
}
.die-grid div:nth-child(3) b,
.mapping-row.faces b:nth-child(3),
.mini-box span:nth-child(2),
.aligned-dice span:nth-child(2),
.tray-dice span:nth-child(2) {
  --pips:
    radial-gradient(circle 4px at 28% 28%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 50% 50%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 72% 72%, var(--forest) 99%, transparent 100%);
}
.die-grid div:nth-child(4) b,
.mapping-row.faces b:nth-child(4) {
  --pips:
    radial-gradient(circle 4px at 28% 28%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 72% 28%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 28% 72%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 72% 72%, var(--forest) 99%, transparent 100%);
}
.die-grid div:nth-child(5) b,
.mapping-row.faces b:nth-child(5),
.mini-box span:nth-child(1),
.aligned-dice span:nth-child(1),
.tray-dice span:nth-child(1) {
  --pips:
    radial-gradient(circle 4px at 28% 28%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 72% 28%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 50% 50%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 28% 72%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 72% 72%, var(--forest) 99%, transparent 100%);
}
.die-grid div:nth-child(6) b,
.mapping-row.faces b:nth-child(6) {
  --pips:
    radial-gradient(circle 4px at 28% 25%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 72% 25%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 28% 50%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 72% 50%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 28% 75%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 72% 75%, var(--forest) 99%, transparent 100%);
}
.die-grid b,
.mapping-row.faces b {
  width: 38px;
  height: 38px;
  min-height: 38px;
}
.box-method,
.cup-method {
  grid-template-columns: 27px auto;
  justify-content: center;
}
.box-method .mini-box {
  animation: shake-box 0.45s ease-in-out infinite alternate;
}
.repeat-instruction::before {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: #fff;
  background: var(--forest);
  border-radius: 50%;
  content: "5";
  font-size: 0.8rem;
  font-weight: 700;
}
.lookup-stage > .visual-step-number {
  align-self: start;
}
.lookup-arrow {
  color: var(--coral);
  font-weight: 700;
  text-align: center;
}
.lookup-sheet,
.sheet-highlight {
  display: block;
  position: relative;
  width: min(100%, 130px);
  height: 92px;
  overflow: hidden;
  object-fit: cover;
  object-position: top left;
  border: 1px solid #9ca89b;
}
.sheet-highlight .lookup-sheet {
  width: 100%;
  height: 100%;
  border: 0;
}
.column-highlight::after,
.column-row-highlight::after {
  position: absolute;
  top: 11%;
  bottom: 8%;
  left: 31%;
  width: 13%;
  border: 2px solid var(--forest);
  background: rgba(44, 109, 83, 0.13);
  content: "";
}
.column-row-highlight::before {
  position: absolute;
  z-index: 1;
  top: 64%;
  right: 3%;
  left: 3%;
  height: 7%;
  border: 2px solid var(--coral);
  background: rgba(230, 117, 99, 0.22);
  content: "";
}
.sheet-stack {
  position: relative;
}
.sheet-stack img {
  position: absolute;
  width: 78%;
  height: 78px;
  object-fit: cover;
  object-position: top left;
  background: #fff;
  border: 1px solid #9ca89b;
  box-shadow: 1px 1px 0 rgba(29, 67, 54, 0.15);
}
.sheet-stack img:nth-child(1) {
  z-index: 1;
  top: 0;
  left: 0;
}
.sheet-stack img:nth-child(2) {
  z-index: 2;
  top: 2px;
  left: 4px;
}
.sheet-stack img:nth-child(3) {
  z-index: 3;
  top: 4px;
  left: 8px;
}
.sheet-stack img:nth-child(4) {
  z-index: 4;
  top: 6px;
  left: 12px;
}
.sheet-stack img:nth-child(5) {
  z-index: 5;
  top: 8px;
  left: 16px;
}
.sheet-stack img:nth-child(6) {
  z-index: 6;
  top: 10px;
  left: 20px;
}
.sheet-stack img:nth-child(7) {
  z-index: 7;
  top: 12px;
  left: 24px;
}
.lookup-stage .visual-step-number {
  color: #fff;
  background: var(--forest);
}
.lookup-stage::after {
  grid-column: 1 / -1;
  width: 100%;
  height: 76px;
  box-sizing: border-box;
  border: 1px solid #171717;
  background:
    linear-gradient(
      90deg,
      transparent 0 7%,
      rgba(255, 213, 105, 0.65) 7% 35%,
      transparent 35% 100%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 20px,
      rgba(29, 29, 29, 0.18) 20px 21px
    ),
    repeating-linear-gradient(
      0deg,
      #fffdf7 0 24px,
      rgba(29, 29, 29, 0.2) 24px 25px
    );
  content: "BitsToWords — 0 1 1 1 0 0 1 0 1 0 0";
  color: #173f34;
  font-family: "DM Mono", monospace;
  font-size: 0.76rem;
  line-height: 2.9;
  text-align: center;
}
.lookup-stage:nth-child(2)::after {
  background:
    linear-gradient(
      90deg,
      transparent 0 34%,
      rgba(255, 213, 105, 0.65) 34% 57%,
      transparent 57% 100%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 20px,
      rgba(29, 29, 29, 0.18) 20px 21px
    ),
    repeating-linear-gradient(
      0deg,
      #fffdf7 0 24px,
      rgba(29, 29, 29, 0.2) 24px 25px
    );
}
.lookup-stage:nth-child(3)::after {
  background:
    linear-gradient(
      90deg,
      transparent 0 56%,
      rgba(255, 213, 105, 0.65) 56% 94%,
      transparent 94% 100%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 20px,
      rgba(29, 29, 29, 0.18) 20px 21px
    ),
    repeating-linear-gradient(
      0deg,
      #fffdf7 0 24px,
      rgba(29, 29, 29, 0.2) 24px 25px
    );
}
@keyframes shake-box {
  from {
    transform: rotate(-4deg) translateX(-3px);
  }
  to {
    transform: rotate(4deg) translateX(3px);
  }
}

@media (max-width: 800px) {
  .wizard {
    padding: 1.2rem;
  }
  .wizard-progress {
    grid-template-columns: auto 1fr;
  }
  .wizard-progress > :last-child {
    grid-column: 1 / -1;
  }
  .wizard .guide-step {
    min-height: auto;
  }
  .wizard .step-visual {
    min-height: 260px;
  }
  .compact,
  .setup-choices,
  .compact-checklist,
  .prepare-step .compact {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 800px) {
  .compact-checklist,
  .compact-checklist.has-box-clearance {
    width: 100%;
  }
  .compact-checklist [data-container-check="box"] {
    grid-column: auto;
    grid-row: auto;
  }
}

.step-visual .visual-step-number {
  justify-self: start;
}
.box-method,
.cup-method {
  justify-content: start;
}
.lookup-stage::after {
  grid-row: 1;
  grid-column: 1 / -1;
  height: 88px;
  padding-top: 0.1rem;
  border: 1px solid #315d50;
  border-radius: 4px;
  background:
    linear-gradient(
      90deg,
      transparent 0 6%,
      rgba(255, 213, 105, 0.48) 6% 31%,
      transparent 31% 100%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 21px,
      rgba(29, 29, 29, 0.2) 21px 22px
    ),
    repeating-linear-gradient(
      0deg,
      #fffdf7 0 28px,
      rgba(29, 29, 29, 0.22) 28px 29px
    );
  box-shadow: none;
  color: #173f34;
  content: "1\A 0 1 1  1 0 0  1 0 1 0 0";
  font-family: "DM Mono", monospace;
  font-size: 0.78rem;
  line-height: 2.2;
  text-align: center;
  white-space: pre;
}
.lookup-stage > * {
  grid-row: 2;
}
.lookup-stage:nth-child(2)::after {
  background:
    linear-gradient(
      90deg,
      transparent 0 31%,
      rgba(255, 213, 105, 0.48) 31% 56%,
      transparent 56% 100%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 21px,
      rgba(29, 29, 29, 0.2) 21px 22px
    ),
    repeating-linear-gradient(
      0deg,
      #fffdf7 0 28px,
      rgba(29, 29, 29, 0.22) 28px 29px
    );
}
.lookup-stage:nth-child(3)::after {
  background:
    linear-gradient(
      90deg,
      transparent 0 56%,
      rgba(108, 198, 135, 0.42) 56% 94%,
      transparent 94% 100%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 21px,
      rgba(29, 29, 29, 0.2) 21px 22px
    ),
    repeating-linear-gradient(
      0deg,
      #fffdf7 0 28px,
      rgba(29, 29, 29, 0.22) 28px 29px
    );
}
.lookup-stage .lookup-sheet,
.lookup-stage .sheet-highlight,
.lookup-stage .sheet-stack {
  height: 112px;
}
.lookup-stage .lookup-sheet {
  width: min(100%, 150px);
  height: 112px;
}
.sheet-stack img {
  width: 78%;
  height: 95px;
}
/* Final visual alignment and Step 4 lookup composition. */
.box-method,
.cup-method,
.face-mapping,
.boundary-shot {
  position: relative;
}
.box-method > .visual-step-number,
.cup-method > .visual-step-number,
.mapping-heading > .visual-step-number,
.boundary-shot > .visual-step-number,
.lookup-stage > .visual-step-number {
  position: absolute;
  z-index: 3;
  top: 0.6rem;
  left: 0.6rem;
}
.box-method,
.cup-method {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  width: 100%;
  padding-top: 0.6rem;
}
.mapping-heading {
  justify-content: center;
  min-height: 27px;
}
.boundary-shot {
  grid-template-columns: 1fr;
  padding-left: 2.7rem;
}

.lookup-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  grid-template-rows: 96px 118px;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 1rem 0.8rem 2.8rem;
  background: #fff;
  border-radius: 8px;
}
.lookup-stage::after {
  grid-row: 1;
  grid-column: 1 / -1;
  width: min(100%, 330px);
  height: 78px;
  justify-self: center;
  box-sizing: border-box;
  padding-top: 0.1rem;
  border: 1px solid #315d50;
  border-radius: 4px;
  background:
    linear-gradient(
      90deg,
      rgba(255, 213, 105, 0.5) 0 27.27%,
      transparent 27.27%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(9.09% - 1px),
      rgba(29, 29, 29, 0.24) calc(9.09% - 1px) 9.09%
    ),
    linear-gradient(#fffdf7, #fffdf7);
  color: #173f34;
  content: "1\A 1 1 0  1 0 0  1 0 1 0 0";
  font-family: "DM Mono", monospace;
  font-size: 0.78rem;
  line-height: 2.35;
  text-align: center;
  white-space: pre;
}
.lookup-stage:nth-child(2)::after {
  background:
    linear-gradient(
      90deg,
      transparent 0 27.27%,
      rgba(255, 213, 105, 0.5) 27.27% 54.54%,
      transparent 54.54%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(9.09% - 1px),
      rgba(29, 29, 29, 0.24) calc(9.09% - 1px) 9.09%
    ),
    linear-gradient(#fffdf7, #fffdf7);
}
.lookup-stage:nth-child(3)::after {
  background:
    linear-gradient(
      90deg,
      transparent 0 54.54%,
      rgba(108, 198, 135, 0.45) 54.54% 100%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(9.09% - 1px),
      rgba(29, 29, 29, 0.24) calc(9.09% - 1px) 9.09%
    ),
    linear-gradient(#fffdf7, #fffdf7);
}
.lookup-stage > .sheet-stack,
.lookup-stage > .lookup-sheet,
.lookup-stage > .sheet-highlight,
.lookup-stage > .lookup-arrow {
  grid-row: 2;
  align-self: center;
  justify-self: center;
}
.lookup-stage .lookup-sheet,
.lookup-stage .sheet-highlight {
  width: min(100%, 155px);
  height: auto;
  aspect-ratio: 297 / 210;
  object-fit: contain;
  background: #fff;
}
.sheet-highlight .lookup-sheet {
  width: 100%;
  height: 100%;
}
.sheet-stack {
  width: min(100%, 155px);
  height: 110px !important;
}
.sheet-stack img {
  width: 125px;
  height: auto;
  aspect-ratio: 297 / 210;
  object-fit: contain;
}
.sheet-stack img:nth-child(1) {
  top: 0;
  left: 0;
}
.sheet-stack img:nth-child(2) {
  top: 3px;
  left: 5px;
}
.sheet-stack img:nth-child(3) {
  top: 6px;
  left: 10px;
}
.sheet-stack img:nth-child(4) {
  top: 9px;
  left: 15px;
}
.sheet-stack img:nth-child(5) {
  top: 12px;
  left: 20px;
}
.sheet-stack img:nth-child(6) {
  top: 15px;
  left: 25px;
}
.sheet-stack img:nth-child(7) {
  top: 18px;
  left: 30px;
}
.column-highlight::after,
.column-row-highlight::after {
  top: 6%;
  bottom: 6%;
  left: 51%;
  width: 11%;
}
.column-row-highlight::before {
  top: 64%;
  height: 5%;
}
.lookup-arrow {
  color: var(--forest);
}

.mini-box {
  position: relative;
  margin-top: 24px;
}
.mini-box::before {
  position: absolute;
  right: -7px;
  bottom: calc(100% + 5px);
  left: -7px;
  height: 15px;
  background: #e4a568;
  border: 3px solid #ae6834;
  border-radius: 7px 7px 3px 3px;
  box-shadow: 0 3px 0 rgba(94, 52, 24, 0.16);
  content: "";
}

.lookup-stage::after {
  display: none;
}
.bits-word-box {
  grid-row: 1;
  grid-column: 1 / -1;
  align-self: start;
  justify-self: center;
  display: grid;
  grid-template-rows: 25px 32px 35px;
  width: min(100%, 330px);
  color: #111;
  background: #fff;
  border: 2px solid #315d50;
  font-family: "DM Mono", monospace;
}
.word-number {
  display: grid;
  place-items: center;
  border-bottom: 1px solid #315d50;
  font-size: 0.84rem;
}
.bit-cells {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
}
.bit-cells i {
  position: relative;
  display: grid;
  place-items: center;
  border-right: 1px solid #315d50;
  font-size: 0.8rem;
  font-style: normal;
}
.bit-cells i:last-child {
  border-right: 0;
}
.word-space {
  border-top: 1px solid #315d50;
}
.bits-page .bit-cells i:nth-child(-n + 3),
.bits-column .bit-cells i:nth-child(n + 4):nth-child(-n + 6),
.bits-row .bit-cells i:nth-child(n + 7) {
  background: rgba(255, 213, 105, 0.38);
}
.bits-page .bit-cells i:first-child::before,
.bits-column .bit-cells i:nth-child(4)::before,
.bits-row .bit-cells i:nth-child(7)::before {
  position: absolute;
  z-index: 2;
  top: -5px;
  left: -5px;
  height: calc(100% + 6px);
  border: 3px solid var(--coral);
  border-right: 0;
  border-radius: 9px 0 0 9px;
  content: "";
}
.bits-page .bit-cells i:first-child::before {
  width: calc(300% + 8px);
}
.bits-column .bit-cells i:nth-child(4)::before {
  width: calc(300% + 8px);
}
.bits-row .bit-cells i:nth-child(7)::before {
  width: calc(500% + 8px);
  border-color: #3bad70;
}
.bits-page .bit-cells i:nth-child(3),
.bits-column .bit-cells i:nth-child(6),
.bits-row .bit-cells i:nth-child(11) {
  z-index: 1;
}

.bits-page .bit-cells i:first-child::before,
.bits-column .bit-cells i:nth-child(4)::before,
.bits-row .bit-cells i:nth-child(7)::before {
  display: none;
}
.bit-cells {
  position: relative;
}
.bit-cells::after {
  position: absolute;
  z-index: 3;
  top: -5px;
  height: calc(100% + 8px);
  box-sizing: border-box;
  border: 3px solid var(--coral);
  border-radius: 9px;
  content: "";
  pointer-events: none;
}
.bits-page .bit-cells::after {
  left: -5px;
  width: calc(27.27% + 7px);
}
.bits-column .bit-cells::after {
  left: calc(27.27% - 3px);
  width: calc(27.27% + 7px);
}
.bits-row .bit-cells::after {
  left: calc(54.54% - 3px);
  width: calc(45.46% + 7px);
  border-color: #3bad70;
}
.lookup-stage .lookup-sheet,
.lookup-stage .sheet-highlight {
  aspect-ratio: 297 / 210;
}
.sheet-highlight {
  box-sizing: border-box;
}
.column-highlight::after,
.column-row-highlight::after {
  top: 0;
  bottom: 0;
  left: 51%;
  width: 11%;
  box-sizing: border-box;
  border: 2px solid var(--coral);
  background: rgba(230, 117, 99, 0.14);
}
.column-row-highlight::before {
  z-index: 2;
  top: 64%;
  right: 0;
  left: 0;
  width: 100%;
  height: 7%;
  box-sizing: border-box;
  border: 2px solid #3bad70;
  background: rgba(59, 173, 112, 0.18);
}

.word-number {
  width: 100%;
  justify-content: center;
  text-align: center !important;
}
.bits-page .bit-cells i:nth-child(-n + 3) {
  background: rgba(74, 137, 171, 0.24);
}
.bits-page .bit-cells::after {
  border-color: #4a89ab;
}
.sheet-stack::after {
  position: absolute;
  z-index: 20;
  top: 1px;
  left: 1px;
  width: 15px;
  height: 6px;
  background: #4a89ab;
  border-radius: 1px;
  box-shadow:
    5px 3px #4a89ab,
    10px 6px #4a89ab,
    15px 9px #4a89ab,
    20px 12px #4a89ab,
    25px 15px #4a89ab,
    30px 18px #4a89ab;
  content: "";
  pointer-events: none;
}

.lookup-write-stage {
  grid-template-rows: 96px;
  min-height: 116px;
}
.lookup-write-stage .bits-word-box {
  align-self: center;
}
.bits-complete .word-space {
  display: grid;
  place-items: center;
  color: var(--deep-forest);
  background: rgba(74, 137, 171, 0.2);
  outline: 3px solid #4a89ab;
  outline-offset: -3px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.bits-complete .bit-cells::after {
  display: none;
}
.bits-complete .word-space {
  color: var(--deep-forest);
  background: rgba(226, 178, 81, 0.28);
  outline-color: #c7922f;
}
.lookup-write-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 116px;
  overflow: hidden;
}
.lookup-write-stage .bits-word-box {
  align-self: auto;
}
.lookup-write-stage > .visual-step-number {
  display: grid !important;
  top: 50% !important;
  left: 0.65rem !important;
  transform: translateY(-50%);
}
.box-method .aligned-dice {
  display: block;
  width: min(100%, 285px);
  height: 150px;
  overflow: hidden;
  background-image: url("assets/IMG_4750.jpeg");
  background-position: 18% 18%;
  background-size: 155% auto;
  border: 1px solid #9ca89b;
  border-radius: 14px;
  box-shadow: 0 6px 15px rgba(29, 67, 54, 0.14);
}
.box-method .aligned-dice span {
  display: none;
}

/* BitsToWords groups, directional lookup cues, and rolling entry examples. */
.bit-cells i:nth-child(3),
.bit-cells i:nth-child(6) {
  border-right: 3px solid #315d50;
}
.bits-column .bit-cells::after {
  left: calc(27.27% - 3px);
  width: calc(27.27% + 3px);
}
.lookup-arrow {
  color: var(--coral);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(125, 46, 33, 0.25);
}
.bits-word-box {
  position: relative;
}
.lookup-stage:not(.lookup-write-stage) .bits-word-box::before {
  position: absolute;
  z-index: 5;
  top: calc(100% + 5px);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: var(--forest);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(21, 72, 62, 0.25);
  content: "↓";
  font-family: Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}
.lookup-stage:nth-child(1) .bits-word-box::before {
  left: 25%;
}
.lookup-stage:nth-child(2) .bits-word-box::before {
  left: 46%;
}
.lookup-stage:nth-child(3) .bits-word-box::before {
  left: 74%;
}
.lookup-stage:nth-child(3)::after {
  position: absolute;
  z-index: 8;
  right: 50%;
  bottom: -1.15rem;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: #3bad70;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(21, 72, 62, 0.25);
  content: "↓";
  font-family: Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.sheet-stack::after {
  width: 21px;
  height: 8px;
  opacity: 0.55;
  box-shadow:
    6px 4px rgba(74, 137, 171, 0.72),
    12px 8px rgba(74, 137, 171, 0.62),
    18px 12px rgba(74, 137, 171, 0.52),
    24px 16px rgba(74, 137, 171, 0.42),
    30px 20px rgba(74, 137, 171, 0.34),
    36px 24px rgba(74, 137, 171, 0.26);
}

.bit-entry-shot,
.final-boundary-shot {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0.35rem 0;
}
.bit-entry-shot > .visual-step-number,
.final-boundary-shot > .visual-step-number {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 0.6rem;
  transform: translateY(-50%);
}
.bit-entry-shot .bits-word-box,
.final-boundary-shot .bits-word-box {
  width: min(100%, 300px);
  grid-template-rows: 23px 31px 30px;
}
.bit-entry-shot .word-space,
.final-boundary-shot .word-space {
  min-height: 30px;
  background: #fff;
}
.bit-entry-shot .new-bit {
  background: rgba(255, 213, 105, 0.52);
}
.bit-entry-shot .bit-cells::after {
  display: block;
  top: -4px;
  height: calc(100% + 7px);
  border-color: var(--coral);
}
.entry-variable .bit-cells::after {
  left: calc(45.45% - 3px);
  width: calc(18.18% + 6px);
}
.entry-binary .bit-cells::after {
  left: calc(45.45% - 3px);
  width: calc(9.09% + 6px);
}
.final-boundary-shot .locked-bit {
  background: repeating-linear-gradient(
    135deg,
    #e2e7e1 0 5px,
    #f4f6f3 5px 10px
  );
}
.final-boundary-shot .bits-word-box {
  border-color: #3bad70;
}
.final-boundary-shot .word-number {
  color: var(--forest);
  background: rgba(59, 173, 112, 0.12);
}

.cup-method .cup-icon {
  position: relative;
  width: 108px;
  height: 100px;
  padding: 28px 14px 12px;
  overflow: hidden;
  color: transparent;
  background: #d6a060;
  border: 5px solid #9f6538;
  border-radius: 13px 13px 45px 45px;
  box-shadow:
    inset 0 8px rgba(255, 255, 255, 0.17),
    0 5px 0 rgba(86, 57, 29, 0.12);
  animation: shake-cup 0.38s ease-in-out infinite alternate;
}
.cup-method .cup-icon::before {
  position: absolute;
  top: 9px;
  right: 11px;
  left: 11px;
  height: 18px;
  background: #85522e;
  border-radius: 50%;
  content: "";
}
.cup-method .cup-icon::after {
  position: absolute;
  right: -20px;
  top: 28px;
  width: 25px;
  height: 40px;
  border: 6px solid #9f6538;
  border-left: 0;
  border-radius: 0 20px 20px 0;
  content: "";
}
.cup-method .cup-icon {
  background-image:
    radial-gradient(circle 4px at 30% 58%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 51% 68%, var(--forest) 99%, transparent 100%),
    radial-gradient(circle 4px at 72% 57%, var(--forest) 99%, transparent 100%);
  background-repeat: no-repeat;
}
.cup-method .tray-dice {
  width: min(100%, 285px);
  height: 150px;
  padding: 68px 24px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(31, 90, 78, 0.08)),
    linear-gradient(145deg, #d9c3a1, #aa7d53);
  border: 8px solid #76533a;
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 4px #e7d3b0,
    0 6px 15px rgba(29, 67, 54, 0.14);
}
.cup-method .tray-dice::before {
  position: absolute;
  top: 12px;
  left: 17%;
  right: 17%;
  height: 35px;
  border: 3px solid rgba(103, 71, 46, 0.65);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  content: "";
}
.cup-method .tray-dice span {
  background-color: #fff8df !important;
}
.cup-method .cup-icon {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  background-image: none;
}
.cup-method .cup-icon span {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--forest);
  background: #fff8df;
  border: 1px solid #315d50;
  border-radius: 4px;
  font-family: "DejaVu Sans", sans-serif;
  font-size: 1rem;
  line-height: 1;
}
.cup-method .cup-icon span:nth-child(2) {
  transform: translateY(-4px) rotate(10deg);
}
.cup-method .cup-icon span:nth-child(3) {
  transform: rotate(-9deg);
}
.cup-method .tray-dice {
  position: relative;
}
@keyframes shake-cup {
  from {
    transform: translateY(-7px) rotate(-4deg);
  }
  to {
    transform: translateY(7px) rotate(4deg);
  }
}
@keyframes shake-hand {
  from {
    transform: translateX(-50%) translateY(-7px) rotate(-4deg);
  }
  to {
    transform: translateX(-50%) translateY(7px) rotate(4deg);
  }
}

/* Final cleanup: preserve only the actual BitsToWords stopping boundary. */
.final-boundary-shot .bit-cells::after {
  display: none;
}
.final-boundary-shot .bit-cells i:nth-child(3),
.final-boundary-shot .bit-cells i:nth-child(6) {
  border-right-width: 1px;
}
.final-boundary-12 .bit-cells i:nth-child(4),
.final-boundary-24 .bit-cells i:nth-child(3) {
  border-right: 4px solid var(--forest);
}
.final-boundary-shot .bits-word-box {
  border-color: #315d50;
}
.final-boundary-shot .word-number {
  color: inherit;
  background: transparent;
}

/* A hand with a palm and fingers, rather than the earlier abstract shape. */
.cup-method::before {
  display: none;
}
.cup-method .cup-shake {
  position: relative;
  display: grid;
  place-items: end center;
  width: 128px;
  height: 120px;
}
.cup-method .cup-hand {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 26px;
  width: 78px;
  height: 35px;
  background: #edbd97;
  border: 3px solid #bd805d;
  border-radius: 42% 42% 30% 30%;
  box-shadow: inset 0 -8px rgba(158, 91, 57, 0.13);
  animation: shake-hand 0.38s ease-in-out infinite alternate;
}
.cup-method .cup-hand::before {
  position: absolute;
  top: -13px;
  left: 6px;
  width: 12px;
  height: 25px;
  background: #edbd97;
  border: 3px solid #bd805d;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  box-shadow:
    15px -3px 0 -3px #edbd97,
    15px -3px 0 0 #bd805d,
    30px -1px 0 -3px #edbd97,
    30px -1px 0 0 #bd805d,
    45px 2px 0 -3px #edbd97,
    45px 2px 0 0 #bd805d;
  content: "";
}
.cup-method .cup-hand::after {
  position: absolute;
  right: -12px;
  bottom: -8px;
  width: 22px;
  height: 14px;
  background: #edbd97;
  border: 3px solid #bd805d;
  border-radius: 4px 10px 10px 9px;
  content: "";
  transform: rotate(32deg);
}
.cup-method .cup-icon {
  animation: shake-cup 0.38s ease-in-out infinite alternate;
}

/* Let the dice settle naturally on a plain tray. */
.cup-method .tray-dice::before {
  display: none;
}
.cup-method .tray-dice {
  display: block;
  position: relative;
  width: 320px;
  height: 170px;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(31, 90, 78, 0.08)),
    linear-gradient(145deg, #d9c3a1, #aa7d53);
  border: 8px solid #76533a;
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 4px #e7d3b0,
    0 6px 15px rgba(29, 67, 54, 0.14);
}
.cup-method .tray-dice span {
  position: absolute;
}
.cup-method .tray-dice span:nth-child(1) {
  bottom: 38px;
  left: 68px;
  transform: rotate(-17deg);
}
.cup-method .tray-dice span:nth-child(2) {
  bottom: 72px;
  left: 136px;
  transform: rotate(13deg);
}
.cup-method .tray-dice span:nth-child(3) {
  right: 68px;
  bottom: 42px;
  transform: rotate(26deg);
}
.cup-method p {
  display: none;
}

/* Longer, heavier conversion arrows. */
.mapping-row.arrows span {
  display: grid !important;
  place-items: center;
  justify-self: center;
  color: var(--coral);
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1.3;
  transform: scaleY(1.22);
}

/* Direct connector arrows: no symbols or circular badges. */
.lookup-arrow {
  color: var(--deep-forest);
  font-size: 3rem !important;
  font-weight: 900;
  line-height: 0.7;
  text-shadow: none;
  transform: scaleX(1.25);
}
.lookup-stage:not(.lookup-write-stage) .bits-word-box::before {
  top: calc(100% + 3px);
  width: 4px;
  height: 35px;
  background: var(--deep-forest);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: transparent;
  content: "";
  clip-path: polygon(20% 0, 80% 0, 80% 72%, 100% 72%, 50% 100%, 0 72%, 20% 72%);
}
.lookup-stage:nth-child(3)::after {
  right: calc(50% - 2px);
  bottom: -1.45rem;
  display: block;
  width: 4px;
  height: 35px;
  background: #3bad70;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: transparent;
  content: "";
  clip-path: polygon(20% 0, 80% 0, 80% 72%, 100% 72%, 50% 100%, 0 72%, 20% 72%);
}

/* Align each conversion column and connect every source highlight to its target. */
.cup-method .cup-hand {
  left: 50%;
  transform-origin: center;
  animation: shake-hand-inverted 0.38s ease-in-out infinite alternate;
}
.cup-method .cup-hand::after {
  right: -24px;
  left: auto;
  transform: rotate(-58deg);
  transform-origin: left center;
}
.cup-method .cup-hand::before {
  box-shadow:
    15px -3px 0 -3px #edbd97,
    15px -3px 0 0 #bd805d,
    30px -1px 0 -3px #edbd97,
    30px -1px 0 0 #bd805d,
    45px 2px 0 -3px #edbd97,
    45px 2px 0 0 #bd805d;
}
.cup-method .cup-icon::before {
  top: 17px;
  height: 10px;
}
.cup-method .cup-hand::before {
  box-shadow: none;
}
.cup-method .hand-finger {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 28px;
  background: #edbd97;
  border: 3px solid #bd805d;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}
.cup-method .finger-two {
  top: -16px;
  left: 21px;
}
.cup-method .finger-three {
  top: -14px;
  left: 36px;
}
.cup-method .finger-four {
  top: -11px;
  left: 51px;
}
@keyframes shake-hand-inverted {
  from {
    transform: translateX(-50%) translateY(-7px) rotate(176deg);
  }
  to {
    transform: translateX(-50%) translateY(7px) rotate(184deg);
  }
}
.lookup-stage > .bits-word-box {
  z-index: 30;
}
.lookup-stage:not(.lookup-write-stage) .bits-word-box::before {
  z-index: 30;
  top: 57px;
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 0;
  clip-path: polygon(0 30%, 80% 30%, 80% 0, 100% 50%, 80% 100%, 80% 70%, 0 70%);
  transform-origin: left center;
}
.lookup-stage:nth-child(1) .bits-word-box::before {
  left: 13.5%;
  width: 67px;
  background: #4a89ab;
  transform: rotate(93deg);
}
.lookup-stage:nth-child(2) .bits-word-box::before {
  left: 40.9%;
  width: 140px;
  background: var(--coral);
  transform: rotate(24deg);
}
.lookup-stage:nth-child(3) .bits-word-box::before {
  top: 58px;
  left: 77.3%;
  width: 117px;
  background: #3bad70;
  transform: rotate(86.6deg);
}
.lookup-stage:nth-child(3)::after {
  z-index: 30;
  top: 75%;
  right: auto;
  bottom: auto;
  left: 78%;
  width: 169px;
  height: 10px;
  background: #c7922f;
  clip-path: polygon(0 30%, 80% 30%, 80% 0, 100% 50%, 80% 100%, 80% 70%, 0 70%);
  transform-origin: left center;
  transform: rotate(125deg);
}
.lookup-stage:nth-child(3) {
  z-index: 40;
}

/* Consistent white visual cards for the rolling and checksum stages. */
.rolling-visual > *:not([hidden]) {
  width: 100%;
  padding: 0.75rem;
  background: #fff;
  border-radius: 8px;
}
.rolling-visual > .box-method,
.rolling-visual > .cup-method {
  padding-top: 0.75rem;
}
.finish-visual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  align-content: center;
}
.final-bits-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
}
.final-bits {
  display: flex;
  overflow: hidden;
  border: 2px solid #c7922f;
  border-radius: 5px;
  font-family: "DM Mono", monospace;
  font-size: 0.78rem;
}
.final-bits span {
  padding: 0.55rem 0.65rem;
}
.rolled-bits {
  color: #fff;
  background: var(--forest);
}
.checksum-bits {
  color: #6f4512;
  background: rgba(255, 213, 105, 0.62);
}
.final-candidate {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  overflow: visible;
}
.final-candidate::after,
.candidate-12::after,
.candidate-24::after {
  display: none;
}
.final-range-highlight {
  position: relative;
  width: min(100%, 155px);
  height: auto;
  aspect-ratio: 297 / 210;
  overflow: hidden;
  border: 1px solid #9ca89b;
  background: #fff;
}
.final-range-highlight .lookup-sheet {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
}
.final-range-highlight::after {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  border: 2px solid #c7922f;
  background: rgba(255, 213, 105, 0.32);
  content: "";
  pointer-events: none;
}
.half-column::after {
  top: 0;
  bottom: 50%;
  left: 51%;
  width: 11%;
}
.full-page::after {
  inset: 0;
}
.final-candidate span {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.45rem;
  padding: 0;
  color: var(--forest);
  background: transparent;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}
.final-range-breakdown ul {
  display: grid;
  gap: 0.3rem;
  padding-left: 1.2rem;
  margin: 0.55rem 0 0;
}
.final-range-breakdown li {
  min-height: 0;
  padding-left: 0;
}
.completion-step {
  grid-template-columns: 1fr;
}
.completion-step .step-copy {
  display: grid;
  place-items: center;
  max-width: 850px;
  margin: auto;
  text-align: center;
}
.completion-step .step-number {
  margin-bottom: 1.3rem;
}
.completion-step h2 {
  margin: 0;
  font-size: clamp(3.7rem, 8vw, 6.7rem) !important;
  line-height: 0.95;
}
.completion-step .step-copy > p:not(.step-number) {
  margin: 1.6rem 0 0;
  font-size: 1.12rem;
}
.celebration-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin-bottom: 1.6rem;
  color: #fff;
  background: var(--coral);
  border-radius: 50%;
  font-size: 3.4rem;
  transform: rotate(10deg);
}
.celebration-mark::before,
.celebration-mark::after {
  position: absolute;
  color: #c7922f;
  content: "✦";
}
.celebration-mark::before {
  top: -20px;
  left: -56px;
  font-size: 1.6rem;
  transform: rotate(-24deg);
}
.celebration-mark::after {
  right: -54px;
  bottom: -15px;
  color: #3bad70;
  font-size: 2rem;
  transform: rotate(27deg);
}

/* Unified visual-stage card pattern: one white card per visual step, badge left-centered. */
.visual-stage {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #fff;
  border-radius: 8px;
}
.visual-stage:last-child {
  margin-bottom: 0;
}
/* Parent grids must not add their own gap; spacing is handled by visual-stage margin. */
.visual-stage > .visual-step-number {
  position: static;
  align-self: center;
  justify-self: start;
}
.visual-stage .visual-step-number {
  position: static;
  top: auto;
  left: auto;
  transform: none;
}
.visual-stage-content {
  min-width: 0;
  width: 100%;
}
.visual-stage-content > [hidden] {
  display: none !important;
}

/* Roll / read method stages */
.roll-method,
.read-method {
  display: none;
}
.roll-method:not([hidden]),
.read-method:not([hidden]) {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0.4rem;
  width: 100%;
}
.roll-method p,
.read-method p {
  display: block;
  margin: 0;
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

/* Re-use cup/box styling for variants inside visual-stage without their old layout assumptions. */
.visual-stage .box-method,
.visual-stage .cup-method {
  padding-top: 0;
}
.visual-stage .box-method > .visual-step-number,
.visual-stage .cup-method > .visual-step-number {
  position: static;
  top: auto;
  left: auto;
  transform: none;
}

/* Face mapping inside visual-stage */
.visual-stage .face-mapping {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
}
.visual-stage .mapping-heading {
  justify-content: center;
  margin-bottom: 0.25rem;
}

/* Bit-entry and final-boundary shots inside visual-stage */
.visual-stage .bit-entry-shot,
.visual-stage .final-boundary-shot {
  padding: 0;
}
.visual-stage .bit-entry-shot > .visual-step-number,
.visual-stage .final-boundary-shot > .visual-step-number {
  position: static;
  transform: none;
}

/* Keep cup/box visuals inside visual-stage from overflowing narrow cards. */
.visual-stage .cup-method .tray-dice,
.visual-stage .box-method .aligned-dice,
.visual-stage .cup-method .cup-shake,
.visual-stage .box-method .mini-box {
  max-width: 100%;
}

/* Worksheet preview for Step 2 — matches the printed BitsToWords sheet. */
.worksheet-preview {
  width: 100%;
}
.worksheet-field {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  width: 100%;
  padding: 0.35rem 0 0.5rem;
  border-bottom: 2px solid #315d50;
}
.worksheet-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--deep-forest);
  white-space: nowrap;
}
.worksheet-input {
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: 0.1rem;
  color: var(--deep-forest);
  font-family: "DM Mono", monospace;
  font-size: 0.82rem;
  border-bottom: 1px dashed #94bb98;
}
.worksheet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem 0.45rem;
  margin-top: 0.55rem;
}
.worksheet-grid[data-worksheet-24] {
  display: none;
}
body[data-phrase-length="24"] .worksheet-grid[data-worksheet-24] {
  display: grid;
}
body[data-phrase-length="24"] .worksheet-grid[data-worksheet-12] {
  display: none;
}
.ws-cell {
  display: grid;
  grid-template-rows: 2.5rem 22px;
  gap: 0.1rem;
}
.ws-cell span:first-child {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
}
.ws-cell span:last-child {
  background: #fffdf7;
  border: 1px solid #94bb98;
  border-radius: 3px;
}

/* Finish visual adjustments */
.guide-step[data-step-panel="5"] .step-visual {
  min-height: 350px;
}
.finish-visual {
  grid-template-columns: 1fr;
  gap: 0;
  align-content: center;
  width: 100%;
}
.finish-visual .visual-stage {
  min-height: 350px;
  margin-bottom: 0;
}
.finish-visual .visual-stage-content {
  display: grid;
  place-items: center;
  width: 100%;
}

/* P/C/R and checksum marker rows mirror the printed BitsToWords worksheet. */
.bits-word-box {
  grid-template-rows: 25px 32px 22px 35px;
}
.bit-entry-shot .bits-word-box,
.final-boundary-shot .bits-word-box {
  grid-template-rows: 23px 31px 22px 30px;
}
.bit-marker-row {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  min-height: 22px;
  border-top: 1px solid #315d50;
  color: #203933;
  background: #fff;
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
}
.bit-marker-row span {
  display: grid !important;
  place-items: center;
  min-width: 0;
  margin: 0 !important;
  padding: 0;
  color: inherit;
  border-right: 1px solid #315d50;
  font-size: inherit !important;
  line-height: 1;
  text-align: center !important;
}
.bit-marker-row span:last-child {
  border-right: 0;
}
.marker-page {
  grid-column: span 3;
  border-right: 3px solid #315d50 !important;
}
.marker-column {
  grid-column: span 3;
  border-right: 3px solid #315d50 !important;
}
.marker-row {
  grid-column: span 5;
}
.bit-marker-final-12 .marker-row-partial {
  grid-column: span 1;
  border-right: 3px solid #315d50 !important;
}
.marker-checksum {
  grid-column: span 4;
  color: #6f4512 !important;
  background: rgba(255, 213, 105, 0.46);
}
.bit-marker-final-24 .marker-checksum {
  grid-column: span 8;
}
.bit-marker-row + .word-space {
  border-top: 0;
}
.bit-cells i:nth-child(8) {
  border-right: 2px solid #94a8a0;
}
.checksum-cell {
  color: #6f4512;
  background: rgba(255, 213, 105, 0.42);
}

/* Updated Step 4 lookup composition, based on the current P/C/R printout. */
.lookup-visual {
  display: grid;
  align-content: center;
  gap: 0.75rem;
  width: 100%;
}
.lookup-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 0.95fr) minmax(0, 1.05fr);
  grid-template-rows: auto;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 155px;
  padding: 0.8rem 0.85rem 0.8rem 2.65rem;
  background: #fff;
  border-radius: 8px;
}
.lookup-stage::after,
.lookup-stage:not(.lookup-write-stage) .bits-word-box::before,
.lookup-stage:nth-child(3)::after {
  display: none !important;
}
.lookup-stage > .visual-step-number {
  position: absolute;
  top: 50%;
  left: 0.65rem;
  z-index: 4;
  transform: translateY(-50%);
}
.lookup-stage > .bits-word-box {
  grid-row: 1;
  grid-column: 1;
  width: min(100%, 320px);
  margin: 0;
}
.lookup-flow {
  display: flex;
  grid-row: 1;
  grid-column: 2;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 0;
}
.lookup-stage .lookup-sheet,
.lookup-stage .sheet-highlight {
  width: min(100%, 142px);
  height: auto;
  aspect-ratio: 297 / 210;
  margin: 0;
  overflow: hidden;
  object-fit: contain;
  border: 1px solid #9ca89b;
  background: #fff;
}
.lookup-stage .sheet-highlight .lookup-sheet {
  width: 100%;
  height: 100%;
  border: 0;
}
.lookup-flow .lookup-arrow {
  flex: 0 0 auto;
  color: var(--deep-forest);
  font-size: 1.55rem !important;
  line-height: 1;
  transform: none;
}
.lookup-stage .sheet-stack {
  width: 104px;
  height: 78px !important;
}
.lookup-stage .sheet-stack img {
  width: 88px;
  height: auto;
  aspect-ratio: 297 / 210;
  object-fit: contain;
}
.lookup-stage .sheet-stack img:nth-child(1) { top: 0; left: 0; }
.lookup-stage .sheet-stack img:nth-child(2) { top: 2px; left: 3px; }
.lookup-stage .sheet-stack img:nth-child(3) { top: 4px; left: 6px; }
.lookup-stage .sheet-stack img:nth-child(4) { top: 6px; left: 9px; }
.lookup-stage .sheet-stack img:nth-child(5) { top: 8px; left: 12px; }
.lookup-stage .sheet-stack img:nth-child(6) { top: 10px; left: 15px; }
.lookup-stage .sheet-stack img:nth-child(7) { top: 12px; left: 18px; }
.lookup-stage .sheet-stack img:nth-child(8) { top: 14px; left: 21px; }
.column-highlight::after,
.column-block-highlight::after,
.column-block-row-highlight::after {
  position: absolute;
  z-index: 2;
  top: 6%;
  bottom: 6%;
  left: 55%;
  width: 11%;
  box-sizing: border-box;
  border: 2px solid var(--coral);
  background: rgba(230, 117, 99, 0.14);
  content: "";
}
.column-block-highlight::before {
  position: absolute;
  z-index: 3;
  top: 51%;
  right: 6%;
  left: 6%;
  height: 20%;
  box-sizing: border-box;
  border: 2px solid var(--deep-forest);
  background: rgba(21, 72, 62, 0.18);
  content: "";
}
.column-block-row-highlight::before {
  position: absolute;
  z-index: 3;
  top: 62.5%;
  right: 6%;
  left: 6%;
  height: 3.5%;
  box-sizing: border-box;
  border: 2px solid #3bad70;
  background: rgba(59, 173, 112, 0.24);
  content: "";
}
.lookup-row-stage {
  min-height: 205px;
}
.row-lookup-flow {
  display: grid;
  grid-row: 1;
  grid-column: 2;
  gap: 0.55rem;
  min-width: 0;
}
.row-selection {
  display: grid;
  grid-template-columns: minmax(3.8rem, 0.5fr) 1.2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
}
.row-selection-source {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0.25rem;
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}
.block-source,
.block-arrow {
  color: #fff;
  background: var(--deep-forest);
}
.row-source,
.row-arrow {
  color: #fff;
  background: #3bad70;
}
.row-selection-arrow {
  display: grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
}
.row-selection .sheet-highlight {
  width: min(100%, 118px);
  justify-self: end;
}
.lookup-write-stage {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 158px;
}
.lookup-write-stage > .bits-word-box {
  grid-column: 1;
  width: min(100%, 320px);
}

/* Final-word range: use the same bit, marker, and word rows as the worksheet. */
.final-bits-stage {
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
}
[data-final-bits] {
  width: min(100%, 320px);
}
[data-final-bits] .bits-word-box {
  width: 100%;
  margin: 0;
  border-color: #c7922f;
}
[data-final-bits] .word-space {
  min-height: 28px;
}
[data-final-bits] .word-number {
  color: var(--deep-forest);
  background: rgba(226, 178, 81, 0.18);
}

@media (max-width: 700px) {
  .lookup-stage,
  .lookup-row-stage {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 2.6rem;
  }
  .lookup-stage > .bits-word-box,
  .lookup-flow,
  .row-lookup-flow {
    grid-column: 1;
  }
  .lookup-flow,
  .row-lookup-flow {
    grid-row: auto;
  }
  .lookup-flow {
    margin-top: 0.1rem;
  }
  .row-selection {
    grid-template-columns: 4rem 1.2rem minmax(0, 1fr);
  }
}

/* Restore the centered BitsToWords-to-page lookup sequence. */
.bit-marker-row + .word-space {
  border-top: 0;
}
.bit-marker-row {
  border-bottom: 1px solid #315d50;
}
.final-boundary-12 .bit-cells i:nth-child(7),
[data-final-bits-12] .bit-cells i:nth-child(7) {
  border-right: 3px solid #315d50;
}
.final-boundary-12 .bit-cells i:nth-child(8),
[data-final-bits-12] .bit-cells i:nth-child(8),
.final-boundary-24 .bit-cells i:nth-child(6),
.final-boundary-24 .bit-cells i:nth-child(8),
[data-final-bits-24] .bit-cells i:nth-child(6),
[data-final-bits-24] .bit-cells i:nth-child(8) {
  border-right-width: 1px;
}
.final-boundary-12 .bit-cells i:nth-child(8),
[data-final-bits-12] .bit-cells i:nth-child(8),
.final-boundary-24 .bit-cells i:nth-child(4),
[data-final-bits-24] .bit-cells i:nth-child(4) {
  border-right-width: 1px;
}
.final-boundary-12 .bit-cells i:nth-child(3),
.final-boundary-12 .bit-cells i:nth-child(6),
.final-boundary-12 .bit-cells i:nth-child(7) {
  border-right: 3px solid #315d50;
}
.final-boundary-12 .bit-cells i:nth-child(4) {
  border-right-width: 1px;
}
.final-boundary-24 .bit-cells i:nth-child(3) {
  border-right: 3px solid #315d50;
}

.lookup-stage,
.lookup-row-stage {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  align-items: start;
  justify-items: center;
  gap: 0.7rem;
  min-height: 258px;
  padding: 0.75rem 0.85rem 0.85rem 2.8rem;
}
.lookup-row-stage {
  min-height: 292px;
}
.lookup-stage > .visual-step-number {
  position: absolute !important;
  top: 50% !important;
  left: 0.65rem !important;
  grid-row: auto !important;
  grid-column: auto !important;
  align-self: auto !important;
  justify-self: auto !important;
  transform: translateY(-50%) !important;
}
.lookup-stage > .bits-word-box {
  grid-row: 1;
  grid-column: 1;
  width: min(100%, 330px);
  margin: 0;
}
.lookup-flow,
.row-lookup-flow {
  display: flex;
  grid-row: 2;
  grid-column: 1;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}
.lookup-stage .lookup-sheet,
.lookup-stage .sheet-highlight {
  width: 155px;
  height: auto;
  aspect-ratio: 297 / 210;
  margin: 0;
  overflow: hidden;
  object-fit: contain;
  border: 1px solid #9ca89b;
  background: #fff;
}
.lookup-stage .sheet-highlight .lookup-sheet {
  width: 100%;
  height: 100%;
  border: 0;
}
.lookup-stage .sheet-stack {
  width: 190px;
  height: 126px !important;
}
.lookup-stage .sheet-stack img {
  width: 155px;
  height: auto;
  aspect-ratio: 297 / 210;
  object-fit: contain;
}
.lookup-stage .sheet-stack img:nth-child(1) { top: 0; left: 0; }
.lookup-stage .sheet-stack img:nth-child(2) { top: 3px; left: 5px; }
.lookup-stage .sheet-stack img:nth-child(3) { top: 6px; left: 10px; }
.lookup-stage .sheet-stack img:nth-child(4) { top: 9px; left: 15px; }
.lookup-stage .sheet-stack img:nth-child(5) { top: 12px; left: 20px; }
.lookup-stage .sheet-stack img:nth-child(6) { top: 15px; left: 25px; }
.lookup-stage .sheet-stack img:nth-child(7) { top: 18px; left: 30px; }
.lookup-stage .sheet-stack img:nth-child(8) { top: 21px; left: 35px; }
.lookup-flow .lookup-arrow {
  flex: 0 0 auto;
  color: var(--deep-forest);
  font-size: 2.15rem !important;
  line-height: 1;
  transform: none;
}
.lookup-flow .lookup-sheet,
.lookup-flow .sheet-highlight {
  flex: 0 0 126px;
  width: 126px;
}
.lookup-flow .sheet-stack {
  flex: 0 0 156px;
  width: 156px;
  height: 111px !important;
}
.lookup-flow .sheet-stack img {
  width: 126px;
}
.sheet-stack img:nth-child(8) {
  z-index: 8;
}
.stack-page-marker {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  box-sizing: border-box;
  border: 2px solid #4a89ab;
  border-radius: 4px;
  background: rgba(74, 137, 171, 0.2);
  pointer-events: none;
}
.page-highlight {
  position: relative;
}
.page-marker-choice {
  position: absolute;
  z-index: 4;
  top: 3%;
  left: 1.5%;
  width: 13.5%;
  height: 9%;
  box-sizing: border-box;
  border: 2px solid #4a89ab;
  border-radius: 4px;
  background: rgba(74, 137, 171, 0.2);
  pointer-events: none;
}

.column-highlight::after {
  display: none;
}
.column-highlight .column-choice {
  position: absolute;
  z-index: 3;
  top: 6%;
  bottom: 6%;
  left: 55%;
  width: 11%;
  box-sizing: border-box;
  border: 2px solid var(--coral);
  border-radius: 0;
  border-color: var(--coral);
  background: rgba(230, 117, 99, 0.14);
  pointer-events: none;
}
.row-lookup-flow {
  position: relative;
}
.row-lookup-sheet {
  position: relative;
}
.row-lookup-sheet .lookup-highlight {
  position: absolute;
  z-index: 3;
  box-sizing: border-box;
  border: 2px solid;
  border-radius: 0;
  pointer-events: none;
}
.row-lookup-sheet .column-choice {
  top: 6%;
  bottom: 6%;
  left: 55%;
  width: 11%;
  border-color: var(--coral);
  background: rgba(230, 117, 99, 0.14);
}
.row-lookup-sheet .block-choice {
  top: 51%;
  left: 2%;
  width: 8%;
  height: 20%;
  border-color: var(--deep-forest);
  background: rgba(21, 72, 62, 0.18);
}
.row-lookup-sheet .row-choice {
  top: 62.5%;
  right: 6%;
  left: 6%;
  height: 3.5%;
  border-color: #3bad70;
  background: rgba(59, 173, 112, 0.24);
}
.bits-row .bit-cells::before,
.bits-row .bit-cells::after {
  position: absolute;
  z-index: 5;
  top: -5px;
  height: calc(100% + 8px);
  box-sizing: border-box;
  border: 3px solid;
  border-radius: 9px;
  content: "";
  pointer-events: none;
}
.bits-row .bit-cells::before {
  left: calc(54.54% - 3px);
  width: calc(18.18% + 6px);
  border-color: var(--deep-forest);
  background: rgba(21, 72, 62, 0.18);
}
.bits-row .bit-cells::after {
  left: calc(72.72% - 3px);
  width: calc(27.28% + 6px);
  border-color: #3bad70;
  background: rgba(59, 173, 112, 0.22);
}
.row-connector-layer {
  position: absolute;
  z-index: 50;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  grid-row: auto !important;
  grid-column: auto !important;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.row-connector-layer line {
  fill: none;
  stroke-width: 3;
}
.block-guide-line {
  stroke: var(--deep-forest);
}
.row-guide-line {
  stroke: #3bad70;
}
.stage-connector-layer {
  position: absolute;
  z-index: 45;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  grid-row: auto !important;
  grid-column: auto !important;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.stage-connector-layer line {
  fill: none;
  stroke-width: 3;
}
.page-guide-line {
  stroke: #4a89ab;
}
.column-guide-line {
  stroke: var(--coral);
}
.lookup-row-stage::after {
  display: none;
  position: absolute;
  z-index: 60 !important;
  bottom: -1.8rem;
  left: 54%;
  width: 4px;
  height: 39px;
  background: #3bad70;
  clip-path: polygon(20% 0, 80% 0, 80% 72%, 100% 72%, 50% 100%, 0 72%, 20% 72%);
  content: "";
  pointer-events: none;
}
.lookup-write-stage::before {
  content: none;
}

.lookup-write-stage {
  display: grid;
  min-height: 158px;
  overflow: visible;
  z-index: 80;
}
.lookup-visual {
  position: relative;
}
.lookup-transfer-layer {
  position: absolute;
  z-index: 90;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.lookup-transfer-layer .word-guide-line {
  fill: none;
  stroke: #c7922f;
  stroke-width: 3;
}
.lookup-write-stage > .bits-word-box {
  grid-column: 1;
}
.lookup-write-stage > .visual-step-number {
  position: absolute !important;
  top: 50% !important;
  left: 0.65rem !important;
  transform: translateY(-50%);
}

/* Final 12-word range begins at the candidate data rows, not the page header. */
[data-final-bits] .bits-word-box {
  border-color: #315d50;
}
[data-final-bits] .bit-cells::after {
  display: block;
  z-index: 6;
  top: -5px;
  height: calc(100% + 8px);
  box-sizing: border-box;
  border: 3px solid #c7922f;
  border-radius: 9px;
  background: rgba(255, 213, 105, 0.25);
  content: "";
  pointer-events: none;
}
[data-final-bits-12] .bit-cells::after {
  left: -5px;
  width: calc(63.64% + 7px);
}
[data-final-bits-24] .bit-cells::after {
  left: -5px;
  width: calc(27.27% + 7px);
}
.half-column::after {
  top: 16%;
  bottom: auto;
  left: 55%;
  width: 11%;
  height: 42%;
}

@media (max-width: 700px) {
  .lookup-stage,
  .lookup-row-stage {
    min-height: 0;
    padding-top: 0.85rem;
  }
  .lookup-flow .sheet-stack {
    flex-basis: 145px;
    width: 145px;
  }
  .lookup-flow .sheet-stack img,
  .lookup-flow .lookup-sheet,
  .lookup-flow .sheet-highlight {
    flex-basis: 118px;
    width: 118px;
  }
}

/* Phone layout: retain the single guide flow while making controls and diagrams fit narrow viewports. */
@media (max-width: 600px) {
  .site-header {
    min-height: 72px;
    padding: 0.8rem 1rem;
  }
  .plain-guide-link {
    font-size: 0.8rem;
  }
  .wizard {
    min-height: auto;
    padding: 1rem 1rem 1.25rem;
  }
  .wizard-progress {
    gap: 0.55rem;
    margin-bottom: 1rem;
    font-size: 0.78rem;
  }
  .wizard .guide-step {
    gap: 1.3rem;
  }
  .wizard .step-copy h2 {
    font-size: 2rem;
  }
  .completion-step h2 {
    max-width: 100%;
    font-size: 2.2rem !important;
    overflow-wrap: anywhere;
  }
  .wizard .step-visual {
    min-height: 0;
    padding: 1rem;
    border-radius: 16px;
  }
  .prepare-step .compact,
  .compact,
  .setup-choices,
  .compact-checklist,
  .compact-checklist.has-box-clearance {
    grid-template-columns: 1fr;
  }
  .compact-checklist [data-container-check="box"] {
    grid-column: auto;
    grid-row: auto;
  }
  .wizard .toggle-group,
  .toggle-group {
    width: 100%;
  }
  .toggle {
    min-width: 0;
  }
  .worksheet-field {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }
  .worksheet-input {
    width: 100%;
  }
  .tooltip-content {
    position: fixed;
    right: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 1rem;
    width: auto;
  }
  .tooltip-content::after {
    display: none;
  }
  .lookup-stage,
  .lookup-row-stage {
    padding: 0.85rem 0.75rem 0.85rem 2.5rem;
  }
  .lookup-flow {
    flex-direction: column;
    gap: 0.35rem;
  }
  .lookup-flow .lookup-arrow {
    transform: rotate(90deg);
  }
  .lookup-flow .sheet-stack {
    flex-basis: 126px;
    width: 126px;
  }
  .lookup-flow .sheet-stack img {
    width: 104px;
  }
  .lookup-flow .lookup-sheet,
  .lookup-flow .sheet-highlight {
    flex: 0 0 auto;
    width: 104px;
  }
  .bit-marker-final-12 .marker-checksum,
  .bit-marker-final-24 .marker-checksum {
    font-size: 0 !important;
  }
  .bit-marker-final-12 .marker-checksum::after,
  .bit-marker-final-24 .marker-checksum::after {
    content: "CS";
    font-size: 0.7rem;
  }
  .step-controls {
    position: sticky;
    z-index: 100;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: calc(100% + 2rem);
    margin: 1.5rem -1rem 0;
    padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--cream) 94%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }
  .step-controls .button {
    width: 100%;
    min-height: 48px;
  }
  .forward-note.is-hidden {
    display: none;
  }
  .wizard .small-note {
    margin-top: 0.75rem;
  }
}

@media (max-width: 380px) {
  .brand {
    gap: 0.45rem;
    font-size: 0.76rem;
  }
  .brand strong {
    font-size: 0.84rem;
  }
  .brand-mark {
    width: 2rem;
    height: 2rem;
    font-size: 1.1rem;
  }
  .plain-guide-link {
    max-width: 7.5rem;
    text-align: right;
  }
  .wizard .step-copy h2 {
    font-size: 1.8rem;
  }
  .die-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
  }
  .die-grid div {
    height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    margin: 12mm;
  }
  body {
    color: #000;
    background: #fff;
    font-size: 10.5pt;
  }
  .site-header,
  .intro,
  .wizard-progress,
  .step-controls,
  footer,
  .plain-guide-link {
    display: none !important;
  }
  .wizard,
  .wizard-active .wizard {
    display: block;
    max-width: none;
    min-height: 0;
    padding: 0;
  }
  .guide-step,
  .guide-step.is-active {
    display: grid !important;
    grid-template-columns: 1fr 190px;
    gap: 1.5rem;
    min-height: 0;
    padding: 0 0 1.2rem;
    margin: 0 0 1.2rem;
    break-inside: avoid;
    border-bottom: 1px solid #aaa;
  }
  .step-copy h2 {
    font-size: 21pt !important;
  }
  .step-visual {
    min-height: 160px !important;
    padding: 1rem !important;
    background: #f4f4f4 !important;
  }
  .checkpoint {
    border: 1px solid #ccc;
    background: #fff !important;
  }
  .compact {
    grid-template-columns: 1fr 1fr;
  }
  .compact .supply-card {
    border: 1px solid #ccc;
    background: #fff;
  }
  .encoding-tabs,
  .toggle-group {
    display: none;
  }
  .encoding-explanation {
    display: block;
  }
  .encoding-explanation:not(.is-visible) {
    display: none;
  }
  .small-note {
    font-size: 8.5pt;
  }
}
