:root {
  color-scheme: dark;
  interpolate-size: allow-keywords;
  --bg: #0a0907;
  --surface: #14110d;
  --surface-2: #1b160f;
  --ink: #fff8ee;
  --muted: #b6ab9b;
  --quiet: #756b60;
  --line: rgba(255, 255, 255, 0.12);
  --orange: #f7931a;
  --gold: #ffbf48;
  --blue: #85d7ff;
  --green: #35d49b;
  --red: #ff6b6b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background: linear-gradient(180deg, #0d0b08 0%, #080806 52%, #0d0a06 100%);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-rail {
  position: fixed;
  inset: 14px 16px auto;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(247, 147, 26, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(247, 147, 26, 0.1), transparent 42%),
    rgba(15, 13, 10, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
}

.rail-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  margin-top: 0;
}

.rail-nav a,
.secondary.as-link {
  color: var(--muted);
  text-decoration: none;
}

.rail-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.rail-nav a:hover,
.rail-nav a.active {
  border-color: rgba(247, 147, 26, 0.3);
  background: rgba(247, 147, 26, 0.1);
  color: var(--ink);
}

.rail-nav a:hover {
  transform: translateY(-1px);
}

.rail-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.26);
  color: var(--muted);
  white-space: nowrap;
}

.sound-toggle {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
}

.sound-toggle[aria-pressed="true"] {
  border-color: rgba(247, 147, 26, 0.46);
  background: rgba(247, 147, 26, 0.1);
  color: var(--gold);
}

.rail-status span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--quiet);
}

.rail-status.mining span {
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(247, 147, 26, 0.12), 0 0 22px rgba(247, 147, 26, 0.8);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1240px;
  margin: 0 auto;
  padding: 94px 18px 32px;
}

.topbar {
  display: block;
  margin-bottom: 18px;
}

.mobile-topline {
  display: none;
}

.menu-button {
  display: none;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.mobile-brand img {
  width: 34px;
  height: 34px;
}

.mobile-brand span {
  white-space: nowrap;
}


.network-tape {
  display: grid;
  grid-template-columns: 0.75fr 0.75fr 1fr 0.9fr;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(247, 147, 26, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(247, 147, 26, 0.13), transparent),
    rgba(17, 13, 9, 0.88);
}

.network-tape div {
  min-height: 58px;
  padding: 11px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.network-tape span,
.metric-top span,
.metric-foot,
.field span,
.header-parts span,
.fact-grid span,
.hash-steps span {
  color: var(--muted);
  font-size: 0.76rem;
}

.network-tape span,
.header-parts span,
.fact-grid span,
.hash-steps span {
  display: block;
  text-transform: uppercase;
}

.network-tape strong {
  display: block;
  margin-top: 5px;
}

.network-tape small {
  display: block;
  margin-top: 3px;
  color: var(--quiet);
  font-size: 0.72rem;
}

.network-tape div {
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.network-tape div.price-up {
  box-shadow: inset 0 0 0 1px rgba(53, 212, 155, 0.36);
}

.network-tape div.price-down {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 107, 0.38);
}

.network-tape div.price-flat {
  box-shadow: inset 0 0 0 1px rgba(255, 191, 72, 0.18);
}

.price-up #btcPrice {
  color: var(--green);
}

.price-down #btcPrice {
  color: var(--red);
}

.help-dot.help-dot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-left: 4px;
  border: 1px solid rgba(255, 191, 72, 0.58);
  border-radius: 50%;
  color: var(--gold);
  cursor: help;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-transform: none;
  vertical-align: 0.08em;
}

.help-dot::before {
  content: "?";
}

.help-popover {
  position: fixed;
  z-index: 30;
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 11px;
  border: 1px solid rgba(255, 191, 72, 0.4);
  border-radius: 8px;
  background: rgba(17, 13, 9, 0.98);
  box-shadow: var(--shadow);
  color: #fff3df;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.help-popover.visible {
  opacity: 1;
  transform: translateY(0);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.intro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 24px;
  min-height: min(650px, calc(100vh - 146px));
}

.intro-copy,
.start-card,
.metric-card,
.workbench,
.activity,
.lesson-card,
.explainer,
.lab-panel,
.lab-result-card,
.settings-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 15, 12, 0.9);
  box-shadow: var(--shadow);
}

