/* Codex 기초 — 혼자 공부용 강의 안내판
   색은 트리니티 매쓰랩 회사 사이트(trinityedulab.com)의 종이·잉크·초록을 따른다.
   한국어는 낱말 단위로만 줄을 바꾼다(word-break: keep-all). */

@font-face {
  font-family: "Pretendard Variable";
  src: url("/assets/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4f0e7;
  --paper-deep: #e9e2d5;
  --card: #fbf9f3;
  --ink: #111313;
  --ink-soft: #464a48;
  --ink-mute: #63635c;
  --line: rgba(17, 19, 19, 0.16);
  --line-strong: rgba(17, 19, 19, 0.42);
  --accent: #245e31;
  --accent-deep: #1b4a26;
  --accent-ink: #ffffff;
  --accent-tint: #e5eedf;
  --green: #2f7a3b;
  --green-tint: #e6f0e1;
  --yellow: #8a5a00;
  --yellow-dot: #d99a12;
  --yellow-tint: #fbf0d6;
  --red: #a52f2f;
  --red-tint: #f8e6e1;
  --focus: #1f6feb;
  --code-bg: #efeadf;
  --shadow: 0 1px 2px rgba(17, 19, 19, 0.06);
  --header-h: 60px;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "D2Coding", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #121413;
    --paper-deep: #1b1e1d;
    --card: #191c1b;
    --ink: #ece8de;
    --ink-soft: #c4c0b6;
    --ink-mute: #a29f96;
    --line: rgba(236, 232, 222, 0.16);
    --line-strong: rgba(236, 232, 222, 0.42);
    --accent: #8cc79a;
    --accent-deep: #a9d8b3;
    --accent-ink: #0f1a12;
    --accent-tint: #1e2c21;
    --green: #8cc79a;
    --green-tint: #1c2b1f;
    --yellow: #e8c06a;
    --yellow-dot: #e0a82e;
    --yellow-tint: #2e2715;
    --red: #f0a49a;
    --red-tint: #33201d;
    --focus: #79b0ff;
    --code-bg: #202423;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121413;
  --paper-deep: #1b1e1d;
  --card: #191c1b;
  --ink: #ece8de;
  --ink-soft: #c4c0b6;
  --ink-mute: #a29f96;
  --line: rgba(236, 232, 222, 0.16);
  --line-strong: rgba(236, 232, 222, 0.42);
  --accent: #8cc79a;
  --accent-deep: #a9d8b3;
  --accent-ink: #0f1a12;
  --accent-tint: #1e2c21;
  --green: #8cc79a;
  --green-tint: #1c2b1f;
  --yellow: #e8c06a;
  --yellow-dot: #e0a82e;
  --yellow-tint: #2e2715;
  --red: #f0a49a;
  --red-tint: #33201d;
  --focus: #79b0ff;
  --code-bg: #202423;
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.75 var(--sans);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0.5em 0; }
ul, ol { padding-left: 1.3em; }
li { margin: 0.25em 0; }
strong { font-weight: 700; }
small { font-size: 0.86em; }

code, kbd, .mono {
  font-family: var(--mono);
  font-size: 0.9em;
}
code {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 0.08em 0.4em;
  white-space: nowrap; /* codex-class 같은 짧은 이름이 붙임표에서 끊기지 않게 */
}
/* 긴 경로는 빗금(/) 뒤에서만 줄을 바꾼다(HTML에 <wbr>을 넣어 둔다) */
code.path { white-space: normal; }
kbd {
  display: inline-block;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0 0.4em;
  background: var(--card);
  line-height: 1.5;
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip:focus { top: 8px; }

/* ---------- 머리 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 1240px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.brand b { font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
.brand span { color: var(--ink-mute); font-size: 0.82rem; white-space: nowrap; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font: 600 0.92rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--accent-ink); }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: 0.85rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn .ok { color: var(--green); }

.progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.progress-pill .bar {
  width: 64px;
  height: 6px;
  border-radius: 6px;
  background: var(--paper-deep);
  overflow: hidden;
}
.progress-pill .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}

/* ---------- 공통 상자 ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

.kicker {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.lead { color: var(--ink-soft); font-size: 1.08rem; }
.muted { color: var(--ink-mute); }

.callout {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  background: var(--card);
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout .label { display: block; font-weight: 800; margin-bottom: 2px; }
.callout.note { border-left-color: var(--accent); background: var(--accent-tint); }
.callout.warn { border-left-color: var(--yellow-dot); background: var(--yellow-tint); }
.callout.danger { border-left-color: var(--red); background: var(--red-tint); }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink-soft);
  white-space: nowrap;
  vertical-align: 0.12em;
}
.tag.time::before { content: "⏱ "; }
.tag.member { border-color: var(--accent); color: var(--accent); }

.src { font-size: 0.86rem; color: var(--ink-mute); }
.src a { color: inherit; }

/* 표 */
.table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
/* 표 칸 안에서는 낱말을 자르지 않는다. 좁으면 표 상자가 가로로 밀린다. */
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); overflow-wrap: normal; }
@media (max-width: 520px) {
  table { font-size: 0.9rem; }
  th, td { padding: 8px 8px; }
  /* 칸이 많은 표는 작은 화면에서 줄마다 쌓는다. 칸 이름은 data-label에서 가져온다. */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 10px 4px; border-bottom: 1px solid var(--line); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 2px 10px; }
  table.stack td:first-child { font-size: 1rem; font-weight: 800; }
  table.stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-mute);
  }
}
th { font-weight: 700; background: var(--paper-deep); }
tr:last-child td { border-bottom: 0; }
td.nowrap, th.nowrap { white-space: nowrap; }

