@font-face {
  font-family: NanumSquare;
  src: url("fonts/NanumSquareR.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: NanumSquare;
  src: url("fonts/NanumSquareB.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Brand accents, interactive blue and completion states have separate roles. */
  --brand-navy: #232f3e;
  --brand-orange: #ff9900;
  --paper: #f2f3f3;
  --interactive: #0972d3;
  --interactive-text: #0868be;
  --interactive-hover: #033160;
  --interactive-soft: #f2f8fd;
  --success: #037f0c;
  --success-soft: #f2fcf3;
  --warning: #855900;
  --warning-soft: #fff7e6;
  --surface: #ffffff;
  --sidebar: #fafafa;
  --strong: var(--brand-navy);
  --text: #414d5c;
  --muted: #5f6b7a;
  --line: #d5dbdb;
  --line-strong: #8d99a8;
  --code: var(--brand-navy);
  --code-text: #f2f3f3;
  --code-bar: #354150;
  --inline-code: #e9ebed;
  --focus: var(--interactive);
  --on-dark: #d5dbdb;
  --interactive-on-dark: #89bdee;
  --button-text: #fff;
  --rail-width: 286px;
  --topbar-height: 68px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow: 0 16px 42px rgb(35 47 62 / 10%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1b2a;
  --surface: var(--brand-navy);
  --sidebar: #192534;
  --strong: #f2f3f3;
  --text: #d5dbdb;
  --muted: #b6bec9;
  --line: #414d5c;
  --line-strong: #7d8998;
  --interactive-soft: #1b3551;
  --interactive: #89bdee;
  --interactive-text: #89bdee;
  --interactive-hover: #c4e5ff;
  --success: #7fd88f;
  --success-soft: #153522;
  --warning: #f3bd63;
  --warning-soft: #392c16;
  --code: #0f1b2a;
  --code-bar: var(--brand-navy);
  --code-text: #f2f3f3;
  --inline-code: #354150;
  --button-text: var(--brand-navy);
  --shadow: 0 16px 42px rgb(0 0 0 / 22%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: NanumSquare, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
button, input, textarea { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: inherit; }
button, a, summary { touch-action: manipulation; }
button:disabled { cursor: wait; }
::selection { background: var(--interactive-soft); color: var(--strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }
.js-only { display: none !important; }
.js .js-only:not([hidden]) { display: var(--js-display, inline-flex) !important; }
.mobile-only, .js .mobile-only.js-only { display: none !important; }
.sr-only, .copy-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.copy-fallback { position: fixed; top: 0; left: 0; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 100;
  border-radius: 8px;
  background: var(--strong);
  color: var(--paper);
  padding: 12px 20px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }
.workspace { margin-left: var(--rail-width); min-width: 0; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-width);
  z-index: 40;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 25px 23px 20px; background: var(--brand-navy); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { flex: 0 0 42px; }
.brand > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.brand strong { color: #fff; font-size: 20px; letter-spacing: -.5px; line-height: 1.4; }
.brand > span > span { color: var(--on-dark); font-size: 12px; letter-spacing: .04em; }
.nav-search {
  --js-display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 20px 16px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}
.nav-search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.nav-search .icon { width: 17px; height: 17px; }
.nav-search input { min-width: 0; width: 100%; padding: 1px 0; border: 0; background: transparent; color: var(--text); font-size: 13px; line-height: 1.7; }
.nav-search input:focus-visible { outline: none; }
.nav-search input::placeholder { color: var(--muted); opacity: 1; }
.nav-search kbd { padding: 0 5px; border: 1px solid var(--line); border-radius: 3px; font: 11px/1.6 var(--mono); }
.chapter-navigation { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 24px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.overview-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 7px; text-decoration: none; font-size: 13px; font-weight: 700; color: var(--strong); }
.overview-link > span { color: var(--muted); font: 11px var(--mono); }
.overview-link[aria-current] { background: var(--interactive-soft); }
.nav-group { margin-top: 24px; }
.nav-group h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 13px 8px; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.6; letter-spacing: .06em; }
.nav-group h2 > span:first-child { font-family: var(--mono); }
.nav-group h2 > span:last-child { letter-spacing: 0; font-size: 10px; font-weight: 400; }
.nav-group ol, .nav-group ul { list-style: none; padding: 0; margin: 0; }
.nav-group li + li { margin-top: 3px; }
.chapter-link, .reference-link { position: relative; display: flex; align-items: center; gap: 10px; min-height: 43px; padding: 9px 11px; border: 1px solid transparent; border-radius: 7px; text-decoration: none; font-size: 12.5px; line-height: 1.5; }
.chapter-link:hover, .reference-link:hover, .overview-link:hover { background: var(--interactive-soft); }
.chapter-link[aria-current], .reference-link[aria-current] { border-color: var(--line-strong); background: var(--surface); color: var(--strong); font-weight: 700; }
.chapter-link[aria-current]::before { content: ""; position: absolute; top: 9px; bottom: 9px; left: -1px; width: 3px; background: var(--brand-orange); border-radius: 2px; }
.nav-number { flex: 0 0 21px; color: var(--muted); font: 11px/1.5 var(--mono); }
.chapter-link[aria-current] .nav-number { color: var(--interactive-text); }
.nav-title { flex: 1; min-width: 0; word-break: keep-all; }
.read-indicator { visibility: hidden; display: inline-flex; align-items: center; flex: 0 0 11px; color: var(--success); }
.read-indicator .icon { width: 12px; height: 12px; stroke-width: 2.3; }
.is-read > .read-indicator { visibility: visible; }
.reference-link .icon { width: 16px; height: 16px; color: var(--muted); }
.reference-link { min-height: 38px; }
.search-empty { margin: 24px 13px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.reading-progress { flex: 0 0 auto; padding: 16px 24px 19px; border-top: 1px solid var(--line); background: var(--sidebar); }
.progress-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 11px; color: var(--muted); }
.progress-label strong { color: var(--strong); font-weight: 700; font-variant-numeric: tabular-nums; }
.reading-progress progress { display: block; width: 100%; height: 4px; margin: 10px 0 11px; appearance: none; border: none; border-radius: 4px; background: var(--line); color: var(--success); overflow: hidden; }
.reading-progress progress::-webkit-progress-bar { background: var(--line); }
.reading-progress progress::-webkit-progress-value { background: var(--success); border-radius: 4px; }
.reading-progress progress::-moz-progress-bar { background: var(--success); border-radius: 4px; }
.reading-progress p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.text-button { background: none; border: 0; padding: 8px 0 0; color: var(--interactive-text); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--topbar-height); padding: 12px 44px; border-bottom: 1px solid var(--brand-navy); background: var(--brand-navy); }
.topbar-leading { display: flex; align-items: center; gap: 16px; min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 13px; color: var(--on-dark); font-size: 12px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; text-underline-offset: 4px; }
.breadcrumb > span:last-child { color: #fff; font-size: 11px; letter-spacing: .02em; }
.toolbar { --js-display: flex; align-items: center; gap: 8px; }
.toolbar-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 36px; min-height: 36px; padding: 7px 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; line-height: 1.5; }
.toolbar-button:hover, .icon-button:hover { border-color: var(--line); background: var(--surface); color: var(--strong); }
.topbar .toolbar-button, .topbar .icon-button, .sidebar-brand .icon-button, .breadcrumb a { color: var(--interactive-on-dark); }
.topbar .toolbar-button:hover, .topbar .icon-button:hover, .sidebar-brand .icon-button:hover { color: #fff; border-color: var(--interactive-on-dark); background: #414d5c; }
.topbar :focus-visible, .sidebar-brand :focus-visible { outline-color: var(--interactive-on-dark); }
.toolbar-button .icon { width: 17px; height: 17px; }
.pwa-panel { --js-display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 10px 44px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; }
.pwa-panel p { flex: 1 1 240px; margin: 0; }
.pwa-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pwa-button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--interactive-text); font-size: 12px; font-weight: 700; }
.pwa-button:hover { background: var(--interactive-soft); border-color: var(--interactive); }
.pwa-update { border-color: var(--brand-orange); }
.pwa-button:disabled { opacity: .7; }
.theme-sun { display: none; }
[data-theme="dark"] .theme-sun { display: inline; }
[data-theme="dark"] .theme-moon { display: none; }
main { padding: 48px clamp(24px, 2.2vw, 40px) 40px; min-height: calc(100vh - 158px); }
main:focus { outline: none; }
.overview { max-width: 970px; margin: 0 auto; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--interactive-text); margin: 0 0 16px; font-size: 10px; font-weight: 700; letter-spacing: .12em; line-height: 1.8; }
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-orange); }
.overview-header { padding: 12px 0 48px; max-width: 800px; }
.overview-header h1 { max-width: 670px; margin: 0; color: var(--strong); font-size: clamp(31px, 3vw, 44px); font-weight: 700; letter-spacing: -.045em; line-height: 1.4; word-break: keep-all; text-wrap: balance; }
.overview-subtitle { margin: 17px 0 0; color: var(--strong); font-size: 17px; line-height: 1.8; word-break: keep-all; }
.overview-intro { margin: 19px 0 0; color: var(--muted); font-size: 14px; line-height: 1.9; word-break: keep-all; }
.course-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin: 21px 0 24px; color: var(--muted); font-size: 11px; line-height: 2; }
.course-meta span + span::before { content: "·"; padding: 0 11px; color: var(--line-strong); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 22px; min-height: 46px; padding: 12px 19px; border: 1px solid transparent; border-radius: 7px; text-decoration: none; font-size: 13px; font-weight: 700; line-height: 1.6; }
.primary-button { color: var(--button-text); background: var(--interactive); border-color: var(--interactive); }
.primary-button:hover { background: var(--interactive-hover); border-color: var(--interactive-hover); }
.button .icon { width: 17px; height: 17px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 25px; }
.section-heading .eyebrow { margin-bottom: 7px; font-size: 9px; }
.section-heading h2 { margin: 0; color: var(--strong); font-size: 22px; font-weight: 700; letter-spacing: -.025em; line-height: 1.5; word-break: keep-all; }
.route-section { padding-top: 32px; border-top: 1px solid var(--line-strong); }
.route-range { display: flex; align-items: center; gap: 11px; padding-bottom: 4px; color: var(--strong); font: 15px/1.5 var(--mono); }
.route-range > span { color: var(--strong); }
.route-day + .route-day { margin-top: 32px; }
.day-heading { display: flex; align-items: baseline; gap: 16px; margin: 0 0 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.day-heading h3 { margin: 0; color: var(--strong); font: 700 11px/1.5 var(--mono); letter-spacing: .06em; }
.day-heading > span { color: var(--muted); font-size: 11px; }
.route-list { list-style: none; margin: 0; padding: 0; }
.route-step { position: relative; }
.route-step::before { content: ""; position: absolute; z-index: 0; left: 21px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.route-step:first-child::before { top: 39px; }
.route-step:last-child::before { bottom: calc(100% - 39px); }
.route-step > a { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 48px 21px; align-items: center; gap: 17px; padding: 17px 9px 17px 0; border-bottom: 1px solid var(--line); text-decoration: none; border-radius: 0 8px 8px 0; }
.route-step:last-child > a { border-bottom-color: transparent; }
.route-number { position: relative; z-index: 1; display: grid; place-items: center; justify-self: center; width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--strong); background: var(--paper); font: 12px/1 var(--mono); }
.route-step.is-next .route-number { border: 2px solid var(--brand-orange); box-shadow: 0 0 0 4px var(--paper); }
.route-step.is-read .route-number { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.route-description { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.route-description > strong { color: var(--strong); font-size: 16px; font-weight: 700; letter-spacing: -.02em; line-height: 1.6; word-break: keep-all; }
.route-description > span { color: var(--muted); font-size: 12px; line-height: 1.7; word-break: keep-all; }
.route-read-label { display: none; margin-left: 9px; color: var(--success); font-size: 10px; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.route-step.is-read .route-read-label { display: inline; }
.route-duration { color: var(--muted); text-align: right; font: 13px/1.5 var(--mono); white-space: nowrap; }
.route-duration > small { padding-left: 3px; font-family: NanumSquare, sans-serif; font-size: 10px; }
.route-arrow { color: var(--line-strong); transition: transform .16s ease; }
.route-arrow .icon { width: 18px; height: 18px; }
.route-step > a:hover .route-description > strong { color: var(--interactive-text); }
.route-step > a:hover .route-arrow { color: var(--interactive-text); transform: translateX(3px); }
.architecture-section { margin-top: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.architecture-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; cursor: pointer; list-style: none; }
.architecture-details > summary::-webkit-details-marker { display: none; }
.architecture-details > summary .eyebrow { margin: 0 0 4px; font-size: 9px; }
.architecture-details > summary strong { color: var(--strong); font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.details-hint { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: 11px; }
.details-hint > span { font-size: 20px; transition: transform .16s; }
.architecture-details[open] .details-hint > span { transform: rotate(45deg); }
.architecture-details figure { margin: 0; border-top: 1px solid var(--line); padding: 22px 24px; }
.architecture-scroll { overflow-x: auto; scrollbar-width: thin; }
.architecture-scroll svg { display: block; width: 100%; min-width: 780px; height: auto; }
.architecture-details figcaption { max-width: 740px; padding-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.8; word-break: keep-all; }
.reference-section { margin-top: 42px; }
.reference-section .section-heading { margin-bottom: 20px; }
.reference-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.reference-card { display: grid; grid-template-columns: 1fr 20px; align-items: end; gap: 18px 8px; padding: 19px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; }
.reference-card > .icon:first-child { grid-column: 1 / -1; width: 21px; height: 21px; color: var(--interactive-text); }
.reference-card > strong { color: var(--strong); font-size: 13px; font-weight: 700; line-height: 1.6; word-break: keep-all; }
.reference-card > .icon:last-child { color: var(--muted); width: 17px; height: 17px; margin-bottom: 2px; }
.reference-card:hover { border-color: var(--line-strong); }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: start; gap: 28px; width: 100%; max-width: 1480px; margin: 0 auto; }
.article-layout.without-toc { grid-template-columns: minmax(0, 1fr); }
.lesson { min-width: 0; }
.lesson-header { margin: 0 0 34px; padding: 5px 0 26px; border-bottom: 1px solid var(--line-strong); }
.lesson-header .eyebrow { margin-bottom: 20px; font-size: 10px; }
.chapter-stamp { display: inline-grid; place-items: center; width: 37px; height: 37px; margin-right: 5px; border: 1.5px solid var(--brand-orange); border-radius: 50%; color: var(--strong); font: 13px/1 var(--mono); letter-spacing: 0; }
.meta-separator { padding: 0 4px; color: var(--muted); }
.lesson-header h1 { margin: 0; color: var(--strong); font-size: clamp(28px, 2.6vw, 38px); font-weight: 700; line-height: 1.45; letter-spacing: -.035em; word-break: keep-all; text-wrap: balance; }
.lesson-summary { margin: 17px 0 0; color: var(--muted); font-size: 15px; line-height: 1.9; word-break: keep-all; }
.lesson-location { display: flex; align-items: center; gap: 12px; margin-top: 20px; color: var(--muted); font-size: 11px; }
.lesson-read-state { padding-left: 12px; border-left: 1px solid var(--line); }
.lesson-read-state.is-read { color: var(--success); }
.prose { color: var(--text); font-size: 16px; line-height: 1.95; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 21px; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { color: var(--strong); font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; }
.prose h2 { margin: 49px 0 19px; padding-top: 9px; font-size: 24px; line-height: 1.55; letter-spacing: -.03em; }
.prose h3 { margin: 33px 0 15px; font-size: 19px; line-height: 1.65; letter-spacing: -.02em; }
.prose h4 { margin: 27px 0 12px; font-size: 17px; }
.prose h5, .prose h6 { margin: 24px 0 12px; font-size: 16px; }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 96px; }
.prose strong { color: var(--strong); font-weight: 700; }
.prose a { color: var(--interactive-text); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.prose a:hover { color: var(--interactive-hover); }
.prose .external-link::after { content: " ↗"; font-size: .75em; text-decoration: none; }
.prose ul, .prose ol { padding-left: 1.65em; margin: 18px 0 25px; }
.prose li { margin: 7px 0; padding-left: 4px; }
.prose li::marker { color: var(--interactive-text); }
.prose li p { margin-bottom: 12px; }
.prose li > ul, .prose li > ol { margin-top: 8px; margin-bottom: 12px; }
.prose .contains-task-list { list-style: none; padding-left: 0; }
.prose .task-list-item { display: block; padding-left: 0; }
.prose .task-list-item > input { margin: 0 9px 0 0; accent-color: var(--interactive); vertical-align: middle; width: 14px; height: 14px; }
.prose blockquote { margin: 27px 0; padding: 19px 23px; border-left: 3px solid var(--interactive); border-radius: 0 7px 7px 0; background: var(--interactive-soft); color: var(--text); font-size: 14px; line-height: 1.95; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose blockquote > :first-child { margin-top: 0; }
.prose hr { height: 1px; margin: 39px 0; border: 0; background: var(--line); }
.prose :not(pre) > code { padding: .18em .38em; border-radius: 4px; background: var(--inline-code); color: var(--strong); font-family: var(--mono); font-size: .81em; white-space: break-spaces; overflow-wrap: anywhere; }
.prose .code-block { margin: 25px 0 29px; border: 1px solid var(--code-bar); border-radius: 9px; background: var(--code); overflow: hidden; }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; min-height: 40px; padding: 6px 12px 6px 20px; background: var(--code-bar); color: var(--on-dark); font: 11px/1.5 var(--mono); }
.code-language { letter-spacing: .03em; }
.code-window-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.code-window-title strong { color: inherit; font: 700 12px/1.5 NanumSquare, sans-serif; white-space: nowrap; }
.code-window-title .code-language { color: #aab7c8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prose .terminal-window { border-color: #404754; border-radius: 12px; background: #181d25; box-shadow: 0 8px 22px rgb(15 23 42 / 12%); }
.terminal-window .code-toolbar { min-height: 44px; padding-left: 15px; background: linear-gradient(#343b46, #292f39); border-bottom: 1px solid #141922; color: #e5e9ef; }
.terminal-lights { display: inline-flex; gap: 7px; margin-right: 6px; flex: 0 0 auto; pointer-events: none; }
.terminal-lights span { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 14%); }
.terminal-light-close { background: #ff5f57; }
.terminal-light-minimize { background: #febc2e; }
.terminal-light-zoom { background: #28c840; }
.terminal-destination { padding: 11px 22px 0; color: #a7b4c7; font: 11px/1.7 NanumSquare, sans-serif; }
.prose .terminal-window pre { background: #181d25; color: #edf1f7; font-size: 13px; }
.prose .prompt-screen { --prompt-accent: #0d7862; --prompt-soft: #eef9f5; border-color: var(--prompt-accent); background: var(--surface); }
.prompt-screen[data-assistant="kiro"] { --prompt-accent: #6f4ab6; --prompt-soft: #f4f0fd; }
.prompt-screen[data-assistant="claude"] { --prompt-accent: #a94d2d; --prompt-soft: #fff3ed; }
[data-theme="dark"] .prompt-screen { --prompt-accent: #80d9c0; --prompt-soft: #173b35; }
[data-theme="dark"] .prompt-screen[data-assistant="kiro"] { --prompt-accent: #c8b1f6; --prompt-soft: #302646; }
[data-theme="dark"] .prompt-screen[data-assistant="claude"] { --prompt-accent: #f1b393; --prompt-soft: #493027; }
.prompt-tools { --js-display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.prompt-tools button { flex: 1; min-width: 0; min-height: 36px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font: 12px/1.5 NanumSquare, sans-serif; white-space: nowrap; }
.prompt-tools button[aria-pressed="true"] { color: var(--prompt-accent); border-color: var(--prompt-accent); background: var(--prompt-soft); font-weight: 700; }
.prompt-tools button:focus-visible { outline-color: var(--prompt-accent); outline-offset: 2px; }
.prompt-toolbar { min-height: 48px; padding: 9px 16px; background: var(--prompt-soft); color: var(--prompt-accent); }
.prompt-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; font-family: NanumSquare, sans-serif; }
.prompt-heading strong { color: var(--prompt-accent); font-size: 14px; }
.prompt-heading > span { font-size: 11px; }
.prose .prompt-destination { margin: 0; padding: 12px 18px 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.prose .prompt-screen pre { max-height: min(640px, 75vh); padding: 16px 18px 20px; background: var(--surface); color: var(--text); font: 14px/1.9 NanumSquare, sans-serif; }
.prose .prompt-screen pre > code { white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-toolbar .copy-button { border-color: var(--prompt-accent); color: var(--prompt-accent); }
.prompt-toolbar .copy-button:hover { background: var(--surface); color: var(--strong); border-color: var(--prompt-accent); }
.prompt-toolbar .copy-button:focus-visible { outline-color: var(--prompt-accent); }
.copy-button { align-items: center; justify-content: center; min-height: 29px; min-width: 48px; padding: 3px 9px; border: 1px solid #8d99a8; border-radius: 5px; background: transparent; color: var(--interactive-on-dark); font-family: NanumSquare, sans-serif; font-size: 11px; line-height: 1.5; }
.copy-button:hover { background: #414d5c; border-color: var(--interactive-on-dark); color: #fff; }
.copy-button:focus-visible { outline-color: var(--interactive-on-dark); outline-offset: 2px; }
.prose pre { margin: 0; padding: 20px 22px 22px; background: var(--code); color: var(--code-text); overflow: auto; font: 12px/1.85 var(--mono); scrollbar-width: thin; scrollbar-color: #8d99a8 var(--code); tab-size: 2; }
.prose pre:focus-visible { outline-offset: -4px; outline-color: var(--interactive-on-dark); }
.prose pre > code { padding: 0; color: inherit; background: none; font: inherit; white-space: pre; overflow-wrap: normal; word-break: normal; }
.table-scroll { margin: 27px 0 31px; border: 1px solid var(--line-strong); border-radius: 8px; overflow-x: auto; scrollbar-width: thin; }
.prose table { width: 100%; margin: 0; border-collapse: collapse; font-size: 13px; line-height: 1.8; }
.prose th { padding: 12px 15px; border-bottom: 1px solid var(--line-strong); background: var(--interactive-soft); color: var(--strong); text-align: left; font-weight: 700; white-space: nowrap; }
.prose td { min-width: 110px; padding: 13px 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) { background: var(--surface); }
.prose td :not(pre) > code, .prose td > code { font-size: 11px; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: 7px; }
.source-reference { text-decoration: underline dotted var(--line-strong); text-underline-offset: 4px; }
.source-reference small { display: inline; padding: 2px 5px; border-radius: 3px; background: var(--inline-code); color: var(--muted); font-size: 10px; white-space: nowrap; text-decoration: none; }
.prose .footnotes { margin-top: 45px; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.prose .footnotes ol { padding-left: 18px; }
.prose .footnotes p { margin: 0; }
.footnote-back-icon { width: 14px; height: 14px; vertical-align: middle; margin-left: 3px; }
.article-toc { position: sticky; top: 106px; max-height: calc(100vh - 140px); overflow-y: auto; padding-left: 17px; border-left: 1px solid var(--line); scrollbar-width: thin; }
.article-toc summary { display: flex; justify-content: space-between; align-items: center; color: var(--strong); font-size: 11px; font-weight: 700; cursor: pointer; list-style: none; }
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc summary > .icon { width: 15px; height: 15px; }
.article-toc details[open] summary > .icon { transform: rotate(180deg); }
.article-toc ol { list-style: none; margin: 13px 0 20px; padding: 0; }
.article-toc li + li { margin-top: 10px; }
.article-toc li a { display: block; padding: 2px 2px 2px 0; color: var(--muted); text-decoration: none; font-size: 11px; line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
.article-toc li.toc-depth-3 { padding-left: 10px; }
.article-toc li.toc-depth-3 a { font-size: 10px; }
.article-toc li a:hover, .article-toc li a.is-active { color: var(--interactive-text); }
.article-toc li a.is-active { font-weight: 700; }
.back-to-top { color: var(--muted); text-decoration: none; font-size: 10px; }
.back-to-top:hover { color: var(--interactive-text); }
.reading-check { --js-display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 52px 0 29px; padding: 24px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.reading-check .eyebrow { margin: 0 0 8px; font-size: 9px; }
.reading-check h2 { margin: 0 0 8px; color: var(--strong); font-size: 18px; line-height: 1.5; letter-spacing: -.02em; }
.reading-check p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.reading-check .button { flex: 0 0 auto; gap: 8px; font-size: 12px; }
.reading-check .button.is-read { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.page-pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.pagination-link { display: flex; align-items: center; gap: 12px; padding: 14px 12px; border: 1px solid transparent; border-radius: 7px; text-decoration: none; }
.pagination-link > span { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pagination-link small { color: var(--muted); font-size: 10px; }
.pagination-link strong { color: var(--strong); font-size: 12px; font-weight: 700; line-height: 1.7; word-break: keep-all; }
.pagination-link > .icon { width: 18px; height: 18px; color: var(--interactive-text); }
.pagination-link.next { justify-content: flex-end; text-align: right; }
.pagination-link:hover { border-color: var(--line); background: var(--surface); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 22px 44px 0; padding: 24px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.8; }
.footer-date { margin-left: 15px; }
.site-footer > a { text-decoration: none; }
.site-footer > a:hover { text-decoration: underline; text-underline-offset: 3px; }
.reader-status { position: fixed; z-index: 80; bottom: 22px; left: calc(50% + var(--rail-width) / 2); transform: translate(-50%, 10px); max-width: min(550px, calc(100vw - 36px)); margin: 0; padding: 12px 19px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); color: var(--strong); font-size: 12px; line-height: 1.7; opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.reader-status.is-visible { opacity: 1; transform: translate(-50%, 0); }
.noscript-note { max-width: 900px; margin: 0 auto 24px; padding: 14px 18px; border-left: 3px solid var(--warning); background: var(--warning-soft); color: var(--warning); font-size: 13px; }

@media (min-width: 1660px) {
  :root { --rail-width: 306px; }
  main { padding-top: 58px; }
  .overview { max-width: 1020px; }
  .article-layout { gap: 32px; }
}

@media (max-width: 1500px) {
  .article-layout { display: flex; flex-direction: column; gap: 0; max-width: 1200px; }
  .lesson { width: 100%; }
  .article-toc { position: static; order: -1; width: 100%; max-height: none; margin-bottom: 27px; padding: 13px 17px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
  .article-toc summary { font-size: 12px; }
  .article-toc ol { columns: 2; column-gap: 25px; margin-bottom: 8px; }
  .article-toc li { break-inside: avoid; }
  .article-toc li a { font-size: 11px; }
  .article-toc .back-to-top { display: none; }
}

@media (max-width: 1250px) {
  :root { --rail-width: 268px; }
  .topbar { padding-inline: 30px; }
  .pwa-panel { padding-inline: 30px; }
  main { padding: 35px 30px 30px; }
  .sidebar-brand { padding-inline: 21px; }
  .site-footer { margin-inline: 30px; }
  .reference-grid { grid-template-columns: 1fr; gap: 9px; }
  .reference-card { display: flex; align-items: center; gap: 13px; padding: 15px 18px; }
  .reference-card > strong { flex: 1; }
  .reference-card > .icon:last-child { margin-bottom: 0; }
}

@media (max-width: 900px) {
  :root { --rail-width: 0px; --topbar-height: 62px; }
  .workspace { margin-left: 0; }
  .sidebar { position: static; width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { padding-block: 19px; }
  .chapter-navigation { max-height: 400px; }
  .js .sidebar { position: fixed; width: min(324px, calc(100vw - 40px)); border-right: 1px solid var(--line); transform: translateX(-105%); transition: transform .18s ease; }
  .js .sidebar .chapter-navigation { max-height: none; }
  .js .mobile-only.js-only { display: inline-flex !important; }
  .nav-open { overflow: hidden; }
  .nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow); }
  .nav-backdrop { position: fixed; z-index: 35; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgb(35 47 62 / 44%); }
  .topbar { min-height: 62px; padding: 11px 23px; }
  .pwa-panel { padding-inline: 28px; }
  .topbar-leading { gap: 12px; }
  .topbar-leading .toolbar-button { margin-left: -8px; color: var(--interactive-on-dark); font-weight: 700; }
  main { padding: 35px 28px 28px; }
  .overview { max-width: 750px; }
  .overview-header { padding-top: 8px; padding-bottom: 35px; }
  .overview-header h1 { max-width: 590px; font-size: 38px; }
  .overview-subtitle { font-size: 16px; }
  .overview-intro { font-size: 14px; }
  .reference-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .reference-card { display: grid; grid-template-columns: 1fr 18px; gap: 18px 8px; padding: 17px; align-items: end; }
  .reference-card > strong { font-size: 12px; }
  .lesson-header h1 { font-size: 34px; }
  .site-footer { margin-inline: 28px; }
  .reader-status { left: 50%; }
}

@media (max-width: 560px) {
  .topbar { gap: 6px; padding: 10px 16px; }
  .pwa-panel { padding-inline: 21px; font-size: 11px; }
  .topbar-leading { gap: 8px; }
  .breadcrumb { gap: 8px; font-size: 11px; }
  .breadcrumb > a, .breadcrumb > span:nth-child(2) { display: none; }
  .toolbar { gap: 0; }
  .toolbar-button { gap: 5px; padding-inline: 8px; min-height: 40px; }
  main { padding: 28px 21px; }
  .overview-header { padding: 3px 0 32px; }
  .eyebrow { font-size: 9px; letter-spacing: .085em; }
  .overview-header h1 { max-width: 340px; font-size: 32px; line-height: 1.4; }
  .overview-subtitle { margin-top: 15px; font-size: 14px; line-height: 1.8; }
  .overview-intro { font-size: 12px; line-height: 1.9; }
  .overview-intro br { display: none; }
  .course-meta { font-size: 10px; margin-top: 17px; margin-bottom: 22px; }
  .course-meta span + span::before { padding-inline: 7px; }
  .button { min-height: 44px; padding: 11px 17px; font-size: 12px; }
  .section-heading { margin-bottom: 20px; gap: 12px; }
  .section-heading h2 { font-size: 19px; }
  .section-heading .eyebrow { font-size: 8px; }
  .route-section { padding-top: 26px; }
  .route-range { gap: 7px; font-size: 12px; }
  .day-heading { gap: 13px; padding-block: 8px; }
  .day-heading h3 { font-size: 10px; }
  .day-heading > span { font-size: 10px; }
  .route-step > a { grid-template-columns: 35px minmax(0, 1fr) 33px; gap: 12px; padding: 16px 0; align-items: start; }
  .route-step::before { left: 17px; }
  .route-step:first-child::before { top: 33px; }
  .route-step:last-child::before { bottom: calc(100% - 33px); }
  .route-number { width: 31px; height: 31px; font-size: 11px; margin-top: 2px; }
  .route-description { gap: 6px; }
  .route-description > strong { font-size: 14px; line-height: 1.65; }
  .route-description > span { font-size: 11px; line-height: 1.7; }
  .route-duration { padding-top: 6px; font-size: 11px; }
  .route-duration > small { font-size: 9px; }
  .route-arrow { display: none; }
  .route-day + .route-day { margin-top: 26px; }
  .architecture-section { margin-top: 27px; }
  .architecture-details > summary { padding: 17px; gap: 10px; }
  .architecture-details > summary strong { font-size: 14px; }
  .details-hint { font-size: 0; gap: 0; }
  .details-hint > span { font-size: 22px; }
  .architecture-details figure { padding: 14px 17px; }
  .reference-section { margin-top: 31px; }
  .reference-grid { grid-template-columns: 1fr; }
  .reference-card { display: flex; align-items: center; gap: 13px; padding: 15px 17px; }
  .reference-card > strong { flex: 1; font-size: 12px; }
  .lesson-header { padding-top: 0; margin-bottom: 26px; }
  .lesson-header .eyebrow { font-size: 9px; margin-bottom: 17px; }
  .chapter-stamp { width: 32px; height: 32px; font-size: 11px; }
  .lesson-header h1 { font-size: 28px; line-height: 1.5; }
  .lesson-summary { font-size: 13px; line-height: 1.9; }
  .lesson-location { font-size: 10px; }
  .article-toc { margin-bottom: 23px; padding: 12px 15px; }
  .article-toc ol { columns: 1; }
  .prose { font-size: 15px; line-height: 1.95; }
  .prose p { margin-bottom: 19px; }
  .prose h2 { font-size: 21px; margin-top: 37px; margin-bottom: 16px; }
  .prose h3 { font-size: 18px; margin-top: 28px; }
  .prose blockquote { margin-block: 24px; padding: 15px 17px; font-size: 13px; }
  .prose pre { padding: 16px; font-size: 11px; line-height: 1.85; }
  .code-toolbar { padding-left: 16px; }
  .copy-button { min-height: 32px; }
  .prose table { font-size: 12px; }
  .prose th { padding: 10px 12px; }
  .prose td { padding: 11px 12px; min-width: 115px; }
  .reading-check { flex-direction: column; align-items: flex-start; gap: 20px; padding: 21px; margin-top: 36px; }
  .reading-check .button { width: 100%; }
  .page-pagination { gap: 10px; margin-top: 29px; padding-top: 16px; }
  .pagination-link { gap: 7px; padding: 10px 0; }
  .pagination-link strong { font-size: 11px; }
  .pagination-link .icon { width: 15px; height: 15px; }
  .site-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 0 21px; padding: 24px 0; font-size: 9px; }
  .footer-date { margin-left: 11px; }
  .reader-status { min-width: 230px; bottom: 16px; padding: 11px 16px; font-size: 11px; }
}

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

@media print {
  @page { margin: 17mm 16mm; }
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --paper: #fff;
    --surface: #fff;
    --strong: #232f3e;
    --text: #232f3e;
    --muted: #414d5c;
    --line: #d5dbdb;
    --line-strong: #8d99a8;
    --interactive-soft: #f2f8fd;
    --interactive: #0972d3;
    --interactive-text: #0868be;
    --interactive-hover: #033160;
    --success: #037f0c;
    --success-soft: #f2fcf3;
    --inline-code: #f2f3f3;
  }
  html { scroll-behavior: auto; }
  body { background: white; font-size: 10pt; }
  .sidebar, .topbar, .nav-backdrop, .skip-link, .article-toc, .reader-status, .reading-check, .page-pagination, .copy-button, .overview-header > .button, .details-hint, .noscript-note { display: none !important; }
  .js .reading-check.js-only, .js .copy-button.js-only, .js .pwa-panel.js-only { display: none !important; }
  .workspace { margin: 0; }
  main { padding: 0; min-height: 0; }
  .overview, .lesson, .article-layout { display: block; max-width: none; width: 100%; }
  .overview-header { padding: 0 0 22px; max-width: none; }
  .overview-header h1, .lesson-header h1 { max-width: none; font-size: 24pt; }
  .overview-subtitle { font-size: 11pt; }
  .overview-intro { font-size: 10pt; }
  .prose { font-size: 10pt; line-height: 1.8; }
  .prose h2 { font-size: 16pt; margin-top: 24pt; }
  .prose h3 { font-size: 13pt; }
  .prose h2, .prose h3, .prose h4, .lesson-header, .day-heading { break-after: avoid; }
  .prose p { orphans: 3; widows: 3; }
  .prose blockquote { padding: 12px 17px; font-size: 9pt; break-inside: avoid; }
  .prose .code-block { border: 1px solid var(--line); border-radius: 3px; background: white; break-inside: auto; }
  .code-toolbar { min-height: 26px; padding: 5px 12px; background: var(--paper); color: var(--text); }
  .prose pre { padding: 12px; background: white; color: var(--text); overflow: visible; font-size: 8pt; }
  .prose .prompt-screen pre { max-height: none; }
  .prompt-tools, .terminal-lights, .terminal-destination, .prompt-destination { display: none !important; }
  .prose pre > code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .table-scroll { overflow: visible; }
  .prose table { font-size: 8.5pt; }
  .prose th { white-space: normal; }
  .prose td { min-width: 0; }
  .prose tr { break-inside: avoid; }
  .prose a { color: var(--interactive-text); }
  .route-step { break-inside: avoid; }
  .route-step > a { grid-template-columns: 40px minmax(0, 1fr) 45px; padding-block: 12px; }
  .route-arrow { display: none; }
  .route-description > strong { font-size: 11pt; }
  .route-description > span { font-size: 9pt; }
  .route-number { background: white; }
  .route-step::before { left: 19px; }
  .architecture-section { break-inside: avoid; }
  .architecture-scroll { overflow: visible; }
  .architecture-scroll svg { min-width: 0; width: 100%; }
  .reference-grid { display: block; }
  .reference-card { display: flex; margin-bottom: 7px; padding: 10px 13px; break-inside: avoid; }
  .site-footer { margin: 22px 0 0; padding-bottom: 0; font-size: 8pt; }
}
.toolbar a.toolbar-button { text-decoration: none; }
.toolbar { flex-shrink: 0; }
.toolbar-button > span { white-space: nowrap; }
@media (max-width: 560px) {
  .toolbar a.toolbar-button > span { display: none; }
}
