@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  font-family: 'Noto Sans KR', system-ui, sans-serif;
  font-size: 16px;
  --ink: #242734;
  --muted: #707583;
  --line: #e9eaf0;
  --accent: #5749cf;
  --accent-soft: #f0edfc;
  --paper: #fff;
  --sidebar: #fafafd;
  --body-size: 17px;
  --mono: 'IBM Plex Mono', monospace;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button { color: inherit; }
button:disabled { opacity: .45; cursor: default; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #8e83e7; outline-offset: 4px; }
[tabindex='-1']:focus { outline: none; }
[hidden] { display: none !important; }
img { width: 19px; height: 19px; flex-shrink: 0; }
button img { pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px 18px; background: white; border: 1px solid var(--accent); }
.skip:focus { top: 8px; }
.site-header { position: sticky; top: 0; z-index: 10; height: 72px; display: flex; align-items: center; padding: 0 28px; border-bottom: 1px solid var(--line); background: #fffffff5; backdrop-filter: blur(12px); gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: -.8px; flex-shrink: 0; }
.brand-light { font-weight: 400; }
.brand-mark { width: 30px; height: 32px; display: grid; place-items: center; background: var(--accent); color: white; border-radius: 8px; font: 500 23px var(--mono); }
.header-context { display: flex; gap: 18px; align-items: center; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; }
.header-context>span:last-child { color: #464c5b; overflow: hidden; text-overflow: ellipsis; }
.header-divider { color: #b6bac5; }
.reading-tools { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }
.language-picker { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; }
.language-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 13px; white-space: nowrap; }
.language-trigger:hover, .language-trigger[aria-expanded='true'] { background: var(--accent-soft); border-color: var(--accent); }
.language-icon { width: 17px; height: 17px; opacity: .75; }
.language-chevron { width: 13px; height: 13px; opacity: .65; transition: transform .12s; }
.language-trigger[aria-expanded='true'] .language-chevron { transform: rotate(180deg); }
.language-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 208px; padding: 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px #18203924; }
.language-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 11px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font-size: 14px; text-align: left; }
.language-menu button + button { margin-top: 3px; }
.language-menu button:hover, .language-menu button:focus-visible { background: var(--sidebar); }
.language-menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.language-menu button[aria-checked='true'] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.language-menu button img { width: 17px; height: 17px; opacity: 0; }
.language-menu button[aria-checked='true'] img { opacity: 1; }
#lesson-count { white-space: nowrap; }
:root:lang(zh-CN) { font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; }
:root:lang(en) { font-family: system-ui, sans-serif; }
:root:lang(en) .lesson-heading h1 { letter-spacing: -.6px; }
.tool-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 6px 11px; border: 1px solid transparent; background: transparent; border-radius: 7px; color: #595e6d; font-size: 13px; white-space: nowrap; }
.tool-button:hover { background: #f2f2f7; }
.tool-button[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); border-color: #ded8f7; }
.font-symbol { font-size: 17px; font-weight: 500; }
.mobile-only { display: none; }
.workspace { max-width: 1680px; margin: auto; display: grid; grid-template-columns: 262px minmax(0,1fr); }
.sidebar { position: sticky; top: 72px; align-self: start; height: calc(100dvh - 72px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d8d8e2 transparent; background: var(--sidebar); border-right: 1px solid var(--line); padding: 31px 20px 22px; }
.overline { color: var(--accent); font: 500 11px var(--mono); letter-spacing: 1.3px; }
.course-heading h2 { font-size: 18px; line-height: 1.5; margin: 10px 0 7px; letter-spacing: -.6px; }
.course-heading p { font-size: 12px; color: var(--muted); line-height: 1.8; margin: 0; }
.course-menu { margin: 20px 0; }
.course-menu a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; line-height: 1.7; }
.course-menu a:hover, .course-menu a[aria-current='page'] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.interview-total { color: var(--muted); font-size: 11px; white-space: nowrap; }
.search-box { display: flex; align-items: center; gap: 8px; background: white; border: 1px solid #e0e1e9; border-radius: 7px; padding: 0 10px; margin: 23px 0 27px; min-height: 39px; }
.search-box img { width: 16px; height: 16px; opacity: .5; }
.search-box input { width: 100%; min-width: 0; background: none; border: 0; outline: none; font-size: 13px; padding: 10px 0; color: var(--ink); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.curriculum details { margin: 0 0 22px; }
.curriculum summary { font-size: 15px; font-weight: 700; line-height: 1.5; color: #757989; padding: 4px 2px 10px; list-style-position: inside; }
.curriculum summary::marker { color: #a3a5b2; font-size: 12px; }
.curriculum a { display: flex; align-items: center; gap: 10px; min-height: 43px; margin: 2px 0; padding: 10px 14px; border-radius: 6px; font-size: 14px; color: #626779; line-height: 1.5; border: 1px solid transparent; }
.curriculum a:hover { background: #eeedf5; color: var(--ink); }
.curriculum a[aria-current='page'] { background: #ece8fa; color: #5140b8; border-color: #e5def8; font-weight: 600; }
.curriculum .number { font: 11px var(--mono); color: #9195a3; width: 18px; flex-shrink: 0; }
.curriculum a[aria-current='page'] .number { color: var(--accent); }
.lesson-check { width: 14px; height: 14px; margin-left: auto; }
.empty-message { font-size: 13px; line-height: 1.8; color: var(--muted); }
.course-progress { padding-top: 20px; border-top: 1px solid var(--line); margin-top: 26px; }
.course-progress>div { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.course-progress strong { font: 11px var(--mono); color: var(--accent); }
progress { appearance: none; width: 100%; height: 4px; border: 0; display: block; margin: 12px 0; border-radius: 5px; background: #e9e6f2; }
progress::-webkit-progress-bar { background: #e9e6f2; border-radius: 5px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 5px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 5px; }
.course-progress small { font-size: 11px; color: var(--muted); line-height: 1.8; display: block; }
.reading-layout { min-width: 0; display: grid; grid-template-columns: minmax(0,740px) 170px; justify-content: center; column-gap: clamp(26px,4vw,64px); padding: 0 clamp(28px,4vw,60px); }
main { min-width: 0; width: 100%; padding: 38px 0 24px; }
body.interview-mode .reading-layout { grid-template-columns: minmax(0,740px); }
#interview { scroll-margin-top: 72px; }
#interview .interview-note { font-size: 13px; color: var(--muted); font-weight: 400; }
.interview-filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; align-items: end; margin-bottom: 16px; }
.interview-filters .search-box { margin: 0; min-height: 44px; background: var(--paper); border-color: var(--line); }
.interview-category-label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.interview-category-label select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 13px; padding: 9px; }
.interview-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.interview-actions p { color: var(--muted); font-size: 13px; }
.interview-card { scroll-margin-top: 100px; border: 1px solid var(--line); border-radius: 9px; padding: 24px; margin-bottom: 22px; }
.interview-card .section-label { flex-wrap: wrap; line-height: 1.8; }
.interview-card .section-label a { margin-left: auto; color: var(--accent); }
.interview-card h2 { font-size: calc(var(--body-size) + 3px); }
.interview-answer { border-top: 1px solid var(--line); }
.interview-answer summary { padding: 14px 0; min-height: 44px; font-size: 14px; color: var(--accent); font-weight: 500; }
.interview-answer .prose { padding: 8px 0 20px; }
.interview-answer .interview-visual { margin-top: 8px; }
.interview-related { display: flex; flex-wrap: wrap; gap: 10px 16px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.8; color: var(--muted); }
.interview-related a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.interview-related a:hover { color: var(--ink); }
@media (max-width: 520px) {
  .interview-filters { grid-template-columns: minmax(0,1fr); }
  .interview-card { padding: 19px 16px; }
}
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.breadcrumb img { width: 15px; height: 15px; opacity: .55; }
.breadcrumb>span:last-child { color: #505769; }
.lesson-heading { padding: 36px 0 27px; }
.lesson-heading .overline { margin: 0 0 12px; }
h1 { font-size: clamp(28px,2.75vw,37px); line-height: 1.5; letter-spacing: -1.4px; word-break: keep-all; overflow-wrap: break-word; margin: 0 0 17px; font-weight: 750; }
.intro { color: #646a79; font-size: 16px; line-height: 1.9; word-break: keep-all; overflow-wrap: anywhere; margin: 0; }
.lesson-meta { display: flex; gap: 20px; color: #7a7e8b; font-size: 12px; margin-top: 22px; flex-wrap: wrap; }
.lesson-meta>span+span { border-left: 1px solid #dedfe6; padding-left: 20px; }
#lesson-status { color: var(--accent); }
.learning-goal { border: 1px solid #e9e4fa; border-left: 3px solid #9685dc; background: #f8f6fe; border-radius: 0 8px 8px 0; padding: 19px 24px; margin: 0 0 36px; }
.goal-label { color: #7865b3; font-size: 12px; font-weight: 600; }
.learning-goal p { font-size: 16px; color: #403553; line-height: 1.8; font-weight: 500; margin: 8px 0 0; word-break: keep-all; overflow-wrap: anywhere; }
.reading-section { scroll-margin-top: 106px; margin: 0 0 48px; }
.section-label { display: flex; align-items: center; gap: 9px; color: #828795; font-size: 12px; margin-bottom: 13px; }
.section-label>span { font: 11px var(--mono); color: #8174ba; }
h2 { font-size: 24px; letter-spacing: -.8px; line-height: 1.6; margin: 0 0 19px; word-break: keep-all; overflow-wrap: anywhere; }
.prose p, .section-description { font-size: var(--body-size); line-height: 2; letter-spacing: -.25px; color: #464c5b; word-break: keep-all; overflow-wrap: anywhere; margin: 0 0 21px; }
.prose p:last-child { margin-bottom: 0; }
#code-example, #case-study, #check-panel, #resources { padding-top: 34px; border-top: 1px solid var(--line); }
.code-window { border: 1px solid #dfe1e9; border-radius: 9px; overflow: hidden; margin: 25px 0 20px; }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-bottom: 1px solid #e5e6ed; background: #f7f8fb; font: 12px var(--mono); }
.code-toolbar>span { display: inline-flex; align-items: center; gap: 9px; color: #3f4657; }
.language-dot { width: 7px; height: 7px; border-radius: 50%; background: #9475bd; }
.code-filename { color: #8b90a0; }
.copy-button { border: 1px solid #e0e2ea; border-radius: 5px; background: #fff; color: #667083; font: 12px 'Noto Sans KR',sans-serif; padding: 6px 10px; min-height: 30px; }
.copy-button:hover { border-color: #bcb3e1; color: var(--accent); }
pre { font: 13px/1.95 var(--mono); tab-size: 4; margin: 0; overflow: auto; }
.code-window>pre { padding: 24px; background: #fcfcff; color: #394259; }
.token.comment { color: #7f869a; }
.token.keyword { color: #8b3eaa; }
.token.string { color: #257455; }
.token.function, .token.builtin { color: #315daf; }
.token.number, .token.boolean { color: #b45e2f; }
.token.operator, .token.punctuation { color: #626b80; }
.output-panel { padding: 16px 24px 20px; border-top: 1px solid #e6e8ee; background: #f5f7f9; }
.output-label { display: block; margin-bottom: 9px; font-size: 11px; font-weight: 600; color: #818796; }
.output-panel pre { color: #48566a; white-space: pre-wrap; overflow-wrap: anywhere; }
.small-heading { font-size: 12px; font-weight: 600; color: #687084; }
.code-explanation { padding: 2px 0; }
.code-explanation p { font-size: 15px; color: #717687; line-height: 1.95; margin: 9px 0 0; word-break: keep-all; overflow-wrap: anywhere; }
.pitfall { border: 1px solid #e5e7ed; border-radius: 8px; padding: 22px 24px; margin-top: 25px; background: #fafbfc; }
.pitfall .small-heading { color: #8a6e45; }
.pitfall h3 { font-size: 17px; line-height: 1.8; margin: 9px 0; word-break: keep-all; }
.pitfall p { color: #697181; font-size: 15px; line-height: 1.95; margin: 0; }
.check-panel>p { font-size: var(--body-size); line-height: 1.9; }
#choices { display: grid; gap: 10px; margin-top: 20px; }
#choices button { display: flex; text-align: left; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; background: white; border: 1px solid #e1e4ed; border-radius: 7px; font-size: 15px; line-height: 1.8; }
.choice-letter { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #dddfea; border-radius: 5px; color: #818799; font: 12px var(--mono); flex-shrink: 0; }
#choices button:hover { background: #faf9ff; border-color: #b5a7e6; }
#choices button[aria-pressed='true'] { background: #f5f2fd; border-color: #a594dc; color: #56419b; }
#choices button.correct { border-color: #7ea896; background: #f1f8f5; color: #35634f; }
.feedback { color: #635693; min-height: 0; font-size: 14px!important; margin: 13px 0 0; }
.feedback:empty { display: none; }
.resources { margin-bottom: 30px; }
.resources a { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #565c70; border: 1px solid var(--line); padding: 17px 20px; border-radius: 7px; font-size: 14px; }
.resources a:hover { border-color: #b8acdd; color: var(--accent); }
.resources a + a { margin-top: 8px; }
.resources a img { width: 15px; height: 15px; opacity: .65; }
.resources>p { font-size: 12px; color: var(--muted); line-height: 1.9; margin-top: 12px; }
.completion { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 27px 0; border-top: 1px solid var(--line); }
.completion strong { font-size: 16px; font-weight: 600; }
.completion p { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 7px 0 0; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border-radius: 6px; font-size: 14px; padding: 11px 16px; min-height: 43px; white-space: nowrap; }
.primary { background: var(--accent); color: white; border: 1px solid var(--accent); }
.primary:hover:not(:disabled) { background: #493cb8; }
.primary img { filter: invert(1); width: 17px; height: 17px; }
.primary[aria-pressed='true'] { background: #f3f0fc; color: var(--accent); border-color: #c9bde8; }
.primary[aria-pressed='true'] img { filter: none; }
.secondary { background: white; border: 1px solid #dddfea; color: #626a7b; }
.lesson-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 9px 0 40px; }
.lesson-navigation>a { padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 10px; }
.lesson-navigation>a:hover { background: #faf9ff; border-color: #c4b8e5; }
.nav-direction { display: flex; gap: 7px; align-items: center; font-size: 12px; color: #868b99; }
.nav-direction img { width: 14px; height: 14px; opacity: .5; }
.lesson-navigation strong { font-size: 14px; font-weight: 500; }
.next-lesson { text-align: right; grid-column: 2; }
.next-lesson .nav-direction { justify-content: flex-end; }
.next-lesson strong { color: var(--accent); }
.site-foot { display: flex; justify-content: space-between; gap: 20px; padding-top: 20px; border-top: 1px solid var(--line); font: 10px var(--mono); letter-spacing: 1px; color: #8b8f9b; }
.site-foot span { font: 11px 'Noto Sans KR',sans-serif; letter-spacing: 0; }
.page-outline { position: sticky; top: 116px; align-self: start; padding-top: 2px; margin-top: 46px; }
#page-toc { display: grid; margin-top: 16px; border-left: 1px solid #e7e5ed; }
#page-toc a { padding: 9px 0 9px 17px; font-size: 12px; color: #7a8090; line-height: 1.7; border-left: 2px solid transparent; margin-left: -1px; }
#page-toc a[aria-current='location'] { color: var(--accent); border-color: var(--accent); font-weight: 500; }
#page-toc a:hover { color: var(--accent); }
.outline-note { border-top: 1px solid var(--line); margin-top: 27px; padding-top: 24px; }
.outline-note img { opacity: .35; width: 18px; height: 18px; }
.outline-note p { font-size: 12px; color: #777e8d; line-height: 1.8; margin: 9px 0; }
.outline-note>span { color: #9095a1; font-size: 11px; line-height: 1.9; display: block; }
.inline-toc { display: none; }
.lab { padding: 25px; background: #f7f6fc; border: 1px solid #e7e2f5; border-radius: 9px; }
.lab-heading { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.demo-badge { border: 1px solid #d9d1ed; padding: 4px 7px; color: #796b96; border-radius: 4px; font-size: 10px; }
.lab h2 { font-size: 21px; margin-bottom: 9px; }
.lab>p { font-size: 14px; line-height: 1.8; color: #767088; }
.lab label { font-size: 12px; color: #7b748b; display: block; margin: 18px 0 7px; }
.lab select { width: 100%; padding: 11px; font-size: 14px; border: 1px solid #d8d1e8; border-radius: 5px; background: white; color: #544567; }
.trace { list-style: none; padding: 0; display: flex; gap: 8px; margin: 25px 0; }
.trace li { flex: 1; padding-bottom: 10px; border-bottom: 2px solid #ddd7e9; text-align: center; color: #968ea4; font-size: 12px; }
.trace li.active { color: var(--accent); border-color: var(--accent); }
.trace li.done { color: #677a71; border-color: #9dafa6; }
.observation { border: 1px solid #e1dbef; border-radius: 6px; background: white; padding: 17px; min-height: 108px; }
.observation>span { font: 11px var(--mono); color: var(--accent); }
.observation p { margin: 10px 0 0; color: #6b617b; font-size: 14px; line-height: 1.9; }
.lab-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.lab .demo-note { font-size: 11px; color: #8c849b; margin-bottom: 0; }
body.large-type { --body-size: 19px; }
body.focus-mode .sidebar, body.focus-mode .page-outline { display: none; }
body.focus-mode .workspace { display: block; }
body.focus-mode .reading-layout { grid-template-columns: minmax(0,740px); }
body.focus-mode .inline-toc { display: flex; }
body.focus-mode #open-course { display: inline-flex; }
#course-dialog { width: min(380px,calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 70px #24243730; }
#course-dialog::backdrop { background: #23232d50; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.dialog-heading h2 { font-size: 20px; margin: 0; }
.dialog-subtitle { font-size: 12px; color: var(--muted); margin: 8px 0 26px; }
#mobile-curriculum a { min-height: 44px; font-size: 14px; }

:root[data-theme='dark'] {
  color-scheme: dark;
  --ink: #ececf4;
  --muted: #a6aaba;
  --line: #343746;
  --accent: #b2a6ff;
  --accent-soft: #302b49;
  --paper: #191b24;
  --sidebar: #20222d;
}
:root[data-theme='dark'] .site-header { background: #191b24f5; }
:root[data-theme='dark'] .skip,
:root[data-theme='dark'] .search-box,
:root[data-theme='dark'] .copy-button,
:root[data-theme='dark'] #choices button,
:root[data-theme='dark'] .secondary,
:root[data-theme='dark'] .lab select,
:root[data-theme='dark'] .observation { background: #272a36; color: var(--ink); }
:root[data-theme='dark'] .tool-button,
:root[data-theme='dark'] .header-context>span:last-child,
:root[data-theme='dark'] .curriculum a,
:root[data-theme='dark'] .breadcrumb>span:last-child,
:root[data-theme='dark'] .intro,
:root[data-theme='dark'] .learning-goal p,
:root[data-theme='dark'] .prose p,
:root[data-theme='dark'] .section-description,
:root[data-theme='dark'] .code-toolbar>span,
:root[data-theme='dark'] .code-window>pre,
:root[data-theme='dark'] .output-panel pre,
:root[data-theme='dark'] .small-heading,
:root[data-theme='dark'] .pitfall h3,
:root[data-theme='dark'] .pitfall p,
:root[data-theme='dark'] .resources a,
:root[data-theme='dark'] .secondary,
:root[data-theme='dark'] .lesson-navigation>a,
:root[data-theme='dark'] .lab h2,
:root[data-theme='dark'] .lab label,
:root[data-theme='dark'] .lab select,
:root[data-theme='dark'] .observation p,
:root[data-theme='dark'] .dialog-heading h2 { color: #e4e5ee; }
:root[data-theme='dark'] img { filter: brightness(0) invert(1); }
:root[data-theme='dark'] .primary[aria-pressed='true'] img { filter: none; }
:root[data-theme='dark'] .tool-button:hover,
:root[data-theme='dark'] .curriculum a:hover,
:root[data-theme='dark'] .lesson-navigation>a:hover { background: #2a2d3a; }
:root[data-theme='dark'] .tool-button[aria-pressed='true'],
:root[data-theme='dark'] .curriculum a[aria-current='page'],
:root[data-theme='dark'] #choices button[aria-pressed='true'] { background: #302b49; color: #c4bbff; border-color: #554b80; }
:root[data-theme='dark'] .curriculum summary,
:root[data-theme='dark'] .curriculum .number,
:root[data-theme='dark'] .breadcrumb,
:root[data-theme='dark'] .lesson-meta,
:root[data-theme='dark'] .section-label,
:root[data-theme='dark'] .nav-direction,
:root[data-theme='dark'] #page-toc a,
:root[data-theme='dark'] .outline-note p,
:root[data-theme='dark'] .outline-note>span,
:root[data-theme='dark'] .lab>p,
:root[data-theme='dark'] .trace li,
:root[data-theme='dark'] .dialog-subtitle { color: #a6aaba; }
:root[data-theme='dark'] .learning-goal { background: #262337; border-color: #49415f; }
:root[data-theme='dark'] .goal-label,
:root[data-theme='dark'] .feedback { color: #c0b5ff; }
:root[data-theme='dark'] .code-window { border-color: #3c4050; }
:root[data-theme='dark'] .code-toolbar { background: #232631; border-color: #383c4b; }
:root[data-theme='dark'] .code-window>pre { background: #1c1f29; color: #d9deee; }
:root[data-theme='dark'] .output-panel { background: #232630; border-color: #383c4b; }
:root[data-theme='dark'] .token.comment { color: #969db1; }
:root[data-theme='dark'] .token.keyword { color: #d0a3f2; }
:root[data-theme='dark'] .token.string { color: #9cdbb6; }
:root[data-theme='dark'] .token.function, :root[data-theme='dark'] .token.builtin { color: #9dbbff; }
:root[data-theme='dark'] .token.number, :root[data-theme='dark'] .token.boolean { color: #f2b58f; }
:root[data-theme='dark'] .token.operator, :root[data-theme='dark'] .token.punctuation { color: #adb6cc; }
:root[data-theme='dark'] .pitfall { background: #252731; border-color: #3b3e4b; }
:root[data-theme='dark'] .pitfall .small-heading { color: #e0bd88; }
:root[data-theme='dark'] #choices button { border-color: #414555; }
:root[data-theme='dark'] #choices button:hover,
:root[data-theme='dark'] .resources a:hover { background: #2a2d3a; border-color: #62568f; }
:root[data-theme='dark'] .choice-letter { color: #b6bbca; border-color: #4b5060; }
:root[data-theme='dark'] #choices button.correct { background: #20352f; border-color: #547b6a; color: #b8e2cd; }
:root[data-theme='dark'] .primary[aria-pressed='true'] { background: #302b49; color: #c4bbff; border-color: #554b80; }
:root[data-theme='dark'] .lab { background: #242431; border-color: #3c3a50; }
:root[data-theme='dark'] .lab select { border-color: #49465b; }
:root[data-theme='dark'] .demo-badge { color: #c0b5df; border-color: #514965; }
:root[data-theme='dark'] .trace li { border-color: #454152; }
:root[data-theme='dark'] .trace li.done { color: #a8cdb8; border-color: #638775; }
:root[data-theme='dark'] .trace li.active { color: var(--accent); border-color: var(--accent); }
:root[data-theme='dark'] .observation { border-color: #464356; }
:root[data-theme='dark'] .observation>span { color: var(--accent); }
:root[data-theme='dark'] #course-dialog { background: #20222d; color: var(--ink); }
:root[data-theme='dark'] #course-dialog::backdrop { background: #08090db8; }
:root[data-theme='dark'] .reading-tools .tool-button:not([aria-pressed='true']) {
  color: #f0f1f7;
  background: #252833;
  border-color: #414657;
}
:root[data-theme='dark'] .reading-tools .tool-button:not([aria-pressed='true']):hover {
  background: #303442;
  border-color: #697087;
}
:root[data-theme='dark'] .language-trigger { background: #252833; border-color: #414657; }
:root[data-theme='dark'] .language-trigger:hover, :root[data-theme='dark'] .language-trigger[aria-expanded='true'] { background: var(--accent-soft); border-color: var(--accent); }
:root[data-theme='dark'] .language-menu { background: #252833; border-color: #414657; box-shadow: 0 16px 40px #0006; }
:root[data-theme='dark'] .search-box { background: #252833; border-color: #555b6d; }
:root[data-theme='dark'] .search-box img,
:root[data-theme='dark'] .outline-note img { filter: brightness(0) invert(1); opacity: .8; }
:root[data-theme='dark'] .search-box input { color: #f0f1f7; }
:root[data-theme='dark'] .search-box input::placeholder { color: #b8bdcb; opacity: 1; }
:root[data-theme='dark'] .copy-button { background: #252833; border-color: #555b6d; color: #e4e5ee; }
:root[data-theme='dark'] .copy-button:hover { background: #303442; border-color: #8f83e7; color: #d0c8ff; }
:root[data-theme='dark'] :focus-visible { outline-color: #b9afff; }
:root[data-theme='dark'] .inline-toc a { color: #b8bdcb; }
@media(min-width:1440px) { .reading-layout { padding-left: 65px; padding-right: 50px; } }
@media(max-width:1200px) {
  .page-outline { display: none; }
  .reading-layout { grid-template-columns: minmax(0,720px); padding: 0 40px; }
  .inline-toc { display: flex; }
  .header-context { display: none; }
}
.inline-toc { flex-wrap: wrap; gap: 7px 18px; padding: 0 0 24px; margin-top: -9px; margin-bottom: 27px; border-bottom: 1px solid var(--line); }
.inline-toc a { font-size: 12px; line-height: 1.8; color: #777a8e; padding: 3px 0; }
.inline-toc a[aria-current='location'] { color: var(--accent); }
@media(max-width:850px) {
  .sidebar { display: none; }
  .workspace { display: block; }
  .mobile-only { display: inline-flex; }
  .reading-tools .tool-label, .course-label { display: none; }
  .reading-layout { padding: 0 32px; }
  .site-header { padding: 0 24px; height: 64px; gap: 15px; }
  .brand { font-size: 21px; }
  main { padding-top: 25px; }
  .lesson-heading { padding-top: 26px; }
  .lesson-heading h1 { font-size: 32px; }
  .reading-section { scroll-margin-top: 92px; }
}
@media(max-width:520px) {
  .site-header { padding: 0 18px; }
  .brand { font-size: 19px; gap: 8px; }
  .brand-mark { width: 26px; height: 28px; font-size: 21px; border-radius: 6px; }
  .reading-tools { gap: 1px; }
  .language-trigger { min-height: 40px; padding: 6px 8px; gap: 5px; font-size: 12px; }
  .language-icon { display: none; }
  .language-menu { left: 0; right: auto; }
  .tool-button { padding: 6px 9px; font-size: 12px; min-height: 40px; }
  .tool-label { display: none; }
  .course-label { display: none; }
  #focus-mode { display: none; }
  .reading-layout { padding: 0 22px; }
  .breadcrumb { font-size: 11px; gap: 8px; }
  .lesson-heading h1 { font-size: 29px; letter-spacing: -1.2px; }
  .intro { font-size: 15px; }
  .lesson-meta { gap: 13px; font-size: 11px; }
  .lesson-meta>span+span { padding-left: 13px; }
  .learning-goal { padding: 17px 19px; margin-bottom: 30px; }
  .learning-goal p { font-size: 15px; }
  h2 { font-size: 22px; }
  .prose p, .section-description { line-height: 1.95; }
  .reading-section { margin-bottom: 37px; }
  .code-window>pre { padding: 18px 16px; font-size: 12px; }
  .code-toolbar { padding: 9px 14px; font-size: 11px; }
  .code-filename { display: none; }
  .output-panel { padding: 15px 16px; }
  .output-panel pre { font-size: 12px; }
  .code-explanation p, .pitfall p { font-size: 14px; }
  .pitfall { padding: 18px; }
  .completion { flex-direction: column; align-items: flex-start; gap: 17px; }
  .completion>button { width: 100%; }
  .lesson-navigation { gap: 10px; }
  .lesson-navigation>a { padding: 16px 13px; }
  .lesson-navigation strong { font-size: 13px; }
  #choices button { padding: 13px; font-size: 14px; gap: 11px; }
  .lab { padding: 18px; }
  .inline-toc { gap: 5px 15px; }
}
@media(max-width:360px) {
  .site-header { padding: 0 12px; gap: 8px; }
  .brand { font-size: 17px; gap: 5px; }
  .brand-mark { display: none; }
  .reading-tools .tool-button { padding: 6px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior: auto!important; transition: none!important; } }

/* Text stays selectable and reflows; diagrams need no image or chart runtime. */
.lesson-visual { container-type: inline-size; margin: 0 0 18px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--sidebar); color: var(--ink); font-size: calc(var(--body-size) - 2px); line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
.visual-caption { font-size: calc(var(--body-size) - 1px); font-weight: 700; margin-bottom: 23px; letter-spacing: -.35px; }
.visual-detail { display: block; color: var(--muted); font-size: calc(var(--body-size) - 3px); line-height: 1.65; margin-top: 5px; }
.visual-note { margin: 23px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: calc(var(--body-size) - 3px); line-height: 1.8; }
.visual-lane + .visual-lane { margin-top: 22px; }
.visual-lane-label { margin: 0 0 10px; color: var(--accent); font-size: calc(var(--body-size) - 4px); font-weight: 600; }
.visual-steps { display: grid; grid-template-columns: repeat(var(--steps), minmax(0, 1fr)); gap: 22px; list-style: none; padding: 0; margin: 0; }
.visual-step { position: relative; padding: 14px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.visual-step-number { display: block; margin-bottom: 9px; color: var(--accent); font: 12px var(--mono); }
.visual-step strong { display: block; font-weight: 600; }
.visual-arrow { position: absolute; left: -19px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 19px; line-height: 1; }
.visual-result { position: relative; text-align: center; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 8px; margin-top: 34px; padding: 14px; }
.visual-result::before { content: '↓'; position: absolute; left: calc(50% - 7px); top: -31px; color: var(--accent); }
.visual-table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; font-size: calc(var(--body-size) - 2px); }
.visual-table th, .visual-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.visual-table thead th { color: var(--accent); font-size: calc(var(--body-size) - 3px); font-weight: 600; background: var(--accent-soft); }
.visual-table th:first-child { width: 27%; }
.visual-table tbody th { font-weight: 600; }
.visual-table tr:last-child th, .visual-table tr:last-child td { border-bottom: 0; }
.visual-layers { margin: 0; }
.visual-layer { display: grid; grid-template-columns: minmax(0, 110px) minmax(0, 1fr); gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.visual-layer:first-child { padding-top: 0; }
.visual-layer:last-child { padding-bottom: 0; border-bottom: 0; }
.visual-layer dt { color: var(--accent); font-weight: 600; border-left: 3px solid var(--accent); padding-left: 11px; align-self: stretch; }
.visual-layer dd { margin: 0; }
.visual-layer strong { font-weight: 600; }
.visual-prompt { background: var(--accent-soft); border: 1px solid var(--line); border-radius: 8px; text-align: center; margin: 0 0 17px; padding: 12px 14px; font-weight: 600; }
.visual-branches { list-style: none; padding: 0 0 0 14px; margin: 0 0 0 9px; border-left: 1px solid var(--line); }
.visual-branch { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1.15fr); align-items: start; column-gap: 9px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.visual-branch::before { content: ''; width: 14px; height: 1px; background: var(--line); position: absolute; left: -14px; top: 27px; }
.visual-branch:last-child { border-bottom: 0; padding-bottom: 0; }
.branch-condition { color: var(--muted); }
.branch-arrow { color: var(--accent); }
.visual-total { font: 500 15px var(--mono); color: var(--accent); margin: 0 0 14px; }
.visual-budget-bar { display: flex; gap: 3px; height: 38px; overflow: hidden; border-radius: 6px; }
.visual-color-0 { background: #6c58c7; }
.visual-color-1 { background: #2d8777; }
.visual-color-2 { background: #96a9c7; }
.visual-color-3 { background: #bc8651; }
.visual-color-4 { background: #bcb6ce; }
.visual-budget-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 22px; padding: 0; margin: 18px 0 0; list-style: none; }
.visual-budget-legend li { display: flex; align-items: center; gap: 9px; }
.visual-budget-legend strong { margin-left: auto; font: 500 13px var(--mono); }
.visual-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.visual-time-axis { margin-left: 118px; display: flex; justify-content: space-between; color: var(--muted); font: 12px var(--mono); }
.visual-timeline { list-style: none; padding: 0; margin: 14px 0 0; }
.visual-time-row { display: grid; grid-template-columns: 106px minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 15px; }
.visual-time-name strong { font-size: calc(var(--body-size) - 3px); font-weight: 500; }
.visual-time-name .visual-detail { font: 11px/1.7 var(--mono); }
.visual-time-track { height: 23px; background: var(--line); border-radius: 4px; position: relative; }
.visual-time-span { position: absolute; height: 100%; border-radius: 4px; background: var(--accent); }
.visual-time-span.is-failed { background: repeating-linear-gradient(135deg, #b06b52 0 5px, #d3a392 5px 8px); }
.concept-details { border-bottom: 1px solid var(--line); }
.concept-details summary { min-height: 48px; padding: 13px 3px; color: var(--accent); font-size: 15px; font-weight: 500; }
.concept-details summary span { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }
.concept-details .prose { padding: 16px 0 24px; }
.learning-path-link { display: block; color: var(--accent); font-size: 14px; margin: 18px 0; line-height: 1.6; }
.engineering-practice h3 { font-size: calc(var(--body-size) + 1px); margin: 26px 0 10px; }
.engineering-practice ul { padding-left: 24px; line-height: 1.8; }
.engineering-practice li + li { margin-top: 10px; }
.engineering-practice p { line-height: 1.85; overflow-wrap: anywhere; }
.prerequisite-links { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 22px; }
.prerequisite-links a { color: var(--accent); text-underline-offset: 4px; font-size: calc(var(--body-size) - 2px); }
.interview-question { font-weight: 500; }
.practice-note { color: var(--muted); font-size: calc(var(--body-size) - 2px); margin-top: 22px; }
@container (max-width: 520px) {
  .visual-steps { grid-template-columns: 1fr; gap: 24px; }
  .visual-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px 10px; }
  .visual-step-number { grid-row: span 2; margin: 4px 0 0; }
  .visual-step .visual-detail { margin-top: 0; grid-column: 2; }
  .visual-arrow { left: 24px; top: -20px; transform: rotate(90deg); }
  .visual-table th, .visual-table td { padding: 11px 7px; font-size: calc(var(--body-size) - 3px); }
  .visual-layer { grid-template-columns: minmax(0, 92px) minmax(0, 1fr); gap: 12px; }
}
@container (max-width: 330px) {
  .visual-branch { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-left: 6px; }
  .branch-arrow { display: none; }
  .visual-branch > div { padding-left: 12px; border-left: 2px solid var(--accent); }
  .visual-budget-legend { grid-template-columns: 1fr; }
  .visual-layer { grid-template-columns: 1fr; gap: 9px; }
  .visual-layer dd { padding-left: 14px; }
  .visual-time-axis { margin-left: 101px; }
  .visual-time-row { grid-template-columns: 91px minmax(0, 1fr); gap: 10px; }
}
@media (max-width: 520px) {
  .lesson-visual { padding: 19px 15px; }
  .concept-details summary span { display: none; }
}
@media (max-width: 380px) {
  .brand > span:last-child { display: none; }
}
