:root {
  --paper: #f5f1e8;
  --paper-strong: #ebe3d5;
  --surface: #fffdf8;
  --ink: #202a28;
  --muted: #59635f;
  --accent: #176044;
  --accent-2: #b74834;
  --accent-3: #d3a427;
  --accent-soft: #dce8df;
  --teal: #1f5e63;
  --plum: #75435f;
  --line: rgba(32, 42, 40, 0.22);
  --shadow: 0 12px 28px rgba(32, 42, 40, 0.12);
  --content: 880px;
  --rail: 252px;
  --toc: 220px;
}

.theme-brick {
  --accent: #a94332;
  --accent-2: #1f5e63;
  --accent-3: #d3a427;
  --accent-soft: #f0ded8;
}

.theme-teal {
  --accent: #1f5e63;
  --accent-2: #b74834;
  --accent-3: #d3a427;
  --accent-soft: #d8e8e7;
}

.theme-mustard {
  --accent: #8a6412;
  --accent-2: #176044;
  --accent-3: #b74834;
  --accent-soft: #f0e6c8;
}

.theme-plum {
  --accent: #75435f;
  --accent-2: #176044;
  --accent-3: #d3a427;
  --accent-soft: #eadde5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(32, 42, 40, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 42, 40, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.78;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

button {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent-3);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 8px;
  z-index: 400;
  transform: translateY(-160%);
  background: var(--ink);
  color: white;
  padding: 8px 12px;
}

.skip-link:focus {
  transform: translateY(0);
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 300;
  height: 5px;
  background: rgba(32, 42, 40, 0.08);
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent-2);
  transform: scaleX(0);
  transform-origin: left;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 22px;
  border-bottom: 2px solid var(--ink);
  background: rgba(245, 241, 232, 0.96);
  backdrop-filter: blur(10px);
}

.course-mark {
  display: grid;
  text-decoration: none;
  line-height: 1.25;
}

.course-mark strong {
  font-size: 16px;
}

.course-mark span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-progress {
  color: var(--accent);
  font-weight: 900;
}

.icon-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  background: var(--accent-3);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.course-layout {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr) var(--toc);
  min-height: calc(100vh - 70px);
}

.course-rail {
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
  padding: 18px 12px 42px;
  border-right: 2px solid var(--ink);
  background: rgba(235, 227, 213, 0.9);
}

.rail-group + .rail-group {
  margin-top: 20px;
}

.rail-group h2 {
  margin: 0 8px 6px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.rail-link {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  padding: 8px;
  border-bottom: 1px dashed var(--line);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.42;
}

.rail-link span {
  color: var(--accent);
  font-weight: 900;
}

.rail-link:hover,
.rail-link:focus-visible {
  background: rgba(211, 164, 39, 0.17);
}

.rail-link.active {
  background: var(--accent);
  color: white;
  box-shadow: 4px 4px 0 var(--ink);
}

.rail-link.active span {
  color: #fff3a8;
}

.page-toc {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  margin: 26px 14px 0 0;
  padding: 4px 0 24px 16px;
  border-left: 2px solid var(--line);
}

.page-toc p {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.page-toc a {
  display: block;
  padding: 7px 8px;
  border-left: 3px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.4;
}

.page-toc a:hover,
.page-toc a:focus-visible,
.page-toc a.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.mobile-toc {
  display: none;
}

.lesson-shell {
  width: min(100%, calc(var(--content) + 112px));
  margin: 0 auto;
  padding: 36px clamp(24px, 4vw, 56px) 80px;
  overflow: hidden;
}

.lesson-header {
  position: relative;
  min-height: 250px;
  display: grid;
  align-content: center;
  padding: 36px 48px;
  border-top: 11px solid var(--accent);
  border-bottom: 3px solid var(--ink);
  background: rgba(255, 253, 248, 0.62);
}

.lesson-header::after {
  content: "";
  position: absolute;
  right: 7%;
  bottom: 22px;
  width: 150px;
  height: 16px;
  background: var(--accent-2);
  opacity: 0.84;
  transform: rotate(-2deg);
}

.stage-label {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 14px;
  font-weight: 900;
}

.page-number {
  position: absolute;
  right: 42px;
  top: 18px;
  margin: 0;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 96px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.12;
}

.lesson-header h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0;
  font-size: 56px;
  line-height: 1.15;
  font-weight: 950;
}

.complete-button,
.command-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 2px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
}