.intro-copy {
  display: grid;
  align-content: center;
  padding: clamp(24px, 5vw, 64px);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 6.3vw, 5.35rem);
  line-height: 1.04;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.lead {
  max-width: 740px;
  color: #ded3c5;
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
  line-height: 1.62;
}

.plain-steps {
  display: grid;
  gap: 10px;
  max-width: 650px;
  margin-top: 24px;
}

.plain-steps div {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid rgba(247, 147, 26, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.plain-steps span,
.lesson-card span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange);
  color: #181008;
  font-weight: 900;
}

.plain-steps p {
  margin: 0;
  color: #eee4d6;
  line-height: 1.45;
}

.start-card {
  align-self: center;
  padding: 20px;
  border-color: rgba(247, 147, 26, 0.34);
  background:
    linear-gradient(180deg, rgba(247, 147, 26, 0.13), transparent 240px),
    rgba(18, 15, 11, 0.94);
}

.card-heading p,
.fine-print {
  color: var(--muted);
  line-height: 1.45;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(3, 5, 6, 0.7);
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(247, 147, 26, 0.8);
  box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.14);
}

input[type="range"] {
  min-height: 22px;
  padding: 0;
  accent-color: var(--orange);
}

.start-row,
.button-row,
.preset-row,
.lab-layout,
.settings-grid,
.split-page {
  display: grid;
  gap: 12px;
}

.start-row {
  grid-template-columns: 1fr 1fr;
}

button,
.secondary.as-link {
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:hover:not(:disabled),
.secondary.as-link:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary {
  border: 0;
  background: linear-gradient(135deg, var(--orange), var(--gold));
  color: #171008;
  box-shadow: 0 16px 34px rgba(247, 147, 26, 0.2);
}

.primary.xl {
  width: 100%;
  min-height: 56px;
  margin-top: 4px;
  font-size: 1.03rem;
}

.secondary,
.secondary.as-link,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  padding: 9px 12px;
}

.mini-button {
  min-height: 38px;
  border-color: rgba(247, 147, 26, 0.3);
  background: rgba(247, 147, 26, 0.09);
  color: #ffdca5;
}

.link-button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 6px 0 12px;
}

.page-head h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4.6vw, 4.4rem);
}

.page-head.readable {
  align-items: flex-start;
}

.button-row {
  grid-auto-flow: column;
  align-items: center;
}

.button-row.stacked {
  grid-template-columns: minmax(0, 1fr) 92px;
}

.mining-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.12fr) minmax(260px, 0.9fr) minmax(260px, 0.9fr);
  gap: 12px;
}

.mining-control-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr) minmax(220px, 0.85fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid rgba(247, 147, 26, 0.2);
  border-radius: 8px;
  background: rgba(17, 15, 12, 0.9);
  box-shadow: var(--shadow);
}

.mining-control-card .field {
  margin-bottom: 0;
}

.control-actions {
  display: grid;
  gap: 8px;
}

.control-actions span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.metric-card,
.workbench,
.activity,
.lesson-card,
.explainer,
.lab-panel,
.lab-result-card,
.settings-card {
  padding: 18px;
}

.hero-metric {
  border-color: rgba(247, 147, 26, 0.32);
  background:
    linear-gradient(135deg, rgba(247, 147, 26, 0.16), rgba(133, 215, 255, 0.04)),
    rgba(18, 15, 10, 0.92);
}

.metric-top,
.metric-foot,
.section-head,
.lab-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.giant {
  margin: 12px 0 4px;
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 950;
  line-height: 0.95;
}

.sparkline {
  display: block;
  width: 100%;
  height: 44px;
  margin-bottom: 8px;
}

.hash-readout,
code {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0;
}

.hash-readout {
  display: block;
  min-height: 64px;
  margin-top: 14px;
  padding: 12px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--blue);
  line-height: 1.45;
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--gold));
}

.split-page {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.42fr);
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(247, 147, 26, 0.34);
  border-radius: 999px;
  background: rgba(247, 147, 26, 0.09);
  color: #ffdca5;
  font-size: 0.78rem;
  white-space: nowrap;
}

.pill.quiet {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.header-parts {
  display: grid;
  grid-template-columns: 0.75fr 1.5fr 0.9fr 0.8fr 0.8fr 0.75fr;
  gap: 10px;
  margin-top: 14px;
}

.header-parts div,
.fact-grid div,
.hash-steps div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.header-parts code,
.fact-grid code,
.hash-steps code {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  overflow-wrap: anywhere;
  line-height: 1.4;
}

#eventLog {
  display: grid;
  gap: 8px;
  max-height: 360px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}

