/* ============================================================
   Inverter Course — applied brand from kristianskorpen.com
   Extends colors_and_type.css + global.css patterns with the
   course-shell layout (sticky sidebar TOC, interactive widgets).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* brand colors */
  --green-50:  #ECF6EE;
  --green-100: #D5EBD9;
  --green-200: #A8D6B0;
  --green-300: #7BC086;
  --green-400: #4FAB5F;
  --green-500: #1F8A4C;
  --green-600: #166E3D;
  --green-700: #0E5630;
  --green-800: #093D22;
  --green-900: #062818;
  --green-lime: #56C24A;

  --ink-1000: #0A0F0D;
  --ink-900:  #0E1413;
  --ink-700:  #2E3633;
  --ink-500:  #5A645F;
  --ink-400:  #7B847F;
  --ink-300:  #A8AEA9;
  --ink-200:  #D6D9D4;
  --ink-150:  #E6E5DE;
  --ink-100:  #EFEDE5;
  --ink-50:   #F7F5EE;
  --ink-25:   #FAFAF6;
  --paper:    #FFFFFF;

  --blue-500: #0B5D8A;
  --blue-600: #07436A;
  --blue-100: #DDEBF4;

  --warn-500: #B04A1B;
  --warn-100: #FAEADD;
  --ok-500:   #1F7A4B;
  --ok-100:   #E0EFD9;
  --info-500: #1A4B7A;
  --info-100: #E2ECF7;
  --danger-500:#A8324A;
  --danger-100:#F5D9DA;

  --code-bg:  #11161A;
  --code-fg:  #E6EDF3;
  --code-line: #B6E3C8;

  /* semantic */
  --fg:        var(--ink-900);
  --fg-soft:   var(--ink-500);
  --fg-muted:  var(--ink-400);
  --bg:        var(--ink-25);
  --bg-card:   var(--paper);
  --bg-paper:  var(--ink-50);
  --bg-inset:  var(--ink-100);
  --border:    var(--ink-150);
  --border-strong: var(--ink-200);

  --accent:       var(--green-500);
  --accent-hover: var(--green-600);
  --accent-soft:  var(--green-50);

  --link:       var(--blue-500);
  --link-hover: var(--blue-600);

  /* type */
  --font-serif: "IBM Plex Serif", "Source Serif 4", Charter, Georgia, serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:  "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  /* sizes (match brand scale) */
  --fs-12: 0.75rem;
  --fs-13: 0.8125rem;
  --fs-14: 0.875rem;
  --fs-15: 0.9375rem;
  --fs-17: 1.0625rem;
  --fs-19: 1.1875rem;
  --fs-22: 1.375rem;
  --fs-26: 1.625rem;
  --fs-32: 2rem;
  --fs-44: 2.75rem;

  --radius-1: 4px;
  --radius-2: 6px;
  --radius-3: 8px;
  --radius-4: 12px;

  --shadow-1: 0 1px 2px rgba(10,15,13,0.04), 0 0 0 1px rgba(10,15,13,0.02);
  --shadow-2: 0 2px 6px rgba(10,15,13,0.06), 0 1px 2px rgba(10,15,13,0.04);
  --shadow-3: 0 8px 24px -8px rgba(10,15,13,0.12), 0 2px 6px rgba(10,15,13,0.06);
  --shadow-focus: 0 0 0 3px rgba(31,138,76,0.25);

  --dur-fast: 120ms;
  --dur-base: 180ms;
  --ease-standard: cubic-bezier(0.2,0,0.2,1);

  --content-max: 760px;
  --wide-max: 1120px;
  --sidebar-w: 256px;
  --rail-w: 260px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-17);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--green-100); color: var(--ink-1000); }

/* ============================================================
   HEADER — matches header.site from the real site
   ============================================================ */