.complete-button {
  justify-self: start;
  margin-top: 24px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
}

.complete-button:hover,
.complete-button:focus-visible,
.command-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-2px);
}

.complete-button.is-complete,
.command-button {
  background: var(--accent);
  color: white;
}

.secondary-button {
  background: var(--surface);
}

.danger-button {
  border-color: #8f2f25;
  background: transparent;
  color: #8f2f25;
}

.lesson-content {
  max-width: var(--content);
  margin: 0 auto;
  padding-top: 50px;
}

.lesson-lead {
  max-width: 760px;
  margin: 0 0 50px;
  padding-left: 20px;
  border-left: 6px solid var(--accent);
  text-align: left;
  font-size: 24px;
  line-height: 1.58;
  font-weight: 650;
}

.lesson-content h2 {
  margin: 76px 0 22px;
  padding-top: 12px;
  border-top: 4px solid var(--accent);
  scroll-margin-top: 92px;
  font-size: 38px;
  line-height: 1.28;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

.lesson-content h2:nth-of-type(3n + 2) {
  border-color: var(--accent-2);
}

.lesson-content h2:nth-of-type(3n) {
  border-color: var(--teal);
}

.lesson-content h3 {
  margin: 38px 0 12px;
  font-size: 26px;
  line-height: 1.38;
}

.lesson-content h4 {
  margin: 28px 0 8px;
  color: var(--accent);
  font-size: 19px;
}

.lesson-content p,
.lesson-content li {
  max-width: 780px;
}

.lesson-content p {
  margin: 0 0 17px;
}

.lesson-content code {
  overflow-wrap: anywhere;
}

.lesson-content blockquote {
  max-width: 780px;
  margin: 28px 0;
  padding: 20px 24px;
  border-left: 7px solid var(--accent-2);
  background: rgba(255, 253, 248, 0.7);
  font-size: 19px;
}

.lesson-content > pre {
  max-width: 100%;
  margin: 28px 0 42px;
  padding: 20px;
  overflow: auto;
  border: 2px solid var(--ink);
  background: #1f2927;
  color: #f7f1df;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Cascadia Code", "Noto Sans Mono CJK TC", Consolas, monospace;
  font-size: 14px;
  line-height: 1.68;
}

.lesson-content strong {
  color: color-mix(in srgb, var(--accent) 82%, var(--ink));
}

.keyword-highlight {
  padding: 0 3px;
  background: linear-gradient(transparent 45%, rgba(211, 164, 39, 0.46) 45%);
  color: inherit;
}

.lesson-content ul,
.lesson-content ol {
  max-width: 820px;
  margin: 16px 0 28px;
  padding-left: 28px;
}

.lesson-content li {
  margin: 8px 0;
  padding-left: 5px;
}

.lesson-content .box-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

.lesson-content .box-list > li {
  min-width: 0;
  margin: 0;
  padding: 16px 18px;
  border-top: 5px solid var(--accent);
  background: rgba(255, 253, 248, 0.76);
  box-shadow: 4px 4px 0 rgba(32, 42, 40, 0.16);
}

.lesson-content .box-list > li:nth-child(2n) {
  border-color: var(--accent-2);
}

.lesson-content .box-list > li:nth-child(3n) {
  border-color: var(--accent-3);
}

.lesson-content .checklist {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.lesson-content .checklist > li {
  margin: 0;
  padding: 0;
}

.lesson-content .checklist label {
  min-height: 58px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
  cursor: pointer;
}

.lesson-content .checklist input {
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.lesson-figure {
  width: min(82%, 820px);
  margin: 48px auto;
}

.lesson-figure img {
  width: 100%;
  display: block;
  border: 3px solid var(--ink);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.lesson-figure figcaption {
  max-width: 720px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.lesson-figure.figure-concept {
  width: min(82%, 820px);
}

.lesson-figure.figure-scene-right {
  width: min(62%, 620px);
  margin-left: auto;
  margin-right: 0;
}

.lesson-figure.figure-scene-left {
  width: min(62%, 620px);
  margin-left: 0;
  margin-right: auto;
}

.lesson-figure.figure-wide {
  width: min(100%, 920px);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 26px 0 40px;
  border: 2px solid var(--ink);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

th,
td {
  padding: 11px 13px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--accent);
  color: white;
}

.prompt-box {
  max-width: 850px;
  margin: 28px 0 42px;
  border: 2px solid var(--ink);
  background: #1f2927;
  color: #f7f1df;
  box-shadow: 7px 7px 0 var(--accent-3);
}

.prompt-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: #151d1b;
}

.prompt-toolbar > div:first-child {
  display: grid;
}

.prompt-label {
  font-weight: 900;
}

.prompt-toolbar small {
  color: #bdc8c2;
  font-size: 12px;
}

.prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.prompt-actions button {
  min-width: 58px;
  min-height: 36px;
  border: 1px solid #dfe6dd;
  background: transparent;
  color: #f7f1df;
  cursor: pointer;
  font-size: 13px;
}

.prompt-box pre {
  max-height: 360px;
  min-height: 180px;
  resize: vertical;
  overflow: auto;
  margin: 0;
  padding: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Cascadia Code", "Noto Sans Mono CJK TC", Consolas, monospace;
  font-size: 14px;
  line-height: 1.68;
}

.prompt-box.is-expanded pre {
  max-height: none;
  height: auto !important;
  resize: none;
}

.source-callout {
  max-width: 820px;
  margin: 36px 0;
  padding: 26px;
  border-left: 9px solid var(--accent-2);
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--ink);
}

.source-callout h3 {
  margin-top: 4px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 950;
}

.inline-actions,
.workspace-actions,
.hero-actions,
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.download-band {
  max-width: var(--content);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 50px auto 0;
  padding: 22px 0;
  border-top: 3px solid var(--accent-2);
  border-bottom: 1px solid var(--line);
}

.download-band a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border: 2px solid var(--ink);
  background: var(--accent-3);
  text-decoration: none;
  font-weight: 850;
}

.artifact-workspace {
  width: 100%;
  margin: 56px 0;
  padding: 28px;
  scroll-margin-top: 96px;
  border: 3px solid var(--ink);
  background: var(--surface);
  box-shadow: 9px 9px 0 var(--accent);
}

.artifact-workspace header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.artifact-workspace header > div {
  min-width: 0;
}

.artifact-workspace h2 {
  margin: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 28px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.artifact-reference {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--accent-2);
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.artifact-reference code {
  color: inherit;
}

.artifact-reference span {
  font-size: 13px;
  white-space: nowrap;
}

.artifact-file-name {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.save-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.artifact-workspace textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  margin: 12px 0 14px;
  padding: 16px;
  border: 2px solid var(--ink);
  background: #fffefb;
  color: var(--ink);
  font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  line-height: 1.65;
  font-family: "Cascadia Code", "Microsoft JhengHei", monospace;
  font-size: 15px;
  line-height: 1.65;
}

.artifact-workspace textarea[readonly] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 45%, white);
  cursor: default;
}

.content-lock-panel {
  width: 100%;
  margin: -22px 0 56px;
  padding: 28px;
  border: 3px solid var(--ink);
  background: color-mix(in srgb, var(--accent-soft) 58%, white);
  box-shadow: 9px 9px 0 var(--ink);
}

.content-lock-panel > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}