#eventLog li {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #ded6ca;
  font-size: 0.86rem;
}

.event-kind {
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
}

.event-kind.error {
  color: var(--red);
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.learning-path {
  display: grid;
  gap: 12px;
}

.learn-step {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 15, 12, 0.9);
  box-shadow: var(--shadow);
}

.step-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--orange);
  color: #181008;
  font-weight: 950;
}

.learn-step h2 {
  margin-bottom: 8px;
}

.learn-step p,
.halving-lesson p {
  color: #d4c9bc;
  line-height: 1.58;
}

.puzzle-flow,
.target-demo,
.halving-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.puzzle-flow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.puzzle-flow div,
.target-demo div,
.halving-card div {
  padding: 12px;
  border: 1px solid rgba(247, 147, 26, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.puzzle-flow strong,
.target-demo span,
.halving-card span {
  display: block;
  color: var(--gold);
}

.puzzle-flow span,
.halving-card span {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.target-demo {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.target-demo code {
  display: block;
  margin-top: 5px;
  color: var(--blue);
}

.target-demo .winner {
  border-color: rgba(53, 212, 155, 0.42);
  background: rgba(53, 212, 155, 0.08);
}

.classroom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  gap: 12px;
  margin-top: 12px;
}

.lesson-card {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.lesson-card summary {
  display: grid;
  grid-template-columns: 40px 1fr auto 24px;
  gap: 12px;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  list-style: none;
  transition: background 160ms ease;
}

.lesson-card summary::-webkit-details-marker {
  display: none;
}

.lesson-card summary strong {
  font-size: 1.05rem;
  line-height: 1.25;
}

.lesson-card summary small {
  color: var(--quiet);
  font-size: 0.76rem;
  font-weight: 800;
}

.lesson-card summary::after,
.explainer summary::after,
.glossary summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(247, 147, 26, 0.28);
  border-radius: 50%;
  color: var(--gold);
  font-weight: 900;
  transition: transform 180ms ease, background 180ms ease;
}

.lesson-card[open] summary::after,
.explainer[open] summary::after,
.glossary[open] summary::after {
  background: rgba(247, 147, 26, 0.12);
  transform: rotate(45deg);
}

.lesson-card summary:hover {
  background: rgba(247, 147, 26, 0.08);
}

.lesson-body,
.explainer p,
.glossary > div {
  overflow: hidden;
}

details::details-content {
  block-size: 0;
  opacity: 0;
  transition: block-size 220ms ease, opacity 180ms ease, content-visibility 220ms ease allow-discrete;
}

details[open]::details-content {
  block-size: auto;
  opacity: 1;
}

.lesson-card p,
.explainer p {
  color: #d4c9bc;
  line-height: 1.58;
}

.lesson-card p {
  margin: 0;
}

.lesson-body {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px 68px;
}

.learn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 18px;
}

.learn-demo,
.halving-lesson,
.learn-map,
.primer-grid article,
.progress-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 15, 12, 0.9);
  box-shadow: var(--shadow);
}

.learn-demo {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: center;
  margin: 0;
  padding: 18px;
}

.halving-lesson {
  padding: 18px;
}

.halving-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.halving-card strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.learn-demo p,
.learn-map p,
.primer-grid p {
  color: #d4c9bc;
  line-height: 1.52;
}

.demo-box {
  display: grid;
  gap: 12px;
}

.demo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-readout {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(247, 147, 26, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.demo-readout span {
  color: var(--muted);
}

.demo-readout code {
  color: var(--blue);
  overflow-wrap: anywhere;
}

.demo-readout strong {
  color: var(--gold);
}

.learn-map {
  margin: 14px 0;
  padding: 18px;
}

.map-grid,
.primer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.map-grid article,
.primer-grid article {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.map-grid strong,
.primer-grid strong {
  color: var(--gold);
}

.primer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.explainer {
  margin-top: 10px;
}

.explainer summary,
.glossary summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--gold);
  font-weight: 900;
  list-style: none;
}

.explainer summary::-webkit-details-marker,
.glossary summary::-webkit-details-marker {
  display: none;
}

.glossary {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(247, 147, 26, 0.22);
  border-radius: 8px;
  background: rgba(17, 15, 12, 0.9);
  box-shadow: var(--shadow);
}

.glossary > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.glossary article {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.glossary strong {
  color: var(--gold);
}

.glossary p {
  margin: 6px 0 0;
  color: #d4c9bc;
  line-height: 1.45;
}

.lab-layout {
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
}

.lab-panel {
  align-self: start;
  border-color: rgba(247, 147, 26, 0.24);
}

.panel-copy {
  margin-bottom: 16px;
  color: #ded3c5;
  line-height: 1.5;
}

.manual-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.preset-row {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
}

.mode-choice {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.mode-choice legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.mode-choice label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 4px 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

.mode-choice input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  accent-color: var(--orange);
}

.mode-choice strong,
.mode-choice span {
  grid-column: 2;
}

.mode-choice span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.42;
}

.mode-choice label:has(input:checked) {
  border-color: rgba(247, 147, 26, 0.58);
  background: rgba(247, 147, 26, 0.12);
}

.lab-result-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.lab-summary {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 147, 26, 0.08);
}

