:root {
  --ink: #171717;
  --paper: #fffef9;
  --muted: #67645e;
  --line: #1d1d1d;
  --soft: #f1efe7;
  --accent: #f36b21;
  --max-reading: 920px;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(23, 23, 23, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 34px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.82;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 4px;
}

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

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 28px;
  border-bottom: 3px solid var(--line);
  background: rgba(255, 254, 249, 0.96);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  text-decoration: none;
}

.brand__mark {
  display: inline-grid;
  min-width: 58px;
  min-height: 42px;
  place-items: center;
  padding: 4px 8px;
  border: 3px solid var(--line);
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--line);
  color: #fff;
  font-size: 0.82rem;
  transform: rotate(-2deg);
}

.header-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

progress {
  width: 150px;
  height: 12px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 0;
  background: #fff;
}

progress::-webkit-progress-bar {
  background: #fff;
}

progress::-webkit-progress-value {
  background: var(--accent);
}

progress::-moz-progress-bar {
  background: var(--accent);
}

.menu-toggle {
  display: none;
}

.reading-progress {
  position: fixed;
  z-index: 60;
  top: 74px;
  right: 0;
  left: 0;
  height: 5px;
  background: transparent;
}

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

.page-nav {
  position: fixed;
  z-index: 20;
  top: 105px;
  bottom: 78px;
  left: 22px;
  width: 270px;
  overflow: auto;
  padding: 18px 18px 22px;
  border: 3px solid var(--line);
  background: #fff;
  box-shadow: 7px 7px 0 color-mix(in srgb, var(--accent) 78%, white);
}

.page-nav h2 {
  margin: 4px 0 14px;
  font-size: 1.1rem;
  line-height: 1.35;
}

.page-nav nav {
  display: grid;
  gap: 2px;
}

.page-nav nav a {
  padding: 7px 8px;
  border-left: 4px solid transparent;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
  text-decoration: none;
}

.page-nav nav a.active {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--ink);
  font-weight: 800;
}

.page-tools {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px dashed var(--line);
}

.saved-status,
.dashboard-saved-status {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.45;
}

button,
.import-label {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: 3px 3px 0 var(--line);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

button:hover,
.import-label:hover {
  background: color-mix(in srgb, var(--accent) 14%, white);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--line);
}

button:active,
.import-label:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.import-label input {
  position: absolute;
  width: 1px;
  max-width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
  white-space: nowrap;
}

.danger-link {
  border-color: #9b2525;
  box-shadow: none;
  color: #9b2525;
}

.reading-canvas {
  width: min(var(--max-reading), calc(100% - 350px));
  margin: 0 auto;
  padding: 62px 0 120px 310px;
}

.page-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 4px solid var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

article > h1 {
  max-width: 860px;
  margin: 0 0 42px;
  font-size: clamp(2.45rem, 5vw, 4.4rem);
  line-height: 1.12;
  text-wrap: balance;
}

article > h1::after {
  display: block;
  width: 42%;
  height: 15px;
  margin-top: -9px;
  background: color-mix(in srgb, var(--accent) 78%, white);
  content: "";
  transform: rotate(-1deg);
}

article h2 {
  margin: 82px 0 26px;
  padding: 12px 0 10px 18px;
  border-left: 11px solid var(--accent);
  font-size: 1.85rem;
  line-height: 1.3;
}

article h3 {
  margin: 46px 0 16px;
  font-size: 1.34rem;
  line-height: 1.4;
}

article h4 {
  margin: 30px 0 10px;
  font-size: 1.08rem;
}

article p,
article li {
  max-width: 42em;
}

article p {
  margin: 0 0 1.35em;
}

article li + li {
  margin-top: 0.55em;
}

article blockquote {
  margin: 36px 0;
  padding: 24px 30px;
  border: 3px solid var(--line);
  border-left: 14px solid var(--accent);
  background: #fff;
  box-shadow: 7px 7px 0 color-mix(in srgb, var(--accent) 64%, white);
  font-size: 1.12rem;
  font-weight: 700;
}

code {
  padding: 0.1em 0.35em;
  border: 1px solid #aaa;
  background: #f7f6f0;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.86em;
}