.content-lock-panel h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 27px;
}

.content-lock-panel output {
  max-width: 360px;
  padding: 7px 10px;
  border: 2px solid var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 900;
}

.content-lock-panel[data-locked="true"] output {
  background: var(--accent);
  color: white;
}

.content-lock-panel[data-lock-error] output {
  background: #fff1e7;
  color: #8a2d19;
}

.content-lock-panel input {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: white;
  color: var(--ink);
}

.content-lock-panel input[readonly] {
  background: rgba(255, 255, 255, 0.58);
}

.content-lock-panel button:disabled,
.artifact-workspace button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.content-lock {
  margin: 28px 0;
  padding: 20px 22px;
  border: 3px solid var(--ink);
  background: var(--accent-soft);
}

.content-lock p {
  margin: 5px 0;
}

.deck-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.deck-comparison a {
  display: grid;
  gap: 6px;
  min-height: 108px;
  align-content: center;
  padding: 18px 20px;
  border: 3px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 6px 6px 0 var(--accent);
}

.deck-comparison a:hover,
.deck-comparison a:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--accent);
}

.deck-comparison span {
  color: var(--muted);
  font-size: 14px;
}

.drift-status {
  display: grid;
  gap: 12px;
  margin: 24px 0 34px;
  padding: 20px;
  border-left: 9px solid var(--accent-2);
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--ink);
}