.lab-summary span {
  color: var(--muted);
}

.lab-summary strong {
  color: var(--gold);
}

.lab-summary strong.valid {
  color: var(--green);
}

.fact-grid,
.hash-steps {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.fact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fact-grid div:last-child {
  grid-column: 1 / -1;
}

.fact-grid div:nth-last-child(-n + 2) {
  grid-column: 1 / -1;
}

.lab-note {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  line-height: 1.5;
}

.settings-grid {
  grid-template-columns: minmax(280px, 0.8fr) minmax(260px, 0.55fr);
}

.custom-pool {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}

.custom-pool .wide {
  grid-column: 1 / -1;
}

.custom-pool-list {
  display: grid;
  gap: 8px;
}

.custom-pool-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.custom-pool-item span {
  color: var(--muted);
  font-size: 0.8rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ded3c5;
}

.toggle-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--orange);
}

.achievement-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.achievement {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  min-height: 70px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.achievement-stamp {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.achievement.unlocked {
  border-color: rgba(247, 147, 26, 0.5);
  background: rgba(247, 147, 26, 0.1);
}

.achievement.unlocked .achievement-stamp {
  border-color: rgba(255, 191, 72, 0.8);
  background: var(--gold);
  color: #19120a;
}

.achievement strong {
  display: block;
  margin-bottom: 3px;
}

.achievement p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  min-width: 230px;
  padding: 14px;
  border: 1px solid rgba(255, 191, 72, 0.54);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(247, 147, 26, 0.22), transparent),
    rgba(16, 13, 10, 0.97);
  box-shadow: var(--shadow);
}

.toast span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.toast strong {
  display: block;
  margin-top: 4px;
  color: var(--gold);
}

.home-guide-summary,
.site-footer,
.site-header,
.guide-shell {
  width: min(1204px, calc(100% - 36px));
  margin-right: auto;
  margin-left: auto;
}

.home-guide-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 18px;
  margin-top: 10px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(247, 147, 26, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(247, 147, 26, 0.13), transparent 45%),
    rgba(17, 15, 12, 0.92);
  box-shadow: var(--shadow);
}

.home-guide-summary h2,
.guide-hero h1,
.guide-section h2 {
  margin-bottom: 10px;
}

.home-guide-summary p,
.site-footer p,
.guide-section p,
.guide-section li,
.guide-card p,
.trust-card p,
.legal-note p {
  color: #d4c9bc;
  line-height: 1.62;
}

.summary-links {
  display: grid;
  gap: 8px;
  align-content: start;
}

.summary-links a,
.site-footer a,
.guide-link,
.breadcrumb a {
  color: #ffdca5;
  text-decoration: none;
}

.summary-links a {
  padding: 12px;
  border: 1px solid rgba(247, 147, 26, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  font-weight: 900;
}

.site-footer {
  margin-bottom: 24px;
  padding: 22px;
  border-top: 1px solid rgba(247, 147, 26, 0.24);
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(180px, 0.45fr));
  gap: 18px;
}

.site-footer nav {
  display: grid;
  gap: 8px;
  align-content: start;
}

.site-footer strong {
  color: var(--ink);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.site-nav a {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  border-color: rgba(247, 147, 26, 0.34);
  color: var(--ink);
}

.guide-shell {
  padding-bottom: 28px;
}

.guide-hero,
.guide-section,
.trust-card,
.legal-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 15, 12, 0.9);
  box-shadow: var(--shadow);
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 22px;
  align-items: end;
  padding: clamp(24px, 5vw, 58px);
  border-color: rgba(247, 147, 26, 0.3);
  background:
    linear-gradient(135deg, rgba(247, 147, 26, 0.18), transparent 52%),
    rgba(18, 15, 11, 0.95);
}