pre {
  overflow: auto;
  padding: 20px;
  border: 2px solid var(--line);
  background: #f7f6f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.table-wrap {
  overflow: auto;
  margin: 30px 0 42px;
  border: 3px solid var(--line);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.55;
}

th,
td {
  min-width: 140px;
  padding: 13px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: color-mix(in srgb, var(--accent) 20%, white);
}

.workbench,
.fill-area {
  margin: 34px 0 48px;
  padding: 26px;
  border: 4px solid var(--line);
  background: #fff;
  box-shadow: 9px 9px 0 var(--accent);
}

.workbench label,
.fill-area label {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
}

.workbench input[type="text"],
.workbench input[type="number"],
.workbench textarea,
.workbench select,
.fill-area input[type="text"],
.fill-area input[type="number"],
.fill-area textarea,
.fill-area select {
  width: 100%;
  min-height: 50px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: #fffef9;
  color: var(--ink);
}

.workbench textarea,
.fill-area textarea {
  min-height: 160px;
  resize: vertical;
}

.workbench input + label,
.workbench textarea + label,
.workbench select + label,
.fill-area input + label,
.fill-area textarea + label,
.fill-area select + label {
  margin-top: 20px;
}

.prompt-card {
  margin: 42px 0 56px;
  padding: 24px;
  border: 4px solid var(--line);
  background: #fff;
  box-shadow: 10px 10px 0 color-mix(in srgb, var(--accent) 70%, white);
}

.prompt-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 3px dashed var(--line);
  font-weight: 900;
}

.prompt-card h3 {
  margin-top: 28px;
}

.prompt-input-contract {
  margin-top: 24px;
  padding: 18px 20px;
  border: 3px solid var(--line);
  background: color-mix(in srgb, var(--accent) 9%, white);
}

.prompt-input-contract h3:first-child {
  margin-top: 0;
}

.prompt-input-contract ul {
  margin-bottom: 22px;
}

.missing-input-rule {
  margin-bottom: 0;
  padding-left: 14px;
  border-left: 5px solid var(--accent);
  font-weight: 750;
}

.guided-tool-card {
  margin: 42px 0 56px;
  padding: 28px;
  border: 4px solid var(--line);
  background: #fff;
  box-shadow: 10px 10px 0 color-mix(in srgb, var(--accent) 70%, white);
}

.guided-tool-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 3px dashed var(--line);
  font-size: 0.78rem;
  font-weight: 900;
}

.guided-tool-card__number {
  margin: 24px 0 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 900;
}

.guided-tool-card h3 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
}

.guided-tool-card h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.guided-tool-card__mode {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 18px 0;
  padding: 10px 14px;
  border-left: 6px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, white);
}

.guided-tool-card__mode span {
  font-size: 0.7rem;
  font-weight: 900;
}

.guided-tool-card__purpose {
  max-width: 760px;
  font-size: 1.05rem;
  font-weight: 700;
}

.guided-tool-card__coach-note {
  margin: 18px 0 0;
  padding: 16px 18px;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 0.88rem;
  line-height: 1.8;
}

.guided-tool-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 26px;
  border: 3px solid var(--line);
}

.guided-tool-card__grid > section {
  min-width: 0;
  padding: 20px;
}

.guided-tool-card__grid > section + section {
  border-left: 3px solid var(--line);
}

.guided-tool-card__grid ul,
.guided-tool-card__grid ol,
.guided-tool-card__outcomes ul {
  margin-bottom: 0;
}

.guided-tool-card__starter {
  margin-top: 24px;
  padding: 18px 20px;
  border: 3px dashed var(--line);
  background: color-mix(in srgb, var(--accent) 7%, white);
}

.guided-tool-card__starter span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.7rem;
  font-weight: 900;
}

.guided-tool-card__starter p {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.guided-tool-card__outcomes {
  margin-top: 24px;
}

.guided-tool-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.guided-tool-card__actions a,
.tool-hub__head > a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 3px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.guided-tool-card__actions .tool-download,
.tool-hub__head > a {
  background: var(--accent);
  color: #fff;
}

.guided-tool-card__actions a:hover,
.tool-hub__head > a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--line);
}