.drift-status p {
  margin: 0;
}

.drift-status button {
  justify-self: start;
  min-height: 44px;
  padding: 8px 13px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 900;
}

.drift-status output {
  min-height: 26px;
  font-weight: 850;
}

.drift-status[data-drift-result="pass"] {
  border-left-color: #2f6b48;
  background: #edf8ef;
}

.drift-status[data-drift-result="fail"] {
  border-left-color: #b13c25;
  background: #fff1e7;
}

.page-turn {
  max-width: var(--content);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 72px auto 0;
  padding-top: 26px;
  border-top: 3px solid var(--ink);
}

.page-turn a {
  min-width: 0;
  display: grid;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.64);
  text-decoration: none;
  font-weight: 850;
}

.page-turn span {
  color: var(--accent-2);
  font-size: 12px;
}

.page-turn .next {
  text-align: right;
}

/* Homepage */

.home-page {
  background-color: #f3eee3;
}

.home-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 4vw;
  border-bottom: 2px solid var(--ink);
  background: rgba(245, 241, 232, 0.96);
}

.home-brand {
  font-weight: 950;
  text-decoration: none;
}

.home-nav nav {
  display: flex;
  gap: 20px;
}

.home-nav nav a {
  font-size: 14px;
  font-weight: 800;
}

.home-hero {
  position: relative;
  min-height: 72vh;
  max-height: 820px;
  overflow: hidden;
  display: flex;
  align-items: end;
  padding: 64px 5vw 72px;
  border-bottom: 8px solid var(--ink);
  background: var(--ink);
}

.home-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.72;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(16, 27, 24, 0.42);
}

.home-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 980px;
  color: white;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.home-hero-copy > p {
  margin: 0 0 10px;
  color: #ffe083;
  font-weight: 950;
}

.home-hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: 72px;
  line-height: 1.08;
}

.home-hero h2 {
  margin: 18px 0 28px;
  font-size: 26px;
  line-height: 1.35;
}

.home-hero .secondary-button {
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  text-shadow: none;
}

.home-section {
  padding: 84px max(5vw, 24px);
  border-bottom: 2px solid var(--ink);
}

.home-section > * {
  width: min(1180px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  margin-bottom: 34px;
}

.section-heading h2,
.qr-copy h2,
.profile-section h2 {
  max-width: 940px;
  margin: 0;
  font-size: 46px;
  line-height: 1.18;
}

.section-heading > p:last-child {
  max-width: 760px;
  margin: 14px 0 0;
  font-size: 19px;
}

.course-map-section {
  background: var(--paper);
}

.journey-image-button {
  position: relative;
  width: min(1180px, 100%);
  display: block;
  padding: 0;
  border: 3px solid var(--ink);
  background: transparent;
  cursor: zoom-in;
  box-shadow: 12px 12px 0 var(--accent-3);
}

.journey-image-button img {
  width: 100%;
  display: block;
}

.journey-image-button span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 12px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.course-journey-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.journey-stage {
  min-width: 0;
  padding-top: 14px;
  border-top: 7px solid var(--accent);
}

.journey-stage:nth-child(2n) {
  border-color: var(--accent-2);
}

.journey-stage:nth-child(3n) {
  border-color: var(--accent-3);
}

.journey-stage h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.journey-stage a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
  text-decoration: none;
  line-height: 1.4;
}

.journey-stage a span {
  color: var(--accent);
  font-weight: 950;
}

.journey-stage a strong {
  min-width: 0;
  font-size: 14px;
}

.qr-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
  background: #dce8df;
}

.qr-copy {
  width: 100%;
}

.long-url {
  display: block;
  max-width: 680px;
  margin: 20px 0;
  overflow-wrap: anywhere;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 16px;
}

.qr-button {
  width: 196px;
  padding: 12px;
  justify-self: end;
  border: 3px solid var(--ink);
  background: var(--surface);
  cursor: zoom-in;
  box-shadow: 10px 10px 0 var(--accent-2);
}

.qr-button img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: contain;
  image-rendering: auto;
}

.qr-button span {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 900;
}

.coach-section {
  background: #f0e6c8;
}

.coach-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.coach-card {
  min-width: 0;
  padding: 26px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--accent);
}

.coach-card > span {
  color: var(--accent-2);
  font-size: 14px;
  font-weight: 950;
}

