/* ══════════════════════════════════════════════════════════════
   BashaByte · Courses (catalog, course landing, lesson preview)
   Uses the shared semantic tokens for the course pages.
   Direction: editorial and flat. Hairlines instead of boxes, one
   reading column, numbers set in JetBrains Mono, a single loud action.
   ══════════════════════════════════════════════════════════════ */

.cx {
  --read: 720px;
  --aside: 340px;
  --gap: clamp(40px, 6vw, 88px);
}
body.cx.cw-page,
body.cx.px-page {
  background: var(--bb-bg);
  color: var(--bb-text);
  font-family: var(--bb-font-sans);
}

/* Keep course actions large enough for the accent fill's text contrast. */
body.cx.cw-page .btn-primary,
body.cx.cw-page .btn-orange,
body.cx.px-page .btn-primary,
body.cx.px-page .btn-orange {
  box-shadow: none;
  background: var(--bb-accent);
  color: var(--bb-text-on-accent);
  font-size: var(--bb-fs-h3);
  font-weight: var(--bb-weight-bold);
}
.cx .btn:hover { transform: none; }
body.cx.cw-page .btn-primary:hover,
body.cx.cw-page .btn-orange:hover,
body.cx.px-page .btn-primary:hover,
body.cx.px-page .btn-orange:hover { filter: brightness(.92); }
.cx .btn-ghost { backdrop-filter: none; background: transparent; }
.cx .btn-ghost:hover { transform: none; }

.cx-main-region { min-height: 60vh; }
.cx-muted { color: var(--bb-text-secondary); }

/* ── Shared type ─────────────────────────────────────────────── */
.cx-title {
  max-width: 18ch;
  margin-top: 18px !important;
  font-size: var(--bb-fs-display);
  font-family: var(--bb-font-display);
  font-weight: var(--bb-weight-bold); letter-spacing: -0.045em; line-height: 1.02;
  text-wrap: balance;
}
.cx-lede {
  max-width: 60ch;
  margin-top: 20px !important;
  color: var(--bb-text-secondary); font-size: var(--bb-fs-body-lg); line-height: 1.65;
  text-wrap: pretty;
}
.cx-h2 { font-size: var(--bb-fs-h2); font-family: var(--bb-font-display); font-weight: var(--bb-weight-semibold); letter-spacing: -0.03em; line-height: 1.2; }
.cx-mono-h { color: var(--bb-text-tertiary); font: 600 12px/1.2 var(--bb-font-sans); letter-spacing: 0.01em; }