header.site {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(250, 250, 246, 0.92);
}
header.site .inner {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink-900);
}
.brand img { height: 30px; width: auto; display: block; }
.brand .name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 17px;
  line-height: 1;
}
header.site nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}
header.site nav a {
  color: var(--ink-900);
  text-decoration: none;
  font-size: 14.5px;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color var(--dur-fast);
}
header.site nav a:hover {
  border-bottom-color: var(--ink-300);
}
header.site nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
}
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--paper);
  font-size: 13px;
  color: var(--ink-700);
  cursor: pointer;
}
.member-chip .av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink-900);
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.member-chip .ok {
  color: var(--ok-500);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ============================================================
   ACCESS BANNER (auth-gate stub)
   ============================================================ */
.access-banner {
  background: var(--green-50);
  border-bottom: 1px solid var(--green-200);
  font-size: 13.5px;
  color: var(--ink-700);
}
.access-banner .inner {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.access-banner .lock {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--green-500);
  color: white;
  display: grid; place-items: center;
}
.access-banner strong { color: var(--ink-900); font-weight: 600; }
.access-banner .sp { flex: 1; }
.access-banner a {
  color: var(--green-600);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.access-banner a:hover { color: var(--green-700); }

/* ============================================================
   COURSE SHELL — content + sticky TOC
   ============================================================ */
.shell {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 28px 22px 80px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
  padding-right: 8px;
  font-size: 14px;
}
.sidebar-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin: 0 0 12px;
  padding: 0 6px;
}
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-chapter { margin-bottom: 2px; }
.toc-chapter > a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 8px;
  text-decoration: none;
  color: var(--ink-900);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.3;
  border-radius: var(--radius-2);
  border-left: 2px solid transparent;
  margin-left: -2px;
}
.toc-chapter > a:hover { background: var(--bg-paper); }
.toc-chapter > a.active {
  background: var(--green-50);
  color: var(--green-700);
  border-left-color: var(--green-500);
}
.toc-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 500;
  min-width: 22px;
}
.toc-chapter > a.active .toc-num { color: var(--green-600); }
.toc-sublist {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0 0 0 32px;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}
.toc-sublist a {
  display: block;
  padding: 4px 10px;
  text-decoration: none;
  color: var(--fg-soft);
  font-size: 13px;
  line-height: 1.4;
  border-left: 1px solid transparent;
  margin-left: -1px;
}
.toc-sublist a:hover { color: var(--ink-900); }
.toc-sublist a.active {
  color: var(--green-600);
  border-left-color: var(--green-500);
}
.sidebar-footer {
  margin-top: 24px;
  padding: 16px 6px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--fg-muted);
}
.sidebar-footer a { color: var(--ink-700); text-decoration: none; }
.sidebar-footer a:hover { color: var(--accent); }

/* progress meter */
.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}
.progress-bar {
  flex: 1;
  height: 3px;
  background: var(--ink-100);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--green-500);
  transition: width 200ms ease-out;
}

/* ============================================================
   CONTENT
   ============================================================ */
.content {
  min-width: 0;
  max-width: var(--content-max);
}

.breadcrumb {
  font-size: 13px;
  color: var(--fg-soft);
  margin: 0 0 18px;
}
.breadcrumb a {
  color: var(--fg-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.breadcrumb a:hover { color: var(--accent); border-bottom-color: currentColor; }

/* hero */
.course-hero {
  padding: 0 0 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.badge {
  display: inline-flex;
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  font-weight: 500;
  margin-bottom: 14px;
  letter-spacing: 0;
}
.badge.course { background: var(--danger-100); color: var(--danger-500); }
.badge.paid { background: #FAE5CF; color: #7A3A0E; }
.badge.free { background: var(--green-50); color: var(--green-700); }
.course-hero h1 {
  font-family: var(--font-serif);
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--ink-900);
  text-wrap: balance;
  max-width: 16em;
}
.course-hero .lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--fg-soft);
  margin: 0 0 22px;
  max-width: 36em;
  text-wrap: pretty;
}
.meta-row {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--fg-soft);
  margin-top: 14px;
}
.meta-row > div strong {
  display: block;
  font-family: var(--font-serif);
  color: var(--ink-900);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 1px;
}

/* chapter */
.chapter { scroll-margin-top: 84px; padding-top: 56px; }
.chapter:first-of-type { padding-top: 0; }
.chapter-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.chapter-title {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--ink-900);
  text-wrap: balance;
}
.chapter-intro {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-700);
  margin: 0 0 28px;
  max-width: 36em;
  text-wrap: pretty;
}

/* sections */
.content h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 48px 0 12px;
  color: var(--ink-900);
  scroll-margin-top: 84px;
}
.content h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
  margin: 32px 0 10px;
  color: var(--ink-900);
  scroll-margin-top: 84px;
}
.content h4 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  margin: 22px 0 8px;
  color: var(--ink-900);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.content p {
  margin: 0 0 14px;
  max-width: 38em;
  text-wrap: pretty;
}
.content strong { font-weight: 600; color: var(--ink-900); }
.content em { font-style: italic; }