.coach-card h3 {
  margin: 8px 0 12px;
  font-size: 26px;
  line-height: 1.3;
}

.coach-card a {
  font-weight: 900;
}

.profile-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  background: #e5e7df;
}

.profile-section > div {
  min-width: 0;
  padding-top: 12px;
  border-top: 6px solid var(--accent);
}

.profile-section > div:nth-child(2) {
  border-color: var(--accent-2);
}

.profile-section > div:nth-child(3) {
  border-color: var(--accent-3);
}

.profile-section h2 {
  font-size: 28px;
}

.link-row a {
  font-weight: 900;
}

.download-section {
  background: var(--paper-strong);
}

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

.download-grid a {
  min-width: 0;
  min-height: 140px;
  display: grid;
  align-content: space-between;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--surface);
  text-decoration: none;
}

.download-grid a:nth-child(2n) {
  background: var(--accent-soft);
}

.download-grid strong {
  font-size: 20px;
}

.download-grid span {
  color: var(--muted);
  font-size: 13px;
}

.safety-note {
  margin-top: 28px;
  padding: 18px 0 0;
  border-top: 2px solid var(--ink);
  font-weight: 800;
}

.image-dialog {
  width: min(94vw, 1280px);
  max-height: 90vh;
  padding: 50px 18px 18px;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.image-dialog::backdrop {
  background: rgba(10, 16, 14, 0.78);
}

.image-dialog > button {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  background: var(--accent-3);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.image-dialog img {
  width: 100%;
  max-height: calc(90vh - 76px);
  display: block;
  object-fit: contain;
}

.qr-dialog {
  width: min(92vw, 480px);
  text-align: center;
}

.qr-dialog img {
  height: auto;
  max-width: 420px;
  margin: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  image-rendering: auto;
}

.qr-dialog a {
  display: block;
  margin-top: 14px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

@media (max-width: 1240px) {
  .course-layout {
    grid-template-columns: var(--rail) minmax(0, 1fr);
  }

  .page-toc {
    display: none;
  }

  .mobile-toc {
    width: min(100%, var(--content));
    display: grid;
    gap: 5px;
    margin: 18px auto 0;
    color: var(--accent-2);
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-toc select {
    width: 100%;
    min-height: 46px;
    padding: 8px 10px;
    border: 2px solid var(--ink);
    background: var(--surface);
    color: var(--ink);
  }
}

@media (max-width: 920px) {
  .icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .course-layout {
    display: block;
  }

  .course-rail {
    position: fixed;
    inset: 70px auto 0 0;
    z-index: 180;
    width: min(86vw, 330px);
    height: calc(100vh - 70px);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 14px 0 30px rgba(32, 42, 40, 0.22);
  }

  .course-rail.is-open {
    transform: translateX(0);
  }

  .lesson-shell {
    padding: 28px 22px 64px;
  }

  .lesson-header {
    min-height: 230px;
    padding: 32px 26px;
  }

  .lesson-header h1 {
    font-size: 44px;
  }

  .lesson-content h2 {
    font-size: 34px;
  }

  .home-hero h1 {
    font-size: 56px;
  }

  .course-journey-grid,
  .profile-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  .topbar {
    padding: 9px 12px;
  }

  .course-mark span {
    display: none;
  }

  .page-progress {
    font-size: 13px;
  }

  .lesson-shell {
    padding: 18px 14px 54px;
  }

  .lesson-header {
    min-height: 210px;
    padding: 28px 20px;
  }

  .lesson-header h1 {
    font-size: 36px;
  }

  .page-number {
    right: 18px;
    font-size: 68px;
  }

  .lesson-content {
    padding-top: 36px;
  }

  .lesson-lead {
    padding-left: 15px;
    font-size: 20px;
  }

  .lesson-content h2 {
    margin-top: 58px;
    font-size: 29px;
  }

  .lesson-content h3 {
    font-size: 22px;
  }

  .lesson-content .box-list {
    grid-template-columns: 1fr;
  }

  .lesson-figure,
  .lesson-figure.figure-concept,
  .lesson-figure.figure-scene-left,
  .lesson-figure.figure-scene-right,
  .lesson-figure.figure-wide {
    width: 100%;
    margin: 40px auto;
  }

  .prompt-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .prompt-actions {
    width: 100%;
  }

  .prompt-actions button {
    flex: 1;
  }

  .prompt-box pre {
    max-height: 320px;
    font-size: 13px;
  }

  .artifact-workspace {
    padding: 18px;
    box-shadow: 6px 6px 0 var(--accent);
  }

  .artifact-workspace header {
    flex-direction: column;
    gap: 8px;
  }

  .workspace-actions > * {
    width: 100%;
  }

  .page-turn {
    grid-template-columns: 1fr;
  }

  .page-turn .next {
    text-align: left;
  }

  .home-nav {
    padding: 9px 14px;
  }

  .home-nav nav {
    display: none;
  }

  .home-hero {
    min-height: 68vh;
    padding: 48px 20px;
  }

  .home-hero h1 {
    font-size: 42px;
  }

  .home-hero h2 {
    font-size: 20px;
  }

  .hero-actions > * {
    width: 100%;
  }

  .home-section {
    padding: 60px 18px;
  }

  .section-heading h2,
  .qr-copy h2 {
    font-size: 34px;
  }

  .course-journey-grid,
  .coach-grid,
  .profile-section,
  .download-grid,
  .qr-section {
    grid-template-columns: 1fr;
  }

  .qr-section {
    gap: 36px;
  }

  .qr-button {
    width: 160px;
    justify-self: start;
  }

  .journey-image-button {
    box-shadow: 7px 7px 0 var(--accent-3);
  }

  .coach-card h3 {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .topbar,
  .course-rail,
  .page-toc,
  .mobile-toc,
  .complete-button,
  .prompt-actions,
  .workspace-actions,
  .page-turn,
  .reading-progress {
    display: none !important;
  }

  .course-layout {
    display: block;
  }

  .lesson-shell {
    width: 100%;
    padding: 0;
  }

  .prompt-box pre {
    max-height: none;
  }
}

/* v0.9 shared course metadata and WP2 components */
.rail-link {
  grid-template-columns: 30px minmax(0, 1fr);
}

.rail-title {
  color: inherit !important;
  font-weight: 750 !important;
}

.rail-participation {
  grid-column: 2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.rail-link.active .rail-participation {
  color: #fff3a8;
}

.lesson-meta-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  max-width: var(--content);
  margin: 24px auto 0;
  border: 2px solid var(--ink);
  background: var(--ink);
}

.lesson-meta-panel > div {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
}

.lesson-meta-panel dt {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.lesson-meta-panel dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.participation-badge,
.fact-label,
.gate-tag,
.status-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid currentColor;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.fact-legend,
.source-note,
.checkpoint-card,
.stop-card,
.legacy-artifact-notice,
.no-script-note {
  max-width: var(--content);
  margin: 24px auto;
  padding: 18px 20px;
  border-left: 7px solid var(--accent);
  background: rgba(255, 253, 248, 0.82);
}

.fact-legend {
  display: grid;
  gap: 10px;
}

.fact-legend p,
.source-note p,
.checkpoint-card p,
.stop-card p,
.legacy-artifact-notice p,
.no-script-note p {
  margin: 0;
}

.fact-label[data-fact="course-rule"] {
  color: #93402f;
}

.fact-label[data-fact="recommended"] {
  color: #765810;
}

.stop-card {
  border-left-color: #982f27;
  background: #fff0eb;
}

.checkpoint-card {
  border-left-color: var(--accent-3);
}

.flow-chain,
.route-map {
  display: grid;
  gap: 12px;
  max-width: 860px;
  margin: 28px 0 40px;
  padding: 0;
  list-style: none;
}

.flow-chain > li,
.route-map > li,
.gate-card,
.outcome-card {
  position: relative;
  margin: 0;
  padding: 18px 20px;
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--accent-soft);
}

.flow-chain > li + li::before,
.route-map > li + li::before {
  content: "↓";
  position: absolute;
  left: 20px;
  top: -26px;
  color: var(--accent);
  font-weight: 950;
}

.flow-chain strong,
.route-map strong {
  color: var(--accent);
}

.outcome-grid,
.gate-grid,
.download-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 38px;
}

.outcome-card h3,
.gate-card h3 {
  margin: 0 0 8px;
  font-size: 21px;
}

.outcome-card p,
.gate-card p {
  margin: 0 0 10px;
}

.preflight-form {
  display: grid;
  gap: 30px;
  margin: 30px 0;
}

.preflight-form fieldset,
.generated-artifact {
  min-width: 0;
  margin: 0;
  padding: 22px;
  border: 2px solid var(--ink);
  background: rgba(255, 253, 248, 0.78);
}

.preflight-form legend {
  max-width: calc(100% - 24px);
  padding: 3px 10px;
  background: var(--accent);
  color: white;
  font-size: 18px;
  font-weight: 900;
}

.preflight-grid,
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.preflight-row,
.field-row {
  min-width: 0;
  display: grid;
  gap: 7px;
  align-content: start;
}

.preflight-row > span,
.field-row > span {
  font-size: 14px;
  font-weight: 850;
}

.preflight-row small,
.field-row small {
  color: var(--muted);
  line-height: 1.45;
}

.preflight-form input,
.preflight-form select,
.preflight-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 9px 11px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: white;
  color: var(--ink);
}

.preflight-form textarea {
  min-height: 112px;
  resize: vertical;
}

.preflight-form input[type="checkbox"] {
  width: 24px;
  min-height: 24px;
  height: 24px;
  accent-color: var(--accent);
}

.artifact-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.artifact-actions button,
.form-actions button,
.form-actions a,
.legacy-artifact-notice button {
  min-height: 44px;
  padding: 8px 13px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
}

.artifact-actions .primary-action,
.form-actions .primary-action {
  background: var(--accent);
  color: white;
}

.save-status {
  min-height: 28px;
  margin: 8px 0 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 850;
}

.artifact-preview {
  max-height: 300px;
  overflow: auto;
  margin: 16px 0 0;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #1f2927;
  color: #f7f1df;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.static-download-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.static-download-list a,
.download-card-grid a {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  background: var(--surface);
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--accent-soft);
}

.static-download-list small,
.download-card-grid small {
  color: var(--muted);
}

.source-list {
  font-size: 14px;
}

.model-route-banner {
  margin: 0;
  padding: 9px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, white);
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

.completion-panel {
  margin-top: 46px;
  padding: 24px;
  border: 3px solid var(--ink);
  background: var(--accent-soft);
}

.completion-panel h2 {
  margin-top: 0;
  border-top: 0;
}

@media (max-width: 680px) {
  .lesson-meta-panel,
  .preflight-grid,
  .field-grid,
  .deck-comparison,
  .outcome-grid,
  .gate-grid,
  .download-card-grid,
  .static-download-list {
    grid-template-columns: 1fr;
  }

  .lesson-meta-panel > div,
  .preflight-form fieldset,
  .generated-artifact {
    padding: 16px;
  }

  .artifact-actions > *,
  .form-actions > * {
    width: 100%;
  }

  .content-lock-panel {
    padding: 20px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .content-lock-panel > header {
    display: grid;
  }

  .content-lock-panel output {
    max-width: none;
  }
}

@media print {
  .artifact-actions,
  .form-actions,
  .legacy-artifact-notice button {
    display: none !important;
  }

  .lesson-meta-panel,
  .preflight-form fieldset,
  .generated-artifact,
  .content-lock-panel,
  .deck-comparison a,
  .drift-status,
  .outcome-card,
  .gate-card {
    break-inside: avoid;
    box-shadow: none;
  }

  .content-lock-panel output {
    border: 1px solid #333;
    background: white !important;
    color: black !important;
  }

  .artifact-preview {
    max-height: none;
    border: 1px solid #333;
    background: white;
    color: black;
  }
}

/* v0.9.1 learner-first revision */
.learner-launch,
.learning-recap,
.technical-details,
.learner-meta {
  width: min(calc(100% - 32px), var(--content));
  margin-right: auto;
  margin-left: auto;
}

.learner-launch {
  margin-top: 24px;
  margin-bottom: 24px;
  padding: clamp(22px, 4vw, 36px);
  border: 3px solid var(--ink);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 78%, white), var(--surface));
  box-shadow: 8px 8px 0 var(--ink);
}

.learner-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.learner-launch h2,
.learning-recap h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  line-height: 1.25;
}

.learner-task {
  max-width: 42rem;
  margin: 12px 0 18px;
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  font-weight: 750;
  line-height: 1.65;
}

.learner-outcome {
  display: grid;
  gap: 2px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border-left: 7px solid var(--accent-3);
  background: var(--surface);
}

.learner-outcome span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.learner-outcome strong {
  font-size: 1.02rem;
}

.learner-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learner-steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 700;
  line-height: 1.55;
}