.cx-prose { color: var(--bb-text); font-size: var(--bb-fs-body-lg); line-height: 1.75; }
.cx-prose > * + * { margin-top: 1em !important; }
.cx-prose h2, .cx-prose h3, .cx-prose h4 { margin-top: 1.8em !important; font-family: var(--bb-font-display); font-weight: var(--bb-weight-semibold); letter-spacing: -0.02em; line-height: 1.3; }
.cx-prose h2 { font-size: var(--bb-fs-h2); }
.cx-prose h3 { font-size: var(--bb-fs-h3); }
.cx-prose h4 { font-size: var(--bb-fs-h4); }
.cx-prose h2:first-child, .cx-prose h3:first-child { margin-top: 0 !important; }
.cx-prose p, .cx-prose li { color: var(--bb-text-secondary); }
.cx-prose strong { color: var(--bb-text); font-weight: 700; }
.cx-prose a { color: var(--bb-text); text-decoration: underline; text-decoration-color: var(--bb-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.cx-prose ul, .cx-prose ol { padding-left: 1.3em; }
.cx-prose ul { list-style: disc; }
.cx-prose ol { list-style: decimal; }
.cx-prose li + li { margin-top: 0.35em; }
.cx-prose li::marker { color: var(--bb-text-tertiary); }
.cx-prose code { padding: 0.1em 0.38em; border-radius: var(--bb-radius-xs); background: var(--bb-surface-subtle); font-size: 0.88em; }
.cx-prose pre, .cx-code {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  border: 1px solid var(--bb-border); border-radius: var(--bb-radius-sm);
  background: var(--bb-surface-subtle); color: var(--bb-text);
  font-size: 14px; line-height: 1.65; tab-size: 4;
}
.cx-prose pre code { padding: 0; background: none; font-size: inherit; }
.cx-prose table { width: 100%; border-collapse: collapse; font-size: var(--bb-fs-body); line-height: 1.5; }
.cx-prose th, .cx-prose td { padding: 10px 12px; border-bottom: 1px solid var(--bb-border); text-align: left; vertical-align: top; }
.cx-prose th { color: var(--bb-text-secondary); font-weight: 700; font-size: 13px; }
.cx-prose blockquote { padding-left: 16px; border-left: 2px solid var(--bb-border-strong); color: var(--bb-text-secondary); }
.cx-prose hr { border: 0; border-top: 1px solid var(--bb-border); }

/* ── Tags, chips, text buttons ───────────────────────────────── */
.cx-tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border: 1px solid var(--bb-border-strong); border-radius: var(--bb-radius-full);
  color: var(--bb-text-secondary); font: 600 12px/1 var(--bb-font-sans); letter-spacing: 0.01em;
  white-space: nowrap;
}
.cx-tag.is-free { color: var(--bb-text); border-color: var(--bb-accent); }
.cx-tag.is-on { color: var(--bb-text); background: var(--bb-accent-soft); border-color: var(--bb-accent); }
.cx-tag.is-draft { color: var(--bb-warning); border-color: var(--bb-warning); }
a.cx-tag:hover { border-color: currentColor; }

.cx-chip {
  display: inline-flex; align-items: center; height: 36px; padding: 0 15px;
  border: 1px solid var(--bb-border-strong); border-radius: var(--bb-radius-full);
  color: var(--bb-text-secondary); font-size: 14px; font-weight: 600;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.cx-chip:hover { color: var(--bb-text); border-color: var(--bb-text); }
.cx-chip.is-on { color: var(--bb-bg); background: var(--bb-text); border-color: var(--bb-text); }

.cx-textbtn {
  padding: 6px 0; border: 0; background: none; cursor: pointer;
  color: var(--bb-text-secondary); font: 600 14px/1 var(--bb-font-display);
  text-decoration: underline; text-decoration-color: var(--bb-border-strong); text-underline-offset: 5px;
}
.cx-textbtn:hover { color: var(--bb-text); text-decoration-color: currentColor; }

/* ── Flash + draft banners ───────────────────────────────────── */
.cx-flash-wrap { padding-top: 20px; display: grid; gap: 8px; }
.cx-flash {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border: 1px solid var(--bb-border-strong); border-radius: var(--bb-radius-sm);
  background: var(--bb-surface); font-size: var(--bb-fs-body);
}
.cx-flash i { color: var(--bb-text-secondary); font-size: 17px; }
.cx-flash.is-success i { color: var(--bb-success); }
.cx-flash.is-error i, .cx-flash.is-warning i { color: var(--bb-warning); }

.cx-draft { border-bottom: 1px solid var(--bb-border); background: var(--bb-warning-soft); font-size: 14px; }
.cx-draft .shell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 11px 0; }
.cx-draft i { color: var(--bb-warning); }
.cx-draft a { margin-left: auto; color: var(--bb-warning); font-weight: 700; }
.cx-draft a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Catalog ─────────────────────────────────────────────────── */
.cx-head { padding: clamp(56px, 9vw, 112px) 0 clamp(32px, 5vw, 56px); }
.cx-head-tight { padding-bottom: 32px; }
.cx-head-meta { margin-top: 24px !important; color: var(--bb-text-tertiary); font: 500 13px/1 var(--bb-font-mono); letter-spacing: 0.04em; }

.cx-paths { display: grid; gap: 14px; padding-bottom: 40px; }
.cx-paths ul { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-path-note { max-width: 70ch; color: var(--bb-text-secondary); font-size: var(--bb-fs-body); }
.cx-path-note b { color: var(--bb-text); }
.cx-path-note a { color: var(--bb-text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--bb-accent); text-underline-offset: 3px; }

.cx-catalog { padding-bottom: clamp(72px, 10vw, 128px); }
.cx-cat { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 32px; padding: 32px 0; border-top: 1px solid var(--bb-border); }
.cx-cat-head h2 { font-size: var(--bb-fs-h3); font-family: var(--bb-font-display); font-weight: var(--bb-weight-semibold); letter-spacing: -0.02em; }
.cx-cat-head p { margin-top: 8px !important; color: var(--bb-text-secondary); font-size: 14px; line-height: 1.55; }

.cx-list > li + li { border-top: 1px solid var(--bb-border); }
.cx-list > li.is-dim { opacity: 0.45; }
.cx-item {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 20px; align-items: center; gap: 18px;
  margin: 0 -14px; padding: 20px 14px; border-radius: var(--bb-radius-sm);
  transition: background 0.2s ease;
}
a.cx-item:hover { background: var(--bb-surface-subtle); }
a.cx-item:hover .cx-item-go { color: var(--bb-text); }
.cx-item.is-static { grid-template-columns: 44px minmax(0, 1fr) auto; }
.cx-item-no { align-self: start; padding-top: 4px; color: var(--bb-text-tertiary); font: 500 13px/1 var(--bb-font-mono); }
.cx-item-body { display: grid; gap: 6px; min-width: 0; }
.cx-item-title { font-size: var(--bb-fs-h4); font-family: var(--bb-font-display); font-weight: var(--bb-weight-semibold); letter-spacing: -0.02em; line-height: 1.25; }
a.cx-item-title:hover { color: var(--bb-text); text-decoration: underline; text-decoration-color: var(--bb-accent); text-underline-offset: 3px; }
.cx-item-sub { color: var(--bb-text-secondary); font-size: var(--bb-fs-body); line-height: 1.5; }
.cx-item-meta { display: flex; flex-wrap: wrap; gap: 4px 0; color: var(--bb-text-tertiary); font-size: 13px; font-weight: 600; }
.cx-item-meta span + span::before { content: "·"; margin: 0 8px; color: var(--bb-border-strong); }
.cx-item-tags { display: flex; align-items: center; gap: 8px; }
.cx-item-go { color: var(--bb-text-tertiary); transition: color 0.2s ease, transform 0.25s var(--bb-ease); }

.cx-empty { display: grid; justify-items: center; gap: 12px; padding: 72px 0 24px; border-top: 1px solid var(--bb-border); text-align: center; }
.cx-empty > i { color: var(--bb-text-tertiary); font-size: 28px; }
.cx-empty h2 { font-size: var(--bb-fs-h2); font-family: var(--bb-font-display); font-weight: var(--bb-weight-semibold); letter-spacing: -0.02em; }
.cx-empty p { max-width: 46ch; color: var(--bb-text-secondary); }
.cx-empty .btn { margin-top: 8px; }

/* ── Course landing: hero ────────────────────────────────────── */
.cx-hero { padding: clamp(40px, 6vw, 72px) 0 clamp(36px, 5vw, 56px); border-bottom: 1px solid var(--bb-border); }
.cx .cx-hero { border-bottom: 0; padding-bottom: clamp(28px, 4vw, 44px); }
.cx-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; color: var(--bb-text-tertiary); font-size: 13px; font-weight: 600; }
.cx-crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--bb-border-strong); }
.cx-crumbs a { color: var(--bb-text-secondary); }
.cx-crumbs a:hover { color: var(--bb-text); }