/* lists */
.content ul, .content ol { margin: 0 0 16px; padding-left: 1.3em; max-width: 38em; }
.content li { margin-bottom: 6px; }

/* links */
.content a:not(.btn):not(.btn-sim):not(.chapter-nav a) {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--link) 35%, transparent);
  padding-bottom: 1px;
  transition: border-color var(--dur-fast);
}
.content a:not(.btn):not(.btn-sim):hover { border-bottom-color: var(--link); }
/* simulator button: white text on green, no link underline/color override */
.btn-sim, .btn-sim:link, .btn-sim:visited { color: #fff; border-bottom: none; }

/* hr */
.content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* inline code */
.content code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--ink-100);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-1);
  color: var(--ink-900);
}

/* ============================================================
   FIGURES (paper card + grid background)
   ============================================================ */
.figure {
  margin: 24px 0 28px;
}
.figure-frame {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  padding: 28px 32px;
  position: relative;
  background-image:
    linear-gradient(rgba(14,20,19,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,20,19,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  display: grid;
  place-items: center;
  min-height: 120px;
}
.figure-frame img,
.figure-frame svg {
  max-width: 100%;
  height: auto;
  display: block;
  filter: contrast(1.04);
}
.figure-corners > span {
  position: absolute;
  width: 10px; height: 10px;
  border: 2px solid var(--accent);
}
.figure-corners .tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.figure-corners .tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.figure-corners .bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.figure-corners .br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.figure-caption {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 12px;
  font-style: italic;
  max-width: 38em;
}
.figure-caption .num {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-700);
  font-weight: 500;
  white-space: nowrap;
  padding-top: 2px;
}

/* ============================================================
   CODE BLOCKS — scope panel style
   ============================================================ */
.codeblock {
  position: relative;
  margin: 18px 0 24px;
  background: var(--code-bg);
  border-radius: var(--radius-2);
  border-top: 2px solid var(--green-lime);
  overflow: hidden;
}
.codeblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.codeblock-head .lang {
  display: flex;
  align-items: center;
  gap: 8px;
}
.codeblock-head .lang::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green-lime);
}
.codeblock-copy {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all var(--dur-fast);
}
.codeblock-copy:hover {
  border-color: rgba(255,255,255,0.5);
  color: white;
}
.codeblock-copy.copied {
  border-color: var(--green-lime);
  color: var(--green-lime);
}
.codeblock pre {
  margin: 0;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--code-fg);
  overflow-x: auto;
  background: var(--code-bg);
  border-top: none;
  border-radius: 0;
}
.codeblock pre code { background: transparent; padding: 0; color: inherit; }

/* simple syntax tokens for code blocks (dark) */
.tok-k { color: #C49DDF; }
.tok-s { color: #E0B074; }
.tok-c { color: #6E7681; font-style: italic; }
.tok-n { color: #9EBFE0; }
.tok-f { color: #A1D08F; }
.tok-o { color: #C9D1D9; }

/* code output (matplotlib screenshots inline) */
.code-output {
  margin: -18px 0 24px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-2) var(--radius-2);
  text-align: center;
}
.code-output-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  margin-bottom: 10px;
  text-align: left;
}
.code-output img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* ============================================================
   CALLOUTS (match brand)
   ============================================================ */
.callout {
  padding: 14px 18px;
  border-radius: var(--radius-2);
  border-left: 3px solid;
  margin: 22px 0;
  background: var(--ok-100);
  border-left-color: var(--ok-500);
}
.callout.warn { background: var(--warn-100); border-left-color: var(--warn-500); }
.callout.info { background: var(--info-100); border-left-color: var(--info-500); }
.callout.def { background: var(--bg-paper); border-left-color: var(--ink-300); }
.callout strong.title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 15px;
  display: block;
  margin-bottom: 4px;
  color: var(--ink-900);
}
.callout p { margin: 0 0 6px; font-size: 14.5px; color: var(--ink-700); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout ul { font-size: 14.5px; color: var(--ink-700); margin: 0; }

/* ============================================================
   PROS / CONS
   ============================================================ */
.proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 26px;
}
.proscons > div {
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  padding: 14px 16px;
  background: var(--paper);
}
.proscons h5 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 10px;
}
.proscons .pros h5 { color: var(--ok-500); }
.proscons .cons h5 { color: var(--danger-500); }
.proscons ul { margin: 0; padding-left: 1.2em; font-size: 13.5px; color: var(--ink-700); }
.proscons li { margin-bottom: 4px; }

/* ============================================================
   TABLES
   ============================================================ */
.notation-table, .compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
  max-width: 38em;
}
.notation-table th, .compare-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-soft);
  font-weight: 500;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-strong);
}
.notation-table td, .compare-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.4;
}
.notation-table td:first-child {
  font-family: var(--font-mono);
  white-space: nowrap;
  color: var(--green-600);
  width: 28%;
}
.notation-table td:last-child {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  width: 12%;
}