.learner-steps li > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  font-weight: 900;
}

.learner-stop {
  display: flex;
  gap: 10px 16px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 14px 16px;
  border: 2px solid var(--accent-2);
  border-radius: 12px;
  color: #542015;
  background: #fff0ea;
}

.learner-stop strong {
  flex: 0 0 auto;
}

.quick-glossary,
.technical-details,
.download-details,
.home-download-details {
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
}

.quick-glossary {
  margin-top: 16px;
}

.quick-glossary summary,
.technical-details summary,
.download-details summary,
.home-download-details summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 850;
}

.quick-glossary dl {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0 16px 16px;
}

.quick-glossary dl > div {
  display: grid;
  grid-template-columns: minmax(8rem, 0.35fr) 1fr;
  gap: 10px;
}

.quick-glossary dt {
  font-weight: 900;
}

.quick-glossary dd {
  margin: 0;
  color: var(--muted);
}

.technical-details {
  margin-top: 14px;
  margin-bottom: 14px;
  border-color: var(--line);
  box-shadow: none;
}

.technical-details > :not(summary) {
  width: auto;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  box-shadow: none;
}

.prompt-guide {
  margin: 18px 0 10px;
  padding: 16px 18px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-soft) 65%, white);
}

.prompt-guide h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.prompt-guide ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 22px;
  margin: 0;
  padding-left: 1.4rem;
}

