/* 從 Chat 到 Harness｜講義樣式，上下半場共用（原型 v2）
   色彩沿用投影片主題 kmu-course：深青為主、橙褐為預測點與警語 */
/* 設計 token 已移至 tokens.css（須在本檔之前載入）；以下僅保留版面專屬變數 */
:root { --top: 60px; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 20px); -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.75; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
code, kbd { font-family: var(--mono); font-size: .86em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); padding: .05em .4em; border-radius: 6px; }
kbd { display: inline-block; min-width: 1.7em; padding: 0 .4em; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); text-align: center; font-size: .75em; color: var(--ink-3); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }

/* ---------- top bar ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; flex-direction: column; line-height: 1.2; text-decoration: none; color: var(--ink); min-width: 0; }
.brand b { font-size: 15px; }
.brand span { font-size: 11.5px; color: var(--ink-3); }
.now { flex: 1; text-align: center; font-size: 14px; font-weight: 500; color: var(--ink-2); opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now.show { opacity: 1; transform: none; }
.part-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); flex: none; }
.part-switch a { padding: 2px 10px; border-radius: 7px; font-size: 13.5px; color: var(--ink-3); text-decoration: none; line-height: 26px; white-space: nowrap; }
.part-switch a[aria-current="page"] { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.part-switch a:not([aria-current]):hover { color: var(--accent); }
.top-actions { display: flex; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; max-width: 1180px; margin: 0 auto; padding: calc(var(--top) + 24px) 28px 80px; }
.sidebar { position: sticky; top: calc(var(--top) + 24px); align-self: start; max-height: calc(100vh - var(--top) - 48px); overflow: auto; }
.main { max-width: 760px; min-width: 0; }
.menu-btn { display: none; }

/* ---------- toc ---------- */
.toc { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); position: relative; font-size: 14.5px; }
.toc li a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; line-height: 1.45; }
.toc li a:hover { background: var(--surface-2); color: var(--ink); }
.toc li a.active { color: var(--accent); font-weight: 700; background: var(--accent-tint); }
.toc li a.done::after { content: "✓"; margin-left: 6px; color: var(--accent); font-size: 12px; }
.toc-group { margin: 16px 0 4px 10px; font-size: 12px; color: var(--ink-3); letter-spacing: .08em; }
.toc-indicator { position: absolute; left: -4px; top: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: 0; transition: transform .3s cubic-bezier(.16,1,.3,1), opacity .2s; }

/* ---------- hero ---------- */
.hero { padding: 32px 0 28px; }
.eyebrow { font-size: 14px; color: var(--accent); font-weight: 500; display: flex; align-items: center; gap: 10px; }
.eyebrow .sep { width: 18px; height: 1px; background: var(--line-2); }
.hero h1 { font-size: clamp(34px, 5.4vw, 54px); line-height: 1.18; font-weight: 900; margin: 14px 0 18px; letter-spacing: -.01em; }
.hero h1 .hl { color: var(--accent); }
.lede { font-size: 18.5px; color: var(--ink-2); margin: 0 0 22px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.btn { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15.5px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); color: var(--on-accent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }

/* route */
.route { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 8px 0 24px; }
.route a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s; }
.route a:hover { border-color: var(--accent); transform: translateY(-2px); }
.route .n { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.route b { display: block; font-size: 15.5px; line-height: 1.3; margin-top: 2px; }
.route small { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.4; margin-top: 3px; }

/* ---------- sections ---------- */
.section { padding: 56px 0 8px; border-top: 1px solid var(--line); margin-top: 32px; }
.sec-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-items: end; margin-bottom: 22px; }
.sec-num { grid-row: span 2; font-family: var(--mono); font-size: 52px; line-height: .9; font-weight: 500; color: var(--accent); opacity: .85; }
.sec-meta { display: flex; gap: 8px; min-height: 4px; }
.sec-head h2 { margin: 0; font-size: clamp(25px, 3.4vw, 34px); line-height: 1.25; font-weight: 900; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface); }
.chip.accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
h3 { font-size: 20px; margin: 36px 0 12px; line-height: 1.4; }
p { margin: 0 0 14px; }
.goal { font-size: 18px; color: var(--ink-2); padding-left: 14px; border-left: 3px solid var(--accent); margin-bottom: 24px; }
.key { font-weight: 700; font-size: 18px; padding: 14px 18px; background: var(--accent-tint); border-radius: var(--radius-sm); color: var(--accent-2); }
ul.plain { padding-left: 1.2em; margin: 0 0 14px; }