/* ============================================================
   MATH (KaTeX)
   ============================================================ */
.katex { font-size: 1.04em !important; }
.katex-display {
  margin: 18px 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
}
.katex-display > .katex {
  font-size: 1.14em !important;
}

/* ============================================================
   INTERACTIVE WIDGETS — match the engineering-doc voice
   ============================================================ */
.widget {
  margin: 26px 0 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  position: relative;
}
.widget::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--green-lime);
}
.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px 13px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-paper);
}
.widget-head-title { display: flex; align-items: baseline; gap: 10px; }
.widget-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green-600);
  font-weight: 600;
}
.widget-name {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-900);
}
.widget-hint {
  font-size: 12px;
  color: var(--fg-soft);
  font-family: var(--font-mono);
}
.widget-body { padding: 22px 22px 24px; }
.widget-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .widget-grid { grid-template-columns: 1fr; }
}

/* slider */
.slider-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.slider-row:last-child { margin-bottom: 0; }
.slider-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
}
.slider-label .key { font-family: var(--font-mono); color: var(--ink-700); }
.slider-label .val {
  font-family: var(--font-mono);
  color: var(--green-600);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track,
input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--border-strong);
  border-radius: 100px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px;
  background: var(--paper);
  border: 2px solid var(--green-500);
  border-radius: 50%;
  margin-top: -6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 80ms;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--paper);
  border: 2px solid var(--green-500);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.3); }

.widget-controls {
  border-left: 1px solid var(--border);
  padding-left: 22px;
}
@media (max-width: 1100px) {
  .widget-controls {
    border-left: none;
    padding-left: 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
  }
}
.widget-controls-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-soft);
  margin-bottom: 14px;
}
.widget-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.btn-mini {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  background: var(--paper);
  color: var(--ink-900);
  border-radius: var(--radius-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--dur-fast);
}
.btn-mini:hover { background: var(--bg-paper); border-color: var(--ink-700); }
.btn-mini.primary {
  background: var(--green-500);
  color: white;
  border-color: var(--green-500);
}
.btn-mini.primary:hover { background: var(--green-600); border-color: var(--green-600); }

.readouts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  font-family: var(--font-mono);
  font-size: 12px;
}
.readouts .k { color: var(--fg-soft); }
.readouts .v {
  color: var(--ink-900);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* phasor svg + chart svg */
.phasor-svg, .chart-svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--paper);
}
.phasor-svg .grid line { stroke: var(--border); stroke-width: 1; }
.phasor-svg .axis line { stroke: var(--ink-700); stroke-width: 1; }
.phasor-svg .axis text { fill: var(--fg-soft); font-family: var(--font-mono); font-size: 10px; }

.widget-explainer {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--green-50);
  border-left: 3px solid var(--green-500);
  border-radius: 0 var(--radius-2) var(--radius-2) 0;
  font-size: 13.5px;
  color: var(--ink-700);
  line-height: 1.55;
}
.widget-explainer strong { color: var(--ink-900); }

/* ============================================================
   CHAPTER NAV (prev / next)
   ============================================================ */
.chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.chapter-nav a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  text-decoration: none;
  background: var(--paper);
  transition: all var(--dur-base) var(--ease-standard);
  color: var(--ink-900);
}
.chapter-nav a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--border-strong);
}
.chapter-nav .dir {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-soft);
  margin-bottom: 3px;
}
.chapter-nav .label {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink-900);
}
.chapter-nav .next { text-align: right; }

/* ============================================================
   FOOTER — match the real footer.site
   ============================================================ */
