/*! © 2026 VertexStudio, Inc. — All rights reserved. */
/* One reading system: a book outline, a quiet article, examples and deliberate next steps. */
#classroom-app [hidden] { display: none !important; }
.cx { --reader-text-size: 13px; --reading-font-size: var(--reader-text-size); --reading-font-weight: 550; --font-display: var(--font-sans); --article-width: 880px; gap: 12px; font-family: var(--font-sans); }
.cx-view[data-reading-size="large"] { --reading-font-size: 15px; }
.cx-view[data-reading-size="larger"] { --reading-font-size: 17px; }
.kh-views > #classroom.course-open { padding: calc(var(--nav-h) + 14px) clamp(16px, 2vw, 32px) 40px; }
#classroom.course-open > .learn-section-head { display: none; }
#classroom.course-open #classroom-app { max-width: 1640px; }
.cx-bar { justify-content: flex-start; gap: 12px; }
.cx-library { border: 0; background: none; color: var(--text-2); font: 500 13px var(--font-sans); cursor: pointer; padding: 10px 0; }
.cx-search { margin-left: auto; }
.cx-toc-btn { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 12px; border-radius: 7px; font: 500 13px var(--font-sans); }
.cx-book-heading { display: grid; gap: 4px; padding: 4px 0; }
.cx-book-heading .cx-book-title { margin: 0; color: var(--text); font: 650 clamp(20px, 1.7vw, 25px)/1.35 var(--font-sans); letter-spacing: -.025em; }
.cx-book-location { margin: 0; color: var(--muted); font: 400 13px/1.6 var(--font-sans); }
.cx-progress { gap: 8px 12px; padding-bottom: 8px; }
.cx-count { font: 400 12px/1.5 var(--font-sans); }
.cx-grid { grid-template-columns: 258px minmax(0, 1fr); gap: clamp(32px, 3vw, 56px); }
.cx-list { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100dvh - var(--nav-h) - 32px); padding: 8px; border-radius: 10px; box-shadow: none; }
.cx-ch-btn { padding: 10px 8px; gap: 8px; }
.cx-ch-t b, .cx-ls-t b { font: var(--reading-font-weight) var(--reader-text-size)/1.5 var(--font-sans); }
.cx-ch-t small { display: none; }
.cx-ch-num, .cx-ch-c { font: 500 11px/1.5 var(--font-sans); }
.cx-ch-ls { padding-left: 8px; }
.cx-ls { padding: 9px 8px; gap: 8px; }
.cx-ls-t small { font: 400 11px/1.5 var(--font-sans); }
.cx-tick { width: 22px; height: 22px; border: 0; border-radius: 5px; font: 400 11px var(--font-sans); }
.cx-ls.cur { background: color-mix(in srgb, var(--brand) 7%, var(--bg-2)); }
.cx-view { min-width: 0; min-height: 420px; padding: 32px clamp(24px, 3vw, 48px); border-radius: 10px; box-shadow: none; }
.cx-view > :is(.cx-lhead,.cx-reader-tools,.cx-lesson-outline,.cx-reading,.cx-design,.cx-lesson-code,.cx-recall,.cx-toolkit-heading,.cx-ltabs,.cx-lpanel,.cx-lbar) { max-width: var(--article-width); margin-left: auto; margin-right: auto; }
.cx-lhead { padding: 0; }
.cx-crumb { font: 400 12px/1.6 var(--font-sans); text-transform: none; letter-spacing: 0; }
.cx-crumb-link { text-transform: none; letter-spacing: 0; }
.cx-lhead-row { gap: 8px 16px; }
.cx-title { font: 650 clamp(25px, 2vw, 32px)/1.25 var(--font-sans); letter-spacing: -.035em; margin: 14px 0 8px; }
.cx-tag { max-width: 72ch; margin: 0; color: var(--text-2); font: var(--reading-font-weight) var(--reading-font-size)/1.75 var(--font-sans); }
.cx-chips { gap: 8px; margin: 12px 0; }
.cx-chips span { padding: 0; border: 0; border-radius: 0; font: 400 12px/1.5 var(--font-sans); }
.cx-chips span + span::before { content: '·'; margin-right: 8px; color: var(--muted); }
.cx-reader-tools { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 12px 20px; margin-block: 12px; }
.cx-mode { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-1); }
.cx-mode button { min-height: 36px; padding: 8px 12px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font: 500 12px var(--font-sans); cursor: pointer; }
.cx-mode button[aria-pressed="true"] { color: var(--text); background: var(--bg-2); box-shadow: 0 1px 3px #0001; }
.cx-text-controls { display: flex; align-items: center; gap: 8px; }
.cx-text-controls button { min-width: 36px; min-height: 36px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); color: var(--text); font: 550 14px var(--font-sans); cursor: pointer; }
.cx-text-controls button:disabled { opacity: .4; cursor: default; }
.cx-text-controls [role="status"] { min-width: 54px; text-align: center; font-size: 11px; color: var(--muted); }
.cx-lesson-outline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.cx-lesson-outline button { border: 0; padding: 4px 0; background: none; color: var(--text-2); font: 500 12px/1.5 var(--font-sans); cursor: pointer; }
.cx-lesson-outline button:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.cx-lesson-outline > span { color: var(--muted); font-size: 11px; }
.cx-reading { display: none; padding: 0; margin-block: 24px; }
.cx-view[data-mode="read"] .cx-reading { display: block; }
.cx-view[data-mode="read"] .cx-steps { display: none; }
.cx-reading p, .cx-view .cx-lpanel .cx-box p, .cx-view .cx-lpanel .cx-box li { color: var(--text); font: var(--reading-font-weight) var(--reading-font-size)/1.75 var(--font-sans); max-width: none; }
.cx-reading p { margin: 0 0 16px; }
.cx-reading-lead { margin-bottom: 24px !important; }
.cx-reading ol { list-style: none; padding: 0; margin: 0; }
.cx-reading li { display: block; padding: 0; margin: 0 0 24px; border: 0; }
.cx-reading-num { display: none; }
.cx-reading h4, .cx-editorial-note h4, .cx-recall h4, .cx-toolkit-heading { margin: 24px 0 10px; color: var(--text); font: var(--reading-font-weight) calc(var(--reading-font-size) + 2px)/1.5 var(--font-sans); letter-spacing: -.015em; }
.cx-reading li h4 { margin-top: 0; }
.cx-reading b { color: var(--text); font-weight: 600; }
.cx-reading-example, .cx-reading-pitfall, .cx-editorial-note { margin: 24px 0; padding: 16px 20px; border: 0; border-left: 3px solid var(--line-2); border-radius: 0 7px 7px 0; background: var(--bg-1); }
.cx-reading-example { border-left-color: var(--brand); }
.cx-reading :is(.cx-reading-example,.cx-reading-pitfall,.cx-editorial-note) h4 { margin: 0 0 8px; font-size: calc(var(--reading-font-size) + 1px); }
.cx-reading :is(.cx-reading-example,.cx-reading-pitfall,.cx-editorial-note) p { margin: 0; }
.cx-recall { border-block: 1px solid var(--line); padding: 18px 0; margin-block: 24px; }
.cx-recall h4 { margin: 0 0 8px; }
.cx-recall p { margin: 8px 0; color: var(--text-2); font-size: var(--reading-font-size); line-height: 1.75; }
.cx-recall summary { padding: 8px 0; color: var(--brand); cursor: pointer; font: 500 13px/1.6 var(--font-sans); }
.cx-toolkit-heading { margin-top: 28px; }
.cx-ltabs { margin-top: 8px; }
.cx-ltab { padding: 10px 12px; font: 500 13px/1.5 var(--font-sans); }
.cx-lpanel .cx-box { padding: 18px 20px; box-shadow: none; }
.cx-lpanel .cx-box .cx-eyebrow { font: 600 13px/1.5 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--text); }
.cx-lbar { position: static; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 12px; margin-top: 32px; padding: 20px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.cx-lbar .btn-lg { min-width: 0; max-width: 100%; padding: 10px 14px; border-radius: 7px; white-space: normal; text-align: left; font: 500 12px/1.5 var(--font-sans); }
.cx-lbar .cx-long { display: inline; }
.cx-lbar .cx-short { display: none; }
.cx-home { max-width: var(--article-width); margin-inline: auto; }
.cx-home-head { display: grid; justify-items: start; gap: 16px; margin-bottom: 28px; }
.cx-home-head .cx-eyebrow { display: none; }
.cx-home-head .cx-home-h { margin: 0 0 10px; color: var(--text); font: 600 21px/1.4 var(--font-sans); }
.cx-book-description { max-width: 76ch; margin: 0; color: var(--text); font: var(--reading-font-weight) var(--reading-font-size)/1.75 var(--font-sans); }
.cx-home-head .btn-lg { padding: 10px 16px; border-radius: 7px; font-size: 13px; }
.cx-contents-heading { margin: 0 0 12px; font: 600 17px/1.5 var(--font-sans); color: var(--text); }
.cx-chgrid { display: grid; grid-template-columns: 1fr; gap: 0; }
.cx-chcard { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; gap: 5px 14px; padding: 18px 8px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.cx-chcard:hover { background: var(--bg-1); transform: none; }
.cx-chcard-top { display: contents; }
.cx-chcard .cx-ch-num { grid-column: 1; grid-row: 1 / 3; padding-top: 3px; }
.cx-chcard .cx-ch-c { grid-column: 3; grid-row: 1; }
.cx-chcard > b { grid-column: 2; grid-row: 1; color: var(--text); font: 550 15px/1.5 var(--font-sans); }
.cx-chcard > small { grid-column: 2; grid-row: 2; margin: 0; color: var(--muted); font: 400 13px/1.65 var(--font-sans); }
.cx-chcard-meter { display: none; }
.cx-chcard-go { grid-column: 3; grid-row: 2; margin: 0; align-self: end; font: 500 12px var(--font-sans); }
.cx-source-note { margin-top: 28px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 16px 0; }
.cx-source-note p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.cx-concept-diagram { padding: 12px 16px; margin: 24px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-1); }
.cx-concept-diagram svg { display: block; width: 100%; max-height: 230px; }
.cx-concept-edges path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.cx-concept-diagram marker path { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.cx-concept-nodes rect { fill: var(--bg-2); stroke: var(--line-2); stroke-width: 1.2; }
.cx-concept-nodes text { text-anchor: middle; dominant-baseline: middle; fill: var(--text); font: 500 12px var(--font-sans); }
.cx-concept-diagram figcaption { padding: 8px 0 2px; color: var(--muted); font: 400 12px/1.65 var(--font-sans); }
.cx-cover { min-height: 170px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px; color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, var(--bg-2)); }
.cx-cover::before,.cx-cover::after { display: none; }
.cx-cover-symbol { width: 64px; height: 64px; flex: none; }
.cx-cover-label { grid-column: 1 / -1; font: 500 10px var(--font-sans); letter-spacing: .1em; }
.cx-view :is(a,button,summary,pre):focus-visible, .cx button:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.cx-view :is(.cx-reading,.cx-design,.cx-lesson-code,.cx-lpanel) { scroll-margin-top: calc(var(--nav-h) + 20px); }
@media (min-width:901px) { .cx.tree-collapsed .cx-grid { grid-template-columns: minmax(0,1fr); } .cx.tree-collapsed .cx-list { display: none; } }
@media (max-width:1100px) { .cx-grid { grid-template-columns: 230px minmax(0,1fr); gap: 24px; } .cx-view { padding: 24px; } }
@media (max-width:900px) { .cx-grid { grid-template-columns: minmax(0,1fr); } .cx-list { position: static; max-height: 60vh; } .cx-view { padding: 22px; } }
@media (max-width:560px) {
  .cx-bar { gap: 8px 12px; } .cx-search { flex-basis: 100%; max-width: none; }
  .cx-view { padding: 18px 16px; } .cx-title { font-size: 25px; }
  .cx-reader-tools { gap: 8px 12px; } .cx-mode button { padding: 8px 10px; }
  .cx-reading p,.cx-view .cx-lpanel .cx-box p,.cx-view .cx-lpanel .cx-box li { font-size: var(--reading-font-size); }
  .cx-reading-example,.cx-reading-pitfall,.cx-editorial-note { padding: 14px 16px; }
  .cx-chcard { grid-template-columns: 20px minmax(0,1fr) auto; gap: 5px 10px; padding-inline: 0; }
  .cx-lbar { grid-template-columns: 1fr 1fr; } .cx-lbar-done { grid-column: 1 / -1; grid-row: 1; justify-self: start; }
  .cx-lbar .btn-lg { padding: 10px; font-size: 12px; }
  .cx-concept-diagram { padding: 8px; overflow-x: auto; } .cx-concept-diagram svg { min-width: 520px; }
}
@media (prefers-reduced-motion:reduce) { .cx *,.cx *::before,.cx *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .cx-bar,.cx-list,.cx-progress,.cx-reader-tools,.cx-lesson-outline,.cx-ltabs,.cx-lbar { display:none!important; } .cx-grid { display:block; } .cx-view { border:0;padding:0; } .cx-reading {display:block;} }

/* Interactive 3D objects and the accessible 2D fallback share the same stage. */
.cx-model-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.cx-model-switch, .cx-model-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.cx-model-toolbar button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg-2); color: var(--text-2); cursor: pointer; font: 500 11px var(--font-sans); }
.cx-model-switch button[aria-pressed="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--bg-2)); color: var(--brand); }
.cx-scene { position: relative; width: 100%; height: clamp(340px, 34vw, 510px); overflow: hidden; }
.cx-scene-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.cx-scene-canvas:active { cursor: grabbing; }
.cx-scene-canvas:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; }
.cx-scene-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cx-scene-label { position: absolute; transform: translate(-50%, -100%); max-width: 135px; pointer-events: auto; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 5px; padding: 4px 7px; font: 500 11px/1.35 var(--font-sans); box-shadow: 0 2px 8px #0001; cursor: pointer; text-wrap: balance; }
.cx-scene-label[data-state="active"] { border-color: var(--brand); color: var(--brand); }
.cx-scene-label[data-state="failed"] { border-color: var(--rose); color: var(--rose); }
.cx-scene-label.selected { box-shadow: 0 0 0 2px var(--brand); }
.cx-svg-stage { position: relative; }
.cx-scene-status { padding: 10px 14px; color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
.cx-scene-status:empty { display: none; }
.cx-node-info { min-height: 46px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); font-size: 12px; line-height: 1.6; }
@media (max-width: 560px) {
  .cx-dia { overflow-x: hidden; }
  .cx-svg-stage { overflow-x: auto; }
  .cx-scene { height: 360px; }
  .cx-scene-label { max-width: 100px; font-size: 10px; }
  .cx-model-toolbar button { min-height: 36px; }
}

/* The diagram uses the same neutral surface as its reader, in either theme. */
.cx-dia, .cx-scene, .cx-svg-stage { background: var(--bg-2); }
.cx-scene-canvas { background: transparent; }


/* Practice uses full-width text and file links, separate from diagram controls. */
.cx-practice { min-width: 0; }
.cx-practice-header { padding-bottom: 24px; }
.cx-practice .cx-practice-header h4 { font: 600 24px/1.35 var(--font-display); letter-spacing: -.025em; margin: 10px 0 0; }
.cx-practice-section { padding: 24px 0; border-top: 1px solid var(--line); min-width: 0; }
.cx-practice-section h4 { font: 600 17px/1.45 var(--font-sans); color: var(--text); margin: 0 0 12px; }
.cx-practice-section p { margin: 0 0 16px; }
.cx-practice-section > :last-child { margin-bottom: 0; }
.cx-practice pre { max-width: 100%; overflow-x: auto; margin: 16px 0 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-1); color: var(--text); font: 13px/1.8 var(--font-mono); tab-size: 4; white-space: pre; overflow-wrap: normal; }
.cx-practice-downloads { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.cx-practice .cx-download { display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 44px; max-width: 100%; padding: 10px 16px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-2); color: var(--text); font: 500 14px/1.5 var(--font-sans); text-decoration: none; }
.cx-download > span:first-child { overflow-wrap: anywhere; min-width: 0; }
.cx-download > span:last-child { flex: none; color: var(--brand); }
.cx-practice .cx-download:hover { border-color: var(--brand); color: var(--brand); }
.cx-practice details { border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; margin-top: 16px; }
.cx-practice summary { cursor: pointer; padding: 16px 0; color: var(--text); font: 500 14px/1.6 var(--font-sans); }
.cx-practice details[open] { padding-bottom: 16px; }
.cx-practice .cx-resources ul { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; }
.cx-practice .cx-resources li { border-top: 1px solid var(--line); }
.cx-resources li a { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; color: var(--brand); font: 13px/1.6 var(--font-mono); text-decoration: none; }
.cx-resources li a span:first-child { overflow-wrap: anywhere; }
.cx-resource-count, .cx-optional { margin-left: 8px; font: 400 12px/1.5 var(--font-sans); color: var(--muted); }
.cx-practice .cx-task-steps { display: grid; gap: 12px; margin: 20px 0; padding-left: 22px; }
.cx-practice-template { margin-top: 24px; }
.cx-practice-result { padding-inline: 20px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 8px; background: var(--bg-1); margin-block: 8px 24px; }
@media (max-width: 560px) {
  .cx-practice .cx-practice-header h4 { font-size: 21px; }
  .cx-practice-downloads { flex-direction: column; }
  .cx-practice .cx-download { width: 100%; box-sizing: border-box; }
  .cx-practice-section { padding-block: 20px; }
  .cx-practice pre { padding: 14px; font-size: 12px; }
}


