@font-face {
  font-family: Geist;
  src: url("fonts/geist-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Geist;
  src: url("fonts/geist-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Geist;
  src: url("fonts/geist-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/playfair-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/playfair-500-italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

/* Trench Academy. GitBook-style docs layout in TAG's dark brand.
   Header, left sidebar, reading column, "On this page" on the right.
   Geist for everything, Geist Mono for code only. One accent: teal. */

:root {
  /* Same colour family as tagxalpha.xyz (assets/tag.css, DESIGN.md): teal-tinted near-black, teal as the one loud colour. */
  --bg: #04080a;
  --bg-raise: #0b1316;
  --bg-hover: rgba(214, 240, 243, 0.06);
  --bg-soft: rgba(214, 240, 243, 0.035);
  --border: rgba(214, 240, 243, 0.09);
  --border-strong: rgba(214, 240, 243, 0.17);
  --ink: #eaf7f8;
  --body: #c4d1d3;
  --soft: #b7c5c8;
  --mute: #8a9da0;
  --dim: #74878a;
  --rule: #121c20;
  --line: #0e171a;
  --frame: #18242a;
  --teal: #7ecfd6;
  --teal-hi: #a6e6eb;
  --teal-lo: #56b3bd;
  --teal-soft: rgba(126, 207, 214, 0.1);
  --teal-line: rgba(126, 207, 214, 0.32);
  --violet: #b794d4;
  --amber: #e9c46a;
  --red: #ef6b6b;
  --green: #5fd49a;
  --grad-text: linear-gradient(96deg, #a6e6eb 0%, #7ecfd6 38%, #b794d4 100%);
  --grad-btn: linear-gradient(180deg, #a6e6eb, #56b3bd);
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: Geist, ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --header-h: 64px;
  --sidebar-w: 288px;
  --toc-w: 232px;
  --read-w: 760px;
  --radius: 12px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: rgba(24, 25, 28, 0.9);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.brand img { width: 24px; height: auto; display: block; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.top-search {
  margin-left: auto; margin-right: auto;
  display: flex; align-items: center; gap: 10px;
  width: min(380px, 40vw); height: 38px; padding: 0 10px 0 12px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  color: var(--mute); font-size: 14px; cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s;
}
.top-search:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.top-search span { flex: 1; }
.top-search kbd, .search-kbd {
  font-family: var(--mono); font-size: 11px; color: var(--mute);
  border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; line-height: 1.5;
}
.top-links { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.top-link { font-size: 14px; color: var(--mute); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.top-link:hover { color: var(--ink); background: var(--bg-hover); }
.top-cta {
  font-size: 14px; font-weight: 500; text-decoration: none;
  color: var(--bg); background: var(--ink);
  padding: 7px 14px; border-radius: 8px;
}
.top-cta:hover { background: #fff; }
.icon-btn {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--soft);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--ink); }

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  max-width: 1480px; margin: 0 auto;
}
.shell.no-toc { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
  border-right: 1px solid var(--border);
}
.sidebar-scroll { height: 100%; overflow-y: auto; padding: 20px 14px 40px 20px; scrollbar-width: thin; scrollbar-color: #2a2c31 transparent; }
.track-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin: 0 0 18px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
}
.track-switch button {
  border: 0; background: none; border-radius: 7px; padding: 6px 8px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--mute);
}
.track-switch button[aria-pressed="true"] { background: var(--bg-raise); color: var(--ink); box-shadow: 0 0 0 1px var(--border-strong) inset; }
.side-track[hidden] { display: none; }
.side-home { margin-bottom: 14px; }
.side-group { margin: 0 0 18px; }
.side-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 0 4px; padding: 4px 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--dim);
  text-decoration: none;
}
a.side-title:hover { color: var(--soft); }
.side-stat { font-weight: 500; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; color: var(--dim); }
.side-kids { display: flex; flex-direction: column; gap: 1px; }
.side-link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 6px;
  font-size: 14px; line-height: 1.45; color: var(--mute); text-decoration: none;
  transition: background .12s, color .12s;
}
.side-link:hover { background: var(--bg-hover); color: var(--ink); }
.side-link.is-current { background: var(--teal-soft); color: var(--teal); font-weight: 500; }
.side-link > span:first-child { flex: 1; }
.side-link .soon {
  font-size: 10.5px; font-weight: 500; letter-spacing: .02em; color: var(--dim);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 0 7px; line-height: 1.6;
}
.side-link.is-soon { color: var(--dim); }
.side-check { display: none; width: 14px; height: 14px; flex: 0 0 14px; color: var(--teal); }
.side-link.is-done .side-check { display: block; }
.side-link.is-done:not(.is-current) { color: var(--soft); }
.side-foot { margin-top: 26px; padding: 14px 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.side-foot a { display: block; color: var(--mute); text-decoration: none; padding: 3px 0; }
.side-foot a:hover { color: var(--ink); }
.scrim { display: none; }

/* ---------- Main column ---------- */
.page { min-width: 0; padding: 40px 56px 80px; }
.page-inner { max-width: var(--read-w); margin: 0 auto; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; font-size: 13px; color: var(--teal); font-weight: 500; }
.crumbs li + li::before { content: "›"; color: var(--dim); margin-right: 6px; font-weight: 400; }
.crumbs a { color: var(--teal); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-head { margin: 0 0 32px; }
.page-head h1, .prose h1 {
  margin: 0; color: var(--ink);
  font-size: clamp(30px, 3.2vw, 38px); line-height: 1.18; font-weight: 650; letter-spacing: -0.025em;
  text-wrap: balance;
}
.page-head .lede, .prose .lede { margin: 12px 0 0; font-size: 18px; line-height: 1.6; color: var(--mute); }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 16px 0 0; font-size: 13px; color: var(--dim); }
.page-meta .pill {
  color: var(--soft); background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 10px; font-weight: 500;
}
.page-meta > span + span:not(.pill)::before { content: ""; }
.page-cover { margin: 0 0 28px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #0b0b0c; }
.page-cover figure.hero, .page-cover figure { margin: 0 !important; }
.page-cover img { display: block; width: 100%; height: auto; }
.coming-note, .coming-soon {
  margin: 18px 0 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--mute); font-size: 14px;
}
.track-rule { display: inline-block; margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--violet); }

/* mobile "On this page" */
.toc-inline { display: none; margin: 0 0 28px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); }
.toc-inline summary { list-style: none; cursor: pointer; padding: 11px 14px; font-size: 14px; font-weight: 500; color: var(--soft); display: flex; justify-content: space-between; align-items: center; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary svg { transition: transform .15s; color: var(--dim); }
.toc-inline[open] summary svg { transform: rotate(180deg); }
.toc-inline ol { list-style: none; margin: 0; padding: 0 14px 12px; }
.toc-inline li a { display: block; padding: 5px 0; font-size: 14px; color: var(--mute); text-decoration: none; }
.toc-inline li.toc-h3 a { padding-left: 14px; }

/* ---------- Prose ---------- */
.prose { color: var(--body); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--soft); }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--teal-line); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-color: var(--teal); color: #fff; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); letter-spacing: -0.015em; position: relative; scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h2 { font-size: 24px; line-height: 1.3; font-weight: 600; margin: 2.2em 0 0.6em; }
.prose h3 { font-size: 19px; line-height: 1.35; font-weight: 600; margin: 1.8em 0 0.5em; }
.prose h4 { font-size: 16px; font-weight: 600; margin: 1.5em 0 0.4em; }
.prose hr { border: 0; height: 0; margin: 0; }
.prose hr + h2, .prose hr + h3 { margin-top: 2.2em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 0.3em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--dim); }
.prose ol > li::marker { font-variant-numeric: tabular-nums; }
.prose blockquote { margin: 0 0 1.2em; padding: 2px 0 2px 16px; border-left: 2px solid var(--border-strong); color: var(--soft); }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--bg-raise); border: 1px solid var(--border); border-radius: 5px; padding: .08em .38em; color: var(--ink); }
.prose pre { background: var(--bg-raise); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.anchor {
  position: absolute; left: -1.2em; top: 0; width: 1.2em; text-align: left;
  color: var(--dim) !important; text-decoration: none !important; opacity: 0; transition: opacity .12s; font-weight: 400;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus { opacity: 1; }
.heading-anchor { color: var(--dim); text-decoration: none; margin-left: 8px; opacity: 0; font-weight: 400; }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor { opacity: 1; }

/* glossary terms */
.term {
  background: none; border: 0; padding: 0; margin: 0; cursor: help; color: inherit; font: inherit;
  text-decoration: underline dotted; text-decoration-color: var(--dim); text-underline-offset: 3px;
}
.term:hover, .term[aria-expanded="true"] { text-decoration-color: var(--teal); color: var(--ink); }
.term-pop, .gloss-pop, [role="tooltip"].term-tip {
  position: absolute; z-index: 60; max-width: 320px;
  background: #16171a; border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  padding: 12px 14px; font-size: 14px; line-height: 1.55; color: var(--soft);
}
.term-pop a, .gloss-pop a { color: var(--teal); }

/* Callouts (GitBook hints) */
.hint {
  display: flex; gap: 12px; margin: 1.4em 0; padding: 14px 16px;
  border-radius: var(--radius); border: 1px solid; font-size: 15px; line-height: 1.65;
  --c: var(--teal); background: color-mix(in srgb, var(--c) 8%, transparent); border-color: color-mix(in srgb, var(--c) 24%, transparent);
}
.hint-info { --c: #6aa8ff; }
.hint-tip, .hint-success { --c: var(--green); }
.hint-warning { --c: var(--amber); }
.hint-danger { --c: var(--red); }
.hint-label {
  margin: 0 !important; flex: 0 0 auto; display: flex; align-items: flex-start;
  font-size: 0 !important; line-height: 0; color: var(--c);
}
.hint-icon { display: block; padding-top: 3px; }
.hint-icon svg { width: 18px; height: 18px; display: block; }
.hint-body { flex: 1; min-width: 0; color: var(--body); }
.hint-body > :last-child { margin-bottom: 0; }
.hint-body strong { color: var(--ink); }

/* Key takeaways */
.takeaways { margin: 0 0 32px; padding: 16px 18px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--border); }
.takeaways-label { margin: 0 0 8px !important; font-size: 13px; font-weight: 600; color: var(--ink); }
.takeaways ul { margin: 0 !important; padding-left: 1.2em; }
.takeaways li { font-size: 15px; margin: .25em 0; }
.in-lesson { display: none; }

/* Stepper */
.stepper { list-style: none; counter-reset: step; padding: 0 !important; margin: 1.4em 0 1.6em; }
.stepper > .step { counter-increment: step; position: relative; padding: 0 0 22px 46px; margin: 0; }
.stepper > .step::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--bg-raise); border: 1px solid var(--border-strong);
}
.stepper > .step::after { content: ""; position: absolute; left: 13.5px; top: 34px; bottom: 6px; width: 1px; background: var(--border-strong); }
.stepper > .step:last-child { padding-bottom: 4px; }
.stepper > .step:last-child::after { display: none; }
.step-body { padding-top: 2px; }
.step-body > :last-child { margin-bottom: 0; }
.step-body h3, .step-body h4 { margin-top: 0; }

