/* =========================================================
   Design system v2 — tokens
   Added 2026-04-30 as part of v2 CSS refresh.
   Existing rules below progressively migrate from hex codes
   to these variables. See INTEGRATION-PLAN-VERIFICATION.md.
   ========================================================= */
:root {
  /* Surface */
  --c-page:        #fafbfc;
  --c-surface:     #ffffff;
  --c-surface-alt: #f1f3f6;
  --c-rule:        #d8dce2;
  --c-rule-soft:   #e8eaef;

  /* Text */
  --c-text:      #0d1117;
  --c-text-soft: #4a5160;
  --c-text-mute: #757a87;

  /* Brand accent — deep navy ink (replaces Tailwind blue) */
  --c-accent:        #1d3158;
  --c-accent-bright: #2c4574;
  --c-accent-soft:   rgba(29, 49, 88, 0.07);
  --c-accent-line:   rgba(29, 49, 88, 0.20);

  /* Semantic colors (callouts; do NOT replace with --c-accent) */
  --c-success:    #1f6f48;
  --c-warning:    #8b6500;
  --c-danger:     #9b1d1d;
  --c-info-blue:  #3b82f6;  /* stays for callout-note */
}

html.dark {
  --c-page:        #0c0d10;
  --c-surface:     #14161a;
  --c-surface-alt: #1a1d22;
  --c-rule:        #262a31;
  --c-rule-soft:   #1e2228;
  --c-text:        #e8eaee;
  --c-text-soft:   #b0b5bf;
  --c-text-mute:   #6e7382;
  --c-accent:        #92a4d8;
  --c-accent-bright: #b3c4f0;
  --c-accent-soft:   rgba(146, 164, 216, 0.10);
  --c-accent-line:   rgba(146, 164, 216, 0.30);
}

/* Site masthead — newspaper-style, shared by homepage and tutorial pages */
.site-masthead { position: sticky; top: 0; z-index: 30; background: rgba(250, 251, 252, 0.92); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid transparent; margin: 0 -15px 24px; transition: border-color 0.2s; }
.site-masthead.scrolled { border-bottom-color: var(--c-rule); }
.site-masthead-inner { max-width: 1170px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 24px; }
.masthead-menu-btn { display: none; background: none; border: 1px solid var(--c-rule); border-radius: 6px; padding: 4px 8px; font-size: 18px; line-height: 1; color: var(--c-text-soft); cursor: pointer; }
.masthead-wordmark { display: inline-flex; align-items: center; gap: 10px; font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 15px; color: var(--c-text); text-decoration: none; white-space: nowrap; }
.masthead-wordmark:hover { text-decoration: none; }
.masthead-mark {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--c-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 19px;
  line-height: 1;
  letter-spacing: -0.04em;
  padding-right: 1px;
  box-shadow: 0 1px 2px rgba(13, 17, 23, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.masthead-mark::after {
  content: '';
  position: absolute;
  right: 5px; bottom: 5px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); }
.masthead-tld { color: var(--c-text-mute); }
.masthead-nav { display: flex; gap: 4px; flex: 1; margin-left: 8px; }
.masthead-nav-link { font-family: 'IBM Plex Sans', sans-serif; color: var(--c-text-soft); font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 6px; text-decoration: none; transition: all 0.15s; }
.masthead-nav-link:hover { background: var(--c-surface-alt); color: var(--c-text); text-decoration: none; }
.masthead-nav-link.active { background: var(--c-surface-alt); color: var(--c-text); }
.masthead-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.masthead-search { margin: 0; display: flex; align-items: center; }
.masthead-search input { height: 32px; padding: 6px 12px; font-size: 13px; border: 1px solid var(--c-rule); border-radius: 6px; background: var(--c-surface); color: var(--c-text); width: 160px; font-family: 'IBM Plex Sans', sans-serif; transition: border-color 0.15s, box-shadow 0.15s; }
.masthead-search input:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.masthead-icon-btn { background: none; border: 1px solid transparent; border-radius: 6px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: var(--c-text-soft); cursor: pointer; transition: all 0.15s; }
.masthead-icon-btn:hover { background: var(--c-surface-alt); color: var(--c-text); }
html.dark .site-masthead { background: rgba(12, 13, 16, 0.85); }
@media (max-width: 767px) {
  .masthead-menu-btn { display: inline-flex !important; }
  .masthead-nav { display: none; }
  .masthead-search { display: none; }
  .site-masthead-inner { padding: 10px 16px; gap: 12px; }
}
@media (max-width: 400px) {
  .masthead-name { font-size: 13px; }
}

.footer-links { font-size: 13px; color: var(--c-text-mute); margin-top: 8px; }
.footer-links a { color: var(--c-text-soft); margin: 0 4px; }
.footer-links a:hover { color: var(--c-accent); }

/* Tool-page explainer ("How X works") — newspaper-callout treatment so
   it reads as background reading, not part of the interactive tool.
   Cream paper tone, serif italic framing, sans uppercase eyebrow. */
.tool-chrome-main > details.preflight,
.tool-chrome-main details.preflight {
  background: #faf7f0 !important;
  border: 1px solid #e8e0cf !important;
  border-left: 3px solid var(--c-accent) !important;
  border-radius: 8px !important;
  padding: 14px 22px !important;
  margin: 14px 18px 20px !important;
  font-family: 'IBM Plex Serif', Georgia, serif; }

html.dark .tool-chrome-main > details.preflight,
html.dark .tool-chrome-main details.preflight {
  background: rgba(146, 124, 80, 0.08) !important;
  border-color: rgba(212, 187, 142, 0.20) !important;
  border-left-color: var(--c-accent-bright) !important; }

.tool-chrome-main details.preflight summary {
  font-family: 'IBM Plex Sans', sans-serif !important;
  font-style: normal;
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-mute) !important;
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0; }

.tool-chrome-main details.preflight summary::-webkit-details-marker { display: none; }

.tool-chrome-main details.preflight summary::before {
  content: 'Background ·';
  color: var(--c-accent);
  font-weight: 700;
  letter-spacing: 0.10em; }

html.dark .tool-chrome-main details.preflight summary::before {
  color: var(--c-accent-bright); }

.tool-chrome-main details.preflight summary::after {
  content: '▸';
  margin-left: auto;
  font-size: 14px;
  transition: transform 0.18s; }

.tool-chrome-main details.preflight[open] summary::after { transform: rotate(90deg); }
.tool-chrome-main details.preflight[open] { padding-bottom: 18px !important; }

.tool-chrome-main details.preflight .preflight-list,
.tool-chrome-main details.preflight .preflight-prose,
.tool-chrome-main details.preflight .primer-content,
.tool-chrome-main details.preflight .primer-toc {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-style: normal;
  font-size: 14px;
  line-height: 1.65;
  color: var(--c-text-soft);
  margin-top: 12px; }

.tool-chrome-main details.preflight strong {
  color: var(--c-text);
  font-weight: 600; }

/* Context band — shown between the flavor picker and the workshop.
   Two-column narrative + scenario chips that map abstract inputs to
   real-world use cases. Currently CI calc only. */
.tool-chrome-main .context-band {
  margin: 6px 16px 16px !important;
  padding: 22px 26px !important;
  background: var(--c-accent-soft) !important;
  border-left: 4px solid var(--c-accent) !important;
  border-radius: 8px !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important; }

.context-band:empty { display: none !important; }

.context-band-eyebrow {
  font: 700 11px 'IBM Plex Sans', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(29, 49, 88, 0.15); }

html.dark .context-band-eyebrow { color: var(--c-accent-bright); border-bottom-color: rgba(146, 164, 216, 0.20); }

.context-band-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px; }

@media (max-width: 760px) {
  .context-band-grid { grid-template-columns: 1fr; gap: 18px; }
}

.context-band h4 {
  font: 700 10.5px 'IBM Plex Sans', sans-serif !important;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--c-text-mute);
  margin: 0 0 6px !important;
  padding: 0;
  border: none; }

.context-band h4:not(:first-child) { margin-top: 14px !important; }

.context-band p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--c-text-soft);
  margin: 0 0 0; }

.context-band .input-map {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7; }

.context-band .input-map li { color: var(--c-text-soft); }

.context-band .input-map code {
  display: inline-block;
  min-width: 64px;
  color: var(--c-accent);
  font-weight: 600;
  margin-right: 8px;
  background: transparent;
  padding: 0; }

html.dark .context-band .input-map code { color: var(--c-accent-bright); }

.context-band .scenario-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px; }

.context-band .scenario-btn {
  text-align: left;
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: 6px;
  padding: 9px 13px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  cursor: pointer;
  transition: all 0.12s; }

.context-band .scenario-btn:hover {
  border-color: var(--c-accent);
  background: var(--c-bg);
  transform: translateX(1px); }

html.dark .context-band .scenario-btn { background: var(--c-bg-alt); }
html.dark .context-band .scenario-btn:hover { border-color: var(--c-accent-bright); background: var(--c-surface); }

/* Workshop tab strip — labels each tool's left/right halves as
   "Input" and "Analyse" without per-tool HTML changes. The labels are
   pseudo-elements of .workshop placed in row 1 of its grid; the inputs
   and output panes shift to row 2. Each tab's bottom border merges
   into the content below so they read as one fluid unit. */
.tool-chrome-main .workshop {
  grid-template-rows: auto 1fr !important;
  margin-top: 8px !important; }
.tool-chrome-main .workshop::before,
.tool-chrome-main .workshop::after {
  padding: 10px 22px 9px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--c-accent);
  background: var(--c-bg-alt);
  border-bottom: 2px solid var(--c-accent);
  z-index: 1;
  display: flex;
  align-items: center; }
.tool-chrome-main .workshop::before {
  content: 'Input';
  grid-row: 1;
  grid-column: 1; }
.tool-chrome-main .workshop::after {
  content: 'Analyse';
  grid-row: 1;
  grid-column: 2;
  background: var(--c-bg); }
.tool-chrome-main .ws-inputs {
  grid-row: 2 !important;
  grid-column: 1 !important;
  border-right: 1px solid var(--c-border-soft) !important;
  border-top: none !important; }
.tool-chrome-main .ws-output {
  grid-row: 2 !important;
  grid-column: 2 !important;
  border-top: none !important; }
@media (max-width: 980px) {
  .tool-chrome-main .workshop {
    grid-template-rows: auto auto auto auto !important; }
  .tool-chrome-main .workshop::before { grid-row: 1; grid-column: 1; }
  .tool-chrome-main .ws-inputs { grid-row: 2 !important; grid-column: 1 !important; border-right: none !important; }
  .tool-chrome-main .workshop::after { grid-row: 3; grid-column: 1; }
  .tool-chrome-main .ws-output { grid-row: 4 !important; grid-column: 1 !important; }
}