footer.site {
  border-top: 1px solid var(--border);
  background: var(--ink-50);
  margin-top: 40px;
  padding: 48px 22px 36px;
}
footer.site .inner {
  max-width: var(--wide-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}
footer.site h4 {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-900);
  margin: 0 0 12px;
}
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site li { margin-bottom: 8px; }
footer.site a { color: var(--fg-soft); text-decoration: none; font-size: 13.5px; }
footer.site a:hover { color: var(--accent); }
footer.site p { font-size: 13.5px; color: var(--fg-soft); line-height: 1.55; margin: 0; }
footer.site .cp { margin-top: 18px; font-size: 12px; color: var(--fg-muted); }
.brandfoot { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.brandfoot img { height: 38px; width: auto; }
.brandfoot .name {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink-900);
  font-size: 16px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; gap: 24px; }
  .sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    border: 1px solid var(--border);
    border-radius: var(--radius-3);
    padding: 16px;
    background: var(--paper);
  }
  footer.site .inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .shell { padding: 22px 16px 64px; }
  .course-hero h1 { font-size: 34px; }
  .chapter-title { font-size: 26px; }
  .content h2 { font-size: 22px; }
  header.site nav { display: none; }
  .meta-row { gap: 14px; }
  footer.site .inner { grid-template-columns: 1fr; gap: 24px; }
  .proscons { grid-template-columns: 1fr; }
  .chapter-nav { grid-template-columns: 1fr; }
  .chapter-nav .next { text-align: left; }
}


/* ============================================================
   PYODIDE WIDGET — imported from pwm-styles
   ============================================================ */

.pyw {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  position: relative;
}
.pyw::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--green-lime);
}

.pyw-head {
  display: flex; align-items: baseline; gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-paper);
  flex-wrap: wrap;
}
.pyw-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-600);
  font-weight: 600;
}
.pyw-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
}
.pyw-hint {
  font-size: 12px;
  color: var(--fg-soft);
  font-family: var(--font-mono);
  margin-left: auto;
}

/* params row */
.pyw-params {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 700px) { .pyw-params { grid-template-columns: 1fr; } }

.pyw-param {
  padding: 12px 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  background: var(--bg-paper);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.pyw-param:hover { border-color: var(--border-strong); background: var(--paper); }
.pyw-param:focus-within {
  border-color: var(--green-500);
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(31,138,76,0.10);
}

.pyw-param-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
  gap: 8px;
}
.pyw-param-label .k {
  font-family: var(--font-mono);
  color: var(--ink-700);
  white-space: nowrap;
}
.pyw-param-label .k sub {
  color: var(--fg-soft);
  font-size: 0.84em;
  margin-left: 1px;
}

/* Editable value (click to type) */
.pyw-val {
  font-family: var(--font-mono);
  color: var(--green-600);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 1px 5px;
  cursor: text;
  transition: all var(--dur-fast);
  text-align: right;
  min-width: 62px;
}
.pyw-val:hover { background: var(--paper); border-color: var(--border); }
.pyw-val.editing,
.pyw-val:focus {
  outline: none;
  background: var(--paper);
  border-color: var(--green-500);
  box-shadow: 0 0 0 2px rgba(31,138,76,0.18);
  color: var(--ink-900);
}
.pyw-val.invalid {
  border-color: var(--danger-500);
  color: var(--danger-500);
  box-shadow: 0 0 0 2px rgba(168,50,74,0.15);
}

/* Slider with filled track */
.pyw-slider {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
}
.pyw-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 2;
}
/* Track — Chrome */
.pyw-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 100px;
  background: linear-gradient(
    to right,
    var(--green-500) 0%,
    var(--green-500) var(--pct, 0%),
    var(--border-strong) var(--pct, 0%),
    var(--border-strong) 100%
  );
  border: none;
}
/* Track — Firefox */
.pyw-slider input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 100px;
  background: var(--border-strong);
}
.pyw-slider input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 100px;
  background: var(--green-500);
}
/* Thumb */
.pyw-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--paper);
  border: 2px solid var(--green-500);
  border-radius: 50%;
  margin-top: -6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  cursor: grab;
  transition: transform 80ms, box-shadow 80ms;
}
.pyw-slider input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--paper);
  border: 2px solid var(--green-500);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  cursor: grab;
}
.pyw-slider input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.12);
  box-shadow: 0 2px 6px rgba(0,0,0,0.22);
}
.pyw-slider input[type="range"]:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.25);
  box-shadow: 0 0 0 6px rgba(31,138,76,0.15), 0 2px 6px rgba(0,0,0,0.22);
}
.pyw-slider input[type="range"]:focus { outline: none; }
.pyw-slider input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(31,138,76,0.25), 0 2px 6px rgba(0,0,0,0.22);
}