.guided-tool-card__note {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

details {
  margin-top: 18px;
  padding: 14px 18px;
  border: 2px solid var(--line);
  background: #fff;
}

summary {
  cursor: pointer;
  font-weight: 900;
}

.generated-figure {
  position: relative;
  margin: 0;
  border: 4px solid var(--line);
  background: #fff;
  box-shadow: 10px 10px 0 color-mix(in srgb, var(--accent) 74%, white);
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px 28px;
  margin: 48px 0 60px;
}

.figure-grid .generated-figure:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  width: min(100%, calc(50% - 14px));
  justify-self: center;
}

.generated-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #fff;
}

.generated-figure figcaption {
  display: grid;
  gap: 3px;
  padding: 13px 16px;
  border-top: 3px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.5;
}

.generated-figure figcaption span {
  color: var(--muted);
}

.image-placeholder {
  display: none;
  min-height: 330px;
  place-content: center;
  gap: 8px;
  padding: 30px;
  background:
    repeating-linear-gradient(-10deg, transparent 0 26px, color-mix(in srgb, var(--accent) 8%, white) 26px 28px),
    #fff;
  text-align: center;
}

.image-placeholder span {
  justify-self: center;
  padding: 3px 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
}

.image-placeholder strong {
  font-size: 1.5rem;
}

.image-placeholder small {
  color: var(--muted);
}

.generated-figure.image-missing img {
  display: none;
}

.generated-figure.image-missing .image-placeholder {
  display: grid;
}

.source-note {
  padding: 10px 0;
  border-top: 1px solid #aaa;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.external-mark {
  margin-left: 0.18em;
  font-size: 0.75em;
  text-decoration: none;
}

.completion-panel {
  margin: 100px 0 42px;
  padding: 30px;
  border: 4px solid var(--line);
  background: color-mix(in srgb, var(--accent) 14%, white);
  box-shadow: 10px 10px 0 var(--line);
}

.completion-panel h2 {
  margin: 4px 0 10px;
  font-size: 1.6rem;
}

.completion-check {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.completion-check input {
  width: 25px;
  height: 25px;
  accent-color: var(--accent);
}

.page-turn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 54px;
}

.page-turn a {
  display: grid;
  min-height: 116px;
  align-content: center;
  padding: 18px 22px;
  border: 3px solid var(--line);
  background: #fff;
  box-shadow: 6px 6px 0 var(--accent);
  text-decoration: none;
}

.page-turn a:last-child {
  text-align: right;
}

.page-turn span {
  color: var(--muted);
  font-size: 0.72rem;
}

.site-footer {
  position: relative;
  z-index: 30;
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 28px;
  border-top: 3px solid var(--line);
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 13px 17px;
  border: 3px solid var(--line);
  background: var(--accent);
  box-shadow: 5px 5px 0 var(--line);
  color: #fff;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.course-dashboard {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 90px;
}

.dashboard-intro {
  max-width: 920px;
  padding-bottom: 42px;
}

.dashboard-intro h1 {
  max-width: 820px;
  margin: 8px 0 20px;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  line-height: 1.05;
  text-wrap: balance;
}

.dashboard-intro > p:not(.eyebrow) {
  max-width: 760px;
  font-size: 1.08rem;
}

.dashboard-video {
  margin: 0 0 46px;
  padding: 32px 0 42px;
  border-top: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
}

.dashboard-video__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  align-items: end;
  gap: 32px;
  margin-bottom: 22px;
}

.dashboard-video__head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.08;
}

.dashboard-video__head > p {
  margin: 0;
  font-size: 1rem;
}

.dashboard-video__frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--line);
  background: #101010;
  box-shadow: 8px 8px 0 var(--line);
  overflow: hidden;
}

.dashboard-video__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.dashboard-video__link {
  margin: 16px 0 0;
  font-weight: 900;
}

.dashboard-video__link a {
  text-underline-offset: 4px;
}

.dashboard-share {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 44px;
  margin: 0 0 46px;
  padding: 34px;
  border: 3px solid var(--line);
  background: #fff;
  box-shadow: 8px 8px 0 var(--accent);
}

.dashboard-share h2 {
  margin: 5px 0 12px;
  font-size: clamp(1.65rem, 3.2vw, 2.6rem);
  line-height: 1.12;
}

.dashboard-share p {
  max-width: 760px;
}