.cx-eyebrow { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 28px !important; color: var(--bb-text-tertiary); font: 600 12px/1.4 var(--bb-font-sans); letter-spacing: 0.01em; }
.cx-eyebrow span + span::before { content: "·"; margin: 0 10px; }
.cx-eyebrow .is-accent { color: var(--bb-text); text-decoration: underline; text-decoration-color: var(--bb-accent); text-underline-offset: 3px; }

/* ── Course landing: layout ──────────────────────────────────── */
.cx-layout { display: grid; grid-template-columns: minmax(0, var(--read)) var(--aside); justify-content: space-between; gap: var(--gap); padding-bottom: clamp(72px, 10vw, 128px); }
.cx-col { min-width: 0; }
.cx-card { padding: 26px; border: 1px solid var(--bb-border-strong); border-radius: var(--bb-radius-md); background: var(--bb-surface); }
.cx-card-price { font-size: var(--bb-fs-h1); font-weight: var(--bb-weight-bold); letter-spacing: -0.04em; line-height: 1; }
.cx-card-note { margin-top: 10px !important; color: var(--bb-text-secondary); font-size: 14px; line-height: 1.55; }
.cx-actions { display: grid; gap: 10px; margin-top: 22px; }
.cx-actions form, .cx-actions .btn { width: 100%; }
.cx-actions form .btn { width: 100%; }
.cx-card-fine { margin-top: 14px !important; color: var(--bb-text-secondary); font-size: 13px; text-align: center; }
.cx-card-fine a { color: var(--bb-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Phone bottom bar */
.cx-mbar { display: none; }

/* ── Lesson preview ──────────────────────────────────────────── */
.cx-hero-lesson .cx-title { max-width: 22ch; }
.cx-layout-lesson { --aside: 260px; }
.cx-goals { margin-top: 48px; padding: 22px 24px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); }
.cx-goals ul { display: grid; gap: 10px; margin-top: 14px; }
.cx-goals li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: var(--bb-fs-body); line-height: 1.55; }
.cx-goals i { color: var(--bb-accent); font-size: 17px; line-height: 1.4; }

.cx-step { padding-top: 64px; scroll-margin-top: 84px; }
.cx-step + .cx-step { margin-top: 0; }
.cx-step-label { display: flex; align-items: center; gap: 10px; color: var(--bb-text-secondary); font: 600 12px/1 var(--bb-font-sans); letter-spacing: 0.01em; }
.cx-step-label i { color: var(--bb-accent); font-size: 14px; }
.cx-step-no { color: var(--bb-text-tertiary); }
.cx-step-title { margin-top: 12px !important; padding-bottom: 18px; border-bottom: 1px solid var(--bb-border); font-size: var(--bb-fs-h1); font-family: var(--bb-font-display); font-weight: var(--bb-weight-bold); letter-spacing: -0.03em; line-height: 1.2; }
.cx-step-title + * { margin-top: 24px !important; }
.cx-step-intro { color: var(--bb-text-secondary); font-size: 16px; line-height: 1.65; }
.cx-step > * + * { margin-top: 20px; }