/* Custom CSS tooltip for scenario cards. Native title= has a 1-2s delay
   and is OS-styled; the data-tooltip pseudo-element shows immediately
   on hover and matches the site. Falls back gracefully when JS or CSS
   is disabled because the title attribute is also present. */
.scenario-card[data-tooltip] {
  position: relative;
}
.scenario-card[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-text);
  color: var(--c-bg);
  padding: 6px 10px;
  border-radius: 6px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  font-style: normal;
  line-height: 1.35;
  white-space: nowrap;
  max-width: min(90vw, 420px);
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(13, 17, 23, 0.18);
  animation: tooltip-fade 0.12s ease-out;
}
.scenario-card[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--c-text);
  z-index: 100;
  pointer-events: none;
}
@keyframes tooltip-fade {
  from { opacity: 0; transform: translateX(-50%) translateY(2px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* On very narrow viewports the tooltip can overflow the page; allow
   wrapping there since nowrap is only useful when the card is wider
   than the truncation. */
@media (max-width: 720px) {
  .scenario-card[data-tooltip]:hover::after { white-space: normal; }
}

/* "What just happened" intro line above the Inference banner. Bridges the
   gap between Output column and Inference verdict — explains in plain
   language what was computed. Smaller, italic, muted than the verdict
   itself so it reads as preface, not headline. */
.tool-chrome-main .inference-section .method-intro,
.shell .inference-section .method-intro {
  font-family: 'IBM Plex Serif', serif;
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--c-text-mute);
  max-width: 80ch;
  margin: 0 0 14px;
  padding: 10px 14px;
  background: var(--c-bg-alt);
  border-left: 2px solid var(--c-rule);
  border-radius: 0 6px 6px 0;
}

/* Context column wrapper: <details class="ws-method-collapse" open>.
   Always-open by attribute so content stays visible regardless of viewport.
   The summary is hidden — modern Chrome's shadow DOM blocks author CSS
   from force-showing closed-details children, so collapse-on-mobile was
   broken; we ship always-visible instead. The original <details> wrap
   stays in case we revisit collapse later. */
.tool-chrome-main .ws-method .ws-method-collapse > summary {
  display: none;
}

/* Mobile graceful 3-column workshop: stack vertically, reorder so the user's
   actual task (Input → Output) comes first, push Context to the bottom as
   reference material. The inference banner becomes sticky so the verdict
   stays visible while scrolling the input form. */
@media (max-width: 720px) {
  .tool-chrome-main .workshop {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .tool-chrome-main .workshop .ws-inputs { order: 1 !important; border-right: none !important; border-bottom: 1px solid var(--c-border) !important; }
  .tool-chrome-main .workshop .ws-output { order: 2 !important; border-right: none !important; border-bottom: 1px solid var(--c-border) !important; }
  .tool-chrome-main .workshop .ws-method { order: 3 !important; border-right: none !important; border-bottom: none !important; }
  /* Compress Context (was the explainer column) so it doesn't dominate the
     bottom of the page — readable but not overweight. */
  .tool-chrome-main .workshop .ws-method { background: var(--c-bg-alt) !important; padding: 16px 18px !important; }
  .tool-chrome-main .workshop .ws-method h5 { font-size: 12px !important; }
  .tool-chrome-main .workshop .ws-method p,
  .tool-chrome-main .workshop .ws-method li { font-size: 13.5px !important; line-height: 1.5 !important; }

  /* Sticky inference banner: keeps the plain-language verdict in view as the
     user scrolls the input form. Only on mobile — desktop already shows it. */
  .tool-chrome-main .inference-section,
  .tool-chrome-main .inference-banner {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    box-shadow: 0 2px 8px rgba(13, 17, 23, 0.08) !important;
  }
  /* Tighten section paddings so the workshop fits more on a phone screen */
  .tool-chrome-main .shell .section { padding: 16px 16px !important; }
  .tool-chrome-main .scenarios-band,
  .tool-chrome-main .scenarios-section { padding: 14px 14px !important; }
}

/* Cohesive tool shell — wrap a tool's content into one bordered card so
   the inner sections (preflight, workshop, etc.) read as divisions of a
   single unit rather than a stack of separate boxes. Targets only tool
   pages via .tool-chrome-main so tutorial pages aren't affected. */
.tool-chrome-main {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm); }
.tool-chrome-main > * {
  margin: 0 !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  box-shadow: none !important; }
.tool-chrome-main > *:not(:last-child) {
  border-bottom: 1px solid var(--c-border-soft) !important; }
.tool-chrome-main > *:last-child {
  border-bottom: none !important; }
/* The full-page tool-shell some tools already wrap content in becomes a
   transparent passthrough inside our chrome — its own border/shadow
   would otherwise double up against the chrome. */
.tool-chrome-main > .tool-shell {
  border: none !important;
  background: transparent !important; }
.tool-chrome-main > .tool-shell > * {
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important; }
.tool-chrome-main > .tool-shell > *:not(:last-child) {
  border-bottom: 1px solid var(--c-border-soft) !important; }

/**
 * Reset some basic elements
 */
body, h1, h2, h3, h4, h5, h6,
p, blockquote, pre, hr,
dl, dd, ol, ul, figure {
  margin: 0;
  padding: 0; }

/**
 * Basic styling
 */
html {
  overflow-x: hidden;
  max-width: 100vw; }

body {
  overflow-x: hidden;
  max-width: 100vw; }

/* Prevent ad elements from causing horizontal overflow */
.reportline, .ezoicwhat, [class*="ezoic"] {
  max-width: 100vw !important;
  overflow: hidden !important; }

html body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  font-weight: 400;
  color: var(--c-text);
  background-color: var(--c-page);
  -webkit-text-size-adjust: 100%; }
@media screen and (max-width: 600px) {
  html body {
    font-size: 17px;
    line-height: 1.65; }

  /* Tighter headings on mobile */
  #content h1 {
    font-size: 1.7em;
    line-height: 1.25; }
  #content h2 {
    font-size: 1.35em; }
  #content h3, #content h4 {
    font-size: 1.1em; }

  /* Reduce list indent on small screens */
  ul, ol {
    margin-left: 20px; }

  /* Horizontal scroll for wide tables */
  #content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; }

  /* Soften FAQ/Exercise negative margins on mobile */
  #content h2#faq ~ h3,
  #content h2#FAQ ~ h3,
  #content h2#faq ~ h4,
  #content h2#FAQ ~ h4,
  #content h3[id*="exercise"],
  #content h3[id*="Exercise"],
  #content h4[id*="exercise"],
  #content h4[id*="Exercise"] {
    margin-left: -6px;
    margin-right: -6px; }

  /* Larger touch targets for WebR buttons */
  .webr-run-btn {
    padding: 8px 18px !important;
    font-size: 14px !important; }
  .webr-reset-btn {
    padding: 6px 14px !important;
    font-size: 13px !important; }

  /* Hide keyboard hints on touch devices */
  .webr-kbd-hint {
    display: none !important; }

  /* Allow horizontal scroll inside code editors so long R lines stay reachable.
     Desktop still suppresses scroll to avoid wheel-event capture; touch scrolling
     on mobile doesn't conflict with page scroll, so we re-enable overflow-x. */
  .webr-editor {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; }
  .webr-editor .CodeMirror-scroll {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch; }
}

/**
 * Set `margin-bottom` to maintain vertical rhythm
 */
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
ul, ol, dl, figure,
.highlight {
  margin-bottom: 15px; }

/**
 * Images
 */
img {
  max-width: 100%;
  vertical-align: middle; }

/**
 * Figures
 */
figure > img {
  display: block; }

figcaption {
  font-size: 0.8em; }

/**
 * Lists
 */
ul, ol {
  margin-left: 30px; }

li > ul,
li > ol {
  margin-bottom: 0; }

/**
 * Headings
 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: #111; }

/**
 * Links — accent migrates to deep navy ink (v2)
 */
a {
  color: var(--c-accent);
  text-decoration: none; }
  a:visited {
    color: var(--c-accent); }
  a:hover {
    color: var(--c-accent-bright);
    text-decoration: underline; }

/**
 * Blockquotes
 */
