:root {
  --bg: #0c1016;
  --bg-2: #161b24;
  --sand: #0c1016;
  --paper: #161b24;
  --cream: #f3efe6;
  --ink: #f3f0e8;
  --ink-2: #c9c4ba;
  --muted: #a39e93;
  --muted-2: #8d887e;
  --line: rgba(243, 240, 232, 0.14);
  --line-2: rgba(243, 240, 232, 0.28);
  --accent: #3c78f2;
  --accent-ink: #8eaeFF;
  --accent-2: #8eaeFF;
  --case: #0c1016;
  --key: #161b24;
  --key-ink: #f3f0e8;
  --yellow: #8eaeFF;
  --editor: #10151d;
  --output: #10151d;
  --editor-line: rgba(243, 240, 232, 0.14);
  --editor-ink: #f3f0e8;
  --output-ink: #d9d4ca;
  --radius: 14px;
  --radius-xl: 16px;
  --font: "Barlow", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --mono: "Source Code Pro", ui-monospace, monospace;
  color-scheme: dark;
  font-family: var(--font);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

button, textarea, kbd { font: inherit; }

button { cursor: pointer; }

.funnel {
  max-width: 56rem;
  margin: 1.15rem auto 0;
  padding: 1.6rem 1.6rem 1.7rem;
  background: #f6f7f4;
  color: var(--ink);
  border: 2px solid #14181a;
  border-radius: 16px;
}

.funnel-kicker {
  margin: 0 0 0.35rem;
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
}

.funnel h2 {
  margin: 0 0 0.75rem;
  max-width: none;
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.15rem, 4.5vw, 2.85rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.12;
  color: var(--ink);
}

.funnel h3 {
  margin: 1.35rem 0 0.45rem;
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}

.funnel p {
  max-width: none;
  margin: 0.55rem 0 0;
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.funnel-lead { color: var(--ink); }

.funnel-moves {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  counter-reset: move;
}

.funnel-moves li {
  counter-increment: move;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  margin: 0;
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.35;
}

.funnel-moves li::before {
  content: counter(move);
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #8ea4a6 0%, #6d888b 100%) center top / calc(100% - 3px) calc(100% - 5px) no-repeat,
    #314044;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: var(--key-ink);
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
}

.funnel-end {
  margin-top: 1.15rem;
  color: var(--ink);
  font-weight: 600;
}

.funnel code {
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.86em;
  color: var(--ink);
}

.funnel-path {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.funnel-path > li {
  max-width: none;
  margin: 0;
  padding: 0.85rem 0.95rem 1rem;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f1e8 100%) center top / calc(100% - 4px) calc(100% - 7px) no-repeat,
    #14181a;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px #14181a;
  color: var(--ink-2);
  font-size: 1.28rem;
  line-height: 1.45;
}

.funnel-path span {
  display: block;
  margin-bottom: 0.15rem;
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--ink);
}

.deal {
  margin-top: 1.4rem;
  padding: 0.95rem 1.05rem 1.1rem;
  background:
    linear-gradient(180deg, #fffdf8 0%, #f4f1e8 100%) center top / calc(100% - 4px) calc(100% - 8px) no-repeat,
    #9d2c26;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px #14181a;
}

.deal p { margin: 0; max-width: none; }

.deal-year {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.deal-amount {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.deal-month {
  margin-top: 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.deal-note {
  margin-top: 0.55rem;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-2);
}

.funnel-gate {
  margin-top: 1.1rem;
  color: var(--ink);
  font-weight: 600;
}

.funnel-go {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.85rem 1.25rem 1.15rem;
  min-height: 3.6rem;
  background:
    linear-gradient(180deg, #e25b54 0%, #d6453d 100%) center top / calc(100% - 4px) calc(100% - 9px) no-repeat,
    #7d2420;
  color: var(--key-ink);
  border: 0;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.funnel-go:hover {
  background:
    linear-gradient(180deg, #ea6d66 0%, #c33b34 100%) center top / calc(100% - 4px) calc(100% - 9px) no-repeat,
    #7d2420;
}

.funnel-go:active {
  transform: translateY(6px);
  background:
    linear-gradient(180deg, #e25b54 0%, #d6453d 100%) center top / calc(100% - 4px) calc(100% - 2px) no-repeat,
    #7d2420;
}

.machine {
  position: relative;
  max-width: 1180px;
  margin: 1.15rem auto 1.4rem;
  background: var(--case);
  color: var(--key-ink);
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 22px 44px rgba(24, 30, 32, 0.22),
    0 3px 8px rgba(24, 30, 32, 0.1);
}

.machine::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  pointer-events: none;
}

.corner-keys {
  position: absolute;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 2;
  display: grid;
  grid-template-columns: 2.85rem 2.85rem;
  gap: 0.42rem;
  pointer-events: none;
}

.corner-keys span {
  display: block;
  height: 1.9rem;
  border: 0;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.corner-keys span:nth-child(1) {
  background:
    linear-gradient(180deg, #ee6d66 0%, #d0453e 100%) center top / calc(100% - 3px) calc(100% - 6px) no-repeat,
    #8a2e2a;
}

.corner-keys span:nth-child(2) {
  background:
    linear-gradient(180deg, #ffe38a 0%, #f2cc3a 100%) center top / calc(100% - 3px) calc(100% - 6px) no-repeat,
    #a68418;
}

.corner-keys span:nth-child(3) {
  background:
    linear-gradient(180deg, #8ed896 0%, #3caf55 100%) center top / calc(100% - 3px) calc(100% - 6px) no-repeat,
    #1f6b34;
}

.corner-keys span:nth-child(4) {
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f1e8 100%) center top / calc(100% - 3px) calc(100% - 6px) no-repeat,
    #14181a;
  box-shadow: inset 0 0 0 2px #14181a;
}

.mast {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 0;
  padding: 1.7rem 1.5rem 1.05rem;
  background: transparent;
  color: var(--key-ink);
  text-align: center;
}

.mast-top,
.mast .deck,
.mast .progress,
.mast .progress-track { position: relative; z-index: 1; }

.mast-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.logo-key {
  display: grid;
  place-items: center;
  width: 7.6rem;
  height: 6.15rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f1e8 100%) center top / calc(100% - 5px) calc(100% - 11px) no-repeat,
    #14181a;
  box-shadow:
    inset 0 0 0 2px #14181a,
    0 2px 0 rgba(0, 0, 0, 0.28);
}

.logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 3.7rem;
  height: 3.7rem;
}

.kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #8ea3a6;
}

.kicker a {
  color: inherit;
  text-underline-offset: 0.15em;
}

.kicker a:hover { color: var(--key-ink); }

h1 {
  margin: 0;
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 3.2vw, 2.2rem);
  letter-spacing: 0.01em;
  line-height: 1.05;
  color: #f7fbfb;
}

.deck {
  max-width: 34rem;
  margin: 0.65rem auto 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #a9bbbe;
}

.basics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
  margin: 0.9rem 0 0.15rem;
  padding: 0;
  list-style: none;
}

.basics li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
}

.ico {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-top: 0.05rem;
}

.basics p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.84rem;
  line-height: 1.45;
}

.basics b {
  color: var(--ink);
  font-weight: 600;
}

.basics code {
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.78em;
  color: var(--ink);
}

.syllabus {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 0;
  padding: 0.15rem 8.2rem 1.7rem 1.15rem;
  min-width: 0;
}

.path {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
}

.part {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  min-width: 0;
  max-width: 100%;
}

.part h2 {
  margin: 0 0 0.35rem;
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  color: #9eb0b3;
}

.part-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
  gap: 0.55rem;
  min-width: 0;
}

.lesson-card {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.45rem;
  row-gap: 0.08rem;
  align-items: center;
  width: auto;
  min-width: 0;
  max-width: none;
  min-height: 5.15rem;
  padding: 0.55rem 0.7rem 0.95rem;
  text-align: left;
  background:
    linear-gradient(180deg, #8ea4a6 0%, #6d888b 72%, #657f82 100%) center top / calc(100% - 4px) calc(100% - 9px) no-repeat,
    #314044;
  color: var(--key-ink);
  border: 0;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  -webkit-mask: none;
  mask: none;
  transition: transform 0.08s ease, background 0.12s ease;
}

.lesson-card:hover {
  background:
    linear-gradient(180deg, #9cb1b3 0%, #7a9699 72%, #6d888b 100%) center top / calc(100% - 4px) calc(100% - 9px) no-repeat,
    #314044;
}

.lesson-card:active {
  transform: translateY(6px);
  background:
    linear-gradient(180deg, #849ea1 0%, #6a8487 100%) center top / calc(100% - 4px) calc(100% - 2px) no-repeat,
    #314044;
  box-shadow: inset 0 2px 3px rgba(20, 28, 30, 0.18);
}

.lesson-card[aria-selected="true"],
.lesson-card[aria-selected="true"]:hover {
  background:
    linear-gradient(180deg, #fffdf8 0%, #f4f1e8 100%) center top / calc(100% - 4px) calc(100% - 9px) no-repeat,
    #9d2c26;
  color: var(--ink);
  border: 0;
  box-shadow: inset 0 0 0 2px #14181a;
}

.lesson-card[aria-selected="true"]:active {
  transform: translateY(6px);
  background:
    linear-gradient(180deg, #fffdf8 0%, #f4f1e8 100%) center top / calc(100% - 4px) calc(100% - 2px) no-repeat,
    #9d2c26;
}

.lesson-card.is-done { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42); }

.lesson-card.is-done[aria-selected="true"],
.lesson-card.is-done[aria-selected="true"]:hover {
  background:
    linear-gradient(180deg, #fffdf8 0%, #f4f1e8 100%) center top / calc(100% - 4px) calc(100% - 9px) no-repeat,
    #9d2c26;
  border: 0;
  box-shadow: inset 0 0 0 2px #14181a;
}

.mark {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  align-self: center;
  background: transparent;
  border-radius: 0;
}

.mark svg { display: block; width: 22px; height: 22px; }
.mark svg [stroke="#fa6400"] { stroke: var(--accent); }
.mark svg [fill="#fa6400"] { fill: var(--accent); }
.mark svg [stroke="#1b1410"] { stroke: var(--ink); }
.mark svg [fill="#1b1410"] { fill: var(--ink); }
.mark svg [fill="#fffaf3"] { fill: var(--paper); }
.mark svg [stroke="#d2c2b3"] { stroke: var(--line-2); }

.lesson-card .mark svg [stroke="#fa6400"] { stroke: var(--yellow); }
.lesson-card .mark svg [fill="#fa6400"] { fill: var(--yellow); }
.lesson-card .mark svg [stroke="#1b1410"] { stroke: var(--key-ink); }
.lesson-card .mark svg [fill="#1b1410"] { fill: var(--key-ink); }
.lesson-card .mark svg [fill="#fffaf3"] { fill: var(--key); }
.lesson-card .mark svg [stroke="#d2c2b3"] { stroke: #8eaaaa; }

.lesson-card[aria-selected="true"] .mark svg [stroke="#fa6400"] { stroke: var(--accent); }
.lesson-card[aria-selected="true"] .mark svg [fill="#fa6400"] { fill: var(--accent); }
.lesson-card[aria-selected="true"] .mark svg [stroke="#1b1410"] { stroke: var(--ink); }
.lesson-card[aria-selected="true"] .mark svg [fill="#1b1410"] { fill: var(--ink); }
.lesson-card[aria-selected="true"] .mark svg [fill="#fffaf3"] { fill: var(--paper); }
.lesson-card[aria-selected="true"] .mark svg [stroke="#d2c2b3"] { stroke: var(--line-2); }

.lesson-label { display: contents; }

.lesson-label .meta {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  min-width: 0;
}

.lesson-label .num,
.lesson-label .time {
  writing-mode: horizontal-tb;
  border: 0;
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ff8d84;
}

.lesson-label .time { color: #8fd18a; }

.lesson-card[aria-selected="true"] .num { color: var(--accent); }
.lesson-card[aria-selected="true"] .time { color: #1f8a42; }

.lesson-label .name {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.12;
  color: #f7fbfb;
}

.lesson-card[aria-selected="true"] .name { color: var(--ink); }

.lesson-card:not(:has(.mark)) .name {
  grid-column: 1 / -1;
  grid-row: 1 / span 2;
  align-self: center;
}

.lesson-head { margin-bottom: 1rem; }

.lesson-kicker {
  margin: 0 0 0.25rem;
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

#lesson-title {
  margin: 0 0 0.45rem;
  scroll-margin-top: 0.75rem;
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.lesson-body p {
  max-width: 40rem;
  margin: 0.45rem 0;
  color: var(--ink);
  font-family: "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.65;
}

.lesson-body .run-nudge {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
  margin: 0.55rem 0 0.1rem;
  color: var(--ink);
  font-weight: 600;
}

.lesson-body .run-nudge span { min-width: 0; }

.lesson-body .run-nudge::before {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  margin-top: 0.4rem;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent var(--accent);
}

.lesson-body.is-fresh,
.explain.is-fresh {
  animation: brief-in 0.28s ease;
}

@keyframes brief-in {
  from { transform: translateY(4px); }
  to { transform: none; }
}

.lesson-look {
  max-width: 40rem;
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.85rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  color: var(--ink);
  font-family: "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
}

#lesson-look[hidden] { display: none; }

.progress {
  margin: 0.7rem auto 0;
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
  color: #a9bbbe;
}

.progress-track {
  display: flex;
  gap: 0.28rem;
  max-width: 16.5rem;
  margin: 0.4rem auto 0.15rem;
}

.progress-track[hidden] { display: none; }

.tick {
  flex: 1 1 0;
  height: 1.15rem;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: transparent;
  position: relative;
}

.tick::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0.22rem;
  height: 0.38rem;
  border-radius: 1px;
  background: var(--line-2);
}

.mast .tick::before { background: #3e4a4d; }

.tick.is-done::before { background: var(--accent); }

.tick.is-current::before {
  background: var(--yellow);
  height: 0.48rem;
  top: 0.17rem;
}

.tick.is-done.is-current::before { background: var(--accent); }

.tick:hover::before { background: var(--accent-ink); }

.lesson-card.is-done .time::before {
  content: "done ";
  color: #8fd18a;
  font-weight: 600;
}

.lesson-card.is-done[aria-selected="true"] .time::before { color: var(--accent); }

.check {
  margin-top: 0.15rem;
  padding: 0.85rem 0.9rem 0.95rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.check[hidden] { display: none; }

.check-prompt {
  margin: 0 0 0.6rem;
  font-family: "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  color: var(--ink);
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.choice {
  width: 100%;
  padding: 0.58rem 0.8rem 0.85rem;
  min-height: 2.9rem;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f1e8 100%) center top / calc(100% - 4px) calc(100% - 7px) no-repeat,
    #14181a;
  color: var(--ink);
  border: 0;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px #14181a;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  transition: transform 0.08s ease, background 0.12s ease;
}

.choice:hover {
  background:
    linear-gradient(180deg, #ffffff 0%, #f7f4ec 100%) center top / calc(100% - 4px) calc(100% - 7px) no-repeat,
    #14181a;
}
.choice:active {
  transform: translateY(5px);
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f1e8 100%) center top / calc(100% - 4px) calc(100% - 2px) no-repeat,
    #14181a;
}
.choice.is-wrong {
  background:
    linear-gradient(180deg, #fff7f5 0%, #fdeceb 100%) center top / calc(100% - 4px) calc(100% - 7px) no-repeat,
    #9d2c26;
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 2px #14181a;
}
.choice:disabled { opacity: 0.55; cursor: wait; }

.lesson-look::before {
  content: "Look for. ";
  font-weight: 700;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.bench {
  max-width: 1180px;
  margin: 0 auto 1.6rem;
  padding: 0.65rem;
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(0, 1.16fr);
  gap: 0.65rem;
  align-items: stretch;
  min-width: 0;
  background: #243033;
  border: 0;
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35),
    0 18px 36px rgba(24, 30, 32, 0.16);
}

.brief {
  min-width: 0;
  padding: 1rem 1.05rem 1.1rem;
  background: #f6f7f4;
  border: 2px solid #14181a;
  border-radius: 10px;
}

.brief-foot { margin-top: 0.85rem; }

.verdict {
  margin: 0.65rem 0 0;
  padding: 0.4rem 0.65rem;
  background: var(--paper);
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-family: "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.verdict[hidden] { display: none; }

.verdict.is-wrong { border-left-color: var(--ink); }

.explain {
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  min-width: 0;
  scroll-margin-top: 0.75rem;
}

.explain[hidden] { display: none; }

.explain-kicker {
  margin: 0 0 0.2rem;
  font-family: "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.studio {
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 1.5rem);
  min-width: 0;
  padding: 0.7rem 0.75rem 0.8rem;
  background: #1a2022;
  border-radius: 10px;
  overflow-x: clip;
  overflow-y: auto;
  scrollbar-width: thin;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
  padding-bottom: 0.7rem;
  margin-bottom: 0.35rem;
}

#run-free {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.05rem 0.9rem 0.85rem;
  min-height: 3rem;
  background:
    linear-gradient(180deg, #8ea4a6 0%, #6d888b 100%) center top / calc(100% - 4px) calc(100% - 8px) no-repeat,
    #314044;
  color: var(--key-ink);
  border: 0;
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  font-family: "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

#run-free::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
}

#run-free:hover {
  background:
    linear-gradient(180deg, #9cb1b3 0%, #7a9699 100%) center top / calc(100% - 4px) calc(100% - 8px) no-repeat,
    #314044;
}
#run-free:active {
  transform: translateY(6px);
  background:
    linear-gradient(180deg, #849ea1 0%, #6a8487 100%) center top / calc(100% - 4px) calc(100% - 2px) no-repeat,
    #314044;
  box-shadow: inset 0 2px 3px rgba(20, 28, 30, 0.18);
}

#run-free:disabled { opacity: 0.55; cursor: wait; }

#run-free:focus-visible { outline-color: var(--ink); }

#demo-on {
  padding: 0.5rem 1rem 0.85rem;
  min-height: 2.9rem;
  background:
    linear-gradient(180deg, #e25b54 0%, #d6453d 100%) center top / calc(100% - 4px) calc(100% - 8px) no-repeat,
    #7d2420;
  color: var(--key-ink);
  border: 0;
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-size: 0.875rem;
  font-weight: 700;
}

#demo-on:hover {
  background:
    linear-gradient(180deg, #ea6d66 0%, #c33b34 100%) center top / calc(100% - 4px) calc(100% - 8px) no-repeat,
    #7d2420;
}
#demo-on:active {
  transform: translateY(6px);
  background:
    linear-gradient(180deg, #e25b54 0%, #d6453d 100%) center top / calc(100% - 4px) calc(100% - 2px) no-repeat,
    #7d2420;
  box-shadow: inset 0 2px 3px rgba(60, 16, 14, 0.2);
}

#gate-close, #demo-off, #prev, #next:disabled {
  padding: 0.5rem 0.875rem;
  min-height: 38px;
  background: var(--bg);
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
}

#next {
  padding: 0.5rem 1rem 0.85rem;
  min-height: 2.9rem;
  background:
    linear-gradient(180deg, #3e484a 0%, #2c3537 100%) center top / calc(100% - 4px) calc(100% - 8px) no-repeat,
    #9d2c26;
  color: var(--key-ink);
  border: 0;
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  font-size: 0.875rem;
  font-weight: 700;
}

#next:hover {
  background:
    linear-gradient(180deg, #4a5557 0%, #323a3c 100%) center top / calc(100% - 4px) calc(100% - 8px) no-repeat,
    #9d2c26;
}
#next:active {
  transform: translateY(6px);
  background:
    linear-gradient(180deg, #3e484a 0%, #2c3537 100%) center top / calc(100% - 4px) calc(100% - 2px) no-repeat,
    #9d2c26;
}

#prev:disabled, #next:disabled { opacity: 0.4; cursor: default; }

#gate-close:hover, #demo-off:hover, #prev:hover {
  color: var(--ink);
  border-color: var(--ink);
}



#status {
  margin: 0 0 0 auto;
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.78rem;
  color: #b7c6c8;
}

.preset-note {
  margin: -0.25rem 0 0.55rem;
  min-height: 1.2em;
  color: #9aafb2;
  font-size: 0.8125rem;
}

.preset-note.is-wrong {
  color: #ffb4a8;
  font-weight: 600;
}

.preset-note.is-edited {
  color: #f4f7f6;
  font-weight: 600;
}

.ide {
  --ide-bg: #1e2426;
  --ide-bg-2: #171c1e;
  --ide-bar: #2a3234;
  --ide-line: #3a4447;
  --ide-ink: #e7eeef;
  --ide-dim: #8aa0a4;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  min-width: 0;
  color-scheme: dark;
  background: var(--ide-bg);
  border: 0;
  border-radius: 10px;
  overflow: hidden;
}

.ide-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--ide-bg);
}

.ide-pane + .ide-pane {
  background: var(--ide-bg-2);
  border-left: 1px solid var(--ide-line);
}

.ide-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.35rem;
  padding: 0 0.8rem;
  background: var(--ide-bar);
  border-bottom: 1px solid var(--ide-line);
}

.ide-tab {
  margin: 0;
  padding: 0.55rem 0 0.45rem;
  border-bottom: 2px solid var(--accent);
  color: var(--ide-ink);
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.ide-tab::before {
  content: "";
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.45rem;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: 1px;
}

.ide-pane + .ide-pane .ide-tab::before { background: var(--yellow); }

.pane-note {
  margin: 0;
  color: var(--ide-dim);
  font-size: 0.72rem;
}

.ide-status {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.32rem 0.8rem;
  background: var(--ide-bar);
  border-top: 1px solid var(--ide-line);
  color: var(--ide-dim);
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.ide-status span { min-width: 0; }

#caret-pos { color: var(--ide-ink); }

#engine-status { color: var(--yellow); }

.editor-shell {
  --pad-top: 0.75rem;
  --pad-x: 0.7rem;
  --pad-bottom: 0.9rem;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: row;
  min-width: 0;
  min-height: 0;
  background: var(--ide-bg);
}

.editor-shell.is-locked { opacity: 0.5; }

.gutter {
  flex: 0 0 2.7rem;
  overflow: hidden;
  box-sizing: border-box;
  padding: var(--pad-top) 0.45rem var(--pad-bottom) 0.2rem;
  background: var(--ide-bg-2);
  color: #7d9196;
  border-right: 1px solid var(--ide-line);
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.84rem;
  font-weight: 400;
  font-variant-ligatures: none;
  line-height: 1.6;
  text-align: right;
  user-select: none;
  scrollbar-width: none;
}

.gutter div {
  overflow: hidden;
  white-space: nowrap;
}

.editor-code {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.editor-code:focus-within {
  box-shadow: inset 2px 0 0 var(--accent);
}

#active-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(242, 204, 58, 0.14);
  opacity: 0;
}

.editor-code:focus-within #active-line { opacity: 1; }

#source-mirror {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  margin: 0;
  padding: var(--pad-top) var(--pad-x) var(--pad-bottom) 0.4rem;
  border: 0;
  box-sizing: border-box;
  background: transparent;
  color: var(--ide-ink);
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.84rem;
  font-weight: 400;
  font-variant-ligatures: none;
  line-height: 1.6;
  letter-spacing: 0;
  white-space: pre-wrap;
  tab-size: 4;
  scrollbar-gutter: stable;
}

#source-mirror .code-line {
  margin: 0;
  padding: 0;
  border: 0;
  min-height: calc(1.6 * 1em);
  white-space: pre-wrap;
}

#source-mirror .tok-kw { color: #ff8d84; }
#source-mirror .tok-name { color: var(--ide-ink); }
#source-mirror .tok-fn { color: #7fd0c8; }
#source-mirror .tok-cls { color: #f4f7f6; }
#source-mirror .tok-num { color: #f2cc3a; }
#source-mirror .tok-cmt { color: #7d9196; }
#source-mirror .tok-op { color: #c5d4d6; }
#source-mirror .tok-str { color: #8fd18a; }

#token-mark {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

#token-mark[hidden] { display: none; }

#token-mark span {
  position: absolute;
  background: rgba(46, 186, 232, 0.35);
  border-radius: 3px;
}

.editor-code textarea,
.out {
  min-height: 320px;
}

.editor-code textarea {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  flex: 1;
  resize: vertical;
  margin: 0;
  padding: var(--pad-top) var(--pad-x) var(--pad-bottom) 0.4rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--ide-ink);
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.84rem;
  font-weight: 400;
  font-variant-ligatures: none;
  line-height: 1.6;
  letter-spacing: 0;
  tab-size: 4;
  overflow-x: clip;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-color: #3a4447 transparent;
}

.editor-code textarea::selection {
  background: rgba(46, 186, 232, 0.35);
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.editor-code textarea:focus {
  outline: none;
  box-shadow: none;
}

.editor-code textarea:disabled { cursor: not-allowed; }

.match {
  margin: 0.85rem 0 0;
  color: var(--output-ink);
}

.out {
  flex: 1;
  margin: 0;
  padding: 0.85rem 0.95rem 1rem;
  overflow-x: clip;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: var(--ide-bg-2);
  color: var(--output-ink);
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  scrollbar-color: #3a4447 transparent;
}

.empty, .note, .engine-line {
  margin: 0 0 0.8rem;
  color: var(--output-ink);
}

.engine-line {
  display: inline-block;
  margin: 0 0 0.9rem;
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--ide-line);
  border-radius: 2px;
  background: rgba(127, 208, 200, 0.16);
  color: var(--editor-ink);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.error { margin: 0.2rem 0; color: #ffb4a8; }

.amp {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  margin: 0.28rem 0;
  font-size: 0.8rem;
}

.basis { color: var(--ide-ink); }

.track {
  display: block;
  height: 0.48rem;
  background: #3a4447;
  border-radius: 1px;
  overflow: hidden;
}

.track > span {
  display: block;
  height: 100%;
  background: #3ec6ef;
}

.nums { color: #9eb4b8; white-space: nowrap; }

.amp-num { color: var(--yellow); }

.p-num { color: #ff8d84; }

.counts, .compiled { margin-top: 1.1rem; }

.counts h3, .compiled h3 {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #9eb4b8;
}

.counts ul { list-style: none; margin: 0; padding: 0; }

.counts li {
  display: flex;
  justify-content: space-between;
  max-width: 12rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid #3a4447;
}

pre {
  margin: 0;
  overflow-x: clip;
  overflow-y: auto;
  max-width: 100%;
  max-height: 280px;
  color: var(--editor-ink);
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: pre;
}

.out [data-tip] { cursor: help; border-radius: 3px; }

[data-explain] { cursor: help; }
button[data-explain], button[data-tip] { cursor: pointer; }
.compiled pre span { white-space: pre; }
.gutter [data-tip] { cursor: help; }

.engine-line[data-tip],
.match[data-tip],
.counts h3[data-tip],
.compiled h3[data-tip],
.compiled pre[data-tip] {
  width: fit-content;
  max-width: 100%;
}

.out [data-tip].is-hot {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.tip {
  position: fixed;
  z-index: 30;
  width: min(18.5rem, calc(100% - 16px));
  margin: 0;
  padding: 0.65rem 0.75rem 0.7rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(28, 36, 38, 0.16);
  pointer-events: none;
}

.tip.is-pinned {
  box-shadow: 0 10px 28px rgba(28, 36, 38, 0.2);
}

.tip[hidden] { display: none; }

.tip-kicker {
  margin: 0;
  font-family: "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.tip-code {
  margin: 0.28rem 0 0;
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ink-2);
}

.tip-body {
  margin: 0.28rem 0 0;
  font-family: "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.84rem;
  line-height: 1.45;
}

.hint {
  margin: 0.875rem 0 0;
  color: #9aafb2;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.hint kbd {
  background: #2c3436;
  border-color: #3e4a4d;
  color: #e7eeef;
}

kbd {
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05em 0.4em;
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.85em;
}

dialog {
  border: 0;
  border-radius: 12px;
  padding: 1.4rem 1.4rem 1.2rem;
  max-width: min(36rem, calc(100% - 2rem));
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(28, 36, 38, 0.28);
}

dialog::backdrop { background: rgba(28, 36, 38, 0.55); }

dialog h2 {
  margin: 0 0 0.6rem;
  font-family: "Archivo", "Figtree", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

dialog p { color: var(--muted); line-height: 1.6; }

#demo-password {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0.85rem 0 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 1rem;
}

#demo-password:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(214, 69, 61, 0.28);
}

.gate-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

button:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.math { white-space: nowrap; }
.katex { font-size: 1.05em; color: inherit; }
.out .katex { font-size: 1em; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 960px) {
  .funnel { margin: 0.55rem 0.55rem 0; padding: 1rem; border-radius: 14px; }
  .machine { margin: 0.55rem 0.55rem 0.9rem; border-radius: 18px; }
  .bench {
    display: flex;
    flex-direction: column;
    margin-inline: 0.55rem;
    padding: 0.5rem;
    border-radius: 16px;
  }
  .brief { display: contents; }
  .brief::after { display: none; }
  .lesson-head {
    order: 1;
    padding: 0.9rem 0.9rem 0.3rem;
    background: #f6f7f4;
    border: 2px solid #14181a;
    border-radius: 8px;
  }
  .studio {
    order: 2;
    position: static;
    max-height: none;
    overflow: visible;
  }
  .brief-foot {
    order: 3;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    margin: 0;
    padding: 0.45rem 0.75rem max(0.55rem, env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 2px solid #14181a;
    box-shadow: none;
  }
  .explain {
    order: 4;
    margin-top: 0.45rem;
    padding: 0.85rem 0.9rem;
    background: #f6f7f4;
    border: 2px solid #14181a;
    border-radius: 8px;
  }
  body { padding-bottom: 4.75rem; }
  body:has(#verdict:not([hidden])) { padding-bottom: 7.75rem; }
  body:has(#check:not([hidden])) { padding-bottom: 19.5rem; }
  #check:not([hidden]) {
    max-height: min(42vh, 16rem);
    overflow-x: clip;
    overflow-y: auto;
    margin: 0 0 0.55rem;
  }
  #status {
    margin-left: auto;
    flex-basis: auto;
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 860px) {
  .corner-keys { display: none; }
  .logo-key { width: 5.7rem; height: 4.65rem; border-radius: 14px; }
  .logo { width: 2.7rem; height: 2.7rem; }
  .mast { padding: 1.15rem 1rem 0.7rem; }
  .syllabus { padding: 0.1rem 0.75rem 1rem; }
  h1 { font-size: 1.55rem; }
  .deck { display: none; }
  .basics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    margin-top: 0.65rem;
    min-width: 0;
  }
  .basics li { min-width: 0; }
  .ide { grid-template-columns: 1fr; }
  .ide-pane + .ide-pane { border-left: 0; border-top: 1px solid var(--ide-line); }
  .editor-code textarea, #source-mirror, .gutter { font-size: 16px; }
  .editor-code textarea, .out { min-height: 180px; }
  .amp { grid-template-columns: auto minmax(0, 1fr); }
  .nums { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .lesson-body.is-fresh,
  .explain.is-fresh,
  .lesson-card,
  .choice,
  #run-free { animation: none; transition: none; }
}

.top {
  position: sticky;
  top: 0;
  z-index: 12;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.35rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.85rem 2.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  color: var(--ink);
}

.brand-mark svg { width: 1.7rem; height: 1.7rem; display: block; }

.top-price {
  margin-left: auto;
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.top-price:hover { color: var(--ink); }

.top-go {
  padding: 0.55rem 1.1rem;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(232, 238, 240, 0.45);
  border-radius: 999px;
  background: transparent;
}

.top-go:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.45rem 2.75rem 1.7rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.foot p { margin: 0; }

.foot a { color: var(--ink); text-decoration: none; }

.foot a:hover { color: var(--accent-2); }

footer { border-top: 1px solid var(--line); }

.machine {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 2.75rem;
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.machine::before,
.corner-keys { display: none; }

.mast {
  padding: 1.7rem 0 0.4rem;
  text-align: left;
  color: var(--ink);
  border-bottom: 0;
}

.mast-split {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 1.25rem 2.5rem;
  align-items: center;
}

.still {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #10151d;
}

.still img {
  display: block;
  width: 100%;
  height: 24rem;
  object-fit: cover;
  object-position: center 72%;
}

.mast-top {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.85rem;
}

.logo-key { display: none; }

.logo {
  width: 2.15rem;
  height: 2.15rem;
  color: var(--ink);
}

.kicker {
  margin: 0 0 0.35rem;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.kicker a:hover { color: var(--ink); }

h1 {
  font-family: var(--font);
  font-weight: 300;
  font-size: clamp(2.35rem, 4vw, 3.15rem);
  letter-spacing: -0.04em;
  line-height: 0.94;
  color: var(--ink);
}

.deck {
  max-width: 38rem;
  margin: 0.9rem 0 0;
  font-size: 1.08rem;
  line-height: 1.5;
  color: var(--muted);
}

.progress,
.progress-track {
  margin-left: 0;
  margin-right: auto;
}

.progress { color: var(--muted); }

.mast .tick::before { background: rgba(243, 240, 232, 0.2); }

.syllabus { padding: 1.35rem 0 0.35rem; }

.path { gap: 0; }

.part + .part { margin-top: 2.15rem; }

.part h2 {
  font-family: var(--font);
  font-size: 1.12rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--muted);
}

.part-row {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lesson-card,
.lesson-card:hover,
.lesson-card:active,
.lesson-card.is-done,
.lesson-card[aria-selected="true"],
.lesson-card[aria-selected="true"]:hover,
.lesson-card[aria-selected="true"]:active,
.lesson-card.is-done[aria-selected="true"],
.lesson-card.is-done[aria-selected="true"]:hover {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  grid-template-rows: auto;
  align-items: center;
  column-gap: 0.85rem;
  row-gap: 0;
  width: 100%;
  transform: none;
  min-height: 0;
  margin: 0;
  padding: 0.95rem 0.15rem;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.part-row .lesson-card:last-child { border-bottom: 1px solid var(--line); }

.lesson-card:hover,
.lesson-card:active { background: rgba(243, 240, 232, 0.035); }

.lesson-card[aria-selected="true"],
.lesson-card[aria-selected="true"]:hover,
.lesson-card[aria-selected="true"]:active,
.lesson-card.is-done[aria-selected="true"],
.lesson-card.is-done[aria-selected="true"]:hover {
  background: transparent;
  box-shadow: inset 3px 0 0 var(--accent);
}

.lesson-card .mark { display: none; }

.lesson-label .meta { display: contents; }

.lesson-label .num,
.lesson-card[aria-selected="true"] .num {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font);
  font-size: 1.65rem;
  font-weight: 300;
  letter-spacing: -0.04em;
  color: var(--accent-2);
}

.lesson-card[aria-selected="true"] .num { color: var(--accent); }

.lesson-label .name,
.lesson-card[aria-selected="true"] .name,
.lesson-card:not(:has(.mark)) .name,
.lesson-card:not(:has(.num)) .name {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  font-family: var(--font);
  font-weight: 300;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.lesson-label .time,
.lesson-card[aria-selected="true"] .time {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  white-space: nowrap;
}

.lesson-card.is-done .time::before,
.lesson-card.is-done[aria-selected="true"] .time::before { color: var(--accent-2); }

.bench {
  max-width: 80rem;
  margin: 0 auto 2.75rem;
  padding: 1.2rem 2.75rem 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  gap: 1.35rem;
  align-items: start;
}

.brief {
  padding: 0.35rem 0 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.lesson-kicker {
  margin-bottom: 0.45rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

#lesson-title {
  font-family: var(--font);
  font-weight: 300;
  font-size: clamp(1.85rem, 3vw, 2.45rem);
  letter-spacing: -0.04em;
  line-height: 0.96;
  scroll-margin-top: 5rem;
}

.lesson-body p,
.check-prompt,
.verdict,
.lesson-look,
.explain-kicker,
.tip-kicker,
.tip-body {
  font-family: var(--font);
}

.lesson-body p {
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
}

.check {
  padding-left: 0;
  padding-right: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.check-prompt {
  font-size: 1.05rem;
  font-weight: 400;
}

.choice,
.choice:hover,
.choice:active,
.choice.is-wrong {
  transform: none;
  min-height: 0;
  padding: 0.72rem 1rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(243, 240, 232, 0.45);
  border-radius: 999px;
  box-shadow: none;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.choice:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.choice.is-wrong {
  background: transparent;
  color: #ffb4a8;
  border-color: #e07a72;
}

.verdict,
.lesson-look {
  background: #10151d;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
}

.verdict.is-wrong { border-left-color: #e07a72; }

.explain {
  border-top: 1px solid var(--line);
}

.explain-kicker {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.studio {
  top: 4.6rem;
  padding: 0.85rem 1rem 0.9rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}

#run-free,
#run-free:hover,
#run-free:active,
#demo-on,
#demo-on:hover,
#demo-on:active,
#next,
#next:hover,
#next:active {
  transform: none;
  min-height: 0;
  padding: 0.72rem 1.25rem;
  background: var(--accent);
  color: #f7f8ff;
  border: 1px solid var(--accent);
  border-radius: 999px;
  box-shadow: none;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#run-free:hover,
#demo-on:hover,
#next:hover {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--bg);
}

#gate-close,
#demo-off,
#prev,
#next:disabled,
#gate-close:hover,
#demo-off:hover,
#prev:hover {
  transform: none;
  min-height: 0;
  padding: 0.68rem 1.1rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(243, 240, 232, 0.45);
  border-radius: 999px;
  box-shadow: none;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#gate-close:hover,
#demo-off:hover,
#prev:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

#prev:disabled,
#next:disabled {
  opacity: 0.4;
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

#status,
.preset-note,
.hint { color: var(--muted); }

#status { margin: 0; max-width: none; }

.preset-note.is-wrong { color: #ffb4a8; }
.preset-note.is-edited { color: var(--ink); }

.hint kbd,
kbd {
  background: var(--bg);
  border-color: rgba(243, 240, 232, 0.28);
  color: var(--ink);
  border-radius: 6px;
}

.ide {
  --ide-bg: transparent;
  --ide-bg-2: transparent;
  --ide-bar: transparent;
  --ide-line: var(--line);
  --ide-ink: var(--ink);
  --ide-dim: var(--muted);
  border: 0;
  border-radius: 0;
  background: transparent;
}

.editor-code textarea,
.out { min-height: 200px; }

.ide-bar {
  min-height: 0;
  padding: 0.85rem 1.15rem 0;
  background: transparent;
  border-bottom: 0;
}

.ide-tab {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 0 0 0.7rem;
}

.ide-tab::before,
.ide-pane + .ide-pane .ide-tab::before {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--accent);
}

.ide-status { background: transparent; }

.gutter { color: rgba(168, 185, 187, 0.7); }

#engine-status { color: var(--muted); background: none; }

#source-mirror .tok-kw { color: var(--accent-2); }

.engine-line {
  background: rgba(60, 120, 242, 0.16);
  color: var(--ink);
  border-color: var(--line);
  border-radius: 999px;
}

.track { background: rgba(243, 240, 232, 0.12); border-radius: 999px; }
.track > span { background: var(--accent); }
.p-num,
.amp-num { color: var(--accent-2); }

.tip {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.tip-code { color: var(--accent-2); }

dialog {
  background: var(--bg-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  padding: 1.7rem 1.55rem 1.45rem;
}

dialog::backdrop { background: rgba(6, 8, 12, 0.74); }

dialog h2 {
  font-family: var(--font);
  font-weight: 300;
  font-size: clamp(2.1rem, 4vw, 2.85rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

dialog p {
  color: var(--muted);
  font-size: 1.05rem;
}

#demo-password {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid rgba(243, 240, 232, 0.28);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}

#demo-password:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(60, 120, 242, 0.35);
}

.gate-sub {
  display: inline-flex;
  align-items: center;
  padding: 0.68rem 1.1rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(243, 240, 232, 0.45);
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.gate-sub:hover {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--bg);
}

@media (max-width: 960px) {
  .top-inner,
  .foot { padding-left: 1.15rem; padding-right: 1.15rem; }
  .top-go { width: 100%; }
  .machine {
    margin: 0;
    padding: 0 1.15rem;
    border-radius: 0;
  }
  .bench {
    margin: 0 0 1.5rem;
    padding: 1rem 1.15rem 0;
    background: transparent;
    border-radius: 0;
    align-items: stretch;
  }
  .studio,
  .ide { width: 100%; }
  .lesson-head,
  .explain {
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  .lesson-head { padding: 0.2rem 0 0; }
  .explain {
    margin-top: 0.85rem;
    padding: 0.85rem 0 0;
    border-top: 1px solid var(--line);
  }
  .brief-foot {
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
  #status { margin-left: 0; max-width: none; }
  .mast-split { grid-template-columns: 1fr; gap: 0.85rem; }
  .still img { height: 14rem; object-position: center 72%; }
  .lesson-label .name,
  .lesson-card[aria-selected="true"] .name { font-size: 1.2rem; }
  .lesson-label .num,
  .lesson-card[aria-selected="true"] .num { font-size: 1.35rem; }
}

@media (max-width: 860px) {
  .logo-key { width: auto; height: auto; border-radius: 0; }
  .logo { width: 1.7rem; height: 1.7rem; }
  .mast { padding: 1.15rem 0 1rem; }
  .syllabus { padding: 1rem 0 0.15rem; }
  h1 { font-size: 2.15rem; }
  .deck { display: block; }
}

/* Lesson lab. The section index is one wrapping row. The editor fills the rest. */

html { height: 100%; }

/* The lab fills the first screen. The footer sits below it, one scroll away. */
.app {
  height: 100dvh;
  min-height: 34rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top,
footer,
.machine { flex: none; }

.top-inner,
.foot {
  max-width: none;
  padding-left: 2.25rem;
  padding-right: 2.25rem;
}

.top-inner { padding-top: 1rem; padding-bottom: 1rem; }

.machine {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.7rem 2.25rem 0;
}

.mast {
  padding: 0.35rem 0 0.2rem;
  text-align: left;
}

.mast-top { align-items: flex-start; }

.mast-split {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 1.25rem;
}

.mast-split > div {
  min-width: 0;
  flex: 0 1 auto;
}

.still { flex: none; }

.still { width: 5.6rem; border-radius: 8px; }

.still img {
  width: 5.6rem;
  height: 3.5rem;
  object-fit: cover;
  object-position: center 72%;
}

.mast h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.deck {
  max-width: none;
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.progress { margin: 0.35rem 0 0; }

.syllabus {
  padding: 0.9rem 0 0.55rem;
  overflow: visible;
}

.path {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.35rem;
}

.part,
.part + .part {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.part h2 {
  margin: 0 0.4rem 0 0;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.part-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.lesson-card,
.lesson-card:hover,
.lesson-card:active,
.lesson-card.is-done,
.lesson-card[aria-selected="true"],
.lesson-card[aria-selected="true"]:hover,
.lesson-card[aria-selected="true"]:active,
.lesson-card.is-done[aria-selected="true"],
.lesson-card.is-done[aria-selected="true"]:hover {
  width: auto;
  grid-template-columns: auto;
  column-gap: 0.45rem;
  padding: 0.42rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.part-row .lesson-card:last-child { border-bottom: 1px solid var(--line); }

.lesson-card[aria-selected="true"],
.lesson-card[aria-selected="true"]:hover,
.lesson-card[aria-selected="true"]:active,
.lesson-card.is-done[aria-selected="true"],
.lesson-card.is-done[aria-selected="true"]:hover {
  grid-template-columns: auto auto;
  border-color: var(--accent);
  background: rgba(60, 120, 242, 0.14);
  box-shadow: none;
}

.lesson-label .num,
.lesson-card[aria-selected="true"] .num {
  font-size: 0.84rem;
  font-weight: 500;
}

.lesson-card .lesson-label .name,
.lesson-card:not(:has(.mark)) .name,
.lesson-card[aria-selected="true"] .name {
  display: none;
}

.lesson-card[aria-selected="true"] .lesson-label .name {
  display: inline;
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.lesson-label .time,
.lesson-card[aria-selected="true"] .time { display: none; }

.bench {
  flex: 1 1 auto;
  max-width: none;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0.95rem 2.25rem 0.8rem;
  grid-template-columns: minmax(18rem, 25rem) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 1.5rem;
}

.brief {
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
}

/* Fades the last visible lines while more text sits below. At the end of the
   scroll it rests in its own space under the text, so nothing stays covered. */
.brief::after {
  content: "";
  position: sticky;
  bottom: 0;
  display: block;
  height: 3rem;
  margin-top: 0.5rem;
  background: linear-gradient(to bottom, rgba(12, 16, 22, 0), var(--bg) 85%);
  pointer-events: none;
}

.lesson-head { margin-bottom: 1.25rem; }

.lesson-kicker { margin-bottom: 0.55rem; }

#lesson-title {
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  line-height: 1.15;
  margin-bottom: 0.7rem;
}

.studio {
  position: relative;
  top: auto;
  max-height: none;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.1rem 1.2rem 1rem;
}

.toolbar { flex-wrap: nowrap; padding-bottom: 0.85rem; margin-bottom: 0.35rem; }

.editor-shell {
  --pad-top: 1.05rem;
  --pad-x: 1rem;
  --pad-bottom: 1.15rem;
}

.gutter { flex-basis: 3rem; padding-left: 0.45rem; }

.out { padding: 1.15rem 1.2rem 1.2rem; }

#status { margin-left: auto; }

.preset-note:empty {
  display: none;
  min-height: 0;
  margin: 0;
}

.ide {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.ide-pane { min-height: 0; height: 100%; }

.editor-shell { flex: 1 1 auto; min-height: 0; }

.editor-code { min-height: 0; height: 100%; }

.gutter,
#source-mirror,
.editor-code textarea,
.out {
  font-size: 0.95rem;
}

.editor-code textarea,
.out {
  min-height: 0;
  height: 100%;
}

.editor-code textarea { resize: none; }

.out { height: auto; flex: 1 1 auto; }

.hint { margin: 0.4rem 0 0; }

.guide {
  margin-top: 1.35rem;
  padding-top: 1.05rem;
  padding-bottom: 0.65rem;
  border-top: 1px solid var(--line);
}

.guide h2,
.guide-steps > summary {
  margin: 0 0 0.5rem;
  font-family: var(--font);
  font-weight: 400;
  font-size: 0.88rem;
  letter-spacing: 0;
  line-height: 1.35;
  color: var(--muted);
}

.guide-steps { margin-top: 1.05rem; }

.guide-steps > summary {
  margin-bottom: 0;
  list-style: none;
  cursor: default;
  pointer-events: none;
}

.guide-steps > summary::-webkit-details-marker { display: none; }

.guide-steps > summary::marker { content: ""; }

.guide p,
.guide li {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
}

.guide ol {
  margin: 0.45rem 0 0;
  padding-left: 1.25rem;
}

.guide li + li { margin-top: 0.55rem; }

.guide code {
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.86em;
  color: var(--accent-2);
}

.foot {
  padding-top: 1rem;
  padding-bottom: 1rem;
  font-size: 0.82rem;
}

@media (max-width: 960px) {
  body {
    height: auto;
    min-height: 100dvh;
    overflow-x: clip;
    overflow-y: auto;
    padding-bottom: 1.25rem;
  }

  .app {
    display: contents;
    height: auto;
    min-height: 0;
  }

  .top-inner,
  .foot {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .machine { padding: 0.65rem 1.25rem 0; }

  .mast-split { gap: 1rem; }

  .mast-split > div { flex: 1 1 auto; }

  .still,
  .still img {
    width: 4.4rem;
    height: 3rem;
  }

  .mast { padding: 0.35rem 0 0.15rem; }

  .syllabus { padding: 0.7rem 0 0.3rem; }

  .path { gap: 0.4rem 0.7rem; }

  .part,
  .part + .part { gap: 0.35rem; }

  .part-row { gap: 0.35rem; }

  .lesson-card,
  .lesson-card:hover,
  .lesson-card:active,
  .lesson-card.is-done,
  .lesson-card[aria-selected="true"],
  .lesson-card[aria-selected="true"]:hover,
  .lesson-card[aria-selected="true"]:active,
  .lesson-card.is-done[aria-selected="true"],
  .lesson-card.is-done[aria-selected="true"]:hover {
    padding: 0.3rem 0.58rem;
  }

  .lesson-head { margin-bottom: 0.9rem; }

  .guide p,
  .guide li { line-height: 1.48; }

  .mast h1,
  h1 { font-size: 1.2rem; }

  .deck { font-size: 0.92rem; }

  .part h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .bench {
    display: flex;
    flex-direction: column;
    height: auto;
    margin: 0;
    padding: 1rem 1.25rem 0.4rem;
    gap: 1.15rem;
  }

  .brief {
    display: contents;
    height: auto;
    overflow: visible;
  }

  .brief::after { display: none; }

  .lesson-head { order: 1; }

  .brief-foot {
    order: 2;
    position: static;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .guide { order: 3; margin-top: 0.85rem; padding-top: 0.9rem; }

  .guide-steps > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    pointer-events: auto;
    padding: 0.15rem 0 0.2rem;
  }

  .guide-steps > summary::after {
    content: "";
    flex: none;
    width: 0.85rem;
    height: 0.85rem;
    background: currentColor;
    mask: url("/icons/down.svg") center / contain no-repeat;
    -webkit-mask: url("/icons/down.svg") center / contain no-repeat;
  }

  .guide-steps[open] > summary::after { transform: rotate(180deg); }

  .explain { order: 4; }

  .studio {
    order: 5;
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .ide { height: auto; }

  .ide-pane { height: auto; }

  .editor-code,
  .editor-shell { height: auto; }

  .editor-code textarea {
    min-height: 64vh;
    height: 64vh;
  }

  .out {
    min-height: 42vh;
    height: 42vh;
  }

  #status { margin-left: 0; }
}

/* Free and members sections in the syllabus, shown only while locked. */
.part:has(.lesson-card.is-free)::after {
  content: "Free";
  align-self: center;
  padding: 0.18rem 0.55rem;
  border: 1px solid rgba(142, 174, 255, 0.55);
  border-radius: 999px;
  color: var(--accent-2);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.3;
}

.lesson-card.is-free:not([aria-selected="true"]) { border-color: rgba(142, 174, 255, 0.4); }

.lesson-card.is-members:not([aria-selected="true"]) { border-style: dashed; }

.lesson-card.is-members .num { color: var(--muted); }

.lesson-card.is-members[aria-selected="true"] .num { color: var(--accent-2); }

.lesson-card.is-members[aria-selected="true"] .num::after {
  content: "";
  display: inline-block;
  width: 0.62rem;
  height: 0.62rem;
  margin-left: 0.32rem;
  vertical-align: -0.04rem;
  background: currentColor;
  -webkit-mask: url("/icons/lock.svg") center / contain no-repeat;
  mask: url("/icons/lock.svg") center / contain no-repeat;
  opacity: 0.85;
}

/* The subscribe box: buy first, members' key second, close last. */
#gate {
  width: min(34rem, calc(100% - 2rem));
  max-width: min(34rem, calc(100% - 2rem));
  padding: 1.5rem 1.45rem 0.9rem;
}

#gate p { margin: 0; }

#gate h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.95rem, 4vw, 2.5rem);
  line-height: 1;
}

#gate-reason { color: var(--ink); font-size: 1.04rem; line-height: 1.5; }

.gate-art:not([hidden]) {
  display: block;
  width: calc(100% + 2.9rem);
  max-width: none;
  height: auto;
  aspect-ratio: 720 / 209;
  margin: -1.5rem -1.45rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.gate-buy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

#gate .gate-sub {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.7rem 1.2rem;
}

#gate .gate-sub:not(.gate-sub-alt) {
  color: #f7f8ff;
  background: var(--accent);
  border-color: var(--accent);
}

#gate .gate-sub:hover,
#gate .gate-sub:not(.gate-sub-alt):hover {
  color: var(--bg);
  background: var(--cream);
  border-color: var(--cream);
}

#gate .gate-sub:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

#gate #gate-terms {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

#gate-terms a,
.gate-lost a { color: var(--accent-2); }

.gate-member {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.gate-key-label { display: block; color: var(--ink); font-size: 0.98rem; line-height: 1.4; }

.gate-key {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

#gate .gate-key #demo-password {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  min-height: 2.9rem;
}

#gate #demo-on,
#gate #demo-on:hover,
#gate #demo-on:active {
  flex: none;
  min-height: 2.9rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(243, 240, 232, 0.45);
}

#gate #demo-on:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

#gate .gate-lost { margin-top: 0.5rem; font-size: 0.9rem; line-height: 1.4; }

#gate #gate-close,
#gate #gate-close:hover {
  display: flex;
  margin: 0.55rem auto 0;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--muted);
  border: 0;
}

#gate #gate-close:hover { color: var(--ink); }

@media (max-width: 480px) {
  #gate { padding: 1.25rem 1.1rem 0.7rem; }
  .gate-art:not([hidden]) { width: calc(100% + 2.2rem); margin: -1.25rem -1.1rem 1rem; }
  #gate h2 { font-size: 1.85rem; }
  #gate-reason { font-size: 0.98rem; }
  .gate-buy { margin-top: 0.95rem; }
  #gate .gate-sub { flex-basis: 100%; }
}

/* Masthead picture: a crop of the pixel lab. */
.mast .still img { object-position: center 40%; }

@media (min-width: 961px) {
  .mast .still { width: 7.5rem; }
  .mast .still img { width: 7.5rem; height: 5rem; }
}

.top-go[hidden] { display: none; }

/* The brief's footer bar is no longer fixed on narrow screens, so the
   page needs no room reserved beneath it. */
@media (max-width: 960px) {
  body,
  body:has(#verdict:not([hidden])),
  body:has(#check:not([hidden])) { padding-bottom: 0; }
}