.cx-callout { padding: 16px 18px; border-left: 2px solid var(--bb-accent); background: var(--bb-accent-soft); border-radius: 0 var(--bb-radius-sm) var(--bb-radius-sm) 0; font-size: var(--bb-fs-body); line-height: 1.65; }
.cx-callout.is-mistake { border-left-color: var(--bb-warning); background: var(--bb-warning-soft); }
.cx-callout b { display: block; margin-bottom: 4px; font-size: 13px; letter-spacing: 0.02em; }

.cx-video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); background: var(--bb-surface-subtle); }
.cx-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cx-video.is-pending { display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.cx-video.is-pending i { color: var(--bb-text-tertiary); font-size: 30px; }
.cx-video.is-pending p { max-width: 40ch; color: var(--bb-text-secondary); font-size: var(--bb-fs-body); }
.cx-video.is-pending b { color: var(--bb-text); }
.cx-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 24px; margin-top: 16px; }
.cx-chapters li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--bb-border); font-size: 14px; }
.cx-chapters code { min-width: 40px; color: var(--bb-text-tertiary); font-size: 13px; }

.cx-q { padding: 22px 0; border-bottom: 1px solid var(--bb-border); }
.cx-q:first-of-type { padding-top: 0; }
.cx-q-head { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; }
.cx-q-no { padding-top: 4px; color: var(--bb-text-tertiary); font: 500 13px/1 var(--bb-font-mono); }
.cx-q-head .cx-prose { font-size: 16px; }
.cx-q-head .cx-prose pre { font-size: var(--bb-fs-body-sm); }
.cx-options { display: grid; gap: 8px; margin: 16px 0 0 44px !important; }
.cx-options li { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 10px; padding: 11px 14px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius-sm); font-size: var(--bb-fs-body); line-height: 1.5; }
.cx-options li > span:last-child { white-space: pre-line; }  /* options like "Hi
Python" must keep their line break */
.cx-opt-key { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--bb-border-strong); border-radius: var(--bb-radius-xs); color: var(--bb-text-secondary); font: 500 11px/1 var(--bb-font-mono); }

.cx-soon { display: flex; align-items: center; gap: 10px; color: var(--bb-text-tertiary); font-size: 14px; font-weight: 600; }
.cx-soon i { color: var(--bb-warning); }

.cx-editor { overflow: hidden; border: 1px solid var(--bb-border); border-radius: var(--bb-radius-sm); background: var(--bb-surface-subtle); }
.cx-editor-bar { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--bb-border); color: var(--bb-text-tertiary); font: 500 12px/1 var(--bb-font-mono); }
.cx-editor-run { display: inline-flex; align-items: center; gap: 6px; color: var(--bb-text-secondary); }
.cx-editor .cx-code { border: 0; border-radius: 0; background: transparent; }
.cx-task { display: grid; gap: 18px; }

.cx-parsons { display: grid; gap: 6px; }
.cx-parsons li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--bb-border-strong); border-radius: var(--bb-radius-sm); background: var(--bb-surface); }
.cx-parsons i { color: var(--bb-text-tertiary); }
.cx-parsons code { font-size: 14px; white-space: pre; overflow-x: auto; }

.cx-next { margin-top: 80px; padding: 32px; border: 1px solid var(--bb-border-strong); border-radius: var(--bb-radius-md); background: var(--bb-surface); }
.cx-next h2 { font-size: var(--bb-fs-h3); font-family: var(--bb-font-display); font-weight: var(--bb-weight-semibold); letter-spacing: -0.03em; }
.cx-next p { margin-top: 8px !important; color: var(--bb-text-secondary); }
.cx-next .btn { margin-top: 20px; }

.cx-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.cx-pager-link { display: grid; gap: 6px; padding: 16px 0; border-top: 1px solid var(--bb-border); }
.cx-pager-link span { color: var(--bb-text-tertiary); font: 600 12px/1 var(--bb-font-sans); letter-spacing: 0.01em; }
.cx-pager-link b { font-size: var(--bb-fs-body); line-height: 1.4; }
.cx-pager-link:hover b { color: var(--bb-text); text-decoration: underline; text-decoration-color: var(--bb-accent); text-underline-offset: 3px; }
.cx-pager-link.is-next { text-align: right; }

.cx-toc-inner { position: sticky; top: 92px; margin-top: 48px; }
.cx-toc ol { display: grid; gap: 2px; margin-top: 14px; border-left: 1px solid var(--bb-border); }
.cx-toc a { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; margin-left: -1px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; color: var(--bb-text-secondary); font-size: var(--bb-fs-body); line-height: 1.4; transition: color 0.2s ease, border-color 0.2s ease; }
.cx-toc a i { color: var(--bb-text-tertiary); font-size: 13px; line-height: 1.4; }
.cx-toc a:hover { color: var(--bb-text); }
.cx-toc a.is-active { color: var(--bb-text); border-left-color: var(--bb-accent); }
.cx-toc a.is-active i { color: var(--bb-accent); }

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