blockquote {
  color: #1e3a5f;
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 1em 1.25em;
  margin: 1.5em 0;
  border-radius: 0 8px 8px 0;
  font-size: 1em;
  letter-spacing: 0;
  font-style: normal;
  line-height: 1.65; }
  blockquote > :last-child {
    margin-bottom: 0; }
  blockquote code {
    background: #dbeafe; }

/**
 * Code formatting
 */
pre,
code {
  font-family: 'IBM Plex Mono', 'JetBrains Mono', Inconsolata, monospace;
  font-size: 0.875em;
  border: 1px solid #e8e8e8;
  border-radius: 3px;
  background-color: #eef; }

code {
  padding: 2px 6px; }

pre {
  padding: 8px 12px;
  overflow-x: auto; }
  pre > code {
    border: 0;
    padding-right: 0;
    padding-left: 0;
    white-space: pre; }

/* =================== Sidebar quiz-link styling ===================
 * Quiz links live in the sidebar at critical pedagogical junctures. They
 * appear as ordinary sidebar items but get a small gold accent so the
 * reader knows they lead to a credential-issuing assessment, not another
 * tutorial. Triggered by href ending in -quiz.html (zero per-item config). */
.sidebar-section-items li a[href$="-quiz.html"],
.sidebar-tools-list li a[href$="-quiz.html"] {
  color: #8a6313;
  font-weight: 500;
}
/* Main sidebar (Option D): the cap takes the progress-dot's exact slot, so the
 * icon column stays aligned and long titles wrap under the text, not the icon. */
.sidebar-section-items li a[href$="-quiz.html"] .progress-dot { display: none; }
.sidebar-section-items li a[href$="-quiz.html"]::before {
  content: "\1F393"; /* 🎓 graduation cap */
  flex-shrink: 0;
  width: 13px;          /* matches .progress-dot footprint: 10px + 1.5px border x2 */
  margin-right: 7px;    /* matches .progress-dot margin-right */
  font-size: 11px;
  line-height: 21px;    /* aligns the cap with the first text line */
  text-align: center;
  opacity: 0.9;
}
/* Tools list has no progress-dot column — keep a simple inline cap there. */
.sidebar-tools-list li a[href$="-quiz.html"]::before {
  content: "\1F393"; /* 🎓 graduation cap */
  margin-right: 8px;
  font-size: 13px;
  opacity: 0.85;
  vertical-align: middle;
}
.sidebar-section-items li a[href$="-quiz.html"]:hover,
.sidebar-tools-list li a[href$="-quiz.html"]:hover {
  color: #b88b1a;
  border-left-color: #b88b1a;
}
html.dark .sidebar-section-items li a[href$="-quiz.html"],
html.dark .sidebar-tools-list li a[href$="-quiz.html"] { color: #e6b428; }

/* =================== Mobile drawer nav (top-section) ===================
 * The mobile sidebar drawer has a "Navigate" top section above the page
 * sidebar — Home / Compendium / Exercises (accordion). Used on every page
 * via the template and on the homepage too. */
.mnav-section { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #e5e7eb; }
.mnav-section:last-child { border-bottom: none; }
.mnav-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px; font-weight: 600; color: #8a8f99;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0 0 8px;
}
.mnav-link {
  display: block; padding: 9px 10px;
  color: #3a3f4a; text-decoration: none;
  font-size: 15px; border-radius: 6px;
  font-family: 'IBM Plex Sans', sans-serif;
}
.mnav-link:hover, .mnav-link:active { background: #f1f3f6; color: #0d1117; text-decoration: none; }
.mnav-accordion { padding: 0; }
.mnav-accordion > summary {
  padding: 9px 10px; cursor: pointer;
  font-size: 15px; font-weight: 500; color: #3a3f4a;
  list-style: none;
  border-radius: 6px;
  font-family: 'IBM Plex Sans', sans-serif;
  display: flex; align-items: center; justify-content: space-between;
}
.mnav-accordion > summary::-webkit-details-marker { display: none; }
.mnav-accordion > summary::after {
  content: '\25BE'; font-size: 11px; color: #8a8f99;
  transition: transform 0.15s;
}
.mnav-accordion[open] > summary::after { transform: rotate(180deg); }
.mnav-accordion > summary:hover { background: #f1f3f6; }
.mnav-accordion-body { padding: 4px 6px 8px 10px; }
.mnav-accordion-body .mnav-link { padding: 7px 8px; font-size: 14px; color: #4a5160; }
.mnav-accordion-body h6 {
  margin: 10px 0 4px 8px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10px; font-weight: 600; color: #8a8f99;
  text-transform: uppercase; letter-spacing: 0.06em;
}
html.dark .mnav-section { border-bottom-color: #334155; }
html.dark .mnav-title { color: #7a808c; }
html.dark .mnav-link, html.dark .mnav-accordion > summary { color: #c5cad3; }
html.dark .mnav-link:hover, html.dark .mnav-link:active,
html.dark .mnav-accordion > summary:hover { background: #1a1d22; color: #fff; }
html.dark .mnav-accordion-body .mnav-link { color: #b0b5bf; }
html.dark .mnav-accordion-body h6 { color: #7a808c; }

/* =================== Masthead nav dropdown ===================
 * The Exercises dropdown lives on every page via the template, and now on
 * the homepage too. Both surfaces read these styles from main.css. */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-trigger { cursor: pointer; }
.nav-dropdown-trigger::after { content: ' \25BE'; font-size: 10px; color: #8a8f99; }
.nav-dropdown-panel {
  display: none; position: absolute;
  top: calc(100% + 6px); left: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 0;
  box-shadow: 0 8px 24px rgba(13, 17, 23, 0.10);
  min-width: 260px;
  z-index: 40;
  flex-direction: column;
}
.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown.open .nav-dropdown-panel { display: flex; }
.nav-cat {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 18px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px; font-weight: 500;
  color: #3a3f4a;
  cursor: pointer;
  transition: background 0.1s;
}
.nav-cat:hover { background: #f1f3f6; color: #0d1117; }
.nav-cat::after { content: ' \25B8'; font-size: 10px; color: #8a8f99; margin-left: 8px; }
.nav-sub {
  display: none; position: absolute;
  top: 0; left: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 8px 24px rgba(13, 17, 23, 0.10);
  min-width: 230px;
  z-index: 50;
}
.nav-cat:hover .nav-sub { display: block; }
.nav-sub a {
  display: block; padding: 5px 0;
  font-size: 13px; color: #3a3f4a; text-decoration: none;
  font-weight: 400; line-height: 1.4;
}
.nav-sub a:hover { color: #1d3158; text-decoration: underline; }
.nav-sub h6 {
  margin: 10px 0 4px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10px; font-weight: 600;
  color: #8a8f99;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav-sub h6:first-child { margin-top: 0; }
html.dark .nav-dropdown-panel, html.dark .nav-sub {
  background: #161a1f; border-color: #2a2e35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
html.dark .nav-cat { color: #c5cad3; }
html.dark .nav-cat:hover { background: #1a1d22; color: #fff; }
html.dark .nav-sub a { color: #c5cad3; }
html.dark .nav-sub a:hover { color: #fff; }
html.dark .nav-sub h6 { color: #7a808c; }
@media (max-width: 768px) {
  .nav-dropdown-panel { min-width: 220px; left: auto; right: 0; }
  .nav-sub { position: static; border: none; box-shadow: none; padding: 6px 0 6px 16px; }
  .nav-cat::after { content: ''; }
}

/* =================== Certificate Banners (diploma-grade v3) ===================
 * Two pieces:
 *   .cert-strip — thin status row under the H1. One line, no button.
 *   .cert-hero  — end-of-hub diploma card. Leads with the credential, not the
 *                 marketing pitch. Watermark, typography-lockup CTA.
 * Palette is mineral ink-gold (#8a6313) over cream (#f7eedb) — quieter than
 * the previous saturation, intentionally diploma-like. */

/* --- Thin status strip (top of the page, under H1) --- */
.cert-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 28px;
  padding: 12px 4px;
  border-top: 1px solid #e8e0cc;
  border-bottom: 1px solid #e8e0cc;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  color: #4a505e;
  line-height: 1.5;
}
.cert-strip-seal {
  flex-shrink: 0;
  width: 22px; height: 22px;
  color: #8a6313;
  display: inline-flex;
}
.cert-strip-seal svg { width: 100%; height: 100%; }
.cert-strip-text { flex: 1; min-width: 0; }
.cert-strip-text strong {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 600;
  color: #0d1f3d;
  letter-spacing: -0.005em;
}
.cert-strip-sep { color: #c5cad3; margin: 0 6px; }
.cert-strip-cta {
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0d1f3d;
  text-decoration: none;
  padding: 4px 0;
  position: relative;
}
.cert-strip-cta::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: #8a6313;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.18s ease;
}
.cert-strip-cta:hover { color: #8a6313; text-decoration: none; }
.cert-strip-cta:hover::after { transform: scaleX(1); }
.cert-strip-arrow { margin-left: 6px; display: inline-block; transition: transform 0.18s ease; }
.cert-strip-cta:hover .cert-strip-arrow { transform: translateX(3px); }
@media (max-width: 600px) {
  .cert-strip { flex-wrap: wrap; gap: 10px; padding: 14px 4px; }
  .cert-strip-cta { width: 100%; text-align: left; }
}

/* --- Diploma hero card (end of hub) --- */
.cert-hero {
  position: relative;
  margin: 56px 0 24px;
  padding: 48px 40px 44px;
  background: #f7eedb;
  border-radius: 4px;
  text-align: center;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px #e0d3a8,
    inset 0 0 0 5px #f7eedb,
    inset 0 0 0 6px #d8c382,
    0 4px 28px rgba(20, 30, 50, 0.05);
}
.cert-hero-issuer {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #8a6313;
  margin: 0 0 32px;
  position: relative;
  z-index: 2;
}
.cert-hero-eyebrow {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: #5a5e68;
  margin: 0 0 8px;
  position: relative;
  z-index: 2;
}
.cert-hero-seal {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  color: #8a6313;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 1px 2px rgba(138, 99, 19, 0.12));
}
.cert-hero-seal svg { width: 100%; height: 100%; }
.cert-hero-title {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  color: #0d1117;
  margin: 0 0 18px !important;
  letter-spacing: -0.015em;
  line-height: 1.1;
  border: none !important;
  padding: 0 !important;
  position: relative;
  z-index: 2;
}
.cert-hero-topics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
  margin: 4px auto 22px;
  max-width: 540px;
  position: relative;
  z-index: 2;
}
.cert-hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 1px solid #d8c382;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  color: #5a4815;
  letter-spacing: 0.005em;
  line-height: 1.35;
}
.cert-hero-trust {
  font-size: 14.5px;
  line-height: 1.65;
  color: #4a505e;
  max-width: 480px;
  margin: 0 auto 26px;
  position: relative;
  z-index: 2;
}
.cert-hero-count {
  margin: 30px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(216, 195, 130, 0.4);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  color: #6a5a2a;
  position: relative;
  z-index: 2;
}
.cert-hero-count strong {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 700;
  font-size: 16px;
  color: #0d1117;
  letter-spacing: -0.005em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.cert-hero-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: #8a6313;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 30px;
  position: relative;
  z-index: 2;
}
.cert-hero-meta-sep { color: #c0a45a; margin: 0 8px; }
.cert-hero-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 auto;
  max-width: 420px;
  position: relative;
  z-index: 2;
}
.cert-hero-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b88b1a 50%, transparent);
  opacity: 0.55;
}
.cert-hero-cta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #0d1f3d;
  text-decoration: none;
  padding: 6px 0;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.cert-hero-cta:hover { color: #8a6313; text-decoration: none; }
.cert-hero-cta-arrow {
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.18s ease;
}
.cert-hero-cta:hover .cert-hero-cta-arrow { transform: translateX(3px); }

/* Subtle "VERIFIED" watermark behind the seal — like a banknote */
.cert-hero-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 200px;
  font-weight: 700;
  color: #8a6313;
  opacity: 0.045;
  transform: rotate(-8deg);
  pointer-events: none;
  z-index: 1;
  letter-spacing: 0.04em;
  user-select: none;
}

/* "You earned this" state — replaces cert-hero contents for returning visitors */
.cert-earned-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #2a9b4a;
  margin: 0 0 20px;
  position: relative; z-index: 2;
}
.cert-earned-flag::before {
  content: ''; width: 7px; height: 7px;
  border-radius: 50%; background: #2a9b4a;
  box-shadow: 0 0 0 3px rgba(42, 155, 74, 0.16);
}
.cert-earned-name {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-style: italic;
  font-size: 24px;
  font-weight: 600;
  color: #0d1117;
  margin: 4px 0 14px;
  position: relative; z-index: 2;
}
.cert-earned-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #6a7080;
  letter-spacing: 0.04em;
  margin: 0 0 22px;
  position: relative; z-index: 2;
}

/* Dark mode */
html.dark .cert-strip {
  border-color: #2d3e58;
  color: #b0b5bf;
}
html.dark .cert-strip-text strong { color: #f0f3f8; }
html.dark .cert-strip-cta { color: #f0f3f8; }
html.dark .cert-strip-cta:hover { color: #e6b428; }
html.dark .cert-strip-cta::after { background: #e6b428; }
html.dark .cert-strip-seal { color: #e6b428; }
html.dark .cert-hero {
  background: #1a1d2a;
  box-shadow:
    inset 0 0 0 1px #34456a,
    inset 0 0 0 5px #1a1d2a,
    inset 0 0 0 6px #34456a,
    0 4px 28px rgba(0, 0, 0, 0.32);
}
html.dark .cert-hero-issuer,
html.dark .cert-hero-meta,
html.dark .cert-hero-seal { color: #e6b428; }
html.dark .cert-hero-eyebrow { color: #a8aebc; }
html.dark .cert-hero-title { color: #f0f3f8; }
html.dark .cert-hero-trust { color: #a8aebc; }
html.dark .cert-hero-cta { color: #f0f3f8; }
html.dark .cert-hero-cta:hover { color: #e6b428; }
html.dark .cert-hero-watermark { color: #e6b428; opacity: 0.05; }
html.dark .cert-hero-meta-sep { color: #6e5a2a; }
html.dark .cert-earned-name { color: #f0f3f8; }
html.dark .cert-earned-meta { color: #a8aebc; }
html.dark .cert-hero-chip { background: rgba(255,255,255,0.04); border-color: #34456a; color: #e6b428; }
html.dark .cert-hero-count { color: #a8aebc; border-top-color: #34456a; }
html.dark .cert-hero-count strong { color: #f0f3f8; }

/* Legacy aliases — old cert-ribbon / cert-final classes still on already-built pages */
html.dark .cert-ribbon { background: #1a1d2a; border-color: #2d3e58; }
html.dark .cert-ribbon-title, html.dark .cert-final-title { color: #f0f3f8; }
html.dark .cert-ribbon-sub, html.dark .cert-final-sub { color: #a8aebc; }
html.dark .cert-ribbon-eyebrow, html.dark .cert-final-eyebrow { color: #e6b428; }
html.dark .cert-ribbon-cta { background: #d4a017; color: #0d1f3d; border-color: #d4a017; }
html.dark .cert-ribbon-cta:hover { background: #e6b428; border-color: #e6b428; color: #0d1f3d; }
html.dark .cert-final-meta { color: #a8aebc; }
html.dark .cert-final-issued { color: #6a7080; }

/**
 * Wrapper
 */
.wrapper {
  max-width: -webkit-calc(800px - (30px * 2));
  max-width: calc(800px - (30px * 2));
  margin-right: auto;
  margin-left: auto;
  padding-right: 30px;
  padding-left: 30px; }
  @media screen and (max-width: 800px) {
    .wrapper {
      max-width: -webkit-calc(800px - (30px));
      max-width: calc(800px - (30px));
      padding-right: 15px;
      padding-left: 15px; } }

/**
 * Clearfix
 */
.wrapper:after, .footer-col-wrapper:after {
  content: "";
  display: table;
  clear: both; }

/**
 * Icons
 */
.icon > svg {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: middle; }
  .icon > svg path {
    fill: #828282; }

/**
 * Site header
 */
.masthead {
  padding-top: 4px; }

.site-header {
  border-top: none;
  border-bottom: none;
  min-height: auto;
  position: relative; }

.site-title {
  font-size: 20px;
  font-weight: 700;
  line-height: normal;
  letter-spacing: normal;
  margin-bottom: 0; }
  .site-title a {
    color: var(--c-accent); }
  .site-title a:visited {
    color: var(--c-accent); }

.site-nav {
  float: right;
  line-height: 56px; }
  .site-nav .menu-icon {
    display: none; }
  .site-nav .page-link {
    color: #111;
    line-height: 1.5; }
    .site-nav .page-link:not(:first-child) {
      margin-left: 20px; }
  @media screen and (max-width: 600px) {
    .site-nav {
      position: absolute;
      top: 9px;
      right: 30px;
      background-color: #fdfdfd;
      border: 1px solid #e8e8e8;
      border-radius: 5px;
      text-align: right; }
      .site-nav .menu-icon {
        display: block;
        float: right;
        width: 36px;
        height: 26px;
        line-height: 0;
        padding-top: 10px;
        text-align: center; }
        .site-nav .menu-icon > svg {
          width: 18px;
          height: 15px; }
          .site-nav .menu-icon > svg path {
            fill: #424242; }
      .site-nav .trigger {
        clear: both;
        display: none; }
      .site-nav:hover .trigger {
        display: block;
        padding-bottom: 5px; }
      .site-nav .page-link {
        display: block;
        padding: 5px 10px; } }

/**
 * Site footer
 */
.site-footer {
  border-top: 1px solid #e8e8e8;
  padding: 30px 0; }

.footer-heading {
  font-size: 18px;
  margin-bottom: 15px; }

.contact-list,
.social-media-list {
  list-style: none;
  margin-left: 0; }

.footer-col-wrapper {
  font-size: 15px;
  color: #828282;
  margin-left: -15px; }

.footer-col {
  float: left;
  margin-bottom: 15px;
  padding-left: 15px; }

.footer-col-1 {
  width: -webkit-calc(35% - (30px / 2));
  width: calc(35% - (30px / 2)); }

.footer-col-2 {
  width: -webkit-calc(20% - (30px / 2));
  width: calc(20% - (30px / 2)); }

.footer-col-3 {
  width: -webkit-calc(45% - (30px / 2));
  width: calc(45% - (30px / 2)); }

@media screen and (max-width: 800px) {
  .footer-col-1,
  .footer-col-2 {
    width: -webkit-calc(50% - (30px / 2));
    width: calc(50% - (30px / 2)); }

  .footer-col-3 {
    width: -webkit-calc(100% - (30px / 2));
    width: calc(100% - (30px / 2)); } }
@media screen and (max-width: 600px) {
  .footer-col {
    float: none;
    width: -webkit-calc(100% - (30px / 2));
    width: calc(100% - (30px / 2)); } }
/**
 * Page content
 */
.page-content {
  padding: 30px 0; }

.page-heading {
  font-size: 20px; }

.post-list {
  margin-left: 0;
  list-style: none; }
  .post-list > li {
    margin-bottom: 30px; }

.post-meta {
  font-size: 14px;
  color: #828282; }

.post-link {
  display: block;
  font-size: 24px; }

/**
 * Posts
 */
.post-header {
  margin-bottom: 30px; }

.post-title {
  font-size: 42px;
  letter-spacing: -1px;
  line-height: 1; }
  @media screen and (max-width: 800px) {
    .post-title {
      font-size: 36px; } }

.post-content {
  margin-bottom: 30px; }
  .post-content h2 {
    font-size: 32px; }
    @media screen and (max-width: 800px) {
      .post-content h2 {
        font-size: 28px; } }
  .post-content h3 {
    font-size: 26px; }
    @media screen and (max-width: 800px) {
      .post-content h3 {
        font-size: 22px; } }
  .post-content h4 {
    font-size: 20px; }
    @media screen and (max-width: 800px) {
      .post-content h4 {
        font-size: 18px; } }

/**
 * Syntax highlighting styles
 */
.highlight {
  background: #fff; }
  .highlight .c {
    color: #998;
    font-style: italic; }
  .highlight .err {
    color: #a61717;
    background-color: #e3d2d2; }
  .highlight .k {
    font-weight: bold; }
  .highlight .o {
    font-weight: bold; }
  .highlight .cm {
    color: #998;
    font-style: italic; }
  .highlight .cp {
    color: #999;
    font-weight: bold; }
  .highlight .c1 {
    color: #998;
    font-style: italic; }
  .highlight .cs {
    color: #999;
    font-weight: bold;
    font-style: italic; }
  .highlight .gd {
    color: #000;
    background-color: #fdd; }
  .highlight .gd .x {
    color: #000;
    background-color: #faa; }
  .highlight .ge {
    font-style: italic; }
  .highlight .gr {
    color: #a00; }
  .highlight .gh {
    color: #999; }
  .highlight .gi {
    color: #000;
    background-color: #dfd; }
  .highlight .gi .x {
    color: #000;
    background-color: #afa; }
  .highlight .go {
    color: #888; }
  .highlight .gp {
    color: #555; }
  .highlight .gs {
    font-weight: bold; }
  .highlight .gu {
    color: #aaa; }
  .highlight .gt {
    color: #a00; }
  .highlight .kc {
    font-weight: bold; }
  .highlight .kd {
    font-weight: bold; }
  .highlight .kp {
    font-weight: bold; }
  .highlight .kr {
    font-weight: bold; }
  .highlight .kt {
    color: #458;
    font-weight: bold; }
  .highlight .m {
    color: #099; }
  .highlight .s {
    color: #d14; }
  .highlight .na {
    color: #008080; }
  .highlight .nb {
    color: #0086B3; }
  .highlight .nc {
    color: #458;
    font-weight: bold; }
  .highlight .no {
    color: #008080; }
  .highlight .ni {
    color: #800080; }
  .highlight .ne {
    color: #900;
    font-weight: bold; }
  .highlight .nf {
    color: #900;
    font-weight: bold; }
  .highlight .nn {
    color: #555; }
  .highlight .nt {
    color: #000080; }
  .highlight .nv {
    color: #008080; }
  .highlight .ow {
    font-weight: bold; }
  .highlight .w {
    color: #bbb; }
  .highlight .mf {
    color: #099; }
  .highlight .mh {
    color: #099; }
  .highlight .mi {
    color: #099; }
  .highlight .mo {
    color: #099; }
  .highlight .sb {
    color: #d14; }
  .highlight .sc {
    color: #d14; }
  .highlight .sd {
    color: #d14; }
  .highlight .s2 {
    color: #d14; }
  .highlight .se {
    color: #d14; }
  .highlight .sh {
    color: #d14; }
  .highlight .si {
    color: #d14; }
  .highlight .sx {
    color: #d14; }
  .highlight .sr {
    color: #009926; }
  .highlight .s1 {
    color: #d14; }
  .highlight .ss {
    color: #990073; }
  .highlight .bp {
    color: #999; }
  .highlight .vc {
    color: #008080; }
  .highlight .vg {
    color: #008080; }
  .highlight .vi {
    color: #008080; }
  .highlight .il {
    color: #099; }

/**
 * Collapsible solution blocks (<details>/<summary>)
 */
details {
  margin: 1.5em 0 2em 0;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s ease; }

details:hover {
  border-color: #3566c0; }

details summary {
  cursor: pointer;
  padding: 11px 16px;
  background: #f7f8fa;
  font-weight: 400;
  font-size: 0.93em;
  color: #3566c0;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
  border-bottom: 1px solid transparent; }

details summary:hover {
  background: #eef2fb; }

details summary::-webkit-details-marker {
  display: none; }

details summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #3566c0;
  transition: transform 0.25s ease;
  margin-right: 2px;
  flex-shrink: 0; }

details[open] summary::before {
  transform: rotate(90deg); }

details[open] summary {
  border-bottom: 1px solid #e0e0e0;
  background: #eef2fb; }

details[open] {
  border-color: #3566c0; }

details[open] > *:not(summary) {
  animation: detailsSlide 0.25s ease-out; }

@keyframes detailsSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); } }

details > *:not(summary) {
  padding: 0 16px; }

details > p:first-of-type {
  margin-top: 14px; }

details > *:not(summary):last-child {
  padding-bottom: 16px; }

details .webr-container {
  margin: 12px 0; }

/**
 * Breadcrumb navigation (Quarto-style)
 */
.breadcrumb-nav {
  font-size: 13.5px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #6c757d;
  margin-bottom: 2px;
  padding: 0; }

.breadcrumb-nav + .webr-loading-banner { margin-top: 4px; }
.breadcrumb-nav + h1,
.breadcrumb-nav + .webr-loading-banner + h1,
.webr-loading-banner.hidden + h1 { margin-top: 2px; }

.breadcrumb-nav a {
  color: #6c757d;
  text-decoration: none;
  transition: color 0.15s; }

.breadcrumb-nav a:hover {
  color: #3b82f6;
  text-decoration: underline; }

.bc-sep, .breadcrumb-sep {
  margin: 0 5px;
  color: #adb5bd; }

.bc-current, .breadcrumb-current {
  color: #495057;
  font-weight: 500; }

/**
 * Featured snippet subtitle
 */
/* p.lead defined in content typography section below */

/**
 * Quarto-style collapsible sidebar
 */
/* Sidebar scrollbar — thin, visible, sleek */
#nav,
#sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: #d0d7de transparent; }

#nav::-webkit-scrollbar,
#sidebar-nav::-webkit-scrollbar { width: 3px; }

#nav::-webkit-scrollbar-track,
#sidebar-nav::-webkit-scrollbar-track { background: transparent; }

#nav::-webkit-scrollbar-thumb,
#sidebar-nav::-webkit-scrollbar-thumb { background: #d0d7de; border-radius: 3px; }

#nav::-webkit-scrollbar-thumb:hover,
#sidebar-nav::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

html.dark #nav,
html.dark #sidebar-nav { scrollbar-color: #475569 transparent; }
html.dark #nav::-webkit-scrollbar-thumb,
html.dark #sidebar-nav::-webkit-scrollbar-thumb { background: #475569; }
html.dark #nav::-webkit-scrollbar-thumb:hover,
html.dark #sidebar-nav::-webkit-scrollbar-thumb:hover { background: #64748b; }

#sidebar-nav {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 8px 0; }

.sidebar-menu { margin: 0; padding: 0; }

/* Sidebar Posts/Tools tabs — underline style. The active tab's bottom
   border erases the strip's bottom border so the tab reads as one
   continuous unit with the panel below. */
.sidebar-tabs {
  display: flex;
  gap: 0;
  margin: 4px 0 0 0;
  border-bottom: 1px solid var(--c-rule); }

.sidebar-tab {
  flex: 1;
  padding: 9px 12px 8px;
  border: none;
  background: transparent;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-mute);
  cursor: pointer;
  letter-spacing: 0.01em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s; }

.sidebar-tab:hover { color: var(--c-text); }
.sidebar-tab.active {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent); }

html.dark .sidebar-tab.active { color: var(--c-accent-bright); border-bottom-color: var(--c-accent-bright); }

.sidebar-panel { display: none; padding-top: 10px; }
.sidebar-panel.active { display: block; }

/* Tools list inside the Tools panel */
.sidebar-tools-list { margin: 0; padding: 0; }
.sidebar-tools-list li { line-height: 1.5; }
.sidebar-tools-list li.sidebar-divider { margin-top: 14px; }
.sidebar-tools-list li.sidebar-divider:first-child { margin-top: 4px; }
.sidebar-tools-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 14px;
  font-size: 14px;
  color: #495057;
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all 0.15s; }
.sidebar-tools-list .tool-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-mute);
  transition: color 0.15s; }
.sidebar-tools-list .tool-icon svg { display: block; }
.sidebar-tools-list li a:hover .tool-icon { color: var(--c-accent); }
.sidebar-tools-list li a.active .tool-icon { color: var(--c-accent); }
html.dark .sidebar-tools-list .tool-icon { color: var(--c-text-mute); }
html.dark .sidebar-tools-list li a:hover .tool-icon,
html.dark .sidebar-tools-list li a.active .tool-icon { color: var(--c-accent-bright); }
.sidebar-tools-list li a:hover {
  color: var(--c-accent);
  background: var(--c-surface-alt);
  border-left-color: var(--c-rule);
  text-decoration: none; }
.sidebar-tools-list li a.active {
  color: var(--c-accent);
  font-weight: 600;
  border-left-color: var(--c-accent);
  background: var(--c-accent-soft); }
html.dark .sidebar-tools-list li a { color: #cbd5e1; }
html.dark .sidebar-tools-list li a:hover { color: var(--c-accent-bright); }
html.dark .sidebar-tools-list li a.active { color: var(--c-accent-bright); }


.sidebar-section { margin-bottom: 1px; }

.sidebar-section-header {
  padding: 7px 12px;
  font-size: 15px;
  font-weight: 700;
  color: #212529;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s; }

.sidebar-section-header:hover {
  background: #f1f3f5;
  color: #000; }

.sidebar-chevron {
  display: inline-block;
  font-size: 10px;
  margin-right: 4px;
  transition: transform 0.2s ease;
  color: #757575; }

.sidebar-section.expanded .sidebar-chevron {
  transform: rotate(90deg);
  color: #6b7280; }

.sidebar-section-items {
  display: none;
  padding-left: 0;
  margin: 2px 0 6px 0; }

.sidebar-section.expanded .sidebar-section-items {
  display: block; }

.sidebar-section-items li { line-height: 1.5; }

.sidebar-section-items li a {
  display: flex;
  align-items: flex-start;
  padding: 4px 10px 4px 32px;
  font-size: 14px;
  color: #495057;
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all 0.15s; }

/* Option D: dot/hat sits in a fixed icon slot; text wraps with a hanging indent */
.sidebar-section-items li a .progress-dot {
  flex-shrink: 0;
  margin-top: 4px; }

.sidebar-section-items li a:hover {
  color: var(--c-accent);
  background: var(--c-surface-alt);
  border-left-color: var(--c-rule); }

.sidebar-section-items li a.active {
  color: var(--c-accent);
  font-weight: 600;
  border-left-color: var(--c-accent);
  background: var(--c-accent-soft); }

.sidebar-divider {
  margin: 12px 0 2px 0;
  padding: 0 12px 4px 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
  border-bottom: 1px solid #f0f2f5;
  cursor: default;
  list-style: none; }

.sidebar-divider:first-child { margin-top: 4px; }

.sidebar-subsection-toggle { cursor: pointer; }
.sidebar-subsection-toggle:hover { color: #6b7280; }

.subsec-chevron {
  font-size: 8px;
  opacity: 0.5;
  margin-right: 2px;
  display: inline-block;
  vertical-align: middle; }

/* Progress completion dots */
.progress-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #d1d5db;
  margin-right: 7px;
  vertical-align: middle;
  flex-shrink: 0;
  position: relative;
  transition: background 0.2s, border-color 0.2s; }

.progress-dot.started {
  border-color: var(--c-accent);
  background: transparent; }

.progress-dot.started::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-accent); }

.progress-dot.visited {
  background: #22c55e;
  border-color: #22c55e; }

.progress-dot.visited::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 0px;
  width: 3px;
  height: 6px;
  border: 1.5px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg); }

html.dark .sidebar-divider { color: #94a3b8; border-bottom-color: #1e293b; }
html.dark .progress-dot { border-color: #4b5563; }
html.dark .progress-dot.started { border-color: var(--c-accent-bright); }
html.dark .progress-dot.started::before { background: var(--c-accent-bright); }
html.dark .progress-dot.visited { background: #16a34a; border-color: #16a34a; }

/* Continue-reading chip (top of sidebar, populated by toc.js from localStorage) */
.continue-chip {
  display: none;
  margin: 0 0 14px 0;
  padding: 10px 12px;
  background: var(--c-accent-soft);
  border-left: 3px solid var(--c-accent);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.4; }

.continue-chip.has-link { display: block; }

.continue-chip .chip-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text-mute);
  margin-bottom: 3px; }

.continue-chip a {
  color: var(--c-accent);
  font-weight: 500;
  text-decoration: none; }

.continue-chip a:hover { text-decoration: underline; }

html.dark .continue-chip a { color: var(--c-accent-bright); }

/* Continue-Reading block at end of every tutorial page.
   Hidden by default; toc.js adds .has-link once it finds a target. */
.continue-reading-block {
  display: none;
  margin: 2.5em 0 1.5em;
  padding: 16px 20px;
  background: var(--c-accent-soft);
  border-left: 3px solid var(--c-accent);
  border-radius: 4px; }

.continue-reading-block.has-link { display: block; }

.continue-reading-block .cr-eyebrow {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-mute);
  margin-bottom: 6px; }

.continue-reading-block .cr-link {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--c-accent);
  text-decoration: none;
  letter-spacing: -0.005em;
  line-height: 1.3; }

.continue-reading-block .cr-link:hover { text-decoration: underline; }

html.dark .continue-reading-block .cr-link { color: var(--c-accent-bright); }

/* Section meta count "3 / 12" — populated by toc.js */
.sidebar-section-header .section-meta {
  font-size: 11px;
  color: var(--c-text-mute);
  font-weight: 400;
  margin-left: 6px;
  font-variant-numeric: tabular-nums; }

.sidebar-section-header .section-meta:empty { display: none; }

.sidebar-subscribe {
  margin-top: 16px;
  padding: 12px;
  font-size: 14px;
  border-top: 1px solid #e9ecef;
  color: #6c757d; }

.sidebar-subscribe a { color: #3b82f6; }

/**
 * Right-side "On this page" TOC
 */
#toc-sidebar { position: relative; }

/* Hide TOC sidebar when empty (e.g., homepage) */
#toc:empty ~ .toc-title,
#toc:empty { display: none; }
#toc-wrapper:has(#toc:empty) { display: none; }

#toc-wrapper {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding-left: 14px;
  border-left: 1px solid #e9ecef;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent; }

#toc-wrapper:hover {
  scrollbar-color: #d0d7de transparent; }

#toc-wrapper::-webkit-scrollbar { width: 3px; }
#toc-wrapper::-webkit-scrollbar-track { background: transparent; }
#toc-wrapper::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
#toc-wrapper:hover::-webkit-scrollbar-thumb { background: #d0d7de; }

.toc-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6c757d;
  margin-bottom: 10px;
  padding-bottom: 0; }

#toc { margin: 0; padding: 0; }

#toc li {
  line-height: 1.45;
  margin-bottom: 1px; }

#toc li a {
  font-size: 13.5px;
  color: #6c757d;
  text-decoration: none;
  display: block;
  padding: 3px 0;
  border-left: 2px solid transparent;
  padding-left: 8px;
  margin-left: -15px;
  transition: all 0.15s; }

#toc li a:hover {
  color: #3b82f6; }

#toc li a.toc-active {
  color: #3b82f6;
  font-weight: 600;
  border-left-color: #3b82f6; }

/**
 * Content typography — IBM Plex Sans (body) + IBM Plex Serif (headings)
 */

/* Smooth scroll removed — handled by JS click handler in template.html
   to avoid compositor overhead during manual scrolling */

/* Paragraph rhythm */
#content p {
  line-height: 1.75;
  margin-bottom: 1.15em;
  color: #1a1a2e; }

/* Serif headings — IBM Plex Serif for authority */
#content h1,
#content h2,
#content h3,
#content h4 {
  font-family: 'IBM Plex Serif', Georgia, 'Times New Roman', serif; }

/* H1: bold, commanding */
#content h1 {
  font-weight: 700;
  font-size: 2.1em;
  line-height: 1.2;
  margin-bottom: 0.4em;
  letter-spacing: -0.01em; }

/* H2: section headers with divider */
#content h2 {
  font-weight: 600;
  font-size: 1.65em;
  line-height: 1.25;
  margin-top: 2.5em;
  margin-bottom: 0.6em;
  padding-top: 0.8em;
  border-top: 1px solid #e5e7eb; }

#content h2:first-of-type {
  border-top: none;
  margin-top: 1.5em; }

/* H3/H4: subheadings */
#content h3,
#content h4 {
  font-weight: 600;
  font-size: 1.2em;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
  color: #1a1a2e; }

/* Lead paragraph */
p.lead {
  font-size: 1.1em;
  line-height: 1.7;
  color: var(--c-text-soft);
  font-weight: 400;
  border-left: 3px solid var(--c-accent);
  padding-left: 1em;
  margin: -4px 0 1.5em 0; }

/* Lists */
#content li {
  line-height: 1.7;
  margin-bottom: 0.3em; }

/* Images: rounded + shadow */
#content img.img-responsive {
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  margin: 1.5em auto;
  display: block;
  max-width: 100%;
  height: auto; }

/* Diagram images: cap height so tall diagrams (flowchart TD, mindmap)
   don't dominate the viewport. Wide diagrams are unaffected — only height
   is constrained, width scales proportionally via auto. */
#content img[src*="/screenshots/"] {
  max-height: 500px;
  width: auto;
  max-width: 100%; }

/* Figure captions (italic paragraph after an image) */
#content p > em:only-child {
  display: block;
  text-align: center;
  font-size: 0.875em;
  color: #6b7280;
  margin-top: -0.5em;
  margin-bottom: 2em;
  line-height: 1.5; }

/* Tables: polished headers */
#content table {
  margin: 1.5em 0; }

#content th {
  background: #f1f5f9;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  border-bottom: 2px solid #cbd5e1; }

#content td {
  padding: 10px 16px; }

/* Strong text */
#content strong {
  font-weight: 600;
  color: #111; }

/* Further Reading section */
#auto-further-reading {
  margin-top: 2.5em;
  padding-top: 1.5em;
  border-top: 1px solid #e5e7eb; }

#auto-further-reading h2 {
  border-top: none;
  margin-top: 0;
  padding-top: 0; }

/* Further Reading — card grid layout (opt-in via .fr-cards-block) */
#auto-further-reading.fr-cards-block { border-top: 2px solid var(--c-text, #0d1117); padding-top: 1.75em; }
#auto-further-reading.fr-cards-block h2 { font-size: 22px; letter-spacing: -0.005em; margin-bottom: 6px; }
.fr-cards-block .fr-intro { color: var(--c-text-soft, #4a5160); font-size: 14.5px; margin: 0 0 18px; max-width: 620px; line-height: 1.55; }
.fr-cards-block .fr-categories { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; padding: 0; list-style: none; }
.fr-cards-block .fr-cat { font-size: 12.5px; padding: 4px 11px; border: 1px solid var(--c-rule, #d8dce2); border-radius: 999px; background: var(--c-surface, #fff); color: var(--c-text-soft, #4a5160); cursor: pointer; transition: all 0.15s; user-select: none; font-family: 'IBM Plex Sans', sans-serif; }
.fr-cards-block .fr-cat:hover { border-color: var(--c-accent-line, rgba(29,49,88,0.2)); color: var(--c-text, #0d1117); }
.fr-cards-block .fr-cat.active { background: var(--c-accent, #1d3158); color: #fff; border-color: var(--c-accent, #1d3158); }
.fr-cards-block .fr-cat .fr-cat-count { opacity: 0.7; margin-left: 4px; font-variant-numeric: tabular-nums; }
.fr-cards-block .fr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fr-cards-block .fr-card { display: flex; flex-direction: column; gap: 6px; background: var(--c-surface, #fff); border: 1px solid var(--c-rule, #d8dce2); border-radius: 8px; padding: 14px 16px; min-height: 120px; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; text-decoration: none; color: inherit; }
.fr-cards-block .fr-card:hover { border-color: var(--c-accent-line, rgba(29,49,88,0.2)); box-shadow: 0 2px 10px rgba(13,17,23,0.05); transform: translateY(-1px); text-decoration: none; color: inherit; }
.fr-cards-block .fr-card .fr-fn { font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--c-accent, #1d3158); background: var(--c-accent-soft, rgba(29,49,88,0.07)); padding: 1px 6px; border-radius: 3px; align-self: flex-start; font-weight: 500; line-height: 1.4; }
.fr-cards-block .fr-card .fr-title { font-family: 'IBM Plex Sans', sans-serif; font-size: 14px; font-weight: 600; color: var(--c-text, #0d1117); line-height: 1.3; margin: 2px 0 0; }
.fr-cards-block .fr-card .fr-excerpt { font-family: 'IBM Plex Sans', sans-serif; font-size: 12.5px; color: var(--c-text-soft, #4a5160); margin: 0; line-height: 1.45; }
.fr-cards-block .fr-card[hidden] { display: none; }
.fr-cards-block .fr-see-all { display: inline-block; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--c-rule-soft, #e8eaef); font-size: 13.5px; font-weight: 500; color: var(--c-accent, #1d3158); width: 100%; }
.fr-cards-block .fr-more { display: block; margin: 16px auto 0; padding: 7px 18px; font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; font-weight: 500; color: var(--c-accent, #1d3158); background: var(--c-surface, #fff); border: 1px solid var(--c-rule, #d8dce2); border-radius: 6px; cursor: pointer; transition: all 0.15s; }
.fr-cards-block .fr-more:hover { border-color: var(--c-accent-line, rgba(29,49,88,0.2)); background: var(--c-surface-alt, #f1f3f6); }
.fr-cards-block .fr-more[hidden] { display: none; }
@media (max-width: 992px) { .fr-cards-block .fr-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .fr-cards-block .fr-grid { grid-template-columns: 1fr; } }

/**
 * Summary table — highlighted so readers can find it instantly
 */
#content h2 + table:last-of-type,
#content table.summary-table {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden; }

/**
 * FAQ section — visual distinction
 */
#content h2#faq ~ h4,
#content h2#FAQ ~ h4 {
  background: #f9fafb;
  padding: 10px 14px;
  margin-left: -14px;
  margin-right: -14px;
  border-radius: 6px;
  border-left: 3px solid #6366f1; }

/**
 * Exercise card styling
 */
#content h3[id*="exercise"],
#content h3[id*="Exercise"],
#content h4[id*="exercise"],
#content h4[id*="Exercise"] {
  background: #fffbeb;
  padding: 8px 14px;
  margin-left: -14px;
  margin-right: -14px;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
  color: #92400e; }

/**
 * Callout boxes: [TIP], [WARNING], [NOTE], [KEY INSIGHT]
 */
.callout {
  margin: 1.6em 0;
  padding: 12px 18px 14px 18px;
  border-left: 4px solid;
  border-radius: 0 8px 8px 0;
  background: #fff; }

.callout-label {
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px; }

.callout-body {
  line-height: 1.6;
  color: #1a1a2e; }

.callout-body > *:last-child { margin-bottom: 0; }

.callout-tip {
  border-left-color: #22c55e;
  background: #f0fdf4; }
.callout-tip .callout-label { color: #15803d; }

.callout-warning {
  border-left-color: #f59e0b;
  background: #fffbeb; }
.callout-warning .callout-label { color: #b45309; }

.callout-note {
  border-left-color: #3b82f6;
  background: #eff6ff; }
.callout-note .callout-label { color: #1e40af; }

.callout-insight {
  border-left-color: #8b5cf6;
  background: #f5f3ff; }
.callout-insight .callout-label { color: #6d28d9; }

/**
 * PSEO Quick Answer block: code-only answer card under the lead paragraph.
 * Snippet-eligible. Always above-the-fold for function-deep PSEO posts.
 */
.quick-answer {
  margin: 1.4em 0 1em 0;
  border-left: 5px solid #f59e0b;
  background: #fffbeb;
  border-radius: 0 8px 8px 0;
  padding: 14px 18px 16px 20px; }
.quick-answer .qa-label {
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b45309;
  margin-bottom: 10px; }
.quick-answer pre {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 5px;
  padding: 12px 14px;
  margin: 0;
  overflow-x: auto;
  font: 13.5px/1.7 'JetBrains Mono', Consolas, monospace; }
.quick-answer pre .qa-cmt { color: #94a3b8; }
.quick-answer .qa-foot {
  font-size: 0.85em;
  font-style: italic;
  color: #92400e;
  margin-top: 10px;
  margin-bottom: 0; }
html.dark .quick-answer { background: #2a1f0a; }
html.dark .quick-answer .qa-label { color: #fbbf24; }
html.dark .quick-answer .qa-foot { color: #fbbf24; }

/**
 * PSEO Decision Tree: visual SVG that maps user task to code.
 * Sits below Quick Answer for function-deep PSEO posts.
 */
.decision-tree {
  margin: 0.6em 0 1.6em 0;
  border-left: 5px solid #0ea5e9;
  background: #f0f9ff;
  border-radius: 0 8px 8px 0;
  padding: 14px 18px 18px 20px; }
.decision-tree .dt-label {
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #075985;
  margin-bottom: 12px; }
.decision-tree svg.dt-svg {
  display: block;
  max-width: 100%;
  height: auto; }
html.dark .decision-tree { background: #0c1a33; }
html.dark .decision-tree .dt-label { color: #38bdf8; }
html.dark .decision-tree svg.dt-svg .node-code { fill: #1e293b; stroke: #38bdf8; }
html.dark .decision-tree svg.dt-svg .code { fill: #e2e8f0; }
html.dark .decision-tree svg.dt-svg .branch { stroke: #38bdf8; }
html.dark .decision-tree svg.dt-svg .branch-label { fill: #7dd3fc; }
html.dark .decision-tree svg.dt-svg .arrow-fill { fill: #38bdf8; }

/**
 * Auto-injected jump-chip nav for PSEO posts. Sits below the Decision Tree
 * (or below the Quick Answer if no tree). Anchor links to every H2.
 * Mobile-friendly (wraps automatically). The "Try it" chip is highlighted.
 */
.jump-chips {
  margin: 2px 0 24px 0;
  padding: 10px 14px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 13.5px; }
.jump-chips .jc-label {
  color: #64748b;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-right: 4px; }
.jump-chips a {
  color: #0369a1;
  text-decoration: none;
  padding: 3px 10px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s; }
.jump-chips a:hover,
.jump-chips a:focus {
  background: #0ea5e9;
  color: #fff;
  border-color: #0284c7; }
.jump-chips a.try-it {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
  font-weight: 600; }
.jump-chips a.try-it:hover,
.jump-chips a.try-it:focus {
  background: #f59e0b;
  color: #fff; }
html.dark .jump-chips {
  background: #1e293b;
  border-top-color: #334155;
  border-bottom-color: #334155; }
html.dark .jump-chips .jc-label { color: #94a3b8; }
html.dark .jump-chips a {
  background: #0f172a;
  color: #7dd3fc;
  border-color: #334155; }
html.dark .jump-chips a:hover,
html.dark .jump-chips a:focus {
  background: #0ea5e9;
  color: #fff;
  border-color: #38bdf8; }
html.dark .jump-chips a.try-it {
  background: #2a1f0a;
  color: #fbbf24;
  border-color: #b45309; }

/**
 * Auto-injected "Run live, no install" callout above the first code block
 * in PSEO posts. Different shade from regular [NOTE] to draw attention once.
 */
.callout-runlive {
  border-left-color: #16a34a;
  background: #f0fdf4;
  display: flex;
  gap: 12px;
  align-items: flex-start; }
.callout-runlive .callout-label { color: #15803d; }
.callout-runlive .callout-body { line-height: 1.55; }
html.dark .callout-runlive { background: #0a2818; }
html.dark .callout-runlive .callout-label { color: #4ade80; }

/**
 * Dark mode
 */
html.dark {
  color-scheme: dark; }

html.dark body {
  background-color: #0f172a;
  color: #cbd5e1; }

html.dark #content p,
html.dark #content li {
  color: #cbd5e1; }

html.dark #content h1,
html.dark #content h2,
html.dark #content h3,
html.dark #content h4,
html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5, html.dark h6 {
  color: #e2e8f0; }

html.dark #content strong {
  color: #f1f5f9; }

html.dark a { color: #60a5fa; }
html.dark a:visited { color: #818cf8; }
html.dark a:hover { color: #93c5fd; }

html.dark p.lead {
  color: #94a3b8;
  border-left-color: #3b82f6; }

html.dark hr { border-color: #334155; }

/* Dark: blockquotes */
html.dark blockquote {
  background: #1e293b;
  border-left-color: #3b82f6;
  color: #94a3b8; }
html.dark blockquote p { color: #94a3b8; }
html.dark blockquote code { background: #334155; }

/* Dark: callouts */
html.dark .callout { background: #1e293b; }
html.dark .callout-body { color: #cbd5e1; }
html.dark .callout-tip { background: #0a2818; }
html.dark .callout-tip .callout-label { color: #4ade80; }
html.dark .callout-warning { background: #241b0e; }
html.dark .callout-warning .callout-label { color: #fbbf24; }
html.dark .callout-note { background: #0c1a33; }
html.dark .callout-note .callout-label { color: #60a5fa; }
html.dark .callout-insight { background: #1e1338; }
html.dark .callout-insight .callout-label { color: #a78bfa; }

/* Dark: inline code */
html.dark code {
  background-color: #1e293b;
  border-color: #334155;
  color: #e2e8f0; }

/* Dark: tables */
html.dark #content table {
  border-color: #334155; }
html.dark #content th {
  background: #1e293b;
  color: #94a3b8;
  border-bottom-color: #475569; }
html.dark #content td {
  color: #cbd5e1;
  border-bottom-color: #334155; }
html.dark .table-striped > tbody > tr:nth-child(odd) > td,
html.dark .table-striped > tbody > tr:nth-child(odd) > th {
  background-color: rgba(30, 41, 59, 0.5) !important; }
html.dark .table-striped > tbody > tr:nth-child(even) > td,
html.dark .table-striped > tbody > tr:nth-child(even) > th {
  background-color: transparent !important; }
html.dark .table > tbody > tr > td,
html.dark .table > tbody > tr > th,
html.dark .table > thead > tr > th {
  border-color: #334155 !important; }

/* Dark: images */
html.dark #content img.img-responsive {
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
  border-radius: 8px; }

/* Dark: details/summary (exercises) */
html.dark details {
  background: #1e293b;
  border-color: #334155; }
html.dark details summary {
  background: #1e293b;
  color: #60a5fa; }
html.dark details summary:hover { background: #334155; }
html.dark details[open] summary {
  background: #334155;
  border-bottom-color: #475569; }
html.dark details[open] { border-color: #3b82f6; }

/* Dark: WebR containers */
html.dark .webr-container {
  border-color: #334155; }
html.dark .webr-container:hover {
  border-color: #4f46e5; }
html.dark .webr-code-block {
  background: #1e293b; }

/* Dark: sidebar */
html.dark .sidebar-section-header { color: #94a3b8; }
html.dark .sidebar-section-header:hover { background: #1e293b; color: #e2e8f0; }
html.dark .sidebar-section-items li a { color: #94a3b8; }
html.dark .sidebar-section-items li a:hover { color: #60a5fa; background: #1e293b; }
html.dark .sidebar-section-items li a.active { color: #60a5fa; background: #1e293b; }

/* Dark: TOC */
html.dark #toc-wrapper { border-left-color: #334155; }
html.dark .toc-title { color: #64748b; }
html.dark #toc li a { color: #64748b; }
html.dark #toc li a:hover { color: #60a5fa; }
html.dark #toc li a.toc-active { color: #60a5fa; border-left-color: #3b82f6; }

/* Dark: header */
html.dark .masthead { border-bottom-color: #334155; }
html.dark .site-title a { color: #e2e8f0; }
html.dark .site-header small { color: #64748b; }
html.dark #dark-mode-toggle { color: #e2e8f0; border-color: #475569; }
html.dark #my-google-search { background: #1e293b; color: #e2e8f0; border-color: #475569; }

/* Dark: footer */
html.dark .footer { color: #64748b; }
html.dark .footer hr { border-color: #334155; }

/* Dark: FAQ and exercise cards */
html.dark #content h2#faq ~ h4,
html.dark #content h2#FAQ ~ h4 {
  background: #1e293b;
  border-left-color: #818cf8; }

html.dark #content h3[id*="exercise"],
html.dark #content h3[id*="Exercise"],
html.dark #content h4[id*="exercise"],
html.dark #content h4[id*="Exercise"] {
  background: #1e293b;
  border-left-color: #f59e0b;
  color: #fbbf24; }

/* Dark: summary table */
html.dark #content h2 + table:last-of-type,
html.dark #content table.summary-table {
  background: #1e293b;
  border-color: #334155; }

/* Dark: figure captions */
html.dark #content p > em:only-child { color: #64748b; }

/* Dark: lead paragraph */
html.dark .breadcrumb-nav,
html.dark .breadcrumb-nav a { color: #64748b; }

/* Dark: loading banner */
html.dark .webr-loading-banner {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155; }
html.dark .webr-loading-banner.ready {
  background: #1e293b;
  color: #4ade80;
  border-color: #334155; }

/**
 * Homepage styles
 */

/* Hero */
.home-hero {
  text-align: center;
  padding: 2.5em 0 1.5em; }

.home-hero h1 {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 700;
  font-size: 2.2em;
  color: #111;
  margin-bottom: 0.3em;
  letter-spacing: -0.01em; }

.home-subtitle {
  font-size: 1.1em;
  color: #6b7280;
  margin-bottom: 1.5em;
  line-height: 1.6; }

.home-cta {
  display: inline-block;
  background: #3b82f6;
  color: #fff;
  padding: 10px 28px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 1em;
  text-decoration: none;
  transition: background 0.2s; }

.home-cta:hover { background: #2563eb; color: #fff; text-decoration: none; }
.home-cta:visited { color: #fff; }

/* Section titles */
.home-section { margin: 2.5em 0 1.5em; }

.home-section-title {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 600;
  font-size: 1.3em;
  color: #374151;
  margin-bottom: 1.2em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid #e5e7eb; }

/* Bar chart */
.home-bar {
  display: flex;
  align-items: center;
  margin-bottom: 1.2em;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease; }

.home-bar:hover { transform: translateX(4px); text-decoration: none; color: inherit; }

.home-bar-fill {
  display: block;
  height: 38px !important;
  border-radius: 6px;
  min-width: 40px;
  flex-shrink: 0;
  transition: width 0.6s ease; }

.home-bar-label {
  margin-left: 16px;
  min-width: 0; }

.home-bar-name {
  font-weight: 600;
  font-size: 0.95em;
  color: #1a1a2e;
  display: block;
  line-height: 1.3; }

.home-bar-topics {
  font-size: 0.8em;
  color: #9ca3af;
  margin-top: 2px;
  line-height: 1.3; }

/* Bar colors — lavender to indigo spectrum */
.home-bar:nth-child(1) .home-bar-fill { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.home-bar:nth-child(2) .home-bar-fill { background: linear-gradient(135deg, #818cf8, #6366f1); }
.home-bar:nth-child(3) .home-bar-fill { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.home-bar:nth-child(4) .home-bar-fill { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.home-bar:nth-child(5) .home-bar-fill { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.home-bar:nth-child(6) .home-bar-fill { background: linear-gradient(135deg, #a5b4fc, #818cf8); }
.home-bar:nth-child(7) .home-bar-fill { background: linear-gradient(135deg, #c4b5fd, #a78bfa); }
.home-bar:nth-child(8) .home-bar-fill { background: linear-gradient(135deg, #ddd6fe, #c4b5fd); }

/* Two-panel layout */
.home-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5em;
  margin: 2.5em 0 2em; }

@media (max-width: 768px) {
  .home-panels { grid-template-columns: 1fr; } }

.home-panel {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.5em; }

.home-panel h3 {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 600;
  font-size: 1.1em;
  margin-bottom: 1em;
  color: #1a1a2e; }

/* Console */
.home-console {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1em 1.2em;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85em;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
  color: #1a1a2e; }

.home-console-note {
  font-size: 0.82em;
  color: #6b7280;
  margin-top: 0.75em; }

/* Featured list */
.home-featured-item {
  display: block;
  padding: 0.75em 0;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.15s ease; }

.home-featured-item:hover { padding-left: 6px; text-decoration: none; color: inherit; }
.home-featured-item:last-child { border-bottom: none; }

.home-featured-item strong {
  display: block;
  font-weight: 600;
  color: #1a1a2e;
  font-size: 0.95em; }

.home-featured-item span {
  font-size: 0.85em;
  color: #6b7280;
  line-height: 1.4; }

/* Homepage dark mode */
html.dark .home-hero h1 { color: #e2e8f0; }
html.dark .home-subtitle { color: #94a3b8; }
html.dark .home-cta { background: #3b82f6; }
html.dark .home-cta:hover { background: #2563eb; }
html.dark .home-section-title { color: #94a3b8; border-bottom-color: #334155; }
html.dark .home-bar-name { color: #e2e8f0; }
html.dark .home-bar-topics { color: #64748b; }
html.dark .home-panel { border-color: #334155; background: #1e293b; }
html.dark .home-panel h3 { color: #e2e8f0; }
html.dark .home-console { background: #0f172a; border-color: #334155; color: #cbd5e1; }
html.dark .home-console-note { color: #64748b; }
html.dark .home-featured-item { border-bottom-color: #334155; }
html.dark .home-featured-item strong { color: #e2e8f0; }
html.dark .home-featured-item span { color: #64748b; }

/* Try It practice blocks — visually distinct from tutorial code */
.tryit-block {
  position: relative;
  margin: 28px 0 24px 0;
  padding: 20px 20px 12px 20px;
  background: #fff8e1;
  border-left: 4px solid #f57c00;
  border-radius: 4px;
}
.tryit-block::before {
  content: "TRY IT";
  display: inline-block;
  position: absolute;
  top: -11px;
  left: 14px;
  padding: 3px 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: #f57c00;
  border-radius: 10px;
  text-transform: uppercase;
}
.tryit-block > p:first-of-type {
  margin: 4px 0 10px 0;
  font-weight: 500;
  color: #5d4037;
}
.tryit-block .webr-container {
  margin: 8px 0;
}
.tryit-block details {
  margin: 10px 0 0 0;
  padding: 8px 12px;
  background: #fff3cd;
  border-radius: 3px;
}
.tryit-block details summary {
  color: #795548;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
html.dark .tryit-block { background: #3e2723; border-left-color: #ffb74d; }
html.dark .tryit-block::before { background: #ffb74d; color: #1a0f0a; }
html.dark .tryit-block > p:first-of-type { color: #ffe0b2; }
html.dark .tryit-block details { background: #4e342e; }
html.dark .tryit-block details summary { color: #ffcc80; }

/* --- Prev/Next post navigation --- */
.prev-next-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin: 4.125em 0 1.5em 0;
  padding-top: 1.32em;
  border-top: 1px solid #e5e7eb;
}
.prev-next-nav .pn-link {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  background: #fafbfc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  text-decoration: none;
  color: #1a1a2e;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.prev-next-nav .pn-link:hover {
  background: #f0f4ff;
  border-color: #3566c0;
  text-decoration: none;
  transform: translateY(-1px);
}
.prev-next-nav .pn-next {
  text-align: right;
  align-items: flex-end;
}
.prev-next-nav .pn-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.prev-next-nav .pn-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #3566c0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prev-next-nav .pn-placeholder {
  flex: 1 1 0;
  visibility: hidden;
}
@media (max-width: 600px) {
  .prev-next-nav { flex-direction: column; gap: 10px; }
  .prev-next-nav .pn-next { text-align: left; align-items: flex-start; }
  .prev-next-nav .pn-placeholder { display: none; }
}
html.dark .prev-next-nav { border-top-color: #334155; }
html.dark .prev-next-nav .pn-link {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html.dark .prev-next-nav .pn-link:hover {
  background: #283548;
  border-color: #60a5fa;
}
html.dark .prev-next-nav .pn-label { color: #94a3b8; }
html.dark .prev-next-nav .pn-title { color: #60a5fa; }

/* --- Related Tutorials grid ---
   No section-level margin/padding/border: the inner <h2 class="rt-heading">
   is styled by #content h2 (id specificity wins), which already provides
   the correct top rhythm. Adding section decoration too produced DOUBLE
   spacing and two stacked horizontal rules above "Related Tutorials". */
.related-tutorials {
  margin: 0 0 1em 0;
}
.related-tutorials .rt-heading {
  margin-bottom: 16px;
}
.related-tutorials .rt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.related-tutorials .rt-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: #fafbfc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  text-decoration: none;
  color: #1a1a2e;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  min-height: 90px;
}
.related-tutorials .rt-card:hover {
  background: #f0f4ff;
  border-color: #3566c0;
  text-decoration: none;
  transform: translateY(-1px);
}
.related-tutorials .rt-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #3566c0;
  line-height: 1.35;
  margin-bottom: 8px;
}
.related-tutorials .rt-meta {
  display: block;
  margin-top: auto;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}
@media (max-width: 520px) {
  .related-tutorials .rt-grid { grid-template-columns: 1fr; }
}
html.dark .related-tutorials { border-top-color: #334155; }
html.dark .related-tutorials .rt-heading { color: #e2e8f0; }
html.dark .related-tutorials .rt-card {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html.dark .related-tutorials .rt-card:hover {
  background: #283548;
  border-color: #60a5fa;
}
html.dark .related-tutorials .rt-title { color: #60a5fa; }
html.dark .related-tutorials .rt-meta { color: #94a3b8; }

/* ============================================================
   Anatomy section: live recap card + per-step IO annotations
   Used by /tools/*.html anatomy sections to tie generic
   formulas to the user's actual inputs and outputs.
   ============================================================ */
.anatomy-recap { background: var(--c-accent-soft); border-left: 3px solid var(--c-accent); padding: 14px 18px; border-radius: 6px; margin-bottom: 22px; font-size: 13.5px; line-height: 1.6; }
.anatomy-recap-title { font-family: 'IBM Plex Sans', sans-serif; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-accent); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.anatomy-recap-title::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--c-accent); border-radius: 50%; }
.anatomy-recap .recap-step { display: flex; gap: 10px; margin: 4px 0; font-family: 'IBM Plex Mono', monospace; flex-wrap: wrap; }
.anatomy-recap .recap-step .recap-label { color: var(--c-text-mute); min-width: 92px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 1px; flex-shrink: 0; }
.anatomy-recap .recap-step .recap-value { color: var(--c-text); font-weight: 500; flex: 1; min-width: 0; word-break: break-word; }
.anatomy-recap .recap-empty { color: var(--c-text-mute); font-style: italic; }
.anatomy-step .anatomy-io { font-size: 12.5px; color: var(--c-text-mute); margin-top: 10px; line-height: 1.6; }
.anatomy-step .anatomy-io b { color: var(--c-accent); font-weight: 600; }
.anatomy-step .anatomy-io .io-row { display: block; margin: 2px 0; }
.anatomy-step .anatomy-io .io-row::before { display: inline-block; width: 32px; font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--c-text-mute); }
.anatomy-step .anatomy-io .io-in::before  { content: "IN  →"; }
.anatomy-step .anatomy-io .io-out::before { content: "OUT →"; }
.anatomy-input { display: inline-block; padding: 1px 6px; background: var(--c-accent-soft); border: 1px solid var(--c-accent-line); border-radius: 3px; font-family: 'IBM Plex Mono', monospace; font-size: 0.92em; color: var(--c-accent); white-space: nowrap; }
.anatomy-step[data-mode-hidden="true"] { display: none; }

/* =========================================================
   Tool R-code preview box — shared across all /tools/* pages
   Refined v3 palette (added 2026-04-30). Uses --c-surface-alt
   surface (auto-inverts in dark mode) with semantic syntax
   colors. Per-tool .r-code-block overrides were removed in
   favor of these shared rules so every tool renders the same
   refined look.
   ========================================================= */
.r-code-block {
  position: relative;
  margin-top: 18px;
  background: var(--c-surface-alt);
  color: var(--c-text);
  border: 1px solid var(--c-rule-soft);
  border-radius: 10px;
  padding: 14px 18px;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  overflow-x: auto;
  box-shadow: none;
}
.r-code-block pre,
.r-code-block code {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.r-code-block::before {
  content: 'R';
  position: absolute;
  top: 8px;
  right: 56px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--c-accent);
  background: var(--c-accent-soft);
  padding: 2px 7px;
  border-radius: 99px;
  font-family: 'IBM Plex Mono', monospace;
}
.r-code-block .copy-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: 1px solid var(--c-rule);
  color: var(--c-text-soft);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.r-code-block .copy-btn:hover {
  background: var(--c-accent-soft);
  border-color: var(--c-accent-line);
  color: var(--c-accent);
}
.r-code-block .copy-btn.copied {
  background: var(--c-success);
  border-color: var(--c-success);
  color: #fff;
}
.r-code-block .keyword { color: #0f1c3a; font-weight: 600; }
.r-code-block .fn      { color: var(--c-accent); }
.r-code-block .string  { color: var(--c-success); }
.r-code-block .number  { color: var(--c-warning); }
.r-code-block .comment { color: var(--c-text-mute); font-style: italic; }
.r-code-block .op      { color: var(--c-text); }

/* Dark-mode: brighter tokens for legibility on dark surface */
html.dark .r-code-block .keyword { color: #c8d3ee; }
html.dark .r-code-block .fn      { color: var(--c-accent-bright); }
html.dark .r-code-block .string  { color: #5fb88a; }
html.dark .r-code-block .number  { color: #d4a14a; }
html.dark .r-code-block .comment { color: var(--c-text-mute); }
html.dark .r-code-block .op      { color: var(--c-text); }