.guide-hero h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
}

.guide-hero .lead {
  margin-bottom: 0;
}

.breadcrumb {
  margin: 4px 0 12px;
  color: var(--quiet);
  font-size: 0.9rem;
}

.guide-kpis,
.guide-grid,
.trust-grid,
.faq-list,
.steps-list {
  display: grid;
  gap: 12px;
}

.guide-kpis {
  grid-template-columns: 1fr;
}

.guide-kpis div,
.guide-card,
.trust-card,
.steps-list article,
.faq-list details,
.legal-note {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.guide-kpis span,
.guide-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.guide-kpis strong {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 1.45rem;
}

.guide-section {
  margin-top: 14px;
  padding: clamp(18px, 3vw, 28px);
}

.guide-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trust-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-card strong,
.steps-list strong,
.faq-list summary {
  color: var(--gold);
}

.guide-card p,
.steps-list p {
  margin-bottom: 0;
}

.guide-section ul {
  margin: 0;
  padding-left: 1.2rem;
}

.faq-list details {
  box-shadow: none;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 900;
}

.faq-list p {
  margin: 10px 0 0;
}

.guide-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.legal-note {
  margin-top: 12px;
  border-color: rgba(247, 147, 26, 0.22);
}

.last-updated {
  color: var(--quiet);
  font-size: 0.9rem;
}

@media (max-width: 1120px) {
  .app-rail {
    inset: 68px 10px auto;
    display: grid;
    grid-template-rows: auto auto auto;
    width: auto;
    padding: 14px;
    transform: translateY(calc(-100% - 88px));
    box-shadow: none;
    transition: transform 180ms ease;
  }

  body.nav-open .app-rail {
    transform: translateY(0);
    box-shadow: var(--shadow);
  }

  .rail-nav {
    display: grid;
    justify-content: stretch;
    margin-top: 12px;
  }

  .app-shell {
    max-width: none;
    margin-left: 0;
    padding: 10px;
  }

  .topbar {
    display: grid;
    gap: 10px;
  }

  .mobile-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 7px 8px 7px 10px;
    border: 1px solid rgba(247, 147, 26, 0.28);
    border-radius: 8px;
    background: rgba(16, 13, 9, 0.92);
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 1px solid rgba(247, 147, 26, 0.28);
    background: rgba(247, 147, 26, 0.1);
    color: var(--ink);
  }

  .mobile-topline .menu-button {
    min-height: 38px;
    padding: 8px 12px;
  }

  .intro-layout,
  .mining-grid,
  .mining-control-card,
  .split-page,
  .home-guide-summary,
  .footer-grid,
  .guide-hero,
  .guide-grid,
  .trust-grid,
  .lesson-grid,
  .learning-path,
  .classroom-grid,
  .puzzle-flow,
  .target-demo,
  .halving-card,
  .learn-demo,
  .map-grid,
  .primer-grid,
  .glossary > div,
  .lab-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .network-tape {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-parts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lesson-card {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .topbar,
  .start-row,
  .preset-row,
  .network-tape,
  .fact-grid,
  .achievement-list,
  .learning-path,
  .classroom-grid,
  .puzzle-flow,
  .target-demo,
  .halving-card,
  .custom-pool,
  .header-parts {
    grid-template-columns: 1fr;
  }

  .intro-copy,
  .start-card,
  .home-guide-summary,
  .site-footer,
  .page-head,
  .metric-card,
  .workbench,
  .activity,
  .lesson-card,
  .explainer,
  .lab-panel,
  .settings-card {
    padding: 16px;
  }

  h1,
  .page-head h1 {
    font-size: 2.28rem;
  }

  .page-head,
  .metric-top,
  .metric-foot,
  .section-head,
  .lab-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row {
    grid-auto-flow: row;
    width: 100%;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .button-row > * {
    width: 100%;
  }

  .giant {
    font-size: 3.1rem;
  }

  .lesson-card {
    padding: 0;
  }

  .lesson-card p {
    padding-left: 16px;
  }

  .lesson-card summary {
    grid-template-columns: 40px 1fr 24px;
  }

  .learn-step {
    grid-template-columns: 1fr;
  }

  .lesson-card summary small {
    grid-column: 2;
  }

  .lesson-body {
    padding-left: 16px;
  }
}

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