/* ── Progress bar ────────────────────────────────────────────── */
.cx-bar {
  display: block; position: relative; height: 6px; overflow: hidden;
  border-radius: var(--bb-radius-full); background: var(--bb-border);
}
.cx-bar > span {
  display: block; height: 100%; min-width: 0; border-radius: inherit;
  background: var(--bb-warning); transition: width 0.6s var(--bb-ease);
}
.cx-bar.is-full > span { background: var(--bb-success); }
.cx-bar.is-big { height: 10px; }
.cx-bar.is-big > span { background: var(--bb-accent); }

/* ── Side cards (learning days, includes) ─────────────────────── */
.cx-sidecard { display: grid; gap: 12px; padding: 22px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); background: var(--bb-surface); }
.cx-sidecard > .mono-label { margin: 0; }
.cx-sidecard .cx-includes { margin: 0; padding: 0; border: 0; }
.cx-includes { display: grid; gap: 12px; }
.cx-includes div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.cx-includes dt { display: flex; align-items: center; gap: 10px; color: var(--bb-text-secondary); font-weight: 600; }
.cx-includes dt i { color: var(--bb-text-tertiary); font-size: 15px; }
.cx-includes dd { margin: 0; font: 500 14px/1.4 var(--bb-font-mono); }

/* Activity (learning days) */
.cx-act-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.cx-act-stats div { display: grid; gap: 4px; }
.cx-act-stats dt { color: var(--bb-text-tertiary); font-size: 11px; font-weight: 700; line-height: 1.3; }
.cx-act-stats dd { margin: 0; font-size: var(--bb-fs-h2); font-weight: var(--bb-weight-bold); letter-spacing: -0.03em; line-height: 1; }
.cx-act-stats dd small { color: var(--bb-text-secondary); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.cx-act-stats .is-streak i { margin-right: 3px; color: var(--bb-warning); font-size: 19px; }
.cx-act-cal { display: grid; gap: 10px; }
.cx-act-dots { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; max-width: 280px; }
.cx-act-dots li { aspect-ratio: 1; border-radius: var(--bb-radius-xs); background: var(--bb-border); }
.cx-act-dots li.is-on { background: var(--bb-accent); }
.cx-act-dots li.is-today { box-shadow: 0 0 0 1.5px var(--bb-bg), 0 0 0 3px var(--bb-border-strong); }
.cx-act-note { color: var(--bb-text-secondary); font-size: 13px; line-height: 1.5; }
.cx-act-note i { color: var(--bb-accent); }

.cx-act.is-wide { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; grid-template-areas: "h h" "s c"; column-gap: 32px; align-content: stretch; }
.cx-act.is-wide .cx-act-stats, .cx-act.is-wide .cx-act-cal { align-self: end; }
.cx-act.is-wide > .mono-label { grid-area: h; }
.cx-act.is-wide .cx-act-stats { grid-area: s; gap: 24px; }
.cx-act.is-wide .cx-act-cal { grid-area: c; }
.cx-act.is-wide .cx-act-dots { width: 252px; }

.cx-prereqs { display: grid; gap: 8px; }
.cx-prereqs a { color: var(--bb-text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--bb-accent); text-underline-offset: 3px; }
.cx-before-ok { display: flex; align-items: center; gap: 8px; font-size: var(--bb-fs-body); font-weight: var(--bb-weight-semibold); }
.cx-before-ok i { color: var(--bb-accent); font-size: 18px; }

/* ── Catalog: welcome strip and course cards ─────────────────── */
.cx-head-me { padding-bottom: 40px; }
.cx-title-me { max-width: none; font-size: var(--bb-fs-display); }
.cx-me-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-top: 32px; align-items: start; }
.cx-me-grid .cx-act.is-wide { row-gap: 20px; }
.cx-me-act { margin-top: 28px; max-width: 760px; }
.cx-resume {
  display: grid; gap: 10px; align-content: start; padding: 22px;
  border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); background: var(--bb-surface);
  transition: border-color 0.2s ease;
}
a.cx-resume:hover { border-color: var(--bb-accent); }
.cx-resume .mono-label { margin: 0; }
.cx-resume-title { font-size: var(--bb-fs-h3); font-family: var(--bb-font-display); font-weight: var(--bb-weight-semibold); letter-spacing: -0.02em; line-height: 1.25; }
.cx-resume-sub { color: var(--bb-text-secondary); font-size: 14px; line-height: 1.5; }
.cx-resume-meta { color: var(--bb-text-secondary); font-size: 13px; font-weight: 600; }
.cx-resume-meta b { color: var(--bb-text); }
.cx-resume-go { display: inline-flex; align-items: center; gap: 6px; color: var(--bb-text); font-size: 14px; font-weight: 700; text-decoration: underline; text-decoration-color: var(--bb-accent); text-underline-offset: 3px; }