/* ---------- 첫 화면 ---------- */
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); margin: 8px 0 12px; font-weight: 800; }
.hero .lead { max-width: 640px; }

.courses { list-style: none; padding: 0; margin: 20px 0 8px; display: grid; gap: 12px; }
.course {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  grid-template-areas:
    "num title act"
    "num desc act";
  gap: 4px 16px;
  align-items: center;
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.course .num { grid-area: num; font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--accent); }
.course.soon .num { color: var(--ink-mute); }
.course h3 { grid-area: title; margin: 0; font-size: 1.2rem; }
.course p { grid-area: desc; margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.course .act { grid-area: act; }
.course.soon { background: transparent; }
@media (max-width: 600px) {
  .course {
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas:
      "num title"
      "num desc"
      "num act";
    align-items: start;
  }
  .course .num { font-size: 2rem; }
  .course .act { justify-self: start; margin-top: 6px; }
}

.howto { list-style: none; padding: 0; display: grid; gap: 10px; counter-reset: how; }
.howto li { counter-increment: how; position: relative; padding: 2px 0 2px 40px; }
.howto li::before {
  content: counter(how);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.9rem;
}

.community {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.community h3 { margin: 0 0 4px; }
.community figure { margin: 0; text-align: center; }
.community img { display: block; width: 148px; height: 148px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.community figcaption { font-size: 0.8rem; color: var(--ink-mute); margin-top: 6px; }
@media (max-width: 600px) {
  .community { grid-template-columns: 1fr; }
  .community figure { justify-self: start; }
}

.section-block { padding: 28px 0; border-top: 1px solid var(--line); }
.section-block h2 { font-size: 1.45rem; margin: 0 0 10px; }

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--ink-mute);
  font-size: 0.86rem;
}
.site-footer p { margin: 0.2em 0; }

/* ---------- 회차 페이지 ---------- */
.lesson-layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .lesson-layout { grid-template-columns: 270px minmax(0, 1fr); gap: 40px; }
}

.toc {
  display: none;
}
@media (min-width: 1100px) {
  .toc {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 16px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 32px);
    overflow-y: auto;
    padding: 8px 4px 24px 0;
  }
  .toc-toggle { display: none !important; }
}
.toc.open {
  display: block;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 15;
  background: var(--paper);
  overflow-y: auto;
  padding: 16px 16px 40px;
}
.toc h2 { font-size: 0.85rem; color: var(--ink-mute); margin: 8px 0; letter-spacing: 0.04em; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.93rem;
  line-height: 1.45;
}
.toc a:hover { background: var(--paper-deep); color: var(--ink); }
.toc a.current { background: var(--accent-tint); color: var(--ink); font-weight: 700; }
.toc a .count { color: var(--ink-mute); font-size: 0.8rem; white-space: nowrap; font-weight: 500; }
.toc a .count.full { color: var(--green); font-weight: 700; }
.toc .toc-sub a { padding-left: 22px; font-size: 0.86rem; }
.toc .toc-foot { margin-top: 16px; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--ink-mute); }
.toc .toc-foot button { margin-top: 8px; }

.lesson { min-width: 0; max-width: 780px; padding-bottom: 40px; }
.lesson-hero { padding: 36px 0 8px; }
.lesson-hero h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); margin: 6px 0 10px; font-weight: 800; }
.meta { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.92rem; color: var(--ink-soft); }
.meta li { margin: 0; }
.meta b { color: var(--ink); }

.outcome {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
}
.outcome h2 { font-size: 1.05rem; margin: 0 0 6px; }
.outcome ol { margin: 0; }

.part { padding-top: 36px; margin-top: 36px; border-top: 2px solid var(--ink); }
.part-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: baseline; }
.part-head .no { font-size: 2.4rem; font-weight: 800; line-height: 1; color: var(--accent); }
.part-head h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 1.9rem); }
.part-head .tag { grid-column: 2; justify-self: start; }
.part-intro { color: var(--ink-soft); }