.pyw-param-range {
  display: flex; justify-content: space-between;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-muted);
}
.pyw-param-range button {
  background: transparent;
  border: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0;
  font-variant-numeric: tabular-nums;
}
.pyw-param-range button:hover { color: var(--ink-700); }

/* Switch (boolean toggle) — same grid cell as PyParam */
.pyw-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  cursor: pointer;
  margin: 4px 0;
}
.pyw-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.pyw-switch-track {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 100px;
  transition: background var(--dur-fast);
}
.pyw-switch-track::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: var(--paper);
  border-radius: 50%;
  transition: transform var(--dur-fast);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.pyw-switch input:checked + .pyw-switch-track {
  background: var(--green-500);
}
.pyw-switch input:checked + .pyw-switch-track::before {
  transform: translateX(22px);
}
.pyw-switch:hover .pyw-switch-track::before {
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.pyw-switch input:focus-visible + .pyw-switch-track {
  box-shadow: 0 0 0 3px rgba(31,138,76,0.25);
}
.pyw-param-toggle .pyw-param-label { margin-bottom: 6px; }

/* Pill-style code-feature toggle (e.g. "vac feedforward · on") in the toolbar row */
.pyw-feature {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  padding: 4px 11px 4px 8px;
  font-size: 12.5px;
  color: var(--ink-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  transition: all var(--dur-fast);
}
.pyw-feature .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-300);
  transition: background var(--dur-fast);
}
.pyw-feature:hover { border-color: var(--ink-700); }
.pyw-feature.on {
  border-color: var(--green-500);
  background: var(--green-50);
  color: var(--green-700);
}
.pyw-feature.on .dot { background: var(--green-500); }

/* chart area + style tabs */
.pyw-style-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
  background: var(--paper);
}
.pyw-style-tab {
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--paper);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-700);
  border-bottom: none;
  border-radius: var(--radius-2) var(--radius-2) 0 0;
  transition: all var(--dur-fast);
  position: relative;
  top: 1px;
}
.pyw-style-tab:hover { background: var(--bg-paper); }
.pyw-style-tab.active {
  background: var(--paper);
  color: var(--ink-900);
  border-color: var(--border);
  font-weight: 500;
}
.pyw-style-tab.active::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--green-500);
  border-radius: 2px 2px 0 0;
}
.pyw-style-tab .num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-muted);
  margin-right: 6px;
  font-weight: 600;
}
.pyw-style-tab.active .num { color: var(--green-500); }

.pyw-chart-frame {
  border-top: 1px solid var(--border);
  padding: 0;
  background: var(--paper);
  position: relative;
}
.pyw-chart-empty {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--fg-soft);
  font-size: 14px;
  padding: 24px;
}
.spin {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--green-500);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pyw-row {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-paper);
  font-size: 13px;
}
.pyw-row-spacer { flex: 1; }
.pyw-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-700);
  cursor: pointer;
  font-size: 13px;
}
.pyw-check input { accent-color: var(--green-500); }
.pyw-toggle {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-2);
  padding: 5px 11px;
  font-size: 13px;
  color: var(--ink-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pyw-toggle:hover { background: var(--paper); border-color: var(--ink-700); }
.pyw-toggle .chev { color: var(--fg-muted); font-size: 11px; }

.pyw-status {
  padding: 8px 18px 14px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-soft);
}
.stat { display: inline-flex; align-items: center; gap: 6px; }
.stat .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-300); }
.stat-loading .dot { background: var(--info-500); animation: pulse 1s infinite; }
.stat-running .dot { background: var(--green-500); animation: pulse 1s infinite; }
.stat-ok .dot { background: var(--green-500); }
.stat-error .dot { background: var(--danger-500); }
@keyframes pulse { 50% { opacity: 0.4; } }

.pyw-err {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--danger-100);
  color: var(--danger-500);
  border-radius: var(--radius-2);
  font-size: 11.5px;
  white-space: pre-wrap;
}