.cx-cards { display: grid; gap: 12px; }
.cx-cards > li.is-dim { opacity: 0.45; }
.cx-ccard {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 22px 24px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius-md); background: var(--bb-surface);
  transition: border-color 0.2s ease;
}
.cx-ccard:hover { border-color: var(--bb-border-strong); }
.cx-ccard.is-enrolled { border-color: var(--bb-success); }
.cx-ccard-no { align-self: start; padding-top: 32px; color: var(--bb-text-tertiary); font: 500 13px/1 var(--bb-font-mono); }
.cx-ccard-body { display: grid; gap: 7px; min-width: 0; }
.cx-ccard-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-ccard-title { font-size: var(--bb-fs-h4); font-family: var(--bb-font-display); font-weight: var(--bb-weight-semibold); letter-spacing: -0.025em; line-height: 1.2; transition: color 0.2s ease; }
.cx-ccard:hover .cx-ccard-title { color: var(--bb-text); text-decoration: underline; text-decoration-color: var(--bb-accent); text-underline-offset: 3px; }
.cx-ccard-sub { color: var(--bb-text-secondary); font-size: var(--bb-fs-body); line-height: 1.5; }
.cx-ccard-prog { display: grid; gap: 6px; max-width: 420px; margin-top: 6px; }
.cx-ccard-prog-text { color: var(--bb-text-secondary); font-size: 13px; font-weight: 600; }
.cx-ccard-prog-text b { color: var(--bb-text); }
.cx-ccard-go { display: inline-flex; align-items: center; gap: 6px; color: var(--bb-text-secondary); font-size: 14px; font-weight: 700; white-space: nowrap; }
.cx-ccard:hover .cx-ccard-go { color: var(--bb-text); text-decoration: underline; text-decoration-color: var(--bb-accent); text-underline-offset: 3px; }
.cx-learning .cx-ccard-prog { margin-top: 4px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .cx { --aside: 300px; }
  .cx-layout-lesson { grid-template-columns: minmax(0, 1fr); }
  .cx-layout-lesson .cx-toc { display: none; }
}