/* Tables */
.table-scroll { margin: 1.4em 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.prose th { color: var(--ink); font-weight: 600; background: var(--bg-soft); }
.prose tr:last-child td { border-bottom: 0; }
.prose td + td, .prose th + th { border-left: 1px solid var(--border); }

/* Expandables */
.prose details:not(.toc-inline) { margin: 0 0 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
.prose details:not(.toc-inline) > summary {
  cursor: pointer; list-style: none; padding: 12px 16px; color: var(--ink); font-weight: 500; font-size: 15px;
  display: flex; align-items: center; gap: 10px;
}
.prose details:not(.toc-inline) > summary::-webkit-details-marker { display: none; }
.prose details:not(.toc-inline) > summary::before {
  content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-right: 1.5px solid var(--mute); border-bottom: 1.5px solid var(--mute);
  transform: rotate(-45deg); transition: transform .15s; margin-right: 2px;
}
.prose details[open]:not(.toc-inline) > summary::before { transform: rotate(45deg); }
.prose details:not(.toc-inline) > :not(summary) { padding: 0 16px; }
.prose details:not(.toc-inline) .expand-body { padding: 0 16px 6px 33px; }
.prose details:not(.toc-inline) + :not(details) { margin-top: 1.4em; }

/* Tabs */
.tabs { margin: 1.4em 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tab-list { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); background: var(--bg-soft); padding: 0 8px; }
.tab-list[hidden] { display: none; }
.tab-list button {
  flex: 0 0 auto; border: 0; background: none; cursor: pointer; padding: 11px 12px 10px; font-size: 14px; font-weight: 500; color: var(--mute);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-list button:hover { color: var(--ink); }
.tab-list button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--teal); }
.tab-panel { padding: 18px 20px 6px; }
.tab-panel + .tab-panel { border-top: 1px solid var(--border); }
.tabs.is-ready .tab-panel + .tab-panel { border-top: 0; }
.tab-panel[hidden] { display: none; }
.tab-heading { font-weight: 600; color: var(--ink); }
.tabs.is-ready .tab-heading { display: none; }

/* Columns */
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 1.4em 0; }
.column { min-width: 0; padding: 16px 18px 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
.columns-merged .column { padding: 0; border: 0; background: none; }

/* Content-ref cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 1.4em 0; }
.card-grid-large { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.prose a.card, a.card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-soft);
  transition: border-color .15s, background .15s;
}
.prose a.card:hover, a.card:hover { border-color: var(--border-strong); background: var(--bg-hover); color: inherit; }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.card-title { color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.4; }
.card-desc { color: var(--mute); font-size: 14px; line-height: 1.5; }
.summary-card { margin: 1.4em 0; padding: 16px 18px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--border); }
.summary-card-body > :last-child { margin-bottom: 0; }
.tool-card { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); padding: 16px 18px; margin: 0 0 12px; }

/* Checklists */
.checklist-wrap { margin: 1.4em 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
.checklist-title { margin: 0 0 8px !important; font-size: 13px; font-weight: 600; color: var(--ink); }
.checklist { list-style: none; padding: 0 !important; margin: 0 !important; }
.check-item { margin: 0; padding: 0; }
.check-item label { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; cursor: pointer; font-size: 15px; line-height: 1.55; }
.check-item input {
  appearance: none; -webkit-appearance: none; flex: 0 0 18px; width: 18px; height: 18px; margin: 3px 0 0;
  border: 1.5px solid var(--border-strong); border-radius: 5px; background: transparent; cursor: pointer; display: grid; place-items: center;
}
.check-item input:checked { background: var(--teal); border-color: var(--teal); }
.check-item input:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #0b0b0c; border-bottom: 2px solid #0b0b0c; transform: translateY(-1px) rotate(-45deg); }
.check-item input:checked + span { color: var(--mute); text-decoration: line-through; text-decoration-color: var(--dim); }
.checklist-status { margin: 6px 0 0 !important; font-size: 13px; color: var(--dim); }
.checklist-status:empty { display: none; }
.checklist-link { font-size: 14px; }

/* Lesson lists (module and home pages) */
.lesson-list { list-style: none; padding: 0 !important; margin: 0 0 1.6em !important; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.lesson-list li { margin: 0; padding: 0; }
.lesson-list li + li { border-top: 1px solid var(--border); }
.prose a.lesson-link, a.lesson-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink);
  font-size: 15px; font-weight: 500; transition: background .12s;
}
.prose a.lesson-link:hover, a.lesson-link:hover { background: var(--bg-hover); color: var(--ink); }
.ll-num { display: none; }
.ll-title { flex: 1; }
.ll-time { color: var(--dim); font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; }
.lesson-link .side-check { width: 16px; height: 16px; }
.lesson-link.is-done .side-check { display: block; }
.lesson-link.is-soon { color: var(--mute); }
.lesson-link .soon { font-size: 12px; color: var(--dim); font-weight: 400; }
.level, .landing-count { display: inline-block; margin: 0 10px 18px 0 !important; font-size: 13px; color: var(--mute); }
.level { color: var(--soft); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 1px 10px; }
.landing-group h2 { margin-top: 1.4em; }
.landing-group h2 a { text-decoration: none; color: var(--ink); }
.back-track { font-size: 14px; }

/* Home */
.home-hero { margin: 8px 0 36px; }
.home-hero h1 { margin: 0; color: var(--ink); font-size: clamp(34px, 4vw, 46px); line-height: 1.1; font-weight: 650; letter-spacing: -0.03em; text-wrap: balance; }
.home-hero .lede { margin: 14px 0 0; font-size: 18px; color: var(--mute); max-width: 620px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px;
  font-size: 15px; font-weight: 500; text-decoration: none !important; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--bg-soft); color: var(--ink) !important;
}
.btn:hover { background: var(--bg-hover); border-color: rgba(255,255,255,.22); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg) !important; }
.btn-primary:hover { background: #fff; border-color: #fff; }
.home-progress { margin: 18px 0 0; font-size: 14px; color: var(--mute); }
.home-progress:empty { display: none; }
.home-section { margin: 44px 0 0; }
.home-section > h2 { margin: 0 0 6px !important; }
.home-section > .section-lede { margin: 0 0 16px; color: var(--mute); font-size: 15px; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.prose a.mod-card, a.mod-card {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 15px; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft); transition: border-color .15s, background .15s;
}
.prose a.mod-card:hover, a.mod-card:hover { border-color: var(--border-strong); background: var(--bg-hover); color: inherit; }
.mod-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.mod-card-code { font-weight: 600; letter-spacing: .04em; color: var(--teal); }
.mod-card-title { color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.35; }
.mod-card-desc { color: var(--mute); font-size: 14px; line-height: 1.5; }
.mod-card-meta { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--dim); }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.promo {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft);
}
.promo-title { color: var(--ink); font-weight: 600; font-size: 15px; }
.promo-desc { color: var(--mute); font-size: 14px; line-height: 1.5; margin: 0 !important; }
.promo a { font-size: 14px; font-weight: 500; color: var(--teal); text-decoration: none; margin-top: auto; }
.promo a:hover { text-decoration: underline; }
.promo code { align-self: flex-start; }

/* ---------- Lesson footer ---------- */
.lesson-foot { max-width: var(--read-w); margin: 48px auto 0; }
.complete-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); }
.complete-row p { margin: 0; font-size: 14px; color: var(--mute); }
.complete-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  height: 36px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--border-strong); background: var(--bg-soft); color: var(--ink);
}
.complete-btn:hover { background: var(--bg-hover); }
.complete-btn[aria-pressed="true"] { background: var(--teal-soft); border-color: var(--teal-line); color: var(--teal); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 0; }
.pager a {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; text-decoration: none;
  border: 1px solid var(--border); border-radius: 10px; transition: border-color .15s, background .15s; min-width: 0;
}
.pager a:hover { border-color: var(--teal-line); background: var(--bg-hover); }
.pager small { font-size: 12px; color: var(--dim); }
.pager span { color: var(--ink); font-weight: 500; font-size: 15px; line-height: 1.4; }
.pager .next { text-align: right; grid-column: 2; }
.pager .prev small::before { content: "← "; }
.pager .next small::after { content: " →"; }
.page-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--dim); }
.page-foot p { margin: 0; }
.page-foot button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--dim); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.page-foot button:hover { color: var(--soft); }