/* code area */
.pyw-codeblock {
  margin: 0;
  background: var(--code-bg);
  border-top: 1px solid var(--border);
}
.pyw-codeblock-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pyw-codeblock-head .lang { display: flex; align-items: center; gap: 8px; }
.pyw-codeblock-head .lang::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green-lime);
}
.pyw-codeblock-copy {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  cursor: pointer;
  text-transform: uppercase;
}
.pyw-codeblock-copy:hover { border-color: rgba(255,255,255,0.5); color: white; }
.pyw-codeblock-edit {
  width: 100%; margin: 0;
  padding: 14px 18px;
  background: var(--code-bg);
  color: var(--code-fg);
  border: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  outline: none;
  display: block;
  box-sizing: border-box;
  min-height: 280px;
}
.pyw-codeblock-edit:focus { background: #14191D; }

/* btn-mini matches other prototype page */
.btn-mini {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  background: var(--paper);
  color: var(--ink-900);
  border-radius: var(--radius-2);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.btn-mini:hover { background: var(--bg-paper); border-color: var(--ink-700); }
.btn-mini.primary {
  background: var(--green-500);
  color: white;
  border-color: var(--green-500);
}
.btn-mini.primary:hover { background: var(--green-600); border-color: var(--green-600); }
.btn-mini:disabled { opacity: 0.5; cursor: not-allowed; }

/* the comparison footer */
.style-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}
@media (max-width: 900px) { .style-notes { grid-template-columns: 1fr; } }
.style-note {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  padding: 18px 20px;
}
.style-note h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink-900);
}
.style-note h3 .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green-500);
  margin-right: 8px;
}
.style-note p { font-size: 13.5px; color: var(--fg-soft); margin: 0; line-height: 1.5; }
.style-note .props {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.style-note .props span {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 100px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  color: var(--ink-700);
}

/* ============================================================
   BUCK WEBCOURSE — additions
   ============================================================ */

/* "Try it in the simulator" link box */
.simlink {
  margin: 22px 0;
  border: 1px solid var(--green-200);
  border-radius: var(--radius-3);
  background: var(--green-50);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.simlink .simlink-body { flex: 1; min-width: 220px; }
.simlink-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green-600);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.simlink p { margin: 0; font-size: 14px; color: var(--ink-700); max-width: 40em; }
.btn-sim {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-500);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-2);
  border: 1px solid var(--green-500);
  white-space: nowrap;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.btn-sim:hover { background: var(--green-600); border-color: var(--green-600); transform: translateY(-1px); }
.btn-sim .arrow { font-size: 16px; line-height: 1; }

/* image-prompt callout */
.callout.imageprompt { background: var(--bg-inset); border-left-color: var(--ink-300); font-family: var(--font-mono); }
.callout.imageprompt p { font-size: 13px; color: var(--fg-soft); }

/* Sign-in-to-continue gate at ch1 -> ch2 boundary */
.continue-gate {
  margin: 48px 0 8px;
  padding: 36px 32px;
  border: 1px solid var(--green-200);
  border-radius: var(--radius-4);
  background:
    radial-gradient(120% 120% at 0% 0%, var(--green-50), var(--paper) 60%);
  text-align: center;
}
.continue-gate .lock-badge {
  width: 44px; height: 44px;
  margin: 0 auto 16px;
  border-radius: 12px;
  background: var(--green-500);
  color: #fff;
  display: grid; place-items: center;
  font-size: 22px;
}
.continue-gate h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  margin: 0 0 8px !important;
  color: var(--ink-900);
}
.continue-gate p { margin: 0 auto 20px; max-width: 34em; color: var(--fg-soft); font-size: 15.5px; }
.continue-gate .btn-continue {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--green-500);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 26px;
  border-radius: var(--radius-2);
  border: 1px solid var(--green-500);
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.continue-gate .btn-continue:hover { background: var(--green-600); transform: translateY(-1px); }
.continue-gate .gate-note { margin-top: 14px; font-size: 12.5px; color: var(--fg-muted); }
.continue-gate .gate-note a { color: var(--green-600); }

/* progress / continue banner at top of continue/ pages */
.continue-banner {
  background: var(--green-50);
  border-bottom: 1px solid var(--green-200);
  font-size: 13.5px;
}
.continue-banner .inner {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 10px 22px;
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-700);
}
.continue-banner a { color: var(--green-600); text-decoration: none; font-weight: 500; border-bottom: 1px solid currentColor; }