@media (max-width: 1023px) {
  .cx-layout { grid-template-columns: minmax(0, 1fr); }
  .cx-me-grid { grid-template-columns: minmax(0, 1fr); }
  .cx-cat { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  body.has-mbar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .has-mbar .cx-mbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-top: 1px solid var(--bb-border-strong); background: var(--bb-bg);
  }
  .cx-mbar-price { display: grid; gap: 2px; min-width: 0; }
  .cx-mbar-price b { font-size: var(--bb-fs-h3); font-weight: var(--bb-weight-bold); letter-spacing: -0.02em; }
  .cx-mbar-price span { color: var(--bb-text-secondary); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cx-mbar .cx-actions { margin: 0; flex: 0 0 auto; }
  .cx-mbar .btn { width: auto; }
}

@media (max-width: 767px) {
  .shell { width: min(calc(100% - 32px), var(--max)); }
  .cx-item { grid-template-columns: 30px minmax(0, 1fr); gap: 12px; margin: 0; padding: 18px 0; }
  .cx-item.is-static { grid-template-columns: 30px minmax(0, 1fr); }
  .cx-item-tags { grid-column: 2; }
  .cx-item-go { display: none; }
  .cx-options { margin-left: 0 !important; }
  .cx-ccard { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px; }
  .cx-ccard-no { display: none; }
  .cx-act.is-wide { grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "s" "c"; row-gap: 16px; }
  .cx-act.is-wide .cx-act-dots { width: auto; max-width: none; }
  .cx-act-dots { max-width: none; }
  .cx-pager { grid-template-columns: 1fr; }
  .cx-pager-link.is-next { text-align: left; }
  .cx-next { padding: 24px; }
  .cx-draft a { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cx-item-go, .cx-ccard-go i, .cx-bar > span { transition: none; }
}

@media print {
  .nav, .footer, .cx-aside, .cx-mbar, .cx-toc, .cx-soon, .cx-next, .cx-pager { display: none !important; }
  .cx-layout { display: block; }
}

/* ── Callouts from the content sheet ("## Common mistakes", "Tip:") ── */
.cx-callout > * + * { margin-top: 0.5em !important; }
.cx-callout-title { margin: 0 0 4px !important; color: var(--bb-text); font: 600 12px/1.3 var(--bb-font-sans); letter-spacing: 0.01em; }
.cx-callout.is-mistake .cx-callout-title { color: var(--bb-warning); }
.cx-callout.is-tip .cx-callout-title { color: var(--bb-text); }
.cx-callout.is-note { border-left-color: var(--bb-info); background: var(--bb-info-soft); }
.cx-callout.is-note .cx-callout-title { color: var(--bb-info); }
.cx-callout ul { padding-left: 1.2em; list-style: disc; }
.cx-callout li + li { margin-top: 0.3em; }

/* ── Syntax highlighting (Pygments class names; same palette as the Monaco themes) ── */
.cx-hl pre { margin: 0; }
.cx-hl .k, .cx-hl .kn, .cx-hl .kd, .cx-hl .kr, .cx-hl .kw, .cx-hl .ow { color: var(--bb-info); }
.cx-hl .kc, .cx-hl .bp { color: var(--bb-info); }
.cx-hl .s, .cx-hl .s1, .cx-hl .s2, .cx-hl .sa, .cx-hl .sb, .cx-hl .sd, .cx-hl .sh, .cx-hl .si, .cx-hl .sx, .cx-hl .sc, .cx-hl .dl { color: var(--bb-warning); }
.cx-hl .se { color: var(--bb-info); }
.cx-hl .m, .cx-hl .mi, .cx-hl .mf, .cx-hl .mh, .cx-hl .mo, .cx-hl .il { color: var(--bb-info); }
.cx-hl .c, .cx-hl .c1, .cx-hl .cm, .cx-hl .ch, .cx-hl .cs, .cx-hl .cp, .cx-hl .cpf { color: var(--bb-text-tertiary); font-style: italic; }
.cx-hl .nb, .cx-hl .nf, .cx-hl .fm, .cx-hl .nc, .cx-hl .nn, .cx-hl .nd, .cx-hl .ne { color: var(--bb-text-secondary); }
.cx-hl .o, .cx-hl .p { color: var(--bb-text-secondary); }
.cx-hl .gp { color: var(--bb-text-tertiary); user-select: none; }
.cx-hl .err { color: inherit; background: none; }

/* ── Images and animations in notes: ![caption](https://…) ── */
.cx-media { margin: 1.4em 0 !important; }
.cx-media img, .cx-media video { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--bb-border); border-radius: var(--bb-radius-sm); background: var(--bb-surface-subtle); }
.cx-media figcaption { margin-top: 8px; color: var(--bb-text-secondary); font-size: 13px; line-height: 1.5; text-align: center; }
.cx-prose p img { display: inline-block; max-height: 1.6em; vertical-align: middle; }
@media (prefers-reduced-motion: reduce) { .cx-media video { animation: none; } }

/* ══════════════════════════════════════════════════════════════
   Phase 1 · Catalogue — Quiet Workbench
   Editorial catalogue with a resume-first hero, progressive
   filters, a deliberate learning-path section, and calmer cards.
   ══════════════════════════════════════════════════════════════ */

/* Learning paths */
.catalog-paths {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(0, 2fr);
  gap: var(--bb-space-6);
  align-items: start;
  padding: var(--bb-space-8) 0;
  border-bottom: 1px solid var(--bb-border);
}
.catalog-paths__heading p {
  max-width: 36ch;
  margin-top: var(--bb-space-2) !important;
  color: var(--bb-text-secondary);
  font-size: var(--bb-fs-body);
}
.catalog-paths ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bb-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.catalog-paths .cx-chip {
  height: auto;
  min-height: var(--bb-space-8);
  padding: var(--bb-space-2) var(--bb-space-4);
  border-radius: var(--bb-radius-sm);
  font-size: var(--bb-fs-label);
  transition: color var(--bb-dur-fast) var(--bb-ease), border-color var(--bb-dur-fast) var(--bb-ease), background var(--bb-dur-fast) var(--bb-ease);
}
.catalog-path {
  display: grid;
  grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 1.5fr);
  gap: var(--bb-space-8);
  margin-top: var(--bb-space-8);
  padding: var(--bb-space-8);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-lg);
  background: var(--bb-surface-subtle);
}
.catalog-path__intro h2 {
  margin-top: var(--bb-space-2) !important;
  font-size: var(--bb-fs-h2);
  font-family: var(--bb-font-display);
  font-weight: var(--bb-weight-semibold);
  letter-spacing: -0.02em;
}
.catalog-path__intro p {
  margin-top: var(--bb-space-3) !important;
  color: var(--bb-text-secondary);
  font-size: var(--bb-fs-body);
}
.catalog-path__courses {
  margin: 0;
  padding: 0;
  list-style: none;
}
.catalog-path__courses li + li { border-top: 1px solid var(--bb-border); }
.catalog-path__courses a {
  display: grid;
  grid-template-columns: var(--bb-space-8) minmax(0, 1fr) auto;
  gap: var(--bb-space-4);
  align-items: center;
  min-height: var(--bb-space-12);
  padding: var(--bb-space-3) 0;
  color: var(--bb-text);
}
.catalog-path__courses a:hover b {
  text-decoration: underline;
  text-decoration-color: var(--bb-accent);
  text-underline-offset: var(--bb-space-1);
}
.catalog-path__number {
  color: var(--bb-text-tertiary);
  font: var(--bb-weight-semibold) var(--bb-fs-body-sm) / 1.4 var(--bb-font-mono);
}
.catalog-path__courses b {
  display: block;
  font-size: var(--bb-fs-body);
}
.catalog-path__courses small {
  display: block;
  margin-top: var(--bb-space-1);
  color: var(--bb-text-secondary);
  font-size: var(--bb-fs-body-sm);
}
.catalog-path__courses i { color: var(--bb-text-tertiary); }