.prompt-guide li {
  margin: 0;
}

.download-details {
  margin: 10px 0 28px;
  border-color: var(--line);
}

.download-details-body {
  padding: 4px 16px 18px;
}

.route-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.route-choice article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
}

.route-choice article > span {
  width: max-content;
  padding: 2px 9px;
  border-radius: 99px;
  color: white;
  background: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.route-choice article > strong {
  font-size: 1.18rem;
}

.route-choice p {
  margin: 0;
}

.route-choice a {
  width: max-content;
  font-weight: 850;
  text-underline-offset: 4px;
}

.learning-recap {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  margin-top: 40px;
  margin-bottom: 26px;
  padding: clamp(20px, 4vw, 30px);
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--accent-3);
}

.learning-recap ul {
  margin: 14px 0 0;
  padding-left: 1.3rem;
}

.self-check {
  padding: 16px;
  border-radius: 12px;
  background: var(--accent-soft);
}

.self-check h3 {
  margin: 0 0 12px;
}

.self-check label {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 9px 0;
  cursor: pointer;
}

.self-check input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.35rem;
  accent-color: var(--accent);
}

.home-welcome {
  max-width: 42rem;
  font-size: 1.12rem;
  font-weight: 650;
}

.home-start-path {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 30px;
  align-items: start;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--accent-3);
}

