/* ============================================================================
   AlgoDrill design system — maguey-terminal (ALGO-REVAMP-002)
   Single source of truth for all page styling. Replaces the per-page inline
   <style> blocks (and generate-pages.mjs TEMPLATE_CSS). Served same-origin so
   CSP style-src needs no hashes. Semantic tokens only — never hardcode hex
   outside :root. Theme: ~/projects/design/tokens/themes.json → maguey-terminal.
   ========================================================================== */

:root {
  --bg: #0B0F14; --fg: #E9E3D7; --accent: #5FA8D3; --accent2: #2F5D50;
  --muted: #0F1620; --muted-text: #A79F92; --border: rgba(233,227,215,0.16);
  --highlight: #EB8F2C; --brand-pop: #7CF2C7; --link: #5FA8D3; --link-hover: #8CC7E8;
  --danger: #B0302F;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--fg); font-family: 'SF Mono','JetBrains Mono','Fira Code','Cascadia Code',ui-monospace,monospace; line-height: 1.7; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
.skip-link { position: absolute; top: -40px; left: 0; background: var(--accent); color: var(--bg); padding: 8px 16px; font-weight: 700; z-index: 999; text-decoration: none; }
.skip-link:focus { top: 0; }

/* Site header */
header.site { border-bottom: 1px solid var(--border); }
header.site .inner { max-width: 820px; margin: 0 auto; padding: 1.1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
header.site .logo { font-size: 1.3rem; font-weight: 800; color: var(--brand-pop); letter-spacing: -0.5px; text-decoration: none; }
header.site .logo span { color: var(--accent); }
header.site nav a { font-size: 0.82rem; color: var(--muted-text); margin-left: 1.1rem; }
header.site nav a:hover { color: var(--link); }
header.site nav a[aria-current="page"] { color: var(--brand-pop); }

/* Main */
main { max-width: 820px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; flex: 1; width: 100%; }

/* Breadcrumb */
.breadcrumb { font-size: 0.78rem; color: var(--muted-text); margin-bottom: 1.2rem; }
.breadcrumb a { color: var(--muted-text); }
.breadcrumb a:hover { color: var(--link); }
.breadcrumb .sep { margin: 0 0.4rem; }

/* Article header */
.article-meta { font-size: 0.72rem; color: var(--muted-text); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.7rem; }
h1 { font-size: 1.8rem; font-weight: 800; line-height: 1.25; color: var(--brand-pop); margin-bottom: 0.75rem; }
p.lede { color: var(--muted-text); font-size: 0.97rem; margin-bottom: 1.75rem; line-height: 1.65; }

/* Body text */
h2 { font-size: 1.15rem; font-weight: 700; color: var(--accent); margin: 2.2rem 0 0.75rem; }
h3 { font-size: 1rem; font-weight: 700; color: var(--fg); margin: 1.4rem 0 0.4rem; }
p { font-size: 0.92rem; margin-bottom: 1rem; }
ul, ol { padding-left: 1.4rem; margin-bottom: 1rem; }
li { font-size: 0.92rem; margin-bottom: 0.35rem; }
li strong { color: var(--accent); }
strong { color: var(--fg); }
em { color: var(--muted-text); font-style: italic; }

/* Code */
code { background: var(--muted); color: var(--brand-pop); padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.88em; }
pre { background: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1rem 1.25rem; overflow-x: auto; margin-bottom: 1.4rem; }
pre code { background: none; padding: 0; font-size: 0.85rem; color: var(--fg); }
.kw { color: var(--accent); }
.str { color: var(--brand-pop); }
.comment { color: var(--muted-text); }

/* Code figures — build-time Prism highlighting (class-based, CSP-safe).
   Token colors map the maguey-terminal palette; see scripts/highlight-code.mjs */
.code-figure { margin: 1.5rem 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--muted); }
.code-filename { font-size: 0.72rem; color: var(--muted-text); padding: 0.45rem 1rem; border-bottom: 1px solid var(--border); background: rgba(233,227,215,0.03); letter-spacing: 0.03em; }
.code-figure pre { margin: 0; border: none; border-radius: 0; background: transparent; }
.token.keyword { color: var(--accent); }
.token.string, .token.triple-quoted-string { color: var(--brand-pop); }
.token.comment { color: var(--muted-text); font-style: italic; }
.token.number, .token.boolean { color: var(--highlight); }
.token.function, .token.class-name, .token.builtin, .token.decorator { color: var(--link-hover); }
.token.operator, .token.punctuation { color: var(--fg); opacity: 0.75; }

/* Formula block */
.formula { background: var(--muted); border-left: 3px solid var(--accent); border-radius: 4px; padding: 0.85rem 1.1rem; margin: 1rem 0 1.4rem; font-size: 1rem; font-weight: 700; color: var(--brand-pop); }
.formula .formula-label { display: block; font-size: 0.78rem; font-weight: 400; color: var(--muted-text); margin-top: 0.3rem; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.82rem; }
.data-table th { text-align: left; color: var(--accent); border-bottom: 2px solid var(--border); padding: 0.5rem 0.7rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; background: var(--muted); }
.data-table td { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); color: var(--fg); vertical-align: top; font-size: 0.82rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table td:first-child { color: var(--brand-pop); font-weight: 700; }

/* Callouts */
.callout { background: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1rem 1.25rem; margin: 1.4rem 0; font-size: 0.88rem; }
.callout p { margin-bottom: 0; }
.callout-warn { border-left: 3px solid var(--highlight); }
.callout-info { border-left: 3px solid var(--accent); }

/* Separator */
hr.sep { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* FAQ */
.faq { margin-top: 2.5rem; }
.faq-item { background: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1rem 1.25rem; margin-bottom: 0.85rem; }
.faq-item dt { font-weight: 700; color: var(--accent); margin-bottom: 0.35rem; font-size: 0.9rem; }
.faq-item dd { font-size: 0.85rem; color: var(--muted-text); }

/* CTA */
.cta-box { background: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin-top: 2.5rem; text-align: center; }
.cta-box p { margin-bottom: 0.9rem; font-size: 0.9rem; }
.btn { display: inline-block; background: var(--accent2); color: var(--fg); border: 1px solid var(--accent); padding: 0.55rem 1.2rem; border-radius: 4px; font-size: 0.88rem; font-weight: 700; text-decoration: none; }
.btn:hover { background: var(--accent); color: var(--bg); text-decoration: none; }

/* Footer */
footer.site { border-top: 1px solid var(--border); margin-top: auto; }
footer.site .inner { max-width: 820px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.35rem 0; margin-bottom: 0.5rem; font-size: 0.8rem; }
.footer-links a { color: var(--muted-text); }
.footer-links a:hover { color: var(--link-hover); }
.footer-links a.current { color: var(--brand-pop); }
.footer-sep { color: var(--border); margin: 0 0.5rem; }
.footer-by { color: var(--muted-text); margin-right: 0.5rem; }
.disclaimer { font-size: 0.73rem; color: var(--muted-text); margin: 0.75rem 0 0.35rem; line-height: 1.5; }
.footer-copy { font-size: 0.75rem; color: var(--muted-text); }

@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  main { padding: 1.5rem 1rem 3rem; }
  header.site nav a { margin-left: 0.7rem; }
}

/* ════════════════════════════════════════════════════════════════════════
   Home page + tools console (migrated from static/index.html inline styles,
   ALGO-REVAMP-003). The solid button variant is .btn-solid — distinct from
   the bordered article .btn above.
   ════════════════════════════════════════════════════════════════════════ */

.tagline { color: var(--muted-text); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* Hero terminal demo (ALGO-REVAMP-005). Default state = everything visible
   (no-JS / SEO / reduced-motion). JS sets data-anim="run" to hide, then
   reveals line by line and flips to data-anim="done" for the stats fade. */
.hero-lede { color: var(--muted-text); font-size: 0.95rem; margin-bottom: 1.5rem; line-height: 1.65; }
.hero-demo .code-figure { margin: 1.25rem 0 0; border-radius: 8px 8px 0 0; }
.hero-stats { border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; background: var(--bg); padding: 0.9rem 1rem 1rem; }
.stats-cmd { font-size: 0.78rem; color: var(--muted-text); margin-bottom: 0.55rem; }
.stats-grid { display: flex; gap: 1.75rem; flex-wrap: wrap; margin: 0; padding: 0; }
.stats-grid > div { display: flex; flex-direction: column; }
.stats-grid dt { font-size: 0.68rem; color: var(--muted-text); text-transform: uppercase; letter-spacing: 0.05em; }
.stats-grid dd { font-size: 1.05rem; font-weight: 700; margin: 0; }
.stats-grid dd.pos { color: var(--brand-pop); }
.stats-grid dd.neg { color: var(--highlight); }
.hero-honesty { font-size: 0.72rem; color: var(--muted-text); margin-top: 0.6rem; line-height: 1.55; }
.btn-row-hero { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.25rem 0 2.25rem; }

.hero-demo[data-anim="run"] .code-line { visibility: hidden; }
.hero-demo[data-anim="run"] .hero-stats { opacity: 0; transform: translateY(4px); }
.hero-demo .hero-stats { transition: opacity 0.45s ease, transform 0.45s ease; }
.code-line.type-cursor::after { content: "█"; color: var(--brand-pop); animation: blink-caret 0.9s steps(1) infinite; }
@keyframes blink-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hero-demo[data-anim] .code-line { visibility: visible !important; }
  .hero-demo[data-anim] .hero-stats { opacity: 1 !important; transform: none !important; transition: none; }
}

.value-prop { background: var(--muted); border-left: 3px solid var(--brand-pop); padding: 1rem 1.25rem; border-radius: 0 6px 6px 0; margin-bottom: 2rem; }
.value-prop p { margin: 0; font-size: 0.95rem; }

.features { display: grid; gap: 1rem; margin-bottom: 2.5rem; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature-tile { background: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; transition: border-color 0.15s; }
.feature-tile:hover { border-color: var(--accent); }
.feature-tile .tile-icon { font-size: 1.5rem; margin-bottom: 0.5rem; display: block; }
.feature-tile h3 { margin: 0 0 0.35rem; font-size: 0.9rem; color: var(--brand-pop); }
.feature-tile p { font-size: 0.8rem; color: var(--muted-text); margin: 0; }
.tile-title-link { color: inherit; text-decoration: none; }
.btn-cta { display: inline-block; margin-top: 1rem; text-decoration: none; }
.noscript-msg { text-align: center; color: var(--muted-text); font-size: 0.85rem; padding: 0.75rem 0; }

.badge { display: inline-block; background: var(--brand-pop); color: var(--bg); font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 3px; margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Forms */
label { font-size: 0.75rem; color: var(--muted-text); }
input, textarea, select { background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 4px; padding: 0.45rem 0.6rem; font-family: inherit; font-size: 0.85rem; transition: border-color 0.15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }

.btn-solid { background: var(--accent); color: var(--bg); border: none; border-radius: 4px; padding: 0.5rem 1.25rem; font-family: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: opacity 0.15s; white-space: nowrap; }
.btn-solid:hover { opacity: 0.85; color: var(--bg); text-decoration: none; }
.btn-solid:active { opacity: 0.7; }

/* Tools console (tabbed) */
.tools-section { margin-bottom: 2.5rem; }
.tools-intro { font-size: 0.9rem; color: var(--muted-text); margin-bottom: 1rem; }
.tool-card { background: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin-bottom: 1rem; }
.tool-card h3 { margin-top: 0; color: var(--brand-pop); }
.tool-card-desc { font-size: 0.8rem; color: var(--muted-text); margin-bottom: 0; }
.tool-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.form-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; min-width: 120px; }
.field-narrow { flex: 0; min-width: 160px; }
.btn-end { align-self: flex-end; }
.label-optional { color: var(--muted-text); }
.tool-result { margin-top: 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0.75rem 1rem; font-size: 0.85rem; line-height: 1.7; min-height: 48px; }
.tool-result.error { border-color: var(--danger); color: var(--danger); }
.tool-console { margin-top: 0.5rem; }
.tool-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.tool-tab { background: var(--muted); color: var(--muted-text); border: 1px solid var(--border); border-radius: 6px; padding: 0.4rem 0.85rem; font-family: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.tool-tab:hover { color: var(--fg); border-color: var(--accent); }
.tool-tab[aria-selected="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.tool-tab:focus-visible { outline: 2px solid var(--brand-pop); outline-offset: 2px; }
.tool-tabs[hidden], .tool-panel[hidden] { display: none; }

/* Content sections (home) */
.content-section { margin-bottom: 2.5rem; }
.content-section p { font-size: 0.9rem; }
.content-section li strong { color: var(--accent); }
.faq dl { display: flex; flex-direction: column; gap: 0.75rem; }

@media (max-width: 480px) {
  .form-row { flex-direction: column; }
}

/* ════════════════════════════════════════════════════════════════════════
   Study page — flashcard SRS UI (migrated from static/study/index.html,
   ALGO-REVAMP-003). Button system is .sbtn (borderless, opacity hover) —
   distinct from the bordered article .btn and the solid .btn-solid.
   ════════════════════════════════════════════════════════════════════════ */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.stats { font-size: 0.75rem; color: var(--muted-text); }

.card-wrap { max-width: 680px; display: flex; flex-direction: column; gap: 1.25rem; }

.card { background: var(--muted); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; min-height: 280px; display: flex; flex-direction: column; gap: 1rem; transition: border-color 0.15s; }
.card-meta { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--muted-text); }
.deck-label { text-transform: capitalize; }
.card-front { font-size: 1.05rem; font-weight: 600; color: var(--fg); flex: 1; }
.divider { border: none; border-top: 1px solid var(--border); }
.card-back { font-size: 0.9rem; color: var(--muted-text); line-height: 1.7; }
.card-sources { font-size: 0.72rem; line-height: 1.5; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: baseline; border-top: 1px dashed var(--border); padding-top: 0.65rem; }
.card-sources .src-label { text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: #BAB1A4; }
.card-sources .src-sep { color: var(--muted-text); }
.card-sources a { color: var(--link); }

.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn-row-center { justify-content: center; }

.sbtn { border: none; border-radius: 6px; padding: 0.55rem 1.4rem; font-family: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: opacity 0.15s; }
.sbtn:hover { opacity: 0.85; text-decoration: none; }
.sbtn:active { opacity: 0.7; }
.btn-flip { background: var(--accent); color: var(--bg); }
.btn-correct { background: var(--accent2); color: var(--fg); }
.btn-incorrect { background: var(--danger); color: var(--fg); }
.btn-neutral { background: var(--muted); color: var(--fg); border: 1px solid var(--border); }
a.btn-neutral { display: inline-block; }
a.btn-neutral:hover { color: var(--fg); }

.keyboard-hint { font-size: 0.7rem; color: var(--muted-text); margin-top: 0.25rem; }

.done-card { background: var(--muted); border: 1px solid var(--border); border-radius: 12px; padding: 2.5rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.done-icon { font-size: 2.5rem; }
.done-title { font-size: 1.2rem; font-weight: 700; color: var(--brand-pop); }
.done-sub { font-size: 0.85rem; color: var(--muted-text); }

.deck-filter { margin-bottom: 1.25rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.5rem; }
.chip { background: var(--muted); color: var(--muted-text); border: 1px solid var(--border); border-radius: 20px; padding: 0.28rem 0.8rem; font-family: inherit; font-size: 0.73rem; font-weight: 600; cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s; user-select: none; }
.chip[aria-pressed="true"] { background: var(--accent2); color: var(--brand-pop); border-color: rgba(124,242,199,0.4); }
.chip:hover { opacity: 0.82; }
.filter-summary { font-size: 0.7rem; color: var(--muted-text); line-height: 1.5; }

/* ════════════════════════════════════════════════════════════════════════
   Resources page — reading-list cards + affiliate tags
   (migrated from static/resources/index.html, ALGO-REVAMP-003)
   ════════════════════════════════════════════════════════════════════════ */

.breadcrumb span[aria-current="page"] { color: var(--fg); }
p.section-intro { color: var(--muted-text); font-size: 0.85rem; margin-bottom: 1rem; }

.disclosure { background: var(--muted); border: 1px solid var(--border); border-left: 3px solid var(--highlight); border-radius: 0 6px 6px 0; padding: 0.85rem 1.1rem; font-size: 0.82rem; color: var(--muted-text); margin-bottom: 0.5rem; }
.disclosure strong { color: var(--fg); }

ul.res-list { list-style: none; padding: 0; margin: 0; }
li.res { background: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem; margin-bottom: 0.85rem; }
li.res .res-meta { font-size: 0.7rem; color: var(--muted-text); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
li.res .res-title { font-size: 0.98rem; font-weight: 700; margin-bottom: 0.25rem; }
li.res .res-title a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
li.res .res-title a:hover { color: var(--brand-pop); }
li.res p { font-size: 0.84rem; color: var(--muted-text); margin: 0; }
.tag { display: inline-block; font-size: 0.62rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 3px; margin-left: 0.4rem; vertical-align: middle; letter-spacing: 0.04em; text-transform: uppercase; }
.tag-affiliate { background: rgba(235,143,44,0.18); color: var(--highlight); }
.tag-free { background: rgba(95,168,211,0.16); color: var(--accent); }

/* ════════════════════════════════════════════════════════════════════════
   Research index — study cards + ethos note
   (migrated from static/research/index.html, ALGO-REVAMP-003)
   ════════════════════════════════════════════════════════════════════════ */

.ethos { background: var(--muted); border-left: 3px solid var(--brand-pop); border-radius: 0 6px 6px 0; padding: 0.9rem 1.1rem; font-size: 0.85rem; color: var(--muted-text); margin-bottom: 2rem; }
.ethos strong { color: var(--fg); }

ul.studies { list-style: none; padding: 0; margin: 0; }
li.study { background: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
li.study .meta { font-size: 0.7rem; color: var(--muted-text); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
li.study .title { font-size: 1.02rem; font-weight: 700; margin-bottom: 0.3rem; }
li.study .title a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
li.study .title a:hover { color: var(--brand-pop); }
li.study p { font-size: 0.85rem; color: var(--muted-text); margin: 0 0 0.5rem; }
li.study .result { font-size: 0.8rem; color: var(--fg); }
li.study .result .pop { color: var(--brand-pop); font-weight: 700; }
li.study .links { font-size: 0.78rem; margin-top: 0.4rem; }

/* ════════════════════════════════════════════════════════════════════════
   Research article (time-series-momentum) — citation, stats table, figures.
   .research-callout is the left-accent note variant (distinct from the boxed
   .callout above — class-name conflict, renamed in the page HTML).
   (migrated from static/research/time-series-momentum/index.html, ALGO-REVAMP-003)
   ════════════════════════════════════════════════════════════════════════ */

.cite { font-size: 0.82rem; color: var(--muted-text); margin-bottom: 0.4rem; }
.cite a { color: var(--accent); }
.paperlinks { font-size: 0.8rem; margin-bottom: 1.5rem; }

.research-callout { background: var(--muted); border-left: 3px solid var(--brand-pop); border-radius: 0 6px 6px 0; padding: 0.9rem 1.1rem; font-size: 0.88rem; color: var(--fg); margin: 1.25rem 0; }
.research-callout.warn { border-left-color: var(--highlight); }

table.stats { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1.25rem; font-size: 0.88rem; }
table.stats th, table.stats td { text-align: left; padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--border); }
table.stats th { color: var(--muted-text); font-weight: 700; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em; }
table.stats td.val { color: var(--brand-pop); font-weight: 700; text-align: right; }
.text-right { text-align: right; }

figure { margin: 1.25rem 0; }
figure img { width: 100%; border: 1px solid var(--border); border-radius: 8px; display: block; }
figcaption { font-size: 0.76rem; color: var(--muted-text); margin-top: 0.4rem; text-align: center; }

/* ════════════════════════════════════════════════════════════════════════
   Build LLM Trading Agent guide — left-accent guide callout + layer cards.
   .guide-callout is the note variant with styled inner p/strong (distinct
   from the boxed .callout — class-name conflict, renamed in the page HTML);
   the page's solid .btn was renamed .btn-solid.
   (migrated from static/build-llm-trading-agent/index.html, ALGO-REVAMP-003)
   ════════════════════════════════════════════════════════════════════════ */

.guide-callout { background: var(--muted); border-left: 3px solid var(--brand-pop); border-radius: 0 6px 6px 0; padding: 0.9rem 1.1rem; font-size: 0.86rem; margin-bottom: 1.5rem; }
.guide-callout p { margin: 0; color: var(--muted-text); }
.guide-callout strong { color: var(--fg); }
.guide-callout.warn { border-left-color: var(--highlight); }
.guide-callout.warn strong { color: var(--highlight); }

.layers { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.layer-card { display: flex; gap: 1rem; align-items: flex-start; background: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem 1.1rem; }
.layer-number { font-size: 0.7rem; font-weight: 800; color: var(--bg); background: var(--accent); border-radius: 3px; padding: 2px 7px; white-space: nowrap; flex-shrink: 0; margin-top: 0.15rem; }
.layer-label { font-size: 0.88rem; font-weight: 700; color: var(--fg); margin-bottom: 0.15rem; }
.layer-desc { font-size: 0.82rem; color: var(--muted-text); margin: 0; }

/* ════════════════════════════════════════════════════════════════════════
   Risk-metric pillar pages (kelly / sharpe / sortino / calmar / information).
   .formula-box is the centered boxed formula variant (distinct from the
   left-accent .formula above — class-name conflict, renamed in page HTML).
   These pages also use .guide-callout (above) and .btn-solid for the CTA.
   (migrated from static/{kelly-criterion,…}/index.html, ALGO-REVAMP-003)
   ════════════════════════════════════════════════════════════════════════ */

.formula-box { background: #0a0e12; border: 1px solid var(--border); border-radius: 6px; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; text-align: center; font-size: 1.05rem; color: var(--brand-pop); font-weight: 700; letter-spacing: 0.02em; }

/* ════════════════════════════════════════════════════════════════════════
   /code section — hub card grid + walkthrough elements (ALGO-REVAMP-008a)
   .code-grid is a 2-col variant of .features for the hub card grid.
   .code-card extends .feature-tile with more structure.
   .code-meta is the run-info / version line at the top of each walkthrough.
   ════════════════════════════════════════════════════════════════════════ */

.code-grid { display: grid; gap: 1rem; margin-bottom: 2.5rem; }
@media (min-width: 540px) { .code-grid { grid-template-columns: repeat(2, 1fr); } }
.code-card { background: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; transition: border-color 0.15s; display: flex; flex-direction: column; }
.code-card:hover { border-color: var(--accent); }
.code-card h3 { font-size: 0.92rem; color: var(--brand-pop); margin: 0 0 0.4rem; }
.code-card h3 a { color: inherit; text-decoration: none; }
.code-card h3 a:hover { text-decoration: underline; }
.code-card p { font-size: 0.8rem; color: var(--muted-text); margin: 0 0 0.8rem; flex: 1; }
.code-card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; }
.code-tag { display: inline-block; background: rgba(95,168,211,0.10); color: var(--accent); border: 1px solid rgba(95,168,211,0.22); border-radius: 3px; font-size: 0.61rem; font-weight: 700; padding: 0.1rem 0.45rem; text-transform: uppercase; letter-spacing: 0.04em; }
.code-meta { background: var(--muted); border: 1px solid var(--border); border-left: 3px solid var(--accent2); border-radius: 0 6px 6px 0; padding: 0.65rem 1rem; font-size: 0.77rem; color: var(--muted-text); margin-bottom: 1.5rem; line-height: 1.7; }
.code-meta strong { color: var(--fg); }
.formula-box .formula-label { display: block; font-size: 0.72rem; color: var(--muted-text); font-weight: 400; margin-top: 0.5rem; letter-spacing: 0.04em; text-transform: uppercase; }

/* ─── /start path picker + /minimum-capital-to-start-trading ──────────
   .path-grid: 1-col mobile, 2-col ≥700px.
   .path-card: per-path entry with minimum, reality check, stack, links.
   .table-scroll: horizontal scroll wrapper for wide comparison tables.
   ─────────────────────────────────────────────────────────────────── */
.path-grid { display: grid; gap: 1.25rem; margin-bottom: 2rem; }
@media (min-width: 700px) { .path-grid { grid-template-columns: repeat(2, 1fr); } }
.path-card { background: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 1.35rem; display: flex; flex-direction: column; gap: 0.6rem; }
.path-card h3 { font-size: 0.92rem; color: var(--brand-pop); margin: 0; }
.path-card .path-min { font-size: 0.78rem; color: var(--accent); font-weight: 700; font-family: var(--mono); margin: 0; }
.path-card .path-check { font-size: 0.83rem; color: var(--fg); margin: 0; line-height: 1.65; }
.path-card .path-stack { font-size: 0.78rem; color: var(--muted-text); margin: 0; line-height: 1.55; }
.path-card .path-links { font-size: 0.8rem; margin-top: auto; padding-top: 0.6rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1.5rem; }