.dashboard-share a,
.instructor-profile a {
  overflow-wrap: anywhere;
  color: var(--line);
  font-weight: 900;
  text-underline-offset: 4px;
}

.qr-trigger {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 3px solid var(--line);
  background: #fffdf8;
  box-shadow: 5px 5px 0 var(--line);
  color: var(--line);
  cursor: zoom-in;
  font: inherit;
  font-weight: 900;
}

.qr-trigger:hover,
.qr-trigger:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--line);
}

.qr-trigger img {
  display: block;
  width: 100%;
  height: auto;
}

.qr-dialog {
  width: min(92vw, 650px);
  max-height: 92vh;
  padding: 0;
  border: 3px solid var(--line);
  background: #fffdf8;
  color: var(--line);
  box-shadow: 12px 12px 0 var(--accent);
}

.qr-dialog::backdrop {
  background: rgb(17 17 17 / 72%);
}

.qr-dialog__panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px;
  text-align: center;
}

.qr-dialog__panel h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
}

.qr-dialog__panel img {
  display: block;
  width: min(70vw, 420px, 52vh);
  height: auto;
  border: 2px solid var(--line);
}

.qr-dialog__panel a {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--line);
  font-weight: 800;
}

.qr-dialog__panel button {
  padding: 11px 24px;
  border: 2px solid var(--line);
  background: var(--line);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.instructor-profile {
  margin: 30px 0 10px;
  padding: 30px;
  border-top: 4px solid var(--accent);
  border-bottom: 4px solid var(--line);
  background: #fff;
}

.instructor-profile h3 {
  margin: 6px 0 14px;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.15;
}

.instructor-profile p {
  max-width: 850px;
}

article a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.route-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.route-switch button.active {
  background: var(--accent);
  color: #fff;
}

.dashboard-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 10px 0 26px;
  padding: 20px 0;
  border-top: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
}

.dashboard-controls label {
  display: grid;
  flex: 1;
  min-width: 0;
  max-width: 560px;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 900;
}

.dashboard-controls input {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 2px solid var(--line);
}

.dashboard-controls .import-label input[type="file"] {
  position: absolute;
  width: 1px;
  max-width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
}

.dashboard-controls > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-saved-status {
  flex: 0 0 100%;
  text-align: right;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 3px solid var(--line);
  border-left: 3px solid var(--line);
}

.unit-card {
  display: grid;
  min-height: 190px;
  grid-template-columns: 58px 1fr;
  gap: 18px;
  align-content: start;
  padding: 22px;
  border-right: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  background: #fff;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease;
}

.unit-card:hover {
  background: color-mix(in srgb, var(--accent) 12%, white);
  transform: translate(-3px, -3px);
}

.unit-card[hidden] {
  display: none;
}

.unit-card__number {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 3px solid var(--line);
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--line);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  transform: rotate(-2deg);
}

.unit-card h2 {
  margin: 0 0 7px;
  font-size: 1.26rem;
  line-height: 1.35;
}

.unit-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.unit-card__status {
  grid-column: 2;
  justify-self: start;
  padding: 3px 9px;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 0.66rem;
  font-weight: 900;
}

.unit-card__status.done {
  background: var(--accent);
  color: #fff;
}

.tool-hub {
  margin-top: 64px;
  padding: 30px 0 6px;
  border-top: 5px solid var(--line);
}

.tool-hub__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.tool-hub__head h2 {
  margin: 4px 0 0;
  font-size: 2rem;
}

.tool-hub > p {
  max-width: 780px;
}

.tool-hub__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
  border-top: 3px solid var(--line);
  border-left: 3px solid var(--line);
}

.tool-hub-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 18px;
  border-right: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.tool-hub-card:hover {
  background: color-mix(in srgb, var(--accent) 8%, white);
}

.tool-hub-card > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 3px solid var(--line);
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.tool-hub-card h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.tool-hub-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.dashboard-note {
  margin: 54px 0 0;
  padding: 26px 0;
  border-top: 4px solid var(--accent);
}

.dashboard-note h2 {
  margin: 0 0 8px;
}