.home-start-path ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-start-path a {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  text-decoration: none;
}

.home-start-path a:hover,
.home-start-path a:focus-visible {
  color: white;
  background: var(--accent);
}

.home-start-path a span {
  font-weight: 950;
}

.first-visit-note {
  display: flex;
  gap: 10px 18px;
  align-items: baseline;
  margin: 20px 0;
  padding: 14px 16px;
  border-left: 7px solid var(--accent-3);
  background: var(--surface);
}

.dual-qr {
  grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(210px, 0.7fr));
  align-items: stretch;
}

.qr-destination {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--surface);
}

.qr-destination h3 {
  margin: 0;
}

.qr-destination img {
  width: min(100%, 240px);
  height: auto;
  aspect-ratio: 1;
  border: 8px solid white;
}

.featured-download {
  margin: 18px 0;
}

.featured-download a {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  color: white;
  background: var(--accent);
  text-decoration: none;
}

.home-download-details {
  margin-top: 16px;
}

.home-download-details .download-grid {
  margin: 0;
  padding: 4px 16px 16px;
}

@media (max-width: 760px) {
  .learner-steps,
  .prompt-guide ol,
  .route-choice,
  .learning-recap,
  .home-start-path,
  .dual-qr {
    grid-template-columns: 1fr;
  }

  .learner-stop,
  .first-visit-note {
    display: grid;
  }

  .quick-glossary dl > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .learner-launch {
    box-shadow: 5px 5px 0 var(--ink);
  }
}

@media print {
  .learner-launch,
  .learning-recap,
  .technical-details,
  .download-details,
  .quick-glossary {
    box-shadow: none;
    break-inside: avoid;
  }

  details > * {
    display: block !important;
  }

  details > summary {
    display: none !important;
  }
}