/* Catalogue filters and results */
.js .catalog-filters { display: grid; }

.catalog-filters {
  display: none;
  grid-template-columns: minmax(14rem, 2fr) repeat(3, minmax(9rem, 1fr)) auto;
  gap: var(--bb-space-3);
  align-items: end;
  margin-top: var(--bb-space-6);
  padding: var(--bb-space-4);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-md);
  background: var(--bb-surface);
}
.catalog-filters label {
  display: block;
  margin-bottom: var(--bb-space-1);
  color: var(--bb-text-secondary);
  font-size: var(--bb-fs-caption);
  font-weight: var(--bb-weight-semibold);
}
.catalog-filters input,
.catalog-filters select {
  width: 100%;
  min-height: var(--bb-space-8);
  padding: 0 var(--bb-space-3);
  border: 1px solid var(--bb-border-control);
  border-radius: var(--bb-radius-sm);
  background: var(--bb-bg);
  color: var(--bb-text);
  font: var(--bb-weight-regular) var(--bb-fs-body) / 1.4 var(--bb-font-sans);
}
.catalog-filters input::placeholder { color: var(--bb-text-tertiary); }

/* Course cards */
.course-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  height: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-md);
  background: var(--bb-surface);
  transition: transform var(--bb-dur-fast) var(--bb-ease), border-color var(--bb-dur-fast) var(--bb-ease), box-shadow var(--bb-dur-fast) var(--bb-ease);
}
.course-card:hover {
  border-color: var(--bb-border-strong);
  box-shadow: var(--bb-shadow-1);
  transform: translateY(-2px);
}
.course-card:active { transform: translateY(0); }

/* Focus visibility and responsive catalogue */
.catalog-paths a:focus-visible,
.catalog-path a:focus-visible,
.catalog-filters input:focus-visible,
.catalog-filters select:focus-visible,
.course-card:focus-visible {
  outline: 2px solid var(--bb-focus-ring);
  outline-offset: 2px;
}

@media (max-width: 1023px) {

  .catalog-paths,
  .catalog-path {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 767px) {

  .catalog-paths,
  .catalog-path { padding: var(--bb-space-6); }

  .catalog-filters { grid-template-columns: minmax(0, 1fr); }

}

@media (prefers-reduced-motion: reduce) {
  .course-card { transition: none; }
  .course-card:hover { transform: none; }
}

/* ── My learning: resume card ── */
.cx-resume {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px;
  margin-bottom: 28px; padding: 20px 24px; border: 1px solid var(--bb-border-strong); border-radius: var(--bb-radius-md);
  background: var(--bb-surface); color: var(--bb-text); text-decoration: none;
  transition: border-color 0.2s var(--bb-ease), transform 0.2s var(--bb-ease);
}
.cx-resume:hover { border-color: var(--bb-accent); transform: translateY(-2px); }
.cx-resume:focus-visible { outline: 2px solid var(--bb-accent); outline-offset: 3px; }
.cx-resume-ring {
  display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
  background: conic-gradient(var(--bb-accent) calc(var(--p) * 1%), var(--bb-border) 0);
  -webkit-mask: radial-gradient(circle 29px at center, transparent 98%, #000 100%);
          mask: radial-gradient(circle 29px at center, transparent 98%, #000 100%);
}
.cx-resume-ring b { display: none; }
.cx-resume-body { display: grid; gap: 4px; min-width: 0; }
.cx-resume-course { font: var(--bb-weight-bold) var(--bb-fs-h4)/1.25 var(--bb-font-display); letter-spacing: -0.02em; }
.cx-resume-next { overflow: hidden; color: var(--bb-text-secondary); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.cx-resume-go { gap: 8px; }
.cx-resume:hover .cx-resume-go i { transform: translateX(3px); }
.cx-resume-go i { transition: transform 0.2s var(--bb-ease); }
@media (max-width: 599px) {
  .cx-resume { grid-template-columns: auto minmax(0, 1fr); }
  .cx-resume-go { grid-column: 1 / -1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .cx-resume, .cx-resume-go i { transition: none; } .cx-resume:hover { transform: none; } }