@media (max-width: 1100px) {
  .page-nav {
    left: 14px;
    width: 235px;
  }

  .reading-canvas {
    width: calc(100% - 285px);
    margin-left: 265px;
    padding-right: 30px;
    padding-left: 0;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 18px;
  }

  .site-header {
    min-height: 68px;
    padding: 9px 14px;
  }

  .header-progress progress {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    min-width: 70px;
  }

  .reading-progress {
    top: 68px;
  }

  .page-nav {
    top: 68px;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(88vw, 360px);
    padding: 22px;
    border-width: 0 0 0 3px;
    box-shadow: -8px 0 0 var(--accent);
    transform: translateX(110%);
    transition: transform 180ms ease;
  }

  .page-nav.open {
    transform: translateX(0);
  }

  .reading-canvas {
    width: min(100% - 32px, 760px);
    margin: 0 auto;
    padding: 40px 0 90px;
  }

  article > h1 {
    font-size: 2.55rem;
  }

  article h2 {
    margin-top: 64px;
    font-size: 1.56rem;
  }

  .site-footer {
    display: grid;
    padding: 16px;
  }

  .figure-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .figure-grid .generated-figure:last-child:nth-child(odd) {
    grid-column: auto;
    width: 100%;
  }

  .unit-grid {
    grid-template-columns: 1fr;
  }

  .guided-tool-card__grid,
  .tool-hub__grid {
    grid-template-columns: 1fr;
  }

  .guided-tool-card__grid > section + section {
    border-top: 3px solid var(--line);
    border-left: 0;
  }

  .tool-hub__head {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-controls > div {
    flex-wrap: wrap;
  }

  .dashboard-saved-status {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .brand > span:last-child {
    display: none;
  }

  .header-progress {
    margin-left: auto;
  }

  .page-kicker {
    align-items: start;
    flex-direction: column;
  }

  article > h1 {
    font-size: 2.15rem;
  }

  .workbench,
  .prompt-card,
  .guided-tool-card,
  .completion-panel {
    padding: 18px;
  }

  .prompt-card__head {
    align-items: stretch;
    flex-direction: column;
  }

  .guided-tool-card__head,
  .guided-tool-card__actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .page-turn a:last-child {
    text-align: left;
  }

  .dashboard-intro h1 {
    font-size: 2.65rem;
  }

  .dashboard-video__head {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dashboard-video__frame {
    box-shadow: 5px 5px 0 var(--line);
  }

  .dashboard-share {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 22px;
    box-shadow: 5px 5px 0 var(--accent);
  }

  .qr-trigger {
    width: min(100%, 240px);
  }

  .qr-dialog__panel {
    padding: 20px;
  }

  .instructor-profile {
    padding: 22px;
  }

  .unit-card {
    grid-template-columns: 48px 1fr;
    padding: 17px;
  }

  .unit-card__number {
    width: 45px;
    height: 45px;
  }
}

@media print {
  @page {
    margin: 18mm 16mm 20mm;
  }

  body {
    background: #fff;
    font-size: 12pt;
  }

  .page-nav,
  .reading-progress,
  .page-turn,
  .toast,
  .qr-dialog,
  button,
  .import-label {
    display: none !important;
  }

  .site-header {
    position: static;
    display: flex !important;
    min-height: 0;
    margin: 0 0 14pt;
    padding: 0 0 7pt;
    border-bottom: 1.5pt solid #000;
    background: #fff;
    backdrop-filter: none;
  }

  .site-header .header-progress,
  .site-header .menu-toggle {
    display: none !important;
  }

  .site-header .brand {
    gap: 7pt;
    color: #000;
    font-size: 10pt;
    text-decoration: none;
  }

  .site-header .brand__mark {
    min-width: 34pt;
    min-height: 20pt;
    padding: 1pt 4pt;
    border: 1.5pt solid #000;
    background: #fff;
    box-shadow: none;
    color: #000;
    font-size: 7pt;
    transform: none;
  }

  .site-footer {
    position: static;
    display: flex !important;
    min-height: 0;
    margin-top: 20pt;
    padding: 7pt 0 0;
    border-top: 1.5pt solid #000;
    background: #fff;
    color: #000;
    font-size: 8pt;
  }

  .reading-canvas {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  article h2 {
    break-after: avoid;
  }

  .generated-figure,
  .workbench,
  .fill-area,
  .prompt-card,
  table {
    break-inside: avoid;
  }

  .figure-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14pt;
  }
}

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