/* Self-contained lesson code, with no diagram-button styling. */
.cx-view[data-mode="read"] > .cx-lesson-code { max-width: var(--article-width); margin: 24px auto; }
.cx-lesson-code { min-width: 0; padding: 0; margin-block: 24px; }
.cx-code-description { color: var(--text-2); max-width: 78ch; font-size: 15px; line-height: 1.7; margin: 10px 0 14px; }
.cx-code-block { min-width: 0; max-width: 100%; margin: 16px 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--bg-1); }
.cx-code-block figcaption { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px 6px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); background: var(--bg-2); }
.cx-code-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 13px/1.5 var(--font-mono); }
.cx-code-language { color: var(--muted); font: 500 11px/1.5 var(--font-mono); }
.cx-code-block .cx-copy-code { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 76px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-1); color: var(--text); font: 500 12px/1.4 var(--font-sans); cursor: pointer; }
.cx-code-block .cx-copy-code:hover { border-color: var(--brand); color: var(--brand); }
.cx-code-block pre, .cx-practice .cx-code-block pre { max-width: 100%; max-height: 420px; overflow: auto; margin: 0; padding: 16px 18px 16px 0; border: 0; border-radius: 0; background: var(--bg-1); color: var(--text); font: 13px/1.85 var(--font-mono); tab-size: 4; white-space: pre; overflow-wrap: normal; }
.cx-code-block code { font: inherit; color: inherit; padding: 0; background: transparent; border: 0; }
.cx-code-line::before { content: attr(data-line); display: inline-block; box-sizing: border-box; width: 48px; padding-right: 16px; color: var(--muted); text-align: right; user-select: none; }
.cx-syntax-keyword { color: var(--brand); font-weight: 600; }
.cx-syntax-string { color: color-mix(in srgb, var(--text) 75%, #16a34a); }
.cx-syntax-comment { color: var(--muted); font-style: italic; }
.cx-syntax-number { color: color-mix(in srgb, var(--text) 75%, #d97706); }
.cx-copy-status { display: block; padding: 0 16px; color: var(--text-2); font-size: 12px; line-height: 1.6; }
.cx-copy-status:not(:empty) { padding-block: 8px; border-top: 1px solid var(--line); }
.cx-clipboard-field { position: fixed; top: -10000px; left: 0; }
@media (max-width: 560px) {
  .cx-code-block figcaption { gap: 8px; padding-left: 12px; }
  .cx-code-language { display: none; }
  .cx-code-block .cx-copy-code { min-width: 44px; min-height: 44px; }
  .cx-code-block pre, .cx-practice .cx-code-block pre { font-size: 12px; max-height: 360px; }
  .cx-code-line::before { width: 36px; padding-right: 10px; }
}


.cx-crumb [data-home] { max-width: 350px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-architecture-diagram svg { max-height: 340px; }
@media (max-width:560px) { .cx-crumb [data-home] { max-width: 220px; } .cx-architecture-diagram svg { min-width: 540px; } }

/* Course discovery shares the reader's restrained type and controls. */
.cx-catalog-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.cx-catalog-search { display: grid; gap: 8px; flex: 1 1 320px; max-width: 560px; color: var(--text); font: 500 13px/1.5 var(--font-sans); }
.cx-catalog-search-field { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 14px; min-height: 48px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg-2); }
.cx-catalog-search-field:focus-within { outline: 2px solid var(--brand); outline-offset: 3px; }
.cx-catalog-search-field svg { width: 19px; height: 19px; flex: none; color: var(--muted); }
.cx-catalog-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 15px/1.5 var(--font-sans); padding: 12px 0; }
.cx-catalog-search input::-webkit-search-cancel-button { display: none; }
.cx-catalog-search button { flex: none; width: 34px; height: 34px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.cx-catalog-search button:hover { background: var(--bg-1); color: var(--text); }
.cx-catalog-count { margin: 0 0 12px; color: var(--muted); font: 400 13px/1.6 var(--font-sans); overflow-wrap: anywhere; }
.cx-catalog-empty { padding: 48px 24px; text-align: center; border: 1px dashed var(--line-2); border-radius: 12px; }
.cx-catalog-empty h3 { margin: 0 0 8px; font: 600 20px/1.4 var(--font-sans); }
.cx-catalog-empty p { color: var(--muted); font: 400 15px/1.7 var(--font-sans); margin: 0 0 20px; }
.cl-catalog :is(button,input,[data-open-course]):focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
@media (max-width: 560px) { .cx-catalog-search { max-width: none; flex-basis: 100%; } .cx-catalog-count { margin-bottom: 0; } .cl-catalog .cl-course-grid { grid-template-columns: minmax(0, 1fr); } }

/* Reading diagrams keep the walkthrough beside the illustration. */
.cx-inline-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; color: var(--muted); font: 500 12px/1.5 var(--font-sans); }
.cx-inline-controls > div { display: flex; gap: 6px; }
.cx-inline-controls button { min-height: 36px; min-width: 36px; }
.cx-inline-explanation { margin-top: 14px; }
.cx-reading .cx-inline-explanation p { margin-bottom: 10px; }
.cx-inline-explanation .cx-flows { margin-bottom: 12px; }
.cx-architecture-diagram .edge.flow, .cx-architecture-diagram .particle { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .cx-architecture-diagram .edge.flow { animation: none; } }

/* ── page transitions ── */
.cx-view { position: relative; scroll-margin-top: calc(var(--nav-h) + 16px); }
.cx-view.cx-loading::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; border-radius: 10px 10px 0 0; background: linear-gradient(90deg, transparent, var(--brand), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: cx-loading 1s linear infinite; }
.cx-view.cx-loading > * { opacity: .55; transition: opacity .2s ease; }
@keyframes cx-loading { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { .cx-view.cx-loading::before { animation: none; background: var(--brand); opacity: .5; } }

/* ── interview guide (design-problem lessons) ── */
.cx-design { margin: 40px auto 8px; padding: 28px 0 0; border-top: 1px solid var(--line); }
.cx-design .cx-design-part { padding: 0; z-index: auto; }  /* override the site-wide section padding */
.cx-design-title { margin: 6px 0 18px; color: var(--text); font: 650 calc(var(--reading-font-size) + 8px)/1.3 var(--font-display); letter-spacing: -.02em; }
.cx-design-prompt { margin: 0 0 8px; padding: 16px 20px; border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; background: var(--bg-1); }
.cx-design-prompt span { display: block; margin-bottom: 6px; color: var(--text-2); font: 600 11px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.cx-design-prompt p { margin: 0; color: var(--text); font: 600 calc(var(--reading-font-size) + 1px)/1.65 var(--font-sans); }
.cx-design h4 { margin: 30px 0 12px; color: var(--text); font: 650 calc(var(--reading-font-size) + 3px)/1.45 var(--font-sans); letter-spacing: -.015em; }
.cx-design h5 { margin: 16px 0 6px; color: var(--text); font: 650 var(--reading-font-size)/1.5 var(--font-sans); }
.cx-design :is(p, li, dd, td, th) { color: var(--text); font: var(--reading-font-weight) var(--reading-font-size)/1.7 var(--font-sans); }
.cx-design p { margin: 0 0 10px; }
.cx-design ul { margin: 0; padding-left: 20px; }
.cx-design li { margin: 4px 0; }
.cx-design code { padding: 1px 5px; border-radius: 4px; background: var(--bg-1); font: 500 .92em/1.5 var(--font-mono); }
.cx-phases { list-style: none; margin: 0; padding: 0; counter-reset: phase; }
.cx-phases li { position: relative; margin: 0; padding: 0 0 16px 40px; counter-increment: phase; }
.cx-phases li::before { content: counter(phase); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-1); border: 1px solid var(--line-2); color: var(--brand); font: 650 12px/24px var(--font-mono); text-align: center; }
.cx-phases li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 4px; border-left: 1px dashed var(--line-2); }
.cx-phase-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.cx-phase-head b { color: var(--text); font: 650 var(--reading-font-size)/1.5 var(--font-sans); }
.cx-phase-head span { color: var(--text-2); font: 500 11px/1.4 var(--font-mono); }
.cx-design-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }
.cx-design-cols h5 { margin-top: 0; }
.cx-table-wrap { overflow-x: auto; margin: 4px 0 8px; border: 1px solid var(--line); border-radius: 8px; }
.cx-table { width: 100%; border-collapse: collapse; }
.cx-table :is(th, td) { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cx-table tbody tr:last-child :is(th, td) { border-bottom: 0; }
.cx-table thead th { background: var(--bg-1); color: var(--text-2); font: 600 11px/1.4 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; }
.cx-table tbody th { font-weight: 650; white-space: nowrap; }
.cx-api { margin: 0; }
.cx-api dt { margin: 12px 0 4px; }
.cx-api dt code { font-size: .95em; }
.cx-api dd { margin: 0 0 0 2px; }
.cx-path { margin: 0 0 8px; padding-left: 22px; }
.cx-deep { margin: 0 0 6px; }
.cx-followups details { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 8px; background: var(--bg-2); }
.cx-followups summary { cursor: pointer; padding: 12px 16px; color: var(--text); font: 600 var(--reading-font-size)/1.55 var(--font-sans); }
.cx-followups details p { margin: 0; padding: 0 16px 14px; }
.cx-concepts-note { color: var(--text-2) !important; }
.cx-concepts { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-concept { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2); color: var(--text); font: 550 12px/1.4 var(--font-sans); cursor: pointer; }
.cx-concept:hover { border-color: var(--brand); color: var(--brand); }
.cx-concept small { color: var(--text-2); font-size: 10.5px; }
.cx-table :is(th, td) { overflow-wrap: normal; word-break: normal; hyphens: manual; }
@media (max-width: 700px) { .cx-design-cols { grid-template-columns: minmax(0, 1fr); } .cx-table { min-width: 560px; } .cx-table :is(th, td) { padding: 9px 12px; } }
@media print { .cx-followups details { break-inside: avoid; } .cx-followups details > p { display: block; } }

/* ── left column: course title, progress and chapter tree stay in view while the page scrolls;
      the tree scrolls on its own and does not hand its scroll over to the page ── */
@media (min-width: 901px) {
  .cx-side { position: sticky; top: calc(var(--nav-h) + 16px); display: flex; flex-direction: column; gap: 10px; max-height: calc(100dvh - var(--nav-h) - 32px); min-width: 0; }
  .cx-side .cx-book-heading, .cx-side .cx-progress { flex: none; }
  .cx-side .cx-list { position: static; top: auto; flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .cx.tree-collapsed .cx-side { position: static; max-height: none; }
}
.cx-side .cx-book-heading .cx-book-title { font-size: clamp(18px, 1.4vw, 21px); }
.cx-side .cx-progress { padding-bottom: 0; }
@media (max-width: 900px) { .cx-side { display: grid; gap: 10px; } }