.step { margin-top: 30px; }
.step > h3 { font-size: 1.22rem; margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.step > h3 .sn { color: var(--accent); font-weight: 800; }
.step h4 { font-size: 1.02rem; margin: 18px 0 6px; }

ol.do { padding-left: 0; list-style: none; counter-reset: do; }
ol.do > li { counter-increment: do; position: relative; padding-left: 36px; margin: 10px 0; }
ol.do > li::before {
  content: counter(do);
  position: absolute;
  left: 0;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
}

/* 프롬프트 상자 */
.prompt {
  margin: 16px 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
}
.prompt-head .title { font-weight: 700; font-size: 0.95rem; min-width: 0; }
.prompt-head .title small { display: block; font-weight: 500; color: var(--ink-mute); }
.prompt pre {
  margin: 0;
  padding: 14px 16px;
  font: 400 0.95rem/1.7 var(--sans);
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.prompt details.mine { border-top: 1px dashed var(--line-strong); }
.prompt details.mine > summary {
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent);
}
.prompt details.mine > summary .saved { font-weight: 500; color: var(--ink-mute); margin-left: 6px; }
.mine-body { padding: 0 16px 14px; }
.mine-body textarea {
  width: 100%;
  min-height: 140px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 400 0.95rem/1.65 var(--sans);
  resize: vertical;
}
.mine-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.mine-tools .status { font-size: 0.82rem; color: var(--ink-mute); }

/* 확인 칸 */
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px dashed var(--accent);
  background: transparent;
  cursor: pointer;
}
.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 3px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.check .ck-label { display: block; font-weight: 800; color: var(--accent); font-size: 0.85rem; }
.check:has(input:checked) { border-style: solid; background: var(--green-tint); }
.check:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* 실제 화면 사진 */
.photo { margin: 16px 0; }
.photo img {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.photo figcaption { margin-top: 6px; font-size: 0.86rem; color: var(--ink-mute); }

/* 그림: 채팅과 에이전트 */
.flows { display: grid; gap: 14px; margin: 16px 0; }
.flow { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--card); }
.flow h4 { margin: 0 0 8px; font-size: 1rem; }
.flow ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; counter-reset: fl; }
.flow li {
  counter-increment: fl;
  flex: 1 1 140px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper-deep);
  font-size: 0.92rem;
  line-height: 1.5;
}
.flow li::before { content: counter(fl) " "; font-weight: 800; color: var(--accent); }
.flow li b { display: block; }
.flow.agent li { background: var(--accent-tint); }

/* 초록·노랑·빨강 */
.lights { display: grid; gap: 12px; margin: 16px 0; }
@media (min-width: 760px) { .lights { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.light { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--card); border-top: 6px solid var(--line-strong); }
.light h4 { margin: 0 0 6px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.light h4::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--line-strong); flex: none; }
.light ul { margin: 0; padding-left: 1.1em; font-size: 0.93rem; }
.light .rule { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 6px; }
.light.green { border-top-color: var(--green); }
.light.green h4::before { background: var(--green); }
.light.yellow { border-top-color: var(--yellow-dot); }
.light.yellow h4::before { background: var(--yellow-dot); }
.light.red { border-top-color: var(--red); }
.light.red h4::before { background: var(--red); }

/* 비교 상자 */
.compare { display: grid; gap: 12px; margin: 14px 0; }
@media (min-width: 700px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare > div { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); background: var(--card); }
.compare .bad { border-left: 5px solid var(--red); }
.compare .good { border-left: 5px solid var(--green); }
.compare b { display: block; margin-bottom: 4px; }

/* 문제 해결(접는 칸) */
details.trouble {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
details.trouble > summary {
  cursor: pointer;
  padding: 12px 16px 12px 40px;
  font-weight: 700;
  position: relative;
  list-style: none;
}
details.trouble > summary::-webkit-details-marker { display: none; }
details.trouble > summary::before {
  content: "+";
  position: absolute;
  left: 14px;
  top: 10px;
  width: 18px;
  font-weight: 800;
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1.4;
}
details.trouble[open] > summary::before { content: "−"; }
details.trouble > .body { padding: 0 16px 14px 40px; }
details.trouble > .body > :first-child { margin-top: 0; }
.trouble-group { margin-top: 22px; }
.trouble-group h4 { margin: 0 0 6px; font-size: 0.95rem; color: var(--ink-mute); }

details.more {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
}
details.more > summary { cursor: pointer; padding: 12px 16px; font-weight: 700; color: var(--ink-soft); }
details.more > .body { padding: 0 16px 14px; }

/* 다음으로 */
.next-box {
  margin: 30px 0 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--paper-deep);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
}
.next-box p { margin: 0; font-weight: 700; }
.next-box .sub { display: block; font-weight: 500; font-size: 0.88rem; color: var(--ink-mute); }

.file-tree {
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.6;
  background: var(--code-bg);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  white-space: pre;
  overflow-x: auto;
}

.ui { font-weight: 700; }
.ui::before { content: "「"; color: var(--ink-mute); font-weight: 400; }
.ui::after { content: "」"; color: var(--ink-mute); font-weight: 400; }

.storage-note { font-size: 0.82rem; color: var(--ink-mute); }
.nb { white-space: nowrap; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .brand span { display: none; }
  .progress-pill .bar { display: none; }
}
@media (max-width: 420px) {
  .lesson-page .header-tools [data-theme-toggle] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-header, .toc, .toc-toggle, .btn, .mine, .next-box .btn, .skip { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .lesson-layout { display: block; }
  details > .body { display: block !important; }
  .part { break-before: page; }
}