/* ---------- On this page ---------- */
.toc { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 40px 24px 40px 8px; }
.toc p { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a {
  display: block; margin-left: -1px; padding: 4px 0 4px 14px; border-left: 1px solid transparent;
  font-size: 13.5px; line-height: 1.45; color: var(--mute); text-decoration: none;
}
.toc li.toc-h3 a { padding-left: 26px; font-size: 13px; }
.toc li a:hover { color: var(--ink); }
.toc li a.is-active { color: var(--teal); border-left-color: var(--teal); }

/* ---------- Search ---------- */
.search-dialog {
  width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 120px)); margin: 10vh auto auto; padding: 0;
  background: #121315; color: var(--body); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6); overflow: hidden;
}
.search-dialog[open] { display: flex; flex-direction: column; }
.search-dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }
.search-form { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.search-form svg { color: var(--dim); flex: 0 0 auto; }
.search-form input { flex: 1; height: 56px; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 16px; }
.search-form input::-webkit-search-cancel-button { display: none; }
.search-results { overflow-y: auto; padding: 8px; }
.search-results:empty { display: none; }
.search-hit { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--body); }
.search-hit:hover, .search-hit.is-active, .search-hit:focus { background: var(--bg-hover); outline: 0; }
.search-hit strong, .search-hit .hit-title { display: block; color: var(--ink); font-weight: 500; font-size: 15px; }
.search-hit small, .search-hit .hit-section { display: block; color: var(--teal); font-size: 12px; margin-bottom: 2px; }
.search-hit span, .search-hit p { display: block; color: var(--mute); font-size: 13.5px; line-height: 1.5; margin: 2px 0 0; }
.search-hit mark { background: none; color: var(--ink); font-weight: 600; }
.search-status { margin: 0; padding: 10px 16px; font-size: 13px; color: var(--dim); border-top: 1px solid var(--border); }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
  .toc-inline { display: block; }
  .page { padding: 36px 40px 72px; }
}
@media (max-width: 900px) {
  :root { --header-h: 56px; }
  .top { padding: 0 8px 0 4px; gap: 4px; }
  .icon-btn { display: inline-flex; }
  .top-search, .top-link { display: none; }
  .top-links { margin-left: auto; }
  .top-cta { padding: 6px 12px; font-size: 13px; }
  .shell, .shell.no-toc { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; height: 100vh; height: 100dvh;
    width: min(320px, 86vw); background: var(--bg); border-right: 1px solid var(--border-strong);
    transform: translateX(-102%); transition: transform .22s ease; visibility: hidden;
  }
  .sidebar-scroll { padding-top: 16px; }
  body.menu-open .sidebar { transform: none; visibility: visible; box-shadow: 20px 0 50px rgba(0,0,0,.5); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open .scrim { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .side-close { display: inline-flex !important; }
  .page { padding: 24px 20px 64px; }
  .page-head h1, .prose h1 { font-size: 29px; }
  .page-head .lede { font-size: 17px; }
  .prose h2 { font-size: 21px; }
  .prose h3 { font-size: 18px; }
  .anchor { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
.side-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.side-head .brand { display: none; }
/* The close button only exists in the phone drawer. (It used to be hidden everywhere: this rule came after the phone one.) */
@media (min-width: 901px) { .side-close { display: none !important; } }
@media (max-width: 900px) { .side-head .brand { display: flex; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sidebar, .scrim { transition: none; }
}

/* ---------- Lesson tools (lesson-tools.js) ---------- */
.read-progress { display: none; }
.h-anchor { display: inline-flex; vertical-align: middle; margin-left: 8px; color: var(--dim); opacity: 0; transition: opacity .12s; text-decoration: none !important; }
.prose h2:hover .h-anchor, .prose h3:hover .h-anchor, .h-anchor:focus-visible { opacity: 1; }
.h-anchor:hover { color: var(--teal) !important; }
.copy-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: #1a1b1e; border: 1px solid var(--border-strong); color: var(--ink); font-size: 14px; padding: 8px 14px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.copy-toast[hidden] { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: var(--bg-raise); border: 1px solid var(--border-strong); color: var(--soft); }
.to-top[hidden] { display: none; }
.checklist-clear { margin-top: 8px; background: none; border: 0; padding: 0; color: var(--dim); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.term-pop[hidden] { display: none; }
.term-pop .term-pop-link, .term-pop a { display: inline-block; margin-top: 6px; font-size: 13px; }
.side-group-head a { color: inherit; text-decoration: none; }
.side-group-head a:hover, .side-group-head a.is-current { color: var(--teal); }
.module-check[hidden], .module-check:empty { display: none; }

/* ---------- Graphics and embeds (kept from the previous build) ---------- */


.embed-frame-wrap,
.x-embed {
  position: relative;
  margin: 1.35rem 0;
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.embed-frame-wrap::before,
.x-embed::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(var(--mute), var(--mute)) left top / 14px 2px no-repeat,
    linear-gradient(var(--mute), var(--mute)) left top / 2px 14px no-repeat,
    linear-gradient(var(--mute), var(--mute)) right top / 14px 2px no-repeat,
    linear-gradient(var(--mute), var(--mute)) right top / 2px 14px no-repeat,
    linear-gradient(var(--mute), var(--mute)) left bottom / 14px 2px no-repeat,
    linear-gradient(var(--mute), var(--mute)) left bottom / 2px 14px no-repeat,
    linear-gradient(var(--mute), var(--mute)) right bottom / 14px 2px no-repeat,
    linear-gradient(var(--mute), var(--mute)) right bottom / 2px 14px no-repeat;
}
.prose figure.redraw::before,
figure.redraw::before,
.prose figure.graphic::before {
  content: none;
  display: none;
  background: none;
}
.prose figure.graphic {
  margin: 1.6rem 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  max-width: 880px;
}
.prose figure.graphic picture,
.prose figure.graphic img {
  display: block;
  width: 100%;
  max-width: 880px;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  aspect-ratio: auto;
}
.prose figure.graphic figcaption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.45;
  color: var(--soft);
}
@media (max-width: 767px) {
  .prose figure.graphic,
  .prose figure.graphic picture,
  .prose figure.graphic img {
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
  }
}
.prose figure.graphic.panel,
.prose figure.graphic.panel img {
  aspect-ratio: auto;
}
.prose figure.graphic.panel a,
.prose figure.graphic.panel a:hover {
  display: block;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}
.card-cover img,
.embed-slot iframe,
.x-embed iframe {
  display: block;
  border: 1px solid var(--frame);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
  mix-blend-mode: normal;
  opacity: 1;
}
.card-cover { background: var(--bg); }

.x-embed { overflow: hidden; }
.x-embed iframe { max-width: 100% !important; }

.embed-slot { margin: 1.25rem 0; }
.embed-frame-wrap {
  overflow: hidden;
  background-color: var(--bg);
  min-height: var(--embed-h, 280px);
}
.embed-slot iframe {
  display: block;
  width: 100%;
  height: var(--embed-h, 280px);
  border: 1px solid var(--frame);
  background: transparent;
}
.embed-slot-placeholder {
  position: absolute;
  inset: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 8px;
  pointer-events: none;
}
.embed-slot.is-ready .embed-slot-placeholder { display: none; }
.embed-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: 1.6rem;
  color: var(--ink);
}
.embed-note { margin: 8px 0 0; color: var(--soft); font-size: 0.95rem; max-width: 36ch; }
.redraw {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  aspect-ratio: 16 / 9;
  margin: 1.6rem 0;
  padding: 16px;
  overflow: hidden;
}
.redraw-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
.redraw-caption {
  margin: 0;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.embed-slug {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--teal);
}
.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  max-width: 880px;
  margin: 0 0 14px;
}
.case-icon {
  width: 28px;
  height: 20px;
  flex: none;
  display: block;
}
.case-ticker {
  margin: 0;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.case-intro {
  flex-basis: 100%;
  margin: 0;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.5;
}
.prose figure.graphic svg[data-anim] {
  display: block;
  width: 100%;
  max-width: 880px;
  height: auto;
  background: transparent;
}
.prose figure.graphic svg.pnut-desk { aspect-ratio: 1600 / 618; }
.prose figure.graphic svg.pnut-phone { display: none; aspect-ratio: 660 / 812; }
.prose figure.graphic svg[data-anim] text {
  font-family: Geist, var(--sans);
}
.anim-ready [data-fx] {
  opacity: 0;
  transition:
    opacity .35s cubic-bezier(.22, .61, .36, 1) var(--d, 0s),
    transform .35s cubic-bezier(.22, .61, .36, 1) var(--d, 0s);
}
.anim-ready.is-in [data-fx] { opacity: 1; transform: none; }
.anim-ready [data-fx="up"] { transform: translateY(8px); }
.anim-ready [data-fx="pop"] {
  transform: scale(.6);
  transform-box: fill-box;
  transform-origin: center;
}
.anim-ready [data-fx="left"] { transform: translateX(-12px); }
.anim-ready [data-fx="right"] { transform: translateX(12px); }
.anim-ready [data-fx="grow"] {
  transform: scaleY(0);
  transform-box: fill-box;
  transform-origin: bottom;
}
.anim-ready [data-fx="draw"] {
  opacity: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset var(--draw, 1.4s) cubic-bezier(.22, .61, .36, 1) var(--d, 0s);
}
.anim-ready.is-in [data-fx="draw"] { stroke-dashoffset: 0; }
.anim-ready [data-fx="arrow"] {
  opacity: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .25s cubic-bezier(.22, .61, .36, 1) var(--d, 0s);
}
.anim-ready.is-in [data-fx="arrow"] { stroke-dashoffset: 0; }
svg[data-anim="line"].anim-ready [data-fx="pop"],
svg[data-anim="line"].anim-ready [data-fx="up"],
svg[data-anim="line"].anim-ready [data-fx="rise"],
svg[data-anim="line"].anim-ready [data-fx="fade"] {
  opacity: 1;
  transform: none;
  transition: none;
}
svg[data-anim="line"].anim-ready [data-fx="draw"] {
  opacity: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: none;
}
.anim-ready .fx-wait { opacity: 0; }
.anim-ready .fx-wait.is-on[data-preset="pop"] {
  transform-box: fill-box;
  transform-origin: center;
  animation: fx-pop 380ms linear both;
  animation-delay: var(--gap, 0ms);
}
.anim-ready .fx-wait.is-on[data-preset="rise"] {
  animation: fx-rise 300ms linear both;
  animation-delay: var(--gap, 0ms);
}
@keyframes fx-pop {
  0% { opacity: 0; transform: scale(0); animation-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
  62% { opacity: 1; transform: scale(1.2); animation-timing-function: cubic-bezier(.22, .61, .36, 1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes fx-rise {
  0% { opacity: 0; transform: translateY(6px); animation-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fx-pulse {
  0% { opacity: 0.45; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.2); }
}
img[data-anim].anim-ready {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity .5s cubic-bezier(.22, .61, .36, 1),
    transform .5s cubic-bezier(.22, .61, .36, 1);
}
img[data-anim="shot"].anim-ready { transform: none; transition-duration: .4s; }
img[data-anim].anim-ready.is-in { opacity: 1; transform: none; }
@media (max-width: 767px) {
  .prose figure.graphic svg[data-anim],
  .case-head { max-width: 100%; }
}
@media (max-width: 640px) {
  .prose figure.graphic svg.pnut-desk { display: none; }
  .prose figure.graphic svg.pnut-phone { display: block; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  [data-fx],
  [data-anim],
  .fx-wait {
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
    animation: none !important;
    transition: none !important;
  }
}
figure.hero{margin:28px 0;padding:0;width:100%;max-width:none;background:none;border:0;border-radius:0;box-shadow:none;outline:0;overflow:visible}
figure.hero picture{display:block}
figure.hero img{display:block;width:100%;height:auto;max-width:none;border:0;border-radius:0;box-shadow:none}
.prose figure.graphic svg.vv-desk { display: block; width: 100%; height: auto; }
.prose figure.graphic svg.vv-phone { display: none; width: 100%; height: auto; }
@media (max-width: 640px) {
  .prose figure.graphic svg.vv-desk { display: none; }
  .prose figure.graphic svg.vv-phone { display: block; }
}
.prose figure.graphic.has-caption figcaption{margin:10px 0 0;padding:0;max-width:60ch;font-family:Geist,"Geist Sans",system-ui,sans-serif;font-size:13px;line-height:1.45;letter-spacing:.01em;font-style:normal;font-weight:400;text-transform:none;color:#8E939C}
.card-text{display:block;margin:1.4rem 0 1.6rem;padding:0 0 0 14px;border:0;border-left:1px solid var(--teal);border-radius:0;background:none;box-shadow:none;max-width:62ch}
.card-text-kicker{display:block;margin:0 0 8px;font-family:var(--mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--mute)}
.card-text-num{font-family:var(--mono);color:var(--teal);margin-right:10px;letter-spacing:.06em}
.prose .card-text ul,.prose .card-text ol{margin:0;padding-left:1.1em}
.prose .card-text li{margin:4px 0;color:var(--soft)}
.prose .card-text li::marker{color:var(--violet)}
.card-text-name{color:var(--teal);font-weight:500}
.card-text-cover{display:block;border:0;padding:14px 0 0;margin:0}
.card-cover:has(.card-text){background:none}
.card-text-cover .card-text-kicker{margin:0}
.card-text-list{display:flex;flex-wrap:wrap;gap:4px 18px;margin-top:10px;font-size:.9rem;color:var(--soft)}
.card-text-item{white-space:nowrap}
.card-text-item .card-text-num{margin-right:6px}
.columns .card-text-cover{padding-top:0}
.columns .card-text-eyebrow{padding:0;margin:0 0 10px}
html.lb-open { overflow: hidden; }
dialog.lightbox {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: rgba(6, 7, 9, 0.97); color: var(--ink);
  font-family: var(--sans); cursor: zoom-out;
}
dialog.lightbox::backdrop { background: rgba(6, 7, 9, 0.9); }
dialog.lightbox[open] { display: flex; flex-direction: column; }
.lb-stage {
  flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center;
  padding: 56px 12px 8px; touch-action: pan-x pan-y pinch-zoom; -webkit-overflow-scrolling: touch;
}
.lb-stage svg, .lb-stage img { display: block !important; width: 100%; max-width: 1600px; height: auto; max-height: calc(100dvh - 160px); object-fit: contain; }
.lb-caption { flex: 0 0 auto; margin: 0 !important; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); max-width: 72ch; align-self: center; font-size: 15px; line-height: 1.5; color: var(--soft); max-height: 30dvh; overflow: auto; }
.lb-close {
  position: absolute; top: 10px; right: 10px; min-width: 44px; min-height: 44px; padding: 0 16px;
  font: 500 15px/1 var(--sans); color: var(--ink); background: #16181d; border: 0; border-radius: 0; cursor: pointer;
}
.lb-close:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.prose hr:has(+ h2) { display: none; }
.cover-kicker { color: var(--soft); font-weight: 500; }
.switch-note { margin: 0 0 16px; }
.page-meta .landing-count, .page-meta .level { margin: 0 !important; display: inline; background: none; border: 0; padding: 0; }
.toc p { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--soft); }
.prose .home-progress { margin: 16px 0 0; font-size: 14px; }
.prose .home-progress a { color: var(--soft); }
.card .card-cover .card-text-cover { padding: 14px 16px 0; }
.card .card-cover:has(.card-text) { background: none; }
/* Quizzes: question shown, answer behind a tap */
.prose ol.quiz { padding-left: 1.4em; }
.prose ol.quiz > li { margin: 0 0 14px; }
.quiz-ask { margin: 0 0 6px !important; }
.prose details.quiz-a { margin: 0; border: 0; background: none; }
.prose details.quiz-a > summary {
  display: inline-flex; padding: 3px 12px; border: 1px solid var(--border-strong); border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--mute); background: var(--bg-soft);
}
.prose details.quiz-a > summary::before { display: none; }
.prose details.quiz-a > summary:hover { color: var(--ink); border-color: rgba(255,255,255,.24); }
.prose details.quiz-a[open] > summary { color: var(--teal); border-color: var(--teal-line); background: var(--teal-soft); }
.prose details.quiz-a > .quiz-answer { padding: 8px 0 0 !important; color: var(--body); }
.quiz-a .qa-hide { display: none; }
.quiz-a[open] .qa-hide { display: inline; }
.quiz-a[open] .qa-show { display: none; }

/* Charcoal theme (2 Nov 2026): SVG graphics are recoloured to --bg at build time.
   PNG graphics still carry the old near-black, so they sit in a rounded dark card. */
.prose figure.graphic:has(img:not([src$=".svg"])), .prose figure.graphic:has(picture source[type="image/png"]) { background: var(--bg-raise); border-radius: 12px; overflow: hidden; }
.page-cover { background: #0b0b0c; }
.search-dialog { background: var(--bg-raise); }
.term-pop, .gloss-pop { background: #222327; }

/* ---------- Rebuilt Terminal screens (.tx) ----------
   Terminal's own look, measured 2 Nov 2026 (hub/academy/platforms/terminal/STYLE.md):
   #0e0e10 page, #242426 borders, #e4e4e7 text, #929296 muted, #20d978 up, #ef4444 down, #edca07 gold, Geist.
   The numbered teal markers are the academy's own frame. */
.tx-shot { margin: 1.6em 0; }
.tx { font-family: Geist, var(--sans); background: #0e0e10; color: #e4e4e7; border: 1px solid #2a2a2d; border-radius: 10px; padding: 16px 16px 18px; -webkit-font-smoothing: antialiased; }
.tx-bar { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.tx-title { font-size: 15px; font-weight: 500; color: #e4e4e7; }
.tx-tag { font-size: 11px; color: #929296; border: 1px solid #242426; border-radius: 16px; padding: 1px 8px; }
.tx-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tx-tile { position: relative; border: 1px solid #242426; border-radius: 4px; padding: 10px 4px 9px; text-align: center; min-width: 0; }
.tx-val { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 15px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
.tx-val svg { width: 15px; height: 15px; flex: 0 0 15px; }
.tx-val .tx-sep { color: #929296; font-weight: 400; margin: 0 1px; }
.tx-lbl { font-size: 12.5px; color: #929296; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .up { color: #20d978; } .tx .down { color: #ef4444; } .tx .gold { color: #edca07; } .tx .plain { color: #e4e4e7; } .tx .muted { color: #929296; }
.tx-n { position: absolute; top: -9px; left: -9px; z-index: 1; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #0b0b0c; font: 600 11px/1 var(--sans); box-shadow: 0 0 0 3px #0e0e10; }
.tx-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid #242426; margin: -4px -16px 0; padding: 0 8px; scrollbar-width: none; }
.tx-tabs > span { flex: 0 0 auto; position: relative; padding: 10px 10px 11px; font-size: 13px; font-weight: 500; color: #929296; white-space: nowrap; }
.tx-tabs > span.on { color: #86efac; box-shadow: inset 0 -2px 0 #86efac; }
.tx-tabs .tx-n { top: 2px; left: auto; right: -6px; }
.tx-scroll { overflow-x: auto; margin: 0 -16px -18px; }
.tx-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12px; font-weight: 500; }
.prose .tx-table th, .prose .tx-table td { border: 0; border-bottom: 1px solid rgba(36,36,38,.6); padding: 9px 12px; text-align: left; white-space: nowrap; vertical-align: middle; background: none; }
.prose .tx-table th { color: #929296; font-weight: 500; font-size: 12px; }
.prose .tx-table td { color: #e4e4e7; }
.tx-table .sub { display: block; color: #929296; font-weight: 400; margin-top: 2px; }
.tx-name { display: inline-flex; align-items: center; gap: 6px; }
.tx-name svg { width: 14px; height: 14px; }
.tx-chip { font-size: 11px; color: #86efac; background: rgba(134,239,172,.1); border-radius: 10px; padding: 1px 7px; }
.tx-pct { color: #20d978; background: rgba(32,217,120,.1); border-radius: 4px; padding: 1px 6px; margin-left: 8px; }
.tx-cell-n { position: relative; }
.tx-cell-n .tx-n { position: static; display: inline-grid; margin-right: 6px; vertical-align: middle; box-shadow: none; }
.tx-shot figcaption { margin-top: 10px; font-size: 13px; color: var(--mute); line-height: 1.5; }
.tx-key { list-style: none; padding: 0 !important; margin: 1em 0 1.6em !important; counter-reset: none; }
.tx-key > li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; margin: 0 0 12px; padding: 0; }
.tx-key > li > .tx-n { position: static; box-shadow: none; margin-top: 3px; }
.tx-key > li > div > p { margin: 0 !important; }
.tx-key .who { display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; border-radius: 999px; padding: 0 8px; margin-left: 6px; vertical-align: 1px; }
.tx-key .who.rule { color: var(--teal); background: var(--teal-soft); }
.tx-key .who.info { color: var(--mute); background: var(--bg-soft); border: 1px solid var(--border); }
@media (max-width: 520px) {
  .tx { padding: 14px 12px 16px; }
  .tx-tiles { gap: 8px; }
  .tx-val { font-size: 13.5px; gap: 4px; }
  .tx-val svg { width: 13px; height: 13px; flex-basis: 13px; }
  .tx-lbl { font-size: 11.5px; }
  .tx-tabs { margin: -4px -12px 0; }
  .tx-scroll { margin: 0 -12px -16px; }
}
/* Real-example stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 1.4em 0; }
.stat { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); padding: 14px 14px 12px; }
.stat b { display: block; color: var(--ink); font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--mute); }
.stat.hot b { color: var(--red); }
@media (max-width: 520px) { .stat-strip { grid-template-columns: 1fr; } .stat b { font-size: 24px; } }
.source-note { font-size: 13px !important; color: var(--dim); line-height: 1.55; }

.tx .table-scroll { border: 0; border-radius: 0; margin: 0; overflow: visible; }
.tx-table svg { width: 14px; height: 14px; flex: 0 0 14px; vertical-align: middle; }
.tx-holder { display: inline-flex; align-items: center; gap: 10px; }
.tx-tabs .tx-n { top: 0; right: -4px; }
.tx-split { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 0; margin: 0 -16px -18px; }
.tx-split .tx-scroll { margin: 0; }
.tx-dev { min-width: 440px !important; }
.tx-mig { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; border: 1.5px solid currentColor; }
.tx-dex { display: inline-block; border: 1px solid #333336; border-radius: 16px; padding: 3px 10px; color: #929296; }
.tx-dex.paid { color: #20d978; border-color: rgba(32,217,120,.35); }
.tx-stats { position: relative; border-left: 1px solid #242426; padding: 14px 14px 16px; font-size: 12.5px; }
.tx-stats .tx-n { top: 8px; left: auto; right: 10px; }
.tx-stats-title { color: #e4e4e7; font-size: 13.5px; margin-bottom: 8px; }
.tx-stats-grid { display: grid; grid-template-columns: 1fr; gap: 6px; color: #929296; }
.tx-stats-grid .sq { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.sq.up { background: #20d978; } .sq.down { background: #ef4444; } .sq.paid { background: #20d978; border-radius: 50%; } .sq.boost { background: #edca07; border-radius: 50%; }
@media (max-width: 640px) { .tx-split { grid-template-columns: 1fr; margin: 0 -12px -16px; } .tx-stats { border-left: 0; border-top: 1px solid #242426; } .tx-stats-grid { grid-template-columns: 1fr 1fr; } }
/* Terminal coin header and Track page rebuilds */
.tx-headbox { padding: 14px 16px; }
.tx-coin { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.tx-coin-id { display: flex; gap: 10px; align-items: center; }
.tx-avatar { width: 38px; height: 38px; border-radius: 6px; display: grid; place-items: center; background: #3a2418; color: #edca07; font-weight: 600; }
.tx-coin-name { font-size: 14px; font-weight: 600; }
.tx-coin-name .muted { font-weight: 400; margin-left: 4px; }
.tx-coin-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-top: 3px; }
.tx-views { position: relative; display: inline-flex; align-items: center; gap: 4px; color: #e4e4e7; }
.tx-views svg { width: 14px; height: 14px; }
.tx-views .tx-n { top: -14px; left: -14px; }
.tx-tip { background: #1b1b1e; border: 1px solid #333336; border-radius: 6px; padding: 6px 10px; font-size: 12px; display: grid; gap: 2px; min-width: 128px; }
.tx-tip b { font-weight: 500; color: #e4e4e7; }
.tx-tip span { display: flex; justify-content: space-between; color: #929296; }
.tx-tip i { font-style: normal; color: #e4e4e7; }
.tx-stats-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; border-top: 1px solid #242426; padding-top: 12px; }
.tx-stats-row > div { position: relative; }
.tx-stats-row .tx-n { top: -16px; left: -12px; }
.tx-mc { font-size: 20px; font-weight: 600; }
.tx-k { display: block; font-size: 12px; color: #929296; }
.tx-v { display: block; font-size: 14px; font-weight: 500; margin-top: 1px; }
.tx-sol { display: inline-block; width: 10px; height: 8px; margin-right: 4px; background: linear-gradient(#9945ff,#14f195); clip-path: polygon(15% 0,100% 0,85% 30%,0 30%,15% 35%,100% 35%,85% 65%,0 65%,15% 70%,100% 70%,85% 100%,0 100%); vertical-align: 0; }
.tx-track { display: grid; grid-template-columns: 1.3fr 1fr; padding: 0; overflow: hidden; }
.tx-track-l { padding: 0 14px 12px; border-right: 1px solid #242426; }
.tx-track-r { padding: 0 14px 12px; }
.tx-track .tx-tabs { margin: 0 -14px 10px; padding: 0 6px; }
.tx-search { border: 1px solid #242426; border-radius: 6px; padding: 7px 10px; font-size: 12px; color: #6b6b70; margin-bottom: 6px; }
.tx-kol { display: grid; grid-template-columns: 20px 1fr auto 22px; gap: 8px; align-items: center; padding: 7px 2px; font-size: 12.5px; border-bottom: 1px solid rgba(36,36,38,.6); }
.tx-kol-av { width: 18px; height: 18px; border-radius: 50%; background: #2c2c30; }
.tx-kol-add svg { width: 14px; height: 14px; display: block; }
.tx-track-tools { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: #929296; }
.tx-track-tools .on { color: #e4e4e7; }
.tx-btn { margin-left: auto; background: #86efac; color: rgba(0,0,0,.87); border-radius: 16px; padding: 4px 12px; font-weight: 500; }
.tx-empty { color: #929296; font-size: 12.5px; text-align: center; padding: 48px 0 32px; }
@media (max-width: 640px) { .tx-track { grid-template-columns: 1fr; } .tx-track-l { border-right: 0; border-bottom: 1px solid #242426; } .tx-coin { flex-direction: column; } }
.tx-views .tx-n { top: -11px; left: auto; right: -20px; }
.tx-stats-row .tx-n { position: static; display: inline-grid; margin: 0 6px 3px 0; box-shadow: none; vertical-align: middle; }
.tx-stats-row .tx-mc .tx-n { margin-bottom: 6px; }
.tx-track > div { min-width: 0; }
.tx-coin-meta { margin-right: 20px; }
.tx-views .tx-n { position: static; display: inline-grid; margin-left: 6px; box-shadow: none; }

/* X Tracker rebuilds (L4.2) */
.tx .tx-in { position: static; display: inline-grid; box-shadow: none; margin: 0 0 0 7px; vertical-align: middle; flex: 0 0 20px; }
.tx-xt { padding: 0; max-width: 460px; overflow: hidden; }
.tx-xt-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #242426; }
.tx-xt-title { font-size: 13.5px; font-weight: 500; }
.tx-xt-tools { display: flex; align-items: center; gap: 10px; }
.tx-xt-tools svg { width: 16px; height: 16px; }
.tx-xt-gap { width: 6px; }
.tx-xt-post { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 12px; border-bottom: 1px solid #242426; }
.tx-xt-launch { border: 1px solid #1f6b43; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #86efac; font-size: 9.5px; letter-spacing: .04em; min-height: 120px; }
.tx-xt-launch svg { width: 15px; height: 15px; }
.tx-xt-launch .tx-in { margin: 4px 0 0; }
.tx-xt-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.tx-xt-av { width: 26px; height: 26px; border-radius: 50%; background: #2a2a2d; flex: 0 0 26px; }
.tx-xt-av.sm { width: 18px; height: 18px; flex-basis: 18px; }
.tx-xt-handle { font-weight: 500; }
.tx-xt-reply { font-size: 12.5px; margin: 4px 0 0 32px; }
.tx-xt-link { color: #58a6ff; }
.tx .tx-xt-text { margin: 4px 0 6px 32px; font-size: 13.5px; }
.tx-xt-tr { display: flex; align-items: center; gap: 6px; margin-left: 32px; color: #58a6ff; font-size: 13px; }
.tx-xt-tr svg { width: 15px; height: 15px; }
.tx-xt-quote { margin: 10px 0 0 32px; border: 1px solid #242426; border-radius: 8px; padding: 9px 10px; }
.tx .tx-xt-quote p { margin: 5px 0 0; font-size: 13px; line-height: 1.45; color: #e4e4e7; }
.tx-xt-cut { max-height: 64px; overflow: hidden; border-bottom: 0; -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent); }
.tx-xt-cut .tx-xt-launch { min-height: 60px; }
.tx-xl { padding-top: 4px; max-width: 460px; }
.tx-xl .tx-tabs > span { flex: 1 1 0; text-align: center; }
.tx-xl .tx-tabs > span.on { color: #86efac; box-shadow: inset 0 -2px #86efac; }
.tx-xl-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; }
.tx-xl-ghost { background: #1c1c1f; border-radius: 16px; padding: 4px 12px; display: inline-flex; align-items: center; }
.tx-xl-dots { color: #929296; font-size: 16px; }
.tx-xl .tx-btn { display: inline-flex; align-items: center; }
.tx-xl .tx-btn .tx-in, .tx-xl-ghost .tx-in { margin-right: -4px; }
.tx-xl-sw { display: flex; gap: 12px; color: #929296; white-space: nowrap; }
.tx-xl-sw .on { color: #e4e4e7; }
.tx-xl .tx-search { flex: 1; margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-xl .tx-tabs .tx-in { margin-left: 6px; }

/* Pump.fun rebuilds: measured 1 Nov 2026 (pump-fun STYLE.md) */
.pf { background: #0a0a0b; border-color: #1e1e22; color: #ededef; }
.pf .up { color: #4ade80; } .pf .down { color: #f87171; } .pf .gold { color: #facc15; }
.pf .tx-n { box-shadow: none; }
.pf-ex { padding: 12px 0 4px; }
.pf-tabs { display: flex; gap: 6px; padding: 0 12px 12px; overflow-x: auto; scrollbar-width: none; }
.pf-tabs > span { flex: 0 0 auto; display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; color: #9b9ba2; padding: 5px 10px; border-radius: 8px; }
.pf-tabs > span.on { background: #86efac; color: #052e16; }
.pf-scroll { overflow-x: auto; }
.tx .pf-table { width: 100%; min-width: 560px; border-collapse: collapse; margin: 0; font-size: 13.5px; border: 0; }
.tx .pf-table th { text-align: right; font-size: 11.5px; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; color: #68686f; padding: 9px 12px; border: 0; border-top: 1px solid #1e1e22; border-bottom: 1px solid #1e1e22; background: none; white-space: nowrap; }
.tx .pf-table td { text-align: right; padding: 9px 12px; border: 0; border-bottom: 1px solid #1e1e22; white-space: nowrap; background: none; color: #ededef; }
.tx .pf-table th:first-child, .tx .pf-table td:first-child { text-align: left; }
.tx .pf-table tr:last-child td { border-bottom: 0; }
.pf-coin { display: flex; align-items: center; gap: 9px; }
.pf-coin > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.pf-av { width: 28px; height: 28px; border-radius: 6px; background: #272a2d; flex: 0 0 28px; display: inline-block; }
.pf-av.lg { width: 34px; height: 34px; border-radius: 50%; flex-basis: 34px; }
.pf-tk { font-size: 12px; color: #9b9ba2; }
.pf-pct { display: inline-block; font-size: 12.5px; padding: 1px 6px; border-radius: 4px; }
.pf-pct.up { background: rgba(74,222,128,.12); } .pf-pct.down { background: rgba(248,113,113,.12); }
.pf-mute { color: #9b9ba2; font-size: 13px; }
.pf-co { max-width: 460px; }
.pf-co-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.tx .pf-co-text { margin: 8px 0 10px 44px; font-size: 14px; }
.pf-co-card { margin-left: 44px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; border: 1px solid #1e1e22; border-radius: 10px; padding: 10px 12px; background: #111113; font-size: 13.5px; }
.pf-co-coin, .pf-co-num { display: flex; flex-direction: column; line-height: 1.3; }
.pf-co-num { text-align: right; position: relative; }
.pf-co-num .tx-in { position: absolute; top: -18px; right: -18px; margin: 0; }
.pf-co-foot { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 0 44px; font-size: 13px; }
.tx-al { padding: 0; max-width: 520px; overflow: hidden; }
.tx-al-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 12px; }
.tx-al-av { width: 40px; height: 40px; border-radius: 6px; background: #3a2a14; color: #edca07; display: grid; place-items: center; font-weight: 600; }
.tx-al-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; flex-wrap: wrap; }
.tx-al-pills { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; font-size: 13px; }
.tx-al-first { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #7f1d1d; color: #ef4444; border-radius: 6px; padding: 2px 8px; }
.tx-al-dot { width: 13px; height: 13px; border-radius: 50%; background: #3b4a7a; }
.tx-al-groups { display: inline-flex; align-items: center; border: 1px solid #edca07; color: #edca07; border-radius: 16px; padding: 2px 10px; }
.tx-al-mc { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 640px) {
  .tx .pf-table { min-width: 0; font-size: 12px; }
  .tx .pf-table th, .tx .pf-table td { padding: 8px 5px; }
  .tx .pf-table th { font-size: 10px; letter-spacing: 0; }
  .tx .pf-table th:first-child, .tx .pf-table td:first-child { padding-left: 10px; }
  .tx .pf-table th:last-child, .tx .pf-table td:last-child { padding-right: 10px; }
  .tx .pf-table th:nth-child(2), .tx .pf-table td:nth-child(2), .tx .pf-table th:nth-child(4), .tx .pf-table td:nth-child(4), .pf-table .pf-av { display: none; }
  .pf-pct { padding: 1px 3px; font-size: 11px; }
  .pf-table .tx-in { width: 16px; height: 16px; font-size: 9.5px; margin-left: 3px; }
  .pf-co-card, .pf-co-foot { margin-left: 0; }
  .tx .pf-co-text { margin-left: 0; }
}
img.pf-av, img.tx-xt-av, img.tx-kol-av { object-fit: cover; display: inline-block; margin: 0; }
img.pf-av { border-radius: 6px; } img.pf-av.lg, img.tx-xt-av, img.tx-kol-av { border-radius: 50%; }
.tx-al-g { width: 16px; height: 16px; border-radius: 50%; background: var(--bg); vertical-align: -3px; margin: 0 4px 0 2px; display: inline-block; }
.tx-track-l .tx-tabs > span:nth-child(2) { display: none; }
@media (max-width: 640px) { .tx-track .tx-tabs > span { padding: 10px 7px 11px; font-size: 12.5px; } }

/* $PNUT case chart head */
.prose figure.graphic img.case-icon { width: 40px; height: 40px; border-radius: 50%; margin: 0; flex: none; }
.case-ticker { font-family: Geist, var(--sans) !important; letter-spacing: 0 !important; font-size: 17px !important; font-weight: 600 !important; }
.case-ticker span { font-weight: 400; color: var(--soft); font-size: 14px; margin-left: 6px; }
.prose figure.graphic.case-anim { background: transparent !important; border: 1px solid var(--border); border-radius: 12px; padding: 18px 18px 6px; overflow: hidden; }
.prose figure.graphic.case-anim .case-head { margin-bottom: 4px; }
.prose figure.graphic.case-anim .case-intro { font-size: 14px; }

/* ---------- 2 Nov UI upgrades ---------- */
/* 1. Linked number keys */
.tx-shot .tx-n { transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.tx-shot.keys-on .tx-n { opacity: .4; }
.tx-shot.keys-on .tx-n.is-hot { opacity: 1; transform: scale(1.3); box-shadow: 0 0 0 4px rgba(88, 190, 210, .3); }
.tx-shot.keys-on .tx-in.is-hot { transform: scale(1.25); }
ol.tx-key > li { border-radius: 10px; transition: background .18s ease; cursor: pointer; margin-left: -10px; margin-right: -10px; padding-left: 10px; padding-right: 10px; }
ol.tx-key > li.is-hot { background: rgba(88, 190, 210, .07); }
ol.tx-key > li > .tx-n { transition: transform .18s ease; }
ol.tx-key > li.is-hot > .tx-n { transform: scale(1.12); }

/* 2. Tap to enlarge (phone and small tablets) */
.zoom-box { position: fixed; inset: 0; z-index: 200; background: #121315; display: flex; flex-direction: column; animation: zoom-in .18s ease; }
.zoom-box[hidden] { display: none; }
@keyframes zoom-in { from { opacity: 0; } to { opacity: 1; } }
html.zoom-open, html.zoom-open body { overflow: hidden; }
.zoom-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-raise); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.zoom-stage { flex: 1; overflow: auto; display: flex; align-items: center; padding: 64px 12px 12px; -webkit-overflow-scrolling: touch; }
.zoom-stage > figure { margin: 0 auto !important; width: 100%; max-width: none !important; }
.zoom-stage.is-zoomed { align-items: flex-start; }
.zoom-stage.is-zoomed > figure { zoom: 1.9; flex: none; }
.zoom-stage .tx-n { animation: none; }
.zoom-tip { margin: 0; padding: 10px 0 18px; text-align: center; color: var(--mute); font-size: 13px; }
@media (max-width: 900px) {
  .prose figure.can-zoom { position: relative; cursor: zoom-in; }
  .prose figure.can-zoom::after { content: ""; position: absolute; bottom: -2px; right: 0; width: 26px; height: 26px; border-radius: 8px; background: rgba(24, 25, 28, .85) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23d4d4d8' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M9.5 2.5h4v4M13.5 2.5L9 7M6.5 13.5h-4v-4M2.5 13.5L7 9'/%3E%3C/svg%3E") center / 14px no-repeat; border: 1px solid var(--border); pointer-events: none; }
}

/* 5. Link icon on headings */
.prose h2[id], .prose h3[id] { position: relative; }
.h-link { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 8px; vertical-align: middle; border-radius: 6px; color: var(--mute); opacity: 0; transition: opacity .15s ease, color .15s ease, background .15s ease; text-decoration: none !important; border: 0 !important; }
.h-link svg { width: 15px; height: 15px; }
.prose h2:hover .h-link, .prose h3:hover .h-link, .h-link:focus-visible { opacity: 1; }
.h-link:hover { color: var(--teal); background: var(--bg-raise); }
@media (hover: none) { .h-link { opacity: .55; } }
.copy-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); z-index: 210; background: var(--bg-raise); color: var(--ink); border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.copy-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* 7. Soft fade between pages (browsers without view transitions just load normally) */
@view-transition { navigation: auto; }
header.top { view-transition-name: site-top; }
nav.sidebar { view-transition-name: site-side; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; animation-timing-function: ease; }
::view-transition-old(root) { animation-name: page-out; }
::view-transition-new(root) { animation-name: page-in; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* Terminal Trending row and Market Lighthouse rebuilds (M3) */
.tx-trend { padding: 12px 0 6px; }
.tx-trend-tabs { display: flex; align-items: center; gap: 16px; padding: 0 14px 12px; font-size: 16px; font-weight: 500; color: #929296; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.tx-trend-tabs > .on { color: #e4e4e7; }
.tx-trend-tf { display: inline-flex; gap: 10px; font-size: 13px; margin-left: 4px; }
.tx-trend-tf .on { color: #86efac; }
.tx .tx-trend-table { width: 100%; min-width: 620px; border-collapse: collapse; margin: 0; border: 0; font-size: 14px; }
.tx .tx-trend-table th { text-align: left; font-weight: 400; font-size: 13px; color: #929296; padding: 10px 14px; border: 0; border-top: 1px solid #242426; border-bottom: 1px solid #242426; background: none; white-space: nowrap; }
.tx .tx-trend-table td { padding: 12px 14px; border: 0; vertical-align: middle; line-height: 1.5; background: none; color: #e4e4e7; white-space: nowrap; }
.tx-trend-pair { display: flex; align-items: center; gap: 10px; }
.tx-trend-eye { display: inline-flex; align-items: center; gap: 4px; color: #e4e4e7; margin-left: 6px; }
.tx-trend-eye svg { width: 15px; height: 15px; color: #929296; }
td .tx-trend-eye:only-child { margin-left: 0; }
.tx-lh { max-width: 420px; padding: 14px; }
.tx-lh-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tx-lh-tf { display: flex; gap: 12px; font-size: 13px; color: #929296; }
.tx-lh-tf .on { color: #86efac; display: inline-flex; align-items: center; }
.tx-lh-box { border: 1px solid #242426; border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.tx-lh-box > span:first-child { font-size: 13px; display: inline-flex; align-items: center; }
.tx-lh-vol { margin: 12px 0 4px; font-size: 14px; }
.tx-lh-volrow { display: flex; justify-content: space-between; align-items: center; }
.tx-lh-volrow.small { font-size: 13px; }
.tx-lh-bar { display: flex; gap: 4px; margin: 8px 0 6px; }
.tx-lh-bar span { height: 3px; border-radius: 2px; background: #20d978; }
.tx-lh-bar span + span { background: #ef4444; }
.tx-lh-sub { margin: 14px 0 8px; font-size: 14px; }
.tx-lh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 640px) {
  .tx .tx-trend-table { min-width: 0; font-size: 12.5px; }
  .tx .tx-trend-table th, .tx .tx-trend-table td { padding: 9px 6px; }
  .tx .tx-trend-table th:first-child, .tx .tx-trend-table td:first-child { padding-left: 10px; }
  .tx .tx-trend-table th:nth-child(2), .tx .tx-trend-table td:nth-child(2), .tx .tx-trend-table th:nth-child(3), .tx .tx-trend-table td:nth-child(3) { display: none; }
  .tx-trend-pair .muted { display: none; }
  .tx-trend-tabs { font-size: 14px; gap: 12px; }
}
@media (max-width: 640px) { .tx-trend-pair .tx-al-av { display: none; } .tx-trend-eye { margin-left: 4px; } .tx .tx-trend-table th, .tx .tx-trend-table td { padding: 9px 5px; } }
@media (max-width: 640px) {
  .prose table.stack-phone, .prose table.stack-phone tbody, .prose table.stack-phone tr, .prose table.stack-phone td { display: block; width: 100%; }
  .prose table.stack-phone thead { display: none; }
  .prose table.stack-phone tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
  .prose table.stack-phone tr:last-child { border-bottom: 0; }
  .prose table.stack-phone td { border: 0 !important; padding: 3px 14px !important; }
  .prose table.stack-phone td:first-child { font-weight: 600; color: var(--ink); padding-top: 6px !important; }
  .prose table.stack-phone td:not(:first-child)::before { content: attr(data-label) ": "; color: var(--mute); }
  .table-scroll:has(table.stack-phone) { overflow: visible; }
}

/* Terminal buy panel rebuild (M5) */
.tx-tp { max-width: 400px; padding: 14px; font-size: 14px; }
.tx-tp-presets { display: flex; align-items: center; gap: 16px; color: #929296; font-weight: 500; margin-bottom: 12px; }
.tx-tp-presets .on { color: #86efac; }
.tx-tp-gear svg, .tx-tp-edit svg { width: 16px; height: 16px; display: block; }
.tx-tp-tabs { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; margin-bottom: 10px; }
.tx-tp-seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #242426; border-radius: 6px; padding: 2px; }
.tx-tp-seg > span { text-align: center; padding: 6px 0; border-radius: 4px; color: #929296; font-weight: 500; }
.tx-tp-seg > .on { background: #20d978; color: #0e0e10; }
.tx-tp-type { border: 1px solid #242426; border-radius: 6px; padding: 7px 10px; }
.tx-tp-total { display: flex; justify-content: space-between; border: 1px solid #242426; border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.tx-tp-amts { display: grid; grid-template-columns: repeat(4, 1fr) 32px; gap: 6px; align-items: center; position: relative; }
.tx-tp-amts > span:not(.tx-n) { border: 1px solid #242426; border-radius: 6px; text-align: center; padding: 6px 0; }
.tx-tp-edit { display: grid; place-items: center; height: 100%; color: #929296; }
.tx .tx-tp-amts > .tx-in { position: absolute; left: auto; right: -8px; top: -10px; margin: 0; }
@media (max-width: 640px) { .tx-tp-gas > .muted { display: none; } .tx-tp-gas { justify-content: space-between; gap: 4px; } }
.tx-tp-exit { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; }
.tx-tp-box { width: 16px; height: 16px; border-radius: 3px; background: #20d978; display: grid; place-items: center; }
.tx-tp-box svg { width: 12px; height: 12px; }
.tx-tp-add { display: flex; justify-content: space-between; background: #18181b; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.tx-tp-gas { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tx-tp-gas > .muted { margin-right: auto; }
.tx-tp-g { display: inline-flex; align-items: center; gap: 3px; }
.tx-tp-g svg { width: 14px; height: 14px; color: #929296; }
.tx-tp-g .tx-in { margin-left: 3px; width: 18px; height: 18px; font-size: 10px; }
.tx-tp-buy { background: #20d978; color: #0e0e10; text-align: center; border-radius: 999px; padding: 11px 0; font-weight: 600; font-size: 15px; }

/* Terminal Top Traders and Cielo wallet rebuilds (M7) */
.tx-tt { padding: 4px 0 6px; }
.tx-tt .tx-tabs { margin: 0 0 0; padding: 0 8px; }
.tx .tx-tt-table { width: 100%; min-width: 0; border-collapse: collapse; margin: 0; border: 0; font-size: 13.5px; }
.tx .tx-tt-table th { text-align: left; font-weight: 400; font-size: 12.5px; color: #929296; padding: 10px 10px; border: 0; border-bottom: 1px solid #242426; background: none; white-space: nowrap; }
.tx .tx-tt-table td { padding: 11px 10px; border: 0; border-bottom: 1px solid #1c1c1f; background: none; color: #e4e4e7; white-space: nowrap; }
.tx .tx-tt-table tr:last-child td { border-bottom: 0; }
.tx-tt-table .dim { opacity: .75; font-size: 12.5px; }
.tx-sol { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.tx-cl { max-width: 560px; padding: 16px; background: #0f0f12; }
.tx-cl-head { display: flex; gap: 12px; align-items: center; }
.tx-cl-av { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #c026d3 50%, #0e7490 50%); flex: none; }
.tx-cl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.tx-cl-tags > span:not(.tx-n) { background: #1d1d22; border-radius: 6px; padding: 2px 8px; font-size: 12.5px; color: #d4d4d8; }
.tx-cl-score { margin: 12px 0; font-size: 14px; }
.tx-cl-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #26262b; border-radius: 10px; }
.tx-cl-stats > div { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid #26262b; }
.tx-cl-stats > div:nth-child(odd) { border-right: 1px solid #26262b; }
.tx-cl-stats > div:nth-last-child(-n+2) { border-bottom: 0; }
.tx-cl-stats .muted { font-size: 12.5px; display: inline-flex; align-items: center; }
.tx-cl-stats b { font-size: 16px; font-weight: 500; }
.tx-cl-pill { font-size: 12px; background: rgba(32, 217, 120, .14); border-radius: 4px; padding: 1px 5px; margin-left: 4px; }
.tx-cl-row { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 12px; align-items: center; margin-top: 12px; border: 1px solid #26262b; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.tx-cl-tok { width: 34px; height: 34px; border-radius: 6px; background: #f4f4f5; color: #18181b; display: grid; place-items: center; font-size: 12px; }
@media (max-width: 640px) {
  .tx .tx-tt-table { min-width: 0; font-size: 12px; }
  .tx .tx-tt-table th, .tx .tx-tt-table td { padding: 9px 5px; }
  .tx .tx-tt-table th:first-child, .tx .tx-tt-table td:first-child, .tx .tx-tt-table th:nth-child(3), .tx .tx-tt-table td:nth-child(3) { display: none; }
  .tx .tx-tt-table td:nth-child(2) { padding-left: 10px; }
  .tx-tt-table .dim { display: block; }
  .tx .tx-tt-table th { white-space: normal; }
}

@media (min-width: 641px) and (max-width: 1280px) { .tx .tx-tt-table th:nth-child(3), .tx .tx-tt-table td:nth-child(3) { display: none; } }
@media (min-width: 641px) { .tx .tx-tt-table th:first-child, .tx .tx-tt-table td:first-child { display: none; } .tx .tx-tt-table td:nth-child(2) { padding-left: 14px; } }

/* Terminal Wallet Manager rebuild (M7) */
.tx-wm { max-width: 560px; padding: 4px 0 8px; }
.tx-wm .tx-tabs { margin: 0; padding: 0 8px; }
.tx-wm-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; }
.tx-wm-group { border: 1px solid #3a3a3f; border-radius: 999px; padding: 4px 12px; font-size: 13.5px; }
.tx-wm .tx-btn { display: inline-flex; align-items: center; }
.tx-wm-row { display: grid; grid-template-columns: 1fr auto 40px; gap: 12px; align-items: center; padding: 9px 14px; font-size: 14px; }
.tx-wm-row:nth-child(odd) { background: #141416; }
.tx-wm-name { display: inline-flex; align-items: center; gap: 8px; }
.tx-wm-addr { display: inline-flex; align-items: center; gap: 6px; }
.tx-wm-addr svg, .tx-wm-bell svg { width: 15px; height: 15px; }
.tx-wm-bell { display: inline-flex; align-items: center; }

/* Phantom and Terminal set-up rebuilds (M1) */
.ph { background: #1c1c1e; border-color: #2c2c30; color: #f2f2f2; max-width: 360px; padding: 18px; font-family: Inter, Geist, var(--sans); }
.ph .muted { color: #999; }
.ph-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.ph-dots span { width: 7px; height: 7px; border-radius: 50%; background: #ab9ff2; }
.ph-dots span:not(.on) { opacity: .9; }
.tx .ph-title { text-align: center; font-weight: 600; margin: 0 0 6px; font-size: 15px; }
.tx .ph-warn { text-align: center; color: #ffdc62; font-size: 13px; margin: 0 0 14px; line-height: 1.45; }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; position: relative; margin-bottom: 14px; }
.tx .ph-grid > .tx-in { position: absolute; left: auto; right: -10px; top: -10px; margin: 0; }
.ph-word { display: flex; align-items: center; gap: 6px; background: #2a2a2e; border-radius: 6px; padding: 7px 8px; font-size: 12px; }
.ph-blur { flex: 1; height: 9px; border-radius: 4px; background: #4a4a50; filter: blur(2px); }
.tx .ph-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0 0 12px; }
.ph-box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #666; flex: none; }
.ph-btn { display: block; text-align: center; border-radius: 10px; padding: 10px 0; font-weight: 600; font-size: 14px; background: #ab9ff2; color: #1c1c1e; }
.ph-btn.off { background: #2a2a2e; color: #777; }
.ph-btn.dark { background: #2a2a2e; color: #f2f2f2; }
.tx .ph-h { font-size: 22px; font-weight: 700; margin: 0; display: flex; align-items: center; }
.tx .ph-site { margin: 2px 0 10px; font-size: 13px; display: flex; align-items: center; }
.tx .ph-small { font-size: 12.5px; color: #bbb; margin: 0 0 12px; line-height: 1.45; }
.tx .ph-small.center { text-align: center; }
.ph-msg { background: #2a2a2e; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: #ccc; margin-bottom: 8px; word-break: break-word; }
.ph-msg b { color: #f2f2f2; font-size: 14px; }
.ph-net { display: flex; justify-content: space-between; background: #2a2a2e; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.ph-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tx-pw { max-width: 420px; padding: 18px; }
.tx .tx-pw-title { text-align: center; color: #86efac; font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.tx-pw-warn { display: flex; gap: 10px; background: #141416; border-radius: 6px; padding: 12px; font-size: 13px; line-height: 1.45; }
.tx .tx-pw-warn p { margin: 0 0 8px; } .tx .tx-pw-warn p:last-child { margin: 0; }
.tx-pw-ic { color: #edca07; font-size: 16px; }
.tx .tx-pw-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #b4b4b8; margin: 14px 0; }
.tx-pw-check .tx-tp-box { flex: none; margin-top: 2px; }
.tx-pw-check .tx-tp-box svg { width: 12px; height: 12px; }
.tx-pw-btn { display: block; width: 60%; margin: 0 auto; text-align: center; background: #86efac; color: #0e0e10; border-radius: 999px; padding: 9px 0; font-weight: 500; }

/* Terminal deposit and first trade rebuilds (L1.3) */
.tx-dep { max-width: 460px; padding: 0 0 16px; }
.tx-dep-head { display: flex; justify-content: space-between; padding: 14px 16px; font-size: 15px; font-weight: 500; }
.tx .tx-dep-tabs { margin: 0; padding: 0; }
.tx-dep-tabs > span { flex: 1 1 0 !important; text-align: center; }
.tx-dep-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; padding: 14px 16px 8px; font-size: 13px; }
.tx-dep-row > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tx-dep-sel { border: 1px solid #242426; border-radius: 6px; padding: 8px 10px; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.tx-dep-addr { margin: 6px 16px; border: 1px solid #242426; border-radius: 6px; display: grid; grid-template-columns: 96px 1fr; overflow: hidden; font-size: 13px; }
.tx-dep-qr { background: #5a5a60; filter: blur(4px); min-height: 96px; }
.tx-dep-addr > div { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.tx-dep-hide { height: 16px; border-radius: 4px; background: #2a2a2e; }
.tx .tx-dep-addr p { margin: 0; color: #b4b4b8; line-height: 1.4; }
.tx .tx-dep-note { margin: 10px 16px; background: rgba(237, 202, 7, .12); color: #edca07; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.tx-dep-btn { width: auto; margin: 6px 16px 0; }
.tx-ft { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; max-width: 640px; font-size: 14px; }
.tx-ft-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tx-tp-seg.sell > .on { background: #ef4444; color: #fff; }
.tx-ft .tx-tp-total { margin: 0; }
.tx-ft .tx-tp-gas { margin: 0; gap: 8px; font-size: 13px; }
.tx-ft .tx-tp-buy { font-size: 14px; padding: 10px 6px; display: flex; align-items: center; justify-content: center; }
.tx-ft-sell { background: #ef4444 !important; color: #fff !important; }
.tx-ft-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tx-ft-chips > span { border: 1px solid #242426; border-radius: 6px; text-align: center; padding: 6px 0; display: inline-flex; justify-content: center; align-items: center; }
.tx-ft-chips > .on { border-color: #ef4444; color: #ef4444; }
.tx-ft-order { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid #242426; padding-top: 10px; font-size: 13px; }
@media (max-width: 640px) { .tx-ft { grid-template-columns: 1fr; } }

/* Pump.fun perps order panel rebuild (P1.1) */
.pf-perp { max-width: 360px; padding: 16px; font-size: 14px; display: flex; flex-direction: column; gap: 12px; }
.pf-perp-ls { display: grid; grid-template-columns: 1fr 1fr; background: #141416; border-radius: 10px; padding: 3px; }
.pf-perp-ls > span { text-align: center; padding: 7px 0; border-radius: 8px; color: #9b9ba2; font-weight: 500; }
.pf-perp-ls > .on { background: #86efac; color: #052e16; }
.pf-perp-amt { display: flex; justify-content: space-between; align-items: center; background: #141416; border: 1px solid #2c2c31; border-radius: 10px; padding: 10px 12px; font-size: 16px; }
.pf-perp-pct { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pf-perp-pct > span { text-align: center; background: #18191b; border-radius: 8px; padding: 5px 0; font-size: 13px; color: #9b9ba2; }
.pf-perp-levtop { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pf-perp-track { position: relative; height: 4px; background: #272a2d; border-radius: 2px; }
.pf-perp-track span { position: absolute; left: 0; top: 0; bottom: 0; background: #86efac; border-radius: 2px; }
.pf-perp-track i { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #ededef; border-radius: 50%; }
.pf-perp-scale { display: flex; justify-content: space-between; font-size: 12px; color: #68686f; margin-top: 6px; }
.pf-perp-tpsl { display: flex; gap: 8px; align-items: center; }
.pf-perp-tpsl > span:not(.tx-n) { border: 1px solid #2c2c31; border-radius: 8px; padding: 5px 10px; font-size: 13px; }
.pf-perp-line { display: flex; justify-content: space-between; align-items: center; }
.pf-perp-line .pf-mute { display: inline-flex; align-items: center; }
/* Tab rows wrap on phones instead of hiding tabs off the edge */
@media (max-width: 640px) { .tabs .tab-list, .tabs [role="tablist"], .tab-buttons { flex-wrap: wrap !important; overflow: visible !important; row-gap: 6px; } }

/* ---------- v3 (27 Nov 2026): the Academy in the site's design system ----------
   Same black, teal, gradient, buttons and cards as tagxalpha.xyz (assets/tag.css, DESIGN.md).
   The docs layout for lessons stays: sidebar, reading column, "On this page".
   The Academy home is a full-width page of its own. */
@font-face {
  font-family: "Geist Var";
  src: url("fonts/geist-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
body { font-family: "Geist Var", var(--sans); font-variant-numeric: tabular-nums; }
::selection { background: rgba(126, 207, 214, .3); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 8px; }
.sidebar-scroll, .toc { scrollbar-color: #18242a transparent; }

/* header: the site's nav, with the Academy's search in the middle */
.top { background: rgba(4, 8, 10, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.brand img { width: 25px; height: 30px; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.top-search { border-radius: 12px; background: rgba(214, 240, 243, .04); border-color: var(--border); color: var(--mute); }
.top-link { color: var(--soft); font-size: 15px; border-radius: 10px; }
.top-cta { color: #04080a; font-weight: 600; background: var(--grad-btn); border-radius: 11px; padding: 10px 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 26px rgba(126, 207, 214, .16); }
.top-cta:hover { background: var(--grad-btn); filter: brightness(1.07); }
.icon-btn { border-radius: 12px; }

/* buttons */
.btn { height: 48px; padding: 0 22px; border-radius: 14px; font-size: 16px; font-weight: 500; border-color: var(--border-strong); background: rgba(214, 240, 243, .04); transition: transform .12s ease, filter .2s ease, background .15s, border-color .15s; }
.btn:hover { background: rgba(214, 240, 243, .08); border-color: rgba(214, 240, 243, .26); }
.btn-primary { background: var(--grad-btn); border-color: transparent; color: #04080a !important; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 1px 2px rgba(0, 0, 0, .5), 0 10px 34px rgba(126, 207, 214, .18); }
.btn-primary:hover { background: var(--grad-btn); border-color: transparent; filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }

/* sidebar and "On this page" */
.sidebar { background: var(--bg); border-right-color: var(--border); }
.track-switch { border-radius: 14px; padding: 4px; background: var(--bg-raise); border: 1px solid var(--border); }
.track-switch button { border-radius: 10px; min-height: 36px; }
.track-switch button[aria-pressed="true"] { background: var(--frame); box-shadow: none; }
.side-link { border-radius: 10px; }
.side-link.is-current { background: var(--teal-soft); color: var(--teal-hi); }
.toc li a.is-active { color: var(--teal-hi); }

/* lesson head */
.crumbs { font-size: 14px; }
.page-head h1, .prose h1 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 700; line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }
.page-head .lede, .prose .lede { font-size: 19px; line-height: 1.55; color: var(--soft); }
.page-meta .pill { border-radius: 999px; }
.prose h2 { font-size: 27px; font-weight: 650; letter-spacing: -.025em; line-height: 1.2; }
.prose h3 { font-size: 20px; letter-spacing: -.015em; }

/* lesson parts */
.takeaways { padding: 20px 22px; border-radius: 16px; background: var(--bg-raise); border-color: var(--border); }
.takeaways-label { font-size: 14px; font-weight: 500; color: var(--teal); }
.takeaways ul { list-style: none; padding-left: 0; }
.takeaways li { position: relative; padding-left: 28px; margin: .5em 0; font-size: 15.5px; }
.takeaways li::before { content: ""; position: absolute; left: 0; top: .32em; width: 17px; height: 17px; border-radius: 6px; background: var(--teal); }
.takeaways li::after { content: ""; position: absolute; left: 6px; top: calc(.32em + 3px); width: 4px; height: 8px; border-right: 2px solid #04080a; border-bottom: 2px solid #04080a; transform: rotate(45deg); }
.hint { border-radius: 14px; }
.toc-inline { border-radius: 14px; background: var(--bg-raise); }
.lesson-list { border-radius: 16px; background: var(--bg-raise); }
.complete-btn { min-height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 500; }
.pager { gap: 12px; }
.pager a { border-radius: 16px; padding: 16px 18px; background: var(--bg-raise); transition: border-color .3s ease, transform .3s cubic-bezier(.2, .7, .2, 1); }
.pager a:hover { transform: translateY(-2px); }
.pager .next { border-color: var(--teal-line); background: radial-gradient(120% 120% at 100% 0%, rgba(126, 207, 214, .1), transparent 60%), var(--bg-raise); }
.pager span { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.search-dialog { border-radius: 20px; border-color: var(--border-strong); }

/* phone bar: previous and next lesson always in reach. Hidden on desktop and whenever the page's own pager is on screen. */
.lesson-bar { display: none; }
@media (max-width: 900px) {
  .lesson-bar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; gap: 6px; padding: 6px; border-radius: 18px; background: rgba(11, 19, 22, .94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--border-strong); box-shadow: 0 18px 50px rgba(0, 0, 0, .5); transition: transform .3s cubic-bezier(.2, .7, .2, 1), opacity .2s ease; }
  .lesson-bar.is-off { transform: translateY(140%); opacity: 0; pointer-events: none; }
  .lesson-bar a, .lesson-bar .lb-prev { min-height: 44px; display: flex; align-items: center; border-radius: 12px; text-decoration: none; color: var(--ink); }
  .lesson-bar .lb-prev { flex: 0 0 44px; justify-content: center; background: rgba(214, 240, 243, .05); }
  .lesson-bar span.lb-prev { background: none; }
  .lesson-bar .lb-next { flex: 1; min-width: 0; gap: 8px; padding: 0 12px 0 14px; background: var(--grad-btn); color: #04080a; font-weight: 600; font-size: 15px; }
  .lesson-bar .lb-next small { flex: none; font-size: 13px; font-weight: 500; opacity: .7; }
  .lesson-bar .lb-next span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lesson-bar .lb-next svg { flex: none; }
  body:has(.lesson-bar) .page-foot { padding-bottom: 76px; }
  body:has(.lesson-bar:not(.is-off)) .to-top { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- Academy home ---- */
.shell:has(.prose.is-home) .toc { display: none; }
@media (min-width: 901px) {
  .shell:has(.prose.is-home) { display: block; }
  .shell:has(.prose.is-home) .sidebar { display: none; }
  .shell:has(.prose.is-home) #menu-btn { display: none; }
  .shell:has(.prose.is-home) .page { padding: 0 32px 40px; }
  .shell:has(.prose.is-home) .page-inner, .shell:has(.prose.is-home) .lesson-foot { max-width: 1180px; }
}
.prose.is-home { font-size: 16px; }
.prose.is-home .h-anchor, .prose.is-home .h-link, .prose.is-home .heading-anchor, .prose.is-home .anchor { display: none; }
.shell:has(.prose.is-home) .page { overflow-x: clip; }
.home-hero { position: relative; display: grid; gap: 28px; margin: 0 0 8px; padding: 28px 0 8px; }
.home-hero::before { content: ""; position: absolute; inset: -80px -60px -40px; pointer-events: none; background-image: radial-gradient(rgba(214, 240, 243, .2) 1px, transparent 1.5px); background-size: 26px 26px; -webkit-mask-image: radial-gradient(ellipse 60% 80% at 76% 40%, #000 0%, transparent 72%); mask-image: radial-gradient(ellipse 60% 80% at 76% 40%, #000 0%, transparent 72%); }
.home-hero::after { content: ""; position: absolute; right: -8%; top: -30%; width: 62%; height: 150%; pointer-events: none; background: radial-gradient(closest-side, rgba(126, 207, 214, .16), rgba(126, 207, 214, .05) 55%, transparent 74%); }
.home-hero > * { position: relative; z-index: 1; }
@media (max-width: 900px) {
  .home-hero::before { inset: 0 -20px; -webkit-mask-image: radial-gradient(ellipse 90% 46% at 50% 74%, #000 0%, transparent 78%); mask-image: radial-gradient(ellipse 90% 46% at 50% 74%, #000 0%, transparent 78%); }
  .home-hero::after { right: -20%; left: -20%; top: 46%; width: auto; height: 62%; }
}
.home-kicker { margin: 0 !important; font-size: 14px; font-weight: 500; color: var(--teal); }
.home-hero h1 { margin: 10px 0 0; font-size: clamp(52px, 14.4vw, 60px); font-weight: 700; line-height: .96; letter-spacing: -.05em; padding-bottom: .06em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--teal); }
.home-hero .lede { margin: 16px 0 0; font-size: 17px; line-height: 1.5; color: var(--soft); max-width: 34em; }
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 0; }
.home-actions .btn { padding: 0 12px; }
.home-progress { margin: 14px 0 0 !important; font-size: 15px; }
.home-progress a { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal); font-weight: 500; text-decoration: none; }
.home-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 14px 0 0 !important; padding: 0 !important; font-size: 14px; color: var(--mute); }
.home-stats li { margin: 0; }
.home-stats b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.home-path { padding: 18px; border-radius: 24px; background: linear-gradient(180deg, rgba(24, 36, 42, .92), rgba(11, 19, 22, .96)); border: 1px solid var(--border-strong); box-shadow: 0 40px 100px rgba(0, 0, 0, .6), 0 0 80px rgba(126, 207, 214, .12), inset 0 1px 0 rgba(255, 255, 255, .06); }
.home-path h2 { margin: 0 !important; font-size: 22px !important; font-weight: 650; letter-spacing: -.02em; }
.home-path .section-lede { margin: 6px 0 14px !important; font-size: 15px; color: var(--mute); }
.home-path .lesson-list { counter-reset: path; margin: 0 !important; border: 0; border-radius: 0; background: none; overflow: visible; }
.home-path .lesson-list li + li { border-top: 0; }
.prose .home-path a.lesson-link { counter-increment: path; position: relative; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 6px 10px 52px; border-radius: 14px; text-decoration: none; color: var(--ink); font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.home-path .lesson-link::before { content: counter(path); position: absolute; left: 6px; top: 50%; width: 32px; height: 32px; margin-top: -16px; display: grid; place-items: center; border-radius: 50%; font-size: 14px; font-weight: 600; color: var(--teal-hi); background: #0b1316; border: 1px solid var(--teal-line); z-index: 1; }
.home-path li + li .lesson-link::after { content: ""; position: absolute; left: 21px; top: -16px; height: 32px; width: 2px; background: linear-gradient(180deg, rgba(126, 207, 214, .1), rgba(126, 207, 214, .45)); }
.prose .home-path a.lesson-link:hover { background: rgba(214, 240, 243, .05); }
.home-path .ll-title { flex: 1; min-width: 0; }
.home-path .ll-time { font-size: 13px; font-weight: 400; color: var(--mute); white-space: nowrap; }
.home-path .lesson-link.is-done::before { content: ""; background: var(--teal); border-color: var(--teal); }
.home-path .lesson-link > svg { position: absolute; left: 14px; top: 50%; margin-top: -8px; width: 16px; height: 16px; color: #04080a; z-index: 2; }

.home-section { margin: 72px 0 0; }
.home-section > h2 { margin: 0 0 8px !important; font-size: clamp(30px, 4.4vw, 46px) !important; font-weight: 700; letter-spacing: -.035em; line-height: 1.04; }
.home-section > .section-lede { margin: 0 0 24px; font-size: 17px; color: var(--soft); max-width: 640px; }
.mod-grid { grid-template-columns: 1fr; gap: 10px; }
.prose a.mod-card, a.mod-card { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: start; padding: 16px; border-radius: 18px; background: var(--bg-raise); border: 1px solid var(--border); transition: border-color .3s ease, transform .3s cubic-bezier(.2, .7, .2, 1); }
.prose a.mod-card:hover, a.mod-card:hover { border-color: var(--teal-line); background: var(--bg-raise); transform: translateY(-2px); }
.mod-card-top { display: contents; }
.mod-card-code { grid-column: 1; grid-row: 1 / span 3; align-self: start; display: grid; place-items: center; height: 52px; border-radius: 14px; font-size: 17px; font-weight: 800; letter-spacing: -.03em; color: var(--teal-hi); background: rgba(126, 207, 214, .08); border: 1px solid rgba(126, 207, 214, .22); }
.mod-card-top > span:last-child { grid-column: 2; grid-row: 3; font-size: 13px; color: var(--mute); margin-top: 4px; }
.mod-card-title { grid-column: 2; grid-row: 1; font-size: 17.5px; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
.mod-card-desc { grid-column: 2; grid-row: 2; font-size: 14.5px; color: var(--soft); }
.mod-card-meta { display: none; }
.promo-grid { grid-template-columns: 1fr; gap: 10px; }
.promo { padding: 20px; border-radius: 18px; background: var(--bg-raise); border: 1px solid var(--border); gap: 8px; }
.promo img { width: 28px; height: 28px; object-fit: contain; margin-bottom: 4px; }
.promo-title { font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.promo-desc { font-size: 15px; color: var(--soft); }
.promo a { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: -10px; font-size: 15px; }
@media (min-width: 700px) {
  .mod-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .promo-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
@media (min-width: 901px) {
  .home-hero { grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding: clamp(36px, 7vh, 80px) 0 clamp(24px, 4vh, 48px); min-height: min(600px, calc(100vh - 240px)); }
  .home-kicker { font-size: 15px; }
  .home-hero h1 { margin-top: 14px; font-size: clamp(68px, 6.7vw, 104px); }
  .home-hero .lede { margin-top: 24px; font-size: 20px; }
  .home-actions { display: flex; gap: 12px; margin-top: 32px; }
  .home-actions .btn { height: 54px; padding: 0 30px; font-size: 17px; }
  .home-stats { margin-top: 22px !important; }
  .home-path { padding: 26px; }
  .home-path h2 { font-size: 26px !important; }
  .home-section { margin-top: 108px; }
  .prose a.mod-card, a.mod-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: 20px; min-height: 196px; }
  .mod-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .mod-card-code { width: 56px; height: 56px; font-size: 19px; }
  .mod-card-top > span:last-child { margin: 0; }
  .mod-card-title { font-size: 20px; }
  .mod-card-meta { display: block; margin-top: auto; padding-top: 10px; font-size: 13px; color: var(--mute); }
  .promo { padding: 24px; border-radius: 20px; }
}
@media (min-width: 901px) and (max-width: 1139px) { .prose a.mod-card, a.mod-card { min-height: 0; } }
@media (min-width: 1140px) {
  .mod-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .mod-grid:has(> :nth-child(10)):not(:has(> :nth-child(11))) { grid-template-columns: repeat(5, 1fr); }
  .prose a.mod-card, a.mod-card { padding: 20px; min-height: 216px; }
  .mod-card-title { font-size: 18.5px; }
}

/* the site's footer, on the Academy home */
.shell:has(.prose.is-home) .page-foot { border-top: 0; }
.tf { border-top: 1px solid var(--border); padding: 64px 32px 36px; }
.tf-in { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
.tf-brand img { height: 34px; width: auto; }
.tf-brand p { margin: 14px 0 0; font-size: 14px; color: var(--mute); max-width: 260px; }
.tf h2 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.tf-in a { display: flex; align-items: center; min-height: 44px; color: var(--mute); text-decoration: none; font-size: 15px; }
.tf-in a:hover { color: var(--teal); }
.tf-legal { max-width: 1180px; margin: 44px auto 0; padding-top: 22px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--mute); display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .tf { padding: 40px 20px 36px; }
  .tf-in { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto; gap: 22px 20px; }
  .tf-brand { grid-column: 1 / -1; }
  .tf-in > div:nth-child(2) { grid-column: 1; grid-row: 2 / span 2; }
  .tf-in > div:nth-child(3) { grid-column: 2; grid-row: 2; }
  .tf-in > div:nth-child(4) { grid-column: 2; grid-row: 3; }
}
@media (prefers-reduced-motion: reduce) { .btn, a.mod-card, .pager a, .lesson-bar { transition: none; } .prose a.mod-card:hover, a.mod-card:hover, .pager a:hover { transform: none; } }

/* ---------- One site: the tagxalpha.xyz nav and footer on every academy page ---------- */
.top { gap: 22px; }
.top-logo { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.top-logo img { width: 25px; height: 30px; display: block; }
.top-nav { display: flex; gap: 24px; flex: none; }
.top-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--soft); text-decoration: none; font-size: 15px; transition: color .15s; }
.top-nav a:hover, .top-nav a[aria-current] { color: var(--ink); }
.top-nav a[aria-current] { position: relative; }
.top-nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 2px; border-radius: 2px; background: var(--grad-text); }
.top .top-search { margin-left: auto; margin-right: 0; width: min(300px, 26vw); }
.top-member { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--teal-line); background: var(--teal-soft); color: var(--teal-hi); font-size: 14px; font-weight: 600; text-decoration: none; }
.top-member[hidden] { display: none; }
.top-member i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px rgba(126, 207, 214, .18); }
.top-member:hover { border-color: var(--teal); }
html.is-member .top-cta { display: none; }
@media (max-width: 1240px) { .top-nav { display: none; } .top .top-search { margin-right: auto; width: min(380px, 40vw); } }
@media (max-width: 900px) {
  .top-logo { margin-left: 2px; }
  .top .top-cta { padding: 8px 14px; font-size: 14px; }
  .top-member { min-height: 36px; padding: 0 12px; font-size: 13px; }
}
.side-foot p { margin: 0 0 6px; color: var(--ink); font-weight: 600; font-size: 13px; }

.tf { border-top: 1px solid var(--border); padding: 56px 24px calc(32px + env(safe-area-inset-bottom, 0px)); background: var(--bg); position: relative; z-index: 1; }
.tf-in { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
.tf-brand img { height: 34px; width: auto; }
.tf-brand p { margin: 14px 0 0; font-size: 14px; color: var(--mute); }
.tf h2 { font-size: 14px; font-weight: 600; margin: 0 0 4px; color: var(--ink); letter-spacing: 0; }
.tf-in a { display: flex; align-items: center; min-height: 40px; color: var(--mute); text-decoration: none; font-size: 15px; }
.tf-in a:hover { color: var(--teal); }
.tf-legal { max-width: 1160px; margin: 40px auto 0; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--mute); display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; }
@media (max-width: 900px) { .tf { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } .tf-in { grid-template-columns: 1fr 1fr; } .tf-brand { grid-column: 1 / -1; } }

/* ---------- Member lessons: lock marks ---------- */
.lock { width: 13px; height: 13px; flex: 0 0 13px; color: var(--dim); }
.side-link.is-locked .lock { opacity: .8; }
.side-link.is-locked.is-current .lock { color: var(--teal); }
.ll-lock { display: inline-flex; align-items: center; color: var(--dim); }
.ll-lock .lock { width: 14px; height: 14px; }
html.is-member .lock, html.is-member .ll-lock { display: none; }

/* ---------- The paywall on a member lesson ---------- */
.gate { position: relative; margin: 4px 0 8px; padding-top: 78px; }
body[data-gated] .complete-row, body[data-gated] .reset-progress { display: none; }
.gate-ghost { position: absolute; inset: 0 0 auto; height: 150px; display: flex; flex-direction: column; gap: 14px; padding-top: 6px; -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, transparent 100%); }
.gate-ghost i { display: block; height: 10px; border-radius: 6px; background: rgba(214, 240, 243, .07); }
.gate-ghost i:nth-child(1) { width: 96%; } .gate-ghost i:nth-child(2) { width: 88%; } .gate-ghost i:nth-child(3) { width: 93%; }
.gate-ghost i:nth-child(4) { width: 61%; } .gate-ghost i:nth-child(5) { width: 90%; } .gate-ghost i:nth-child(6) { width: 76%; }
.gate-card { position: relative; padding: 30px 30px 26px; border-radius: 20px; background: radial-gradient(120% 90% at 0% 0%, rgba(126, 207, 214, .09), transparent 55%), radial-gradient(90% 80% at 100% 100%, rgba(183, 148, 212, .08), transparent 60%), var(--bg-raise); border: 1px solid var(--border-strong); box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(214, 240, 243, .06); overflow: hidden; }
.gate-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(166, 230, 235, .55), rgba(183, 148, 212, .45), transparent); }
.prose .gate-badge { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 16px; padding: 4px 11px 4px 9px; border-radius: 999px; border: 1px solid var(--teal-line); background: var(--teal-soft); color: var(--teal-hi); font-size: 12.5px; font-weight: 600; line-height: 1.6; }
.gate-badge .lock { color: currentColor; width: 13px; height: 13px; }
.prose .gate-h { margin: 0 0 10px; padding: 0; border: 0; font-size: clamp(22px, 3.2vw, 27px); line-height: 1.2; letter-spacing: -.02em; color: var(--ink); font-weight: 600; }
.prose .gate-h::before { display: none; }
.prose .gate-p { margin: 0 0 20px; color: var(--soft); max-width: 58ch; }
.prose .gate-note { margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; background: rgba(233, 196, 106, .08); border: 1px solid rgba(233, 196, 106, .28); color: #f1d891; font-size: 14.5px; }
.gate-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.prose a.gate-btn, .prose button.gate-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 20px; border-radius: 12px; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: filter .15s, border-color .15s, background .15s, transform .15s; }
.prose a.gate-join, .prose button.gate-join { color: #04080a; background: var(--grad-btn); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 30px rgba(126, 207, 214, .18); }
.prose a.gate-join:hover, .prose button.gate-join:hover { filter: brightness(1.07); color: #04080a; }
.prose a.gate-discord { color: var(--ink); background: rgba(214, 240, 243, .05); border-color: var(--border-strong); }
.prose a.gate-discord::before { content: ""; width: 18px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M20.3 1.5A19.6 19.6 0 0 0 15.4 0l-.6 1.3a18 18 0 0 0-5.6 0L8.6 0a19.5 19.5 0 0 0-4.9 1.5C.6 6.2-.3 10.7.1 15.2A19.8 19.8 0 0 0 6.1 18l1.3-2a12.8 12.8 0 0 1-2-1l.5-.4a14 14 0 0 0 12.2 0l.5.4c-.6.4-1.3.7-2 1l1.3 2a19.7 19.7 0 0 0 6-2.8c.5-5.2-.8-9.7-3.6-13.7ZM8 12.4c-1.2 0-2.2-1.1-2.2-2.4S6.8 7.6 8 7.6s2.2 1.1 2.2 2.4-1 2.4-2.2 2.4Zm8 0c-1.2 0-2.2-1.1-2.2-2.4s1-2.4 2.2-2.4 2.2 1.1 2.2 2.4-1 2.4-2.2 2.4Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M20.3 1.5A19.6 19.6 0 0 0 15.4 0l-.6 1.3a18 18 0 0 0-5.6 0L8.6 0a19.5 19.5 0 0 0-4.9 1.5C.6 6.2-.3 10.7.1 15.2A19.8 19.8 0 0 0 6.1 18l1.3-2a12.8 12.8 0 0 1-2-1l.5-.4a14 14 0 0 0 12.2 0l.5.4c-.6.4-1.3.7-2 1l1.3 2a19.7 19.7 0 0 0 6-2.8c.5-5.2-.8-9.7-3.6-13.7ZM8 12.4c-1.2 0-2.2-1.1-2.2-2.4S6.8 7.6 8 7.6s2.2 1.1 2.2 2.4-1 2.4-2.2 2.4Zm8 0c-1.2 0-2.2-1.1-2.2-2.4s1-2.4 2.2-2.4 2.2 1.1 2.2 2.4-1 2.4-2.2 2.4Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.prose a.gate-discord:hover { border-color: var(--teal-line); background: rgba(214, 240, 243, .08); color: var(--ink); }
.prose .gate-free, .prose .gate-who { margin: 0; font-size: 14.5px; color: var(--mute); }
.prose .gate-who { margin: -4px 0 18px; color: var(--soft); }
.prose .gate-who b { color: var(--ink); font-weight: 600; }
.prose .gate-free a { color: var(--teal); }
.prose button.gate-link { padding: 0; border: 0; background: none; color: var(--teal); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.gate-loading { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; color: var(--soft); }
.gate-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(126, 207, 214, .22); border-top-color: var(--teal); animation: gate-spin .8s linear infinite; }
@keyframes gate-spin { to { transform: rotate(360deg); } }
.gate-card[data-gate-state="loading"] { padding-block: 24px; }
@media (max-width: 640px) {
  .gate { padding-top: 46px; }
  .gate-ghost { height: 90px; gap: 11px; }
  .gate-ghost i:nth-child(n+5) { display: none; }
  .gate-card { padding: 24px 20px 22px; border-radius: 18px; }
  .gate-acts { flex-direction: column; }
  .prose a.gate-btn, .prose button.gate-btn { width: 100%; }
}

/* ---------- A member lesson ---------- */
.prose.is-member-lesson { position: relative; }
.member-lesson { animation: member-in .35s ease both; }
@keyframes member-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.is-member-lesson .member-lesson { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.is-member-lesson .member-lesson input, .is-member-lesson .member-lesson textarea, .is-member-lesson .member-lesson label { -webkit-user-select: auto; user-select: auto; }
.is-member-lesson img { -webkit-user-drag: none; }
.wm-print { display: none; }
.gate-toast { position: fixed; left: 50%; white-space: nowrap; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 90; margin: 0; padding: 10px 16px; border-radius: 12px; background: rgba(11, 19, 22, .96); border: 1px solid var(--border-strong); color: var(--ink); font-size: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.gate-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media print {
  html.is-member .member-lesson, html.is-member .module-check, html.is-member #gate-check { display: none !important; }
  html.is-member .wm-print { display: block; font-size: 14pt; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-spin { animation: none; border-top-color: rgba(126, 207, 214, .22); }
  .member-lesson { animation: none; }
  .gate-toast, .prose a.gate-btn { transition: none; }
}

/* ---------- Coin case studies ---------- */
.prose .cs-lede { font-size: 18px; color: var(--soft); line-height: 1.65; }
.prose .cs-empty { padding: 22px 22px; border: 1px dashed var(--border-strong); border-radius: 16px; background: var(--bg-soft); }
.prose .cs-empty p { margin: 0; color: var(--mute); }
.prose .cs-empty strong { color: var(--ink); font-weight: 600; }
.prose ol.cs-list { list-style: none; padding: 0; margin: 0 0 1.6em; display: grid; gap: 10px; }
.prose ol.cs-list li { margin: 0; padding: 0; }
.prose a.cs-item { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-raise); text-decoration: none; transition: border-color .15s, background .15s; }
.prose a.cs-item:hover { border-color: var(--teal-line); background: #0d171a; }
.cs-tick { grid-row: 1 / 3; align-self: start; font-family: var(--mono); font-size: 13px; color: var(--teal-hi); padding: 3px 8px; border-radius: 8px; background: var(--teal-soft); }
.cs-title { color: var(--ink); font-weight: 600; font-size: 16px; }
.cs-sum { grid-column: 2; color: var(--mute); font-size: 14.5px; line-height: 1.5; }
.cs-item .lock { grid-row: 1 / 3; grid-column: 3; }
.prose ol.cs-parts { counter-reset: part; list-style: none; padding: 0; margin: 0 0 1.4em; display: grid; gap: 2px; }
.prose ol.cs-parts li { counter-increment: part; position: relative; margin: 0; padding: 12px 0 12px 46px; border-top: 1px solid var(--border); display: flex; flex-direction: column; }
.prose ol.cs-parts li:first-child { border-top: 0; }
.prose ol.cs-parts li::before { content: counter(part); position: absolute; left: 0; top: 12px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--teal-hi); border: 1px solid var(--teal-line); background: var(--teal-soft); }
.prose ol.cs-parts strong { color: var(--ink); font-weight: 600; }
.prose ol.cs-parts span { color: var(--mute); font-size: 15px; }
/* Placeholders in the template are labelled as such, never styled like real content. */
.prose .cs-ph { margin: 0 0 1.4em; padding: 14px 16px; border: 1px dashed rgba(233, 196, 106, .45); border-radius: 14px; background: repeating-linear-gradient(135deg, rgba(233, 196, 106, .045) 0 10px, transparent 10px 20px); }
.prose .cs-ph p { margin: 0; color: var(--soft); font-size: 15px; }
.prose .cs-ph .cs-ph-label { display: inline-block; margin-bottom: 6px; padding: 1px 9px; border-radius: 999px; background: rgba(233, 196, 106, .14); color: #f1d891; font-size: 12px; font-weight: 600; }

/* ---------- Log in / Member in the header, Free and Members labels, the membership band ---------- */
.top-login { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 11px; color: var(--ink); font-size: 14.5px; font-weight: 600; text-decoration: none; border: 1px solid var(--border-strong); background: rgba(214, 240, 243, .03); }
.top-login:hover { border-color: var(--teal-line); color: var(--teal-hi); }
.top-login[hidden], .top-cta[hidden] { display: none; }
.top-member:not(.is-on) { border-color: var(--border-strong); background: rgba(214, 240, 243, .04); color: var(--ink); }
.top-member:not(.is-on) i { background: var(--mute); box-shadow: none; }
@media (max-width: 900px) { .top-login { min-height: 36px; padding: 0 10px; font-size: 13px; } }
@media (max-width: 380px) { .top-login { padding: 0 8px; } }

.ll-free { flex: none; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--teal-hi); background: var(--teal-soft); border: 1px solid var(--teal-line); }
html.is-member .ll-free { display: none; }

.members-band { margin: 28px 0 8px; }
.members-band .mb-out { position: relative; padding: 26px 26px 22px; border-radius: 20px; border: 1px solid var(--border-strong); background: radial-gradient(120% 90% at 0% 0%, rgba(126, 207, 214, .09), transparent 55%), radial-gradient(90% 80% at 100% 100%, rgba(183, 148, 212, .08), transparent 60%), var(--bg-raise); overflow: hidden; }
.members-band .mb-out::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(166, 230, 235, .55), rgba(183, 148, 212, .45), transparent); }
.prose .members-band .gate-badge, .members-band .gate-badge { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 14px; padding: 4px 11px 4px 9px; border-radius: 999px; border: 1px solid var(--teal-line); background: var(--teal-soft); color: var(--teal-hi); font-size: 12.5px; font-weight: 600; line-height: 1.6; }
.members-band .mb-h, .prose .members-band .mb-h { margin: 0 0 8px; padding: 0; border: 0; font-size: clamp(21px, 3vw, 26px); line-height: 1.2; letter-spacing: -.02em; color: var(--ink); font-weight: 600; }
.prose .members-band .mb-h::before { display: none; }
.members-band .mb-p, .prose .members-band .mb-p { margin: 0 0 18px; color: var(--soft); max-width: 60ch; font-size: 16px; }
.members-band .gate-acts { margin: 0; }
.members-band a.gate-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 20px; border-radius: 12px; font-size: 15px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.members-band a.gate-join { color: #04080a; background: var(--grad-btn); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 30px rgba(126, 207, 214, .18); }
.members-band a.gate-discord { color: var(--ink); background: rgba(214, 240, 243, .05); border-color: var(--border-strong); }
.members-band a.gate-discord:hover { border-color: var(--teal-line); }
.members-band.is-compact .mb-out { padding: 22px 22px 20px; }
.members-band .mb-in { display: none; align-items: center; gap: 10px; margin: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--teal-line); background: var(--teal-soft); color: var(--teal-hi); font-weight: 600; font-size: 15px; }
.members-band .mb-in .side-check { width: 18px; height: 18px; flex: none; }
html.is-member .members-band .mb-out { display: none; }
html.is-member .members-band .mb-in { display: flex; }
@media (max-width: 640px) { .members-band .mb-out { padding: 22px 18px 18px; } .members-band .gate-acts { flex-direction: column; } .members-band a.gate-btn { width: 100%; } }

/* What's inside a member lesson, under the paywall. Section names only, never the text. */
.gate-inside { margin-top: 16px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-soft); }
.prose .gate-inside-h { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--mute); }
.prose .gate-inside ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: gi; }
.prose .gate-inside li { counter-increment: gi; position: relative; margin: 0; padding-left: 30px; color: var(--soft); font-size: 15px; }
.prose .gate-inside li::before { content: counter(gi); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--mute); border: 1px solid var(--border-strong); }

/* ---------- Module cards (30 Nov 2026): access in the corner, level and length in the footer ---------- */
.prose a.mod-card, a.mod-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 18px 18px 0; border-radius: 18px; overflow: hidden; min-height: 0; }
.mod-card .mod-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.mod-card .mod-card-code { grid-column: auto; grid-row: auto; width: 48px; height: 48px; font-size: 17px; flex: none; }
.mod-card .mod-card-title { grid-column: auto; grid-row: auto; font-size: 18px; line-height: 1.25; }
.mod-card .mod-card-desc { grid-column: auto; grid-row: auto; font-size: 14.5px; line-height: 1.5; color: var(--soft); margin-bottom: 16px; }
.mod-card .mod-card-foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: auto -18px 0; padding: 14px 18px 15px; border-top: 1px solid var(--border); font-size: 13px; color: var(--mute); white-space: nowrap; }
.mod-card .mod-card-meta { display: inline; margin: 0; padding: 0; font-size: 13px; color: var(--mute); }
.mod-card .mod-card-count { color: var(--mute); font-variant-numeric: tabular-nums; }
.mod-card .mod-card-min { color: var(--dim); }
/* Progress runs along the card's bottom edge once a lesson is done. */
.mod-card .mod-card-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; }
.mod-card .mod-card-bar i { display: block; height: 100%; width: 0; background: var(--grad-text, linear-gradient(90deg, #a6e6eb, #b794d4)); transition: width .6s cubic-bezier(.2, .7, .2, 1); }

.mod-access { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; font-size: 12.5px; font-weight: 600; line-height: 1; }
.mod-access.is-free, .mod-access.is-part { height: 26px; padding: 0 11px; border-radius: 999px; color: var(--teal-hi); background: var(--teal-soft); border: 1px solid var(--teal-line); }
.mod-access.is-part { color: var(--soft); background: rgba(214, 240, 243, .04); border-color: var(--border-strong); }
.mod-access.is-lock { width: 32px; height: 32px; border-radius: 50%; color: var(--mute); background: rgba(214, 240, 243, .035); border: 1px solid var(--border-strong); }
.mod-access.is-lock .lock { width: 14px; height: 14px; flex-basis: 14px; color: currentColor; }
a.mod-card:hover .mod-access.is-lock { color: var(--teal-hi); border-color: var(--teal-line); }
/* The free module is where to start: it carries the teal edge. */
.prose a.mod-card.is-free, a.mod-card.is-free { border-color: rgba(126, 207, 214, .34); background: radial-gradient(120% 80% at 0% 0%, rgba(126, 207, 214, .1), transparent 60%), var(--bg-raise); }
html.is-member .mod-access { visibility: hidden; }
html.is-member .prose a.mod-card.is-free, html.is-member a.mod-card.is-free { border-color: var(--border); background: var(--bg-raise); }

@media (min-width: 901px) {
  .prose a.mod-card, a.mod-card { padding: 22px 22px 0; border-radius: 20px; min-height: 236px; }
  .mod-card .mod-card-code { width: 54px; height: 54px; font-size: 19px; }
  .mod-card .mod-card-title { font-size: 19px; }
  .mod-card .mod-card-foot { margin: auto -22px 0; padding: 15px 22px 16px; }
}
@media (min-width: 1140px) {
  .prose a.mod-card, a.mod-card { padding: 20px 20px 0; min-height: 250px; }
  .mod-card .mod-card-title { font-size: 18px; }
  .mod-card .mod-card-foot { margin: auto -20px 0; padding: 14px 20px 15px; }
}
@media (prefers-reduced-motion: reduce) { .mod-card .mod-card-bar i { transition: none; } }

/* Where progress is saved: this device, or the member's account. Filled by progress.js. */
.home-sync { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 13.5px; color: var(--mute); }
.home-sync:empty { display: none; }
.home-sync::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.home-sync.is-synced { color: var(--soft); }
.home-sync.is-synced::before { background: var(--teal); box-shadow: 0 0 0 3px rgba(126, 207, 214, .18); }