/* cards */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.card { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card.accent { border-color: var(--accent); background: var(--accent-tint); }
.card .k { font-size: 13px; color: var(--ink-3); }
.card b { display: block; font-size: 17px; margin: 2px 0 6px; }
.card p { margin: 0; font-size: 15px; color: var(--ink-2); line-height: 1.6; }

/* ladder */
.ladder { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.ladder > div { position: relative; padding: 14px 14px 40px; border: 1px solid var(--line); margin-left: -1px; background: var(--surface); }
.ladder > div:first-child { border-radius: 14px 0 0 14px; margin-left: 0; }
.ladder > div:last-child { border-radius: 0 14px 14px 0; }
.ladder > div.here { background: var(--accent-tint); }
.ladder .k { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 500; }
.ladder b { display: block; font-size: 14.5px; line-height: 1.4; margin: 2px 0 4px; }
.ladder p { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.ladder .tag { position: absolute; left: 14px; bottom: 12px; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.ladder .tag.dim { background: var(--surface-2); color: var(--ink-3); }

/* agent loop */
.loop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 16px; }
.loop span { display: inline-flex; flex-direction: column; align-items: center; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-tint); font-weight: 700; color: var(--accent-2); line-height: 1.2; }
.loop small { font-weight: 400; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.loop i { font-style: normal; color: var(--ink-3); }

/* steps */
.steps { list-style: none; padding: 0; margin: 0 0 22px; counter-reset: s; }
.steps > li { position: relative; padding: 0 0 18px 50px; counter-increment: s; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-family: var(--mono); font-size: 14px; font-weight: 500; background: var(--surface); }
.steps > li::after { content: ""; position: absolute; left: 16.5px; top: 40px; bottom: 4px; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps > li > b { display: inline-block; font-size: 17px; padding-top: 3px; margin-bottom: 2px; }
.steps > li p { color: var(--ink-2); margin: 0; }
.steps .min { margin-left: 10px; font-family: var(--mono); font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); vertical-align: 2px; }

/* callouts */
.callout { display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--radius-sm); margin: 0 0 20px; background: var(--surface-2); }
.callout::before { flex: none; font-weight: 900; font-size: 15px; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; display: grid; place-items: center; color: var(--on-accent); }
.callout > div > :last-child { margin-bottom: 0; }
.callout ul { margin: 6px 0 0; padding-left: 1.2em; }
.callout.tip { background: var(--accent-tint); } .callout.tip::before { content: "✓"; background: var(--accent); font-size: 12px; }
.callout.info { background: var(--info-soft); } .callout.info::before { content: "i"; background: var(--info); }
.callout.stop { background: var(--stop-soft); } .callout.stop::before { content: "!"; background: var(--stop); }
.callout.predict { background: var(--warn-soft); } .callout.predict::before { content: "?"; background: var(--warn); }
.callout.codex { background: var(--info-soft); } .callout.codex::before { content: "C"; background: var(--info); font-size: 12px; }

/* checklist */
.checklist { list-style: none; padding: 6px; margin: 0 0 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.checklist-title { display: flex; justify-content: space-between; padding: 8px 12px 4px; font-weight: 700; font-size: 15px; }
.checklist .count { font-family: var(--mono); font-size: 12px; color: var(--ink-3); font-weight: 400; }
.checklist[data-complete="true"] .count { color: var(--accent); }
.checklist label { position: relative; display: flex; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; line-height: 1.6; }
.checklist label:hover { background: var(--surface-2); }
.checklist input { position: absolute; opacity: 0; pointer-events: none; }
.checklist .box { flex: none; width: 20px; height: 20px; margin-top: 3px; border: 1.5px solid var(--line-2); border-radius: 6px; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.checklist .box::after { content: ""; width: 10px; height: 5px; border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.checklist input:checked + .box { background: var(--accent); border-color: var(--accent); }
.checklist input:checked + .box::after { opacity: 1; }
.checklist input:checked ~ span { color: var(--ink-3); }
.checklist input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.checklist small { display: block; color: var(--ink-3); font-size: 13.5px; }

/* prompt card */
.prompt { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 0 0 18px; box-shadow: var(--shadow); overflow: hidden; }
.prompt-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 12px 14px 10px 16px; border-bottom: 1px solid var(--line); }
.prompt-id { font-family: var(--mono); font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-2); }
.prompt-title { flex: 1; min-width: 0; font-weight: 700; font-size: 15.5px; line-height: 1.35; }
.tool { width: 100%; order: 3; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.tool::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tool[data-tool="project"]::before { background: var(--warn); }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.prompt-body { position: relative; }
.prompt-clip { max-height: 168px; overflow: hidden; transition: max-height .45s cubic-bezier(.16,1,.3,1); }
.prompt.expanded .prompt-clip, .prompt.short .prompt-clip { max-height: var(--full, 3000px); }
.prompt-text { margin: 0; padding: 14px 16px; font-family: var(--font); font-size: 15px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
.prompt-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; transition: opacity .3s; }
.prompt.expanded .prompt-fade, .prompt.short .prompt-fade { opacity: 0; }
.prompt-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.prompt.short .expand-btn { display: none; }
.ph-note { color: var(--warn); }
.expand-btn { border: 0; background: transparent; font-size: 13.5px; font-weight: 500; color: var(--ink-2); padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.expand-btn:hover { background: var(--surface-2); }
mark.ph { background: var(--warn-soft); color: var(--warn); padding: 0 2px; border-radius: 4px; font-weight: 500; }

/* details */
details.more { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin: 0 0 12px; }
details.more > summary { cursor: pointer; padding: 12px 16px; font-weight: 700; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--accent); transition: transform .2s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > :not(summary) { margin-left: 16px; margin-right: 16px; }
details.more > :last-child { margin-bottom: 16px; }

.acc details { border-bottom: 1px solid var(--line); }
.acc details:first-child { border-top: 1px solid var(--line); }
.acc summary { cursor: pointer; padding: 14px 32px 14px 4px; font-weight: 700; list-style: none; position: relative; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font-size: 20px; font-weight: 400; color: var(--ink-3); }
.acc details[open] summary::after { content: "−"; }
.acc summary small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-3); font-family: var(--mono); }
.acc-body { padding: 0 4px 14px; color: var(--ink-2); }
.acc-body ul { padding-left: 1.2em; margin: 0; }

/* table */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.6; }
tr:last-child td { border-bottom: 0; }
th { background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
td small { display: block; color: var(--ink-3); font-size: 12.5px; }
.st { display: inline-block; font-size: 12.5px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.st.ok { background: var(--accent-soft); color: var(--accent-2); }
.st.wait { background: var(--warn-soft); color: var(--warn); }
.st.you { background: var(--info-soft); color: var(--info); }

/* schedule */
.schedule { list-style: none; padding: 0; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.schedule li { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.schedule li:last-child { border-bottom: 0; }
.schedule .n { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.schedule a { color: var(--ink); text-decoration: none; font-weight: 700; }
.schedule a:hover { color: var(--accent); }
.schedule .d { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }
.schedule li.hands { background: var(--accent-tint); }
.schedule li.hands .d { color: var(--accent); font-weight: 500; }
.schedule li.soft b { font-weight: 400; color: var(--ink-3); }

/* homework */
.homework { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; }
.qr { margin: 0; text-align: center; font-size: 13px; color: var(--ink-3); }
.qr img { width: 150px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 6px; margin-bottom: 6px; }

/* glossary */
.glossary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.term { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.term b { display: block; font-size: 15px; }
.term span { display: block; font-size: 14px; color: var(--ink-2); line-height: 1.6; }

.foot { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); }
.proto { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 18px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14.5px; transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* search */
.search { position: fixed; inset: 0; z-index: 70; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(20, 28, 33, .35); backdrop-filter: blur(4px); }
.search.open { display: flex; }
.search-panel { width: 100%; max-width: 600px; background: var(--surface); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.2); overflow: hidden; }
.search-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.search-input input { flex: 1; height: 56px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--ink); }
.search-results { list-style: none; margin: 0; padding: 6px; max-height: 56vh; overflow: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; line-height: 1.5; }
.search-results a.sel, .search-results a:hover { background: var(--accent-tint); }
.search-results .k { font-size: 12px; color: var(--accent); margin-right: 8px; }
.search-results small { display: block; color: var(--ink-3); font-size: 13px; }
.search-empty { padding: 14px 12px; color: var(--ink-3); font-size: 14.5px; }
.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); } }

/* sheet (mobile toc) */
.sheet { position: fixed; inset: 0; z-index: 65; display: none; }
.sheet.open { display: block; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 28, 33, .35); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 80vh; overflow: auto; background: var(--surface); border-radius: 18px 18px 0 0; padding: 8px 18px 28px; animation: up .3s cubic-bezier(.16,1,.3,1); }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 4px auto 14px; }
@keyframes up { from { transform: translateY(100%); } }

/* reveal（尊重減少動態設定） */
@media (prefers-reduced-motion: no-preference) {
  .js .section > *:not(.sec-head) { transition: opacity .5s ease-out, transform .6s cubic-bezier(.16,1,.3,1); }
  .js .section:not(.in) > *:not(.sec-head) { opacity: 0; transform: translateY(10px); }
}

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-left: 24px; padding-right: 24px; }
  .sidebar { display: none; }
  .menu-btn { display: inline-flex; }
  .main { margin: 0 auto; }
}
@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .now { display: none; }
  .brand { flex: 1; }
  .brand span { display: none; }
  .part-switch a { padding: 2px 8px; font-size: 13px; }
  .icon-btn .lbl, .icon-btn kbd { display: none; }
  .icon-btn { width: 38px; padding: 0; justify-content: center; }
  .layout { padding: calc(var(--top) + 8px) 16px 64px; }
  .route { grid-template-columns: 1fr 1fr; }
  .route a:last-child { grid-column: span 2; }
  .pair, .glossary { grid-template-columns: 1fr; }
  .ladder { grid-template-columns: 1fr; }
  .ladder > div { margin-left: 0; margin-top: -1px; padding-bottom: 14px; padding-right: 90px; }
  .ladder > div:first-child { border-radius: 14px 14px 0 0; }
  .ladder > div:last-child { border-radius: 0 0 14px 14px; }
  .ladder .tag { left: auto; right: 12px; top: 14px; bottom: auto; }
  .sec-num { font-size: 40px; }
  .homework { grid-template-columns: 1fr; }
  .qr { justify-self: start; }
  .schedule li { grid-template-columns: 34px 1fr; }
  .schedule .d { grid-column: 2; }
}

@media print {
  .topbar, .sidebar, .toast, .search, .sheet, .copy-btn, .expand-btn, .prompt-fade { display: none !important; }
  .layout { display: block; padding: 0; }
  .prompt-clip { max-height: none !important; }
  .section > * { opacity: 1 !important; transform: none !important; }
  details { display: block; } details > * { display: block !important; }
}
