/* ═══════════════════════════════════════════════════════════════
   The House of Tea & Madness — SYSTEM
   Tweak modes · cursor lantern · animated chain · post page · print
   Loaded AFTER tea-madness.css; overrides take precedence.
   ═══════════════════════════════════════════════════════════════ */

/* ── FONT-STACK FALLBACKS ──────────────────────────────────────
   Source's screen.css normally defines these; provide fallbacks so
   the preview HTML (which doesn't load screen.css) still has them. */
:root {
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-serif: "EB Garamond", Georgia, Times, serif;
  --font-mono: "JetBrains Mono", Menlo, Consolas, Monaco, monospace;
}

/* ── PREVIEW CHROME ─────────────────────────────────────────────
   Lightweight nav + footer for the standalone index.html / post.html
   skeletons. In a real Ghost render, the nav comes from
   partials/components/navigation.hbs (.gh-navigation) and the footer
   from footer.hbs (.gh-footer), both styled by tea-madness.css's
   overlay on Source. These .tm-nav / .tm-footer rules only exist so
   the preview is usable without a Ghost runtime. */
.tm-nav {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  padding: 18px 40px;
  background: color-mix(in oklab, var(--ink-void) 88%, transparent);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: saturate(140%) blur(8px);
}
.tm-nav-brand img { height: 28px; width: auto; display: block; }
.tm-nav-menu { display: flex; gap: 28px; justify-content: center; }
.tm-nav-menu a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-fade);
  position: relative;
  transition: color 0.15s;
}
.tm-nav-menu a:hover { color: var(--bone); }
.tm-nav-menu a::before { content: "/"; color: var(--bone-ghost); margin-right: 6px; opacity: 0.6; }
.tm-nav-actions { display: flex; gap: 20px; justify-content: flex-end; align-items: center; }
.tm-nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-fade);
}
.tm-nav-link:hover { color: var(--bone); }
.tm-btn-ghost {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--cheshire);
  color: var(--cheshire);
  padding: 10px 16px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tm-btn-ghost:hover { background: var(--cheshire); color: var(--ink-void); }

.tm-footer {
  border-top: 1px solid var(--hairline);
  background: var(--ink-floor);
  padding: 80px 56px 0;
}
.tm-foot-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  gap: 64px;
  padding-bottom: 72px;
}
.tm-foot-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--bone-fade);
  margin-bottom: 18px;
}
.tm-foot-mantra {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 21px;
  line-height: 1.45;
  color: var(--bone);
  margin: 0;
}
.tm-foot-list { list-style: none; margin: 0; padding: 0; }
.tm-foot-list li { margin-bottom: 10px; }
.tm-foot-list a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
}
.tm-foot-list a:hover { color: var(--cheshire); }
.tm-foot-sub-copy {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.5;
  color: var(--bone-dim);
  margin: 0 0 18px;
}
.tm-foot-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
}
.tm-foot-form input {
  background: var(--ink-void);
  border: 1px solid var(--hairline-bright);
  color: var(--bone);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.tm-foot-form input:focus { outline: none; border-color: var(--cheshire); }
.tm-foot-form button {
  background: var(--cheshire);
  color: var(--ink-void);
  border: none;
  padding: 14px 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
}
.tm-foot-form button:hover { background: var(--bone); }
.tm-foot-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 0;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--bone-ghost);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.tm-foot-bar-mid {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--bone-ghost);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.tm-foot-bar > :last-child { text-align: right; }
@media (max-width: 980px) {
  .tm-foot-grid { grid-template-columns: 1fr; gap: 40px; padding: 0 4px 56px; }
  .tm-foot-bar  { grid-template-columns: 1fr; gap: 12px; text-align: center; }
  .tm-foot-bar > :last-child { text-align: center; }
  .tm-nav { padding: 14px 20px; grid-template-columns: auto 1fr auto; }
  .tm-nav-menu { display: none; }
}


/* ── ACCENT PALETTE SWITCHER ──────────────────────────────────── */
/* All accent uses through the site flow from --cheshire; remapping
   it here re-themes everything that hangs off it. */
body.accent-cheshire { --cheshire: oklch(0.82 0.14 195); --cheshire-deep: oklch(0.55 0.12 195); }
body.accent-chain    { --cheshire: oklch(0.74 0.20 340); --cheshire-deep: oklch(0.50 0.18 340); }
body.accent-maze     { --cheshire: oklch(0.70 0.18 295); --cheshire-deep: oklch(0.46 0.15 295); }
body.accent-tea      { --cheshire: oklch(0.82 0.14 75);  --cheshire-deep: oklch(0.55 0.12 75);  }

/* ── CHAIN ON / OFF ───────────────────────────────────────────── */
/* "off" means the magenta accent fades into the dominant cheshire,
   for a single-accent reading. */
body.chain-off { --chain: var(--cheshire-deep); }
body.chain-off .tm-tag-chain { color: var(--cheshire-deep) !important; }
body.chain-off .tm-pf-corner { opacity: 0.4; }
body.chain-off .tm-chain-link { color: var(--cheshire-deep); }
body.chain-off .tm-node-arm::after { opacity: 0.35; }

/* ── GLOW INTENSITY ───────────────────────────────────────────── */
/* class names match @custom.node_glow_intensity in package.json:
   quiet · standard · lanternlit */
body.glow-quiet .tm-featured-sigil .tm-ring { filter: none; }
body.glow-quiet .tm-featured-sigil .tm-ring-mid,
body.glow-quiet .tm-featured-sigil .tm-ring-outer { animation: none; }
body.glow-quiet .tm-node:hover .tm-node-card { box-shadow: none; }
body.glow-quiet .tm-node-sigil { box-shadow: 0 0 0 1px var(--hairline-bright); }
body.glow-quiet .tm-node:hover .tm-node-sigil { box-shadow: 0 0 0 1px var(--cheshire); }
body.glow-quiet .tm-pull-glow { text-shadow: none; }
body.glow-quiet .tm-pull-glow::before { display: none; }

body.glow-lanternlit .tm-featured-sigil .tm-ring {
  filter: drop-shadow(0 0 64px color-mix(in oklch, var(--cheshire) 38%, transparent))
          drop-shadow(0 0 18px color-mix(in oklch, var(--cheshire) 25%, transparent));
}
body.glow-lanternlit .tm-node-sigil {
  box-shadow: 0 0 0 1px var(--hairline-bright),
              0 0 40px color-mix(in oklch, var(--cheshire) 45%, transparent);
}
body.glow-lanternlit .tm-node:hover .tm-node-sigil {
  box-shadow: 0 0 0 1px var(--cheshire),
              0 0 60px color-mix(in oklch, var(--cheshire) 70%, transparent);
}
body.glow-lanternlit .tm-node:hover .tm-node-card {
  box-shadow: 0 0 0 1px var(--cheshire),
              0 30px 80px -10px color-mix(in oklch, var(--cheshire) 45%, transparent),
              0 0 60px -10px color-mix(in oklch, var(--cheshire) 30%, transparent);
}
body.glow-lanternlit .tm-pull-glow {
  text-shadow:
    0 0 24px color-mix(in oklch, var(--cheshire) 35%, transparent),
    0 0 60px color-mix(in oklch, var(--cheshire) 18%, transparent);
}

/* ── DENSITY ──────────────────────────────────────────────────── */
body.density-library .tm-threshold { padding: 64px 56px 80px; }
body.density-library .tm-threshold-prose .tm-meta-line { margin-bottom: 36px; }
body.density-library .tm-prose-body { font-size: 17px; line-height: 1.5; }
body.density-library .tm-prose-body p { margin: 0 0 12px; }
body.density-library .tm-lanterns { padding: 72px 0 80px; }
body.density-library .tm-corridor { padding: 72px 0 90px; }
body.density-library .tm-pace { padding: 14px 0; }
body.density-library .tm-pace-rule { flex-basis: 60px; }
body.density-library .tm-node { padding: 4px 0; }
body.density-library .tm-node-card { padding: 18px 22px; }
body.density-library .tm-card-title { font-size: 26px; }
body.density-library .tm-card-excerpt { font-size: 16px; line-height: 1.45; margin-bottom: 14px; }
body.density-library .tm-featured-dek { font-size: 18px; }
body.density-library .tm-essay { line-height: 1.55; }
body.density-library .tm-essay p { font-size: 18px; margin: 0 0 14px; }

/* ── ITALIC DIAL ──────────────────────────────────────────────── */
/* "soft" — italics stay, accent color recedes
   "off"  — no italics anywhere, accent color recedes */
body.italic-soft .tm-display em,
body.italic-soft .tm-featured-title em,
body.italic-soft .tm-card-title em,
body.italic-soft .tm-essay h1 em,
body.italic-soft .tm-essay h2 em { color: var(--bone-dim); }
body.italic-soft .tm-corridor-howto em { color: var(--bone); }

body.italic-off .tm-display em,
body.italic-off .tm-featured-title em,
body.italic-off .tm-card-title em,
body.italic-off .tm-essay h1 em,
body.italic-off .tm-essay h2 em,
body.italic-off .tm-lede,
body.italic-off .tm-foot-mantra,
body.italic-off .tm-corridor-howto,
body.italic-off .tm-pt-name,
body.italic-off .tm-sig .tm-sig-name,
body.italic-off .tm-essay .tm-lede,
body.italic-off .tm-featured-stamp em { font-style: normal !important; color: inherit; }
body.italic-off .tm-display em,
body.italic-off .tm-featured-title em,
body.italic-off .tm-card-title em,
body.italic-off .tm-essay h1 em,
body.italic-off .tm-essay h2 em { color: var(--bone-dim); }


/* ═══════════════════════════════════════════════════════════════
   CURSOR LANTERN
   A soft accent glow follows the cursor, plus a deepening veil
   pushes the room darker beyond the lantern's reach.
   ═══════════════════════════════════════════════════════════════ */
.cursor-lantern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.4s ease;
  background:
    radial-gradient(circle 360px at var(--lx, 50%) var(--ly, 50%),
      color-mix(in oklch, var(--cheshire) 10%, transparent) 0%,
      color-mix(in oklch, var(--cheshire) 4%, transparent) 25%,
      transparent 55%),
    radial-gradient(circle 720px at var(--lx, 50%) var(--ly, 50%),
      transparent 0%,
      transparent 30%,
      color-mix(in oklab, var(--ink-void) 55%, transparent) 75%,
      color-mix(in oklab, var(--ink-void) 80%, transparent) 100%);
  mix-blend-mode: normal;
}
body.lantern-on .cursor-lantern { opacity: 1; }


/* ═══════════════════════════════════════════════════════════════
   ANIMATED CHAIN MOTIF
   ═══════════════════════════════════════════════════════════════ */
.tm-foot-bar-mid {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.tm-chain-link {
  color: var(--chain);
  font-size: 11px;
  animation: chain-pulse 7s ease-in-out infinite;
}
.tm-chain-sep { color: var(--bone-ghost); opacity: 0.6; }
.tm-chain-link:nth-of-type(1) { animation-delay: 0s; }
.tm-chain-link:nth-of-type(2) { animation-delay: -1.2s; }
.tm-chain-link:nth-of-type(3) { animation-delay: -2.4s; }
.tm-chain-link:nth-of-type(4) { animation-delay: -3.6s; }
.tm-chain-link:nth-of-type(5) { animation-delay: -4.8s; }
@keyframes chain-pulse {
  0%, 100% {
    opacity: 0.55;
    text-shadow: 0 0 0 transparent;
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 12px color-mix(in oklch, var(--chain) 60%, transparent);
  }
}

/* The magenta dots on node arms — staggered breath, very subtle */
.tm-node:nth-of-type(2n) .tm-node-arm::after  { animation: chain-dot 9s ease-in-out infinite; }
.tm-node:nth-of-type(2n+1) .tm-node-arm::after { animation: chain-dot 9s ease-in-out -4s infinite; }
@keyframes chain-dot {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50%      { box-shadow: 0 0 12px color-mix(in oklch, var(--chain) 60%, transparent); }
}

/* Portrait chain corners — same slow breath */
.tm-pf-corner { animation: chain-corner 11s ease-in-out infinite; }
.tm-pf-tr     { animation-delay: -2.75s; }
.tm-pf-bl     { animation-delay: -5.5s; }
.tm-pf-br     { animation-delay: -8.25s; }
@keyframes chain-corner {
  0%, 100% { filter: none; }
  50%      { filter: drop-shadow(0 0 4px color-mix(in oklch, var(--chain) 70%, transparent)); }
}


/* ═══════════════════════════════════════════════════════════════
   ESSAY / POST PAGE
   ═══════════════════════════════════════════════════════════════ */

.tm-post {
  padding: 80px 56px 120px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(0, 740px) 1fr;
  gap: 0;
  column-gap: 48px;
}

.tm-post-rail-l { grid-column: 1; }
.tm-post-main   { grid-column: 2; }
.tm-post-rail-r { grid-column: 3; }

/* article frame eyebrow */
.tm-essay-frame {
  position: relative;
  margin-bottom: 56px;
}
.tm-essay-frame .tm-brk {
  border-color: var(--cheshire);
  width: 24px; height: 24px;
}
.tm-essay-frame .tm-brk-tl { top: -12px; left: -12px; }
.tm-essay-frame .tm-brk-tr { top: -12px; right: -12px; }
.tm-essay-frame .tm-brk-bl { bottom: -12px; left: -12px; }
.tm-essay-frame .tm-brk-br { bottom: -12px; right: -12px; }

.tm-essay-stamp {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 28px;
  color: var(--cheshire);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.tm-essay-stamp .dot { color: var(--bone-ghost); }
.tm-essay-stamp .tm-tag-chain { color: var(--chain); }

.tm-essay-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 6vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--bone);
  margin: 0 0 20px;
  text-wrap: balance;
}
.tm-essay-title em { font-style: italic; font-weight: 400; color: var(--cheshire); }

.tm-essay-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.35;
  color: var(--bone-dim);
  margin: 0 0 36px;
  text-wrap: pretty;
}

.tm-essay-byline {
  display: flex; gap: 20px; align-items: baseline;
  padding: 14px 0;
  border-top: 1px solid var(--hairline-bright);
  border-bottom: 1px solid var(--hairline-bright);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-fade);
}
.tm-essay-byline .tm-by-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--bone);
}
.tm-essay-byline .tm-by-meta { margin-left: auto; color: var(--bone-ghost); }

/* ── ESSAY BODY ───────────────────────────────────────────────── */
.tm-essay {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.62;
  color: var(--bone-dim);
}
.tm-essay p { margin: 0 0 22px; }
.tm-essay p strong { color: var(--bone); font-weight: 500; }
.tm-essay em { font-style: italic; color: var(--bone); }
.tm-essay a {
  color: var(--cheshire);
  border-bottom: 1px solid color-mix(in oklch, var(--cheshire) 40%, transparent);
}
.tm-essay a:hover { color: var(--bone); border-bottom-color: var(--bone); }

/* Heading tiers — explicit color by level so hierarchy is visible */
.tm-essay h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 6vw, 80px);
  line-height: 1.02;
  color: var(--bone);
  margin: 64px 0 24px;
  letter-spacing: -0.02em;
}
.tm-essay h1 em { color: var(--cheshire); font-style: italic; font-weight: 400; }

.tm-essay h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.15;
  color: var(--cheshire);
  margin: 64px 0 18px;
  letter-spacing: -0.012em;
}
.tm-essay h2 em { font-style: italic; color: var(--bone); font-weight: 400; }

.tm-essay h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 26px;
  line-height: 1.2;
  color: var(--maze);
  margin: 48px 0 14px;
}
.tm-essay h3 em { color: var(--bone); font-style: normal; }

.tm-essay h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--tea);
  margin: 40px 0 10px;
}

/* Section separator — the ◦ glyph from the source text */
.tm-essay-sep {
  display: block;
  text-align: center;
  margin: 44px 0 36px;
  color: var(--cheshire);
  font-size: 18px;
  letter-spacing: 1.5em;
  padding-left: 1.5em;
  opacity: 0.7;
}

/* Drop cap on the first paragraph — span-based for reliable rendering
   across all browsers, screenshot tools, and Ghost's Koenig output.
   (Ghost can apply this class via {{#contentFor "drop_cap"}} or content
   wrapping in post.hbs.) */
.tm-essay .tm-dropcap,
.tm-essay > .tm-first-para::first-letter,
.tm-essay .tm-first-para::first-letter {
  font-family: var(--font-display);
  font-size: 86px;
  line-height: 0.85;
  font-weight: 500;
  float: left;
  padding: 6px 14px 0 0;
  margin: 6px 0 0;
  color: var(--cheshire);
  font-style: italic;
}

/* Pull-quote — bigger, glowy, special */
.tm-essay .pull,
.tm-pull-glow {
  position: relative;
  margin: 44px 0 44px;
  padding: 0 0 0 28px;
  border-left: 1px solid var(--chain);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 28px;
  line-height: 1.32;
  color: var(--bone);
  max-width: 38ch;
  text-wrap: balance;
  text-shadow: 0 0 28px color-mix(in oklch, var(--cheshire) 22%, transparent);
}
.tm-essay .pull cite,
.tm-pull-glow cite {
  display: block;
  margin-top: 18px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-fade);
  text-shadow: none;
}

/* Marginalia — small notes that hang in the right rail next to prose */
.tm-margin-note {
  position: absolute;
  width: 220px;
  left: calc(100% + 56px);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: var(--bone-fade);
  padding-left: 14px;
  border-left: 1px solid var(--hairline-bright);
}
.tm-margin-note .tm-mn-tag {
  display: block;
  margin-bottom: 6px;
  color: var(--cheshire);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.tm-margin-note em { color: var(--bone); font-style: italic; font-family: var(--font-display); font-size: 13px; }

/* anchor the margin note to its containing paragraph */
.tm-with-note { position: relative; }


/* ── PACES RAIL (right side, fixed) ──────────────────────────── */
.tm-paces-rail {
  position: fixed;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  z-index: 20;
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-ghost);
  pointer-events: none;
}
.tm-paces-rail .tm-pr-meta {
  text-align: right;
  margin-bottom: 12px;
  color: var(--cheshire);
}
.tm-paces-rail .tm-pr-meta .tm-pr-cur { color: var(--bone); }
.tm-paces-rail .tm-pr-track {
  position: relative;
  width: 1px; height: 320px;
  background: var(--hairline-bright);
  pointer-events: auto;
}
.tm-paces-rail .tm-pr-fill {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0%;
  background: var(--cheshire);
  box-shadow: 0 0 8px color-mix(in oklch, var(--cheshire) 60%, transparent);
  transition: height 0.15s ease;
}
.tm-paces-rail .tm-pr-tick {
  position: absolute;
  left: -3px;
  width: 7px; height: 1px;
  background: var(--bone-ghost);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s, width 0.15s;
}
.tm-paces-rail .tm-pr-tick:hover { background: var(--cheshire); width: 12px; left: -5px; }
.tm-paces-rail .tm-pr-tick[data-active="true"] { background: var(--cheshire); }
.tm-paces-rail .tm-pr-end {
  margin-top: 12px;
  text-align: right;
  color: var(--bone-ghost);
}

/* ── NEIGHBOURS BLOCK ────────────────────────────────────────── */
.tm-neighbours {
  max-width: 740px;
  margin: 84px auto 0;
  padding: 32px 0 0;
  border-top: 1px solid var(--hairline-bright);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.tm-nbr {
  display: block;
  padding: 22px 24px;
  background: var(--ink-floor);
  border: 1px solid var(--hairline);
  transition: border-color 0.15s, transform 0.18s;
}
.tm-nbr:hover { border-color: var(--cheshire); transform: translateY(-2px); }
.tm-nbr .tm-nbr-dir {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cheshire);
  margin-bottom: 8px;
}
.tm-nbr .tm-nbr-num { color: var(--bone-fade); }
.tm-nbr .tm-nbr-title {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.15;
  color: var(--bone);
  margin: 0 0 8px;
}
.tm-nbr .tm-nbr-title em { font-style: italic; color: var(--cheshire); font-weight: 400; }
.tm-nbr .tm-nbr-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--bone-fade);
}
.tm-nbr.nbr-right { text-align: right; }
.tm-nbr.nbr-right .tm-nbr-dir { text-align: right; }

/* responsive — collapse rails */
@media (max-width: 1280px) {
  .tm-margin-note {
    position: static;
    width: auto;
    margin: 12px 0 28px;
  }
  .tm-post { grid-template-columns: 1fr; }
  .tm-post-rail-l, .tm-post-rail-r { display: none; }
  .tm-post-main { max-width: 740px; margin: 0 auto; }
  .tm-paces-rail { right: 12px; }
  .tm-paces-rail .tm-pr-track { height: 240px; }
}
@media (max-width: 720px) {
  .tm-post { padding: 56px 24px 80px; }
  .tm-paces-rail { display: none; }
  .tm-essay { font-size: 18px; }
  .tm-essay .pull, .tm-pull-glow { font-size: 22px; padding-left: 18px; }
  .tm-neighbours { grid-template-columns: 1fr; }
  .tm-nbr.nbr-right { text-align: left; }
  .tm-nbr.nbr-right .tm-nbr-dir { text-align: left; }
}


/* ═══════════════════════════════════════════════════════════════
   PRINT — clean serif page, no chrome
   ═══════════════════════════════════════════════════════════════ */
@media print {
  @page {
    size: letter;
    margin: 0.85in 0.9in 1in;
  }
  body {
    background: white !important;
    color: #1a1a1a !important;
    font-family: "EB Garamond", Georgia, serif;
  }
  .tm-nav, .tm-footer, .gh-navigation, .gh-footer,
  .tm-paces-rail, .cursor-lantern, .twk-panel,
  .tm-neighbours, .tm-essay-frame .tm-brk { display: none !important; }

  .tm-post { display: block; padding: 0; }
  .tm-essay-stamp {
    color: #666 !important;
    letter-spacing: 0.18em;
    border-bottom: 0.5pt solid #ccc;
    padding-bottom: 8pt;
    margin-bottom: 20pt;
  }
  .tm-essay-title {
    color: #111 !important;
    font-size: 30pt;
    line-height: 1.05;
    margin: 0 0 8pt;
  }
  .tm-essay-title em { color: #555 !important; }
  .tm-essay-subtitle {
    color: #444 !important;
    font-size: 14pt;
    margin: 0 0 18pt;
  }
  .tm-essay-byline {
    color: #555 !important;
    border-top: 0.5pt solid #ccc;
    border-bottom: 0.5pt solid #ccc;
    font-size: 9pt;
    letter-spacing: 0.15em;
    padding: 6pt 0;
    margin-bottom: 24pt;
  }
  .tm-essay-byline .tm-by-name { color: #111 !important; }
  .tm-essay { color: #1a1a1a !important; font-size: 12pt; line-height: 1.5; }
  .tm-essay h1, .tm-essay h2 { color: #111 !important; page-break-after: avoid; }
  .tm-essay h1 em, .tm-essay h2 em { color: #555 !important; }
  .tm-essay h3 { color: #333 !important; font-style: italic; page-break-after: avoid; }
  .tm-essay h4 { color: #555 !important; }
  .tm-essay p { orphans: 3; widows: 3; }
  .tm-essay .pull, .tm-pull-glow {
    color: #111 !important;
    border-left: 1pt solid #555 !important;
    text-shadow: none !important;
    page-break-inside: avoid;
    font-size: 14pt;
    margin: 18pt 0;
  }
  .tm-essay-sep { color: #888 !important; margin: 22pt 0 18pt; }
  .tm-essay > .tm-first-para::first-letter,
  .tm-essay .tm-first-para::first-letter { color: #444 !important; font-size: 56pt; }
  .tm-margin-note {
    display: block;
    position: static;
    width: auto;
    margin: 8pt 0 16pt 24pt;
    padding-left: 12pt;
    border-left: 0.5pt solid #aaa;
    font-size: 9pt;
    color: #555 !important;
    font-family: "EB Garamond", Georgia, serif;
  }
  .tm-margin-note .tm-mn-tag {
    color: #777 !important;
    font-family: "EB Garamond", Georgia, serif;
    font-style: italic;
    letter-spacing: 0;
    text-transform: none;
    font-size: 9pt;
  }
  .tm-margin-note em { color: #333 !important; }
  a { color: inherit !important; text-decoration: none; border: none !important; }
}


/* ═══════════════════════════════════════════════════════════════
   PAGE HERO — atmospheric eyebrow + title + subtitle
   Shared across class.html, healing.html, news.html
   ═══════════════════════════════════════════════════════════════ */
.tm-page {
  position: relative;
  padding: 88px 56px 56px;
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}
.tm-page .tm-brk { border-color: var(--cheshire); opacity: 0.7; }
.tm-page-inner {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.tm-page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cheshire);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.tm-page-eyebrow::after {
  content: "";
  width: 64px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}
.tm-page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 6.5vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--bone);
  margin: 0 0 24px;
  text-wrap: balance;
  max-width: 22ch;
}
.tm-page-title em { font-style: italic; font-weight: 400; color: var(--cheshire); }
.tm-page-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.4;
  color: var(--bone-dim);
  max-width: 54ch;
  margin: 0 0 32px;
  text-wrap: pretty;
}
.tm-page-body {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.6;
  color: var(--bone-dim);
  max-width: 56ch;
}
.tm-page-body p { margin: 0 0 16px; }
.tm-page-body strong { color: var(--bone); font-weight: 500; }
.tm-page-body em { font-style: italic; color: var(--bone); }


/* ═══════════════════════════════════════════════════════════════
   CLASS / LEARNING PAGE — curriculum + volumes + module rows
   ═══════════════════════════════════════════════════════════════ */
.tm-curriculum {
  padding: 96px 56px 120px;
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in oklch, var(--cheshire) 4%, transparent), transparent 50%),
    var(--ink-void);
  border-bottom: 1px solid var(--hairline);
}
.tm-curr-inner {
  max-width: 1280px;
  margin: 0 auto;
}

/* Volume row — three book cards */
.tm-volumes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 0 0 88px;
}
.tm-volume {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--ink-floor);
  border: 1px solid var(--hairline-bright);
  padding: 24px 24px 28px;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
  text-decoration: none;
}
.tm-volume:hover {
  border-color: var(--cheshire);
  transform: translateY(-2px);
  box-shadow:
    0 30px 60px -20px color-mix(in oklch, var(--cheshire) 25%, transparent);
}
.tm-vol-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  background:
    repeating-linear-gradient(135deg,
      transparent 0 14px,
      color-mix(in oklab, var(--cheshire) 7%, transparent) 14px 15px),
    var(--ink-void);
  border: 1px solid var(--hairline-bright);
  margin-bottom: 22px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tm-vol-cover .tm-vol-glyph {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 180px;
  line-height: 1;
  color: var(--cheshire);
  opacity: 0.65;
  filter: drop-shadow(0 0 24px color-mix(in oklch, var(--cheshire) 35%, transparent));
  letter-spacing: -0.04em;
}
.tm-vol-cover .tm-vol-stamp {
  position: absolute;
  top: 14px; left: 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-fade);
}
.tm-vol-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cheshire);
  margin-bottom: 8px;
}
.tm-vol-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: var(--bone);
  margin: 0 0 10px;
}
.tm-vol-title em { font-style: italic; color: var(--cheshire); font-weight: 400; }
.tm-vol-dek {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.45;
  color: var(--bone-dim);
  margin: 0 0 18px;
}
.tm-vol-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-fade);
}
.tm-vol-meta .tm-vol-status { color: var(--cheshire); }

/* Six-up book grid variant — wraps to two rows of three.
   Same column rule as .tm-volumes; this just opens the bottom-margin
   so the books-foot caption sits cleanly below. */
.tm-volumes-six { margin-bottom: 16px; }

/* The "Download PDF" link inside .tm-vol-meta.
   Replaces the static "Read" status from the old volume layout. */
.tm-vol-dl {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cheshire);
  border-bottom: 1px solid color-mix(in oklch, var(--cheshire) 35%, transparent);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.tm-vol-dl:hover {
  color: var(--bone);
  border-bottom-color: var(--bone);
}

/* Caption beneath the book grid pointing at /library/. */
.tm-books-foot {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  line-height: 1.55;
  color: var(--bone-fade);
  text-align: center;
  margin: 0 0 88px;
  padding: 0 8%;
}
.tm-books-foot a {
  font-style: normal;
  color: var(--cheshire);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklch, var(--cheshire) 30%, transparent);
}
.tm-books-foot a:hover {
  border-bottom-color: var(--cheshire);
}

/* Empty-state message for class/healing feeds before any posts are tagged. */
.tm-feed-empty {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  line-height: 1.6;
  color: var(--bone-fade);
  border: 1px dashed var(--hairline-bright);
  border-radius: 3px;
  padding: 32px 28px;
  margin: 0;
  text-align: center;
}
.tm-feed-empty code {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cheshire);
  background: color-mix(in oklch, var(--cheshire) 8%, transparent);
  padding: 1px 6px;
  border-radius: 2px;
}

/* Module rows — curriculum index */
.tm-modules {
  margin: 0 0 88px;
  border-top: 1px solid var(--hairline-bright);
}
.tm-module {
  display: grid;
  grid-template-columns: 80px 1fr 200px 120px;
  gap: 28px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.15s;
  text-decoration: none;
}
.tm-module:hover { background: color-mix(in oklab, var(--ink-floor) 60%, transparent); }
.tm-mod-num {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--cheshire);
}
.tm-mod-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--bone);
  margin: 0;
}
.tm-mod-name em { font-style: italic; color: var(--bone-dim); font-weight: 400; }
.tm-mod-name .tm-mod-dek {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  line-height: 1.4;
  color: var(--bone-dim);
  font-weight: 400;
  margin-top: 6px;
  max-width: 60ch;
}
.tm-mod-status {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-fade);
}
.tm-mod-status.is-ready { color: var(--cheshire); }
.tm-mod-status.is-soon  { color: var(--chain); }
.tm-mod-walk {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cheshire);
  text-align: right;
  justify-self: end;
}
.tm-module:hover .tm-mod-walk { letter-spacing: 0.32em; }

/* Video / lesson media slots */
.tm-lessons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 48px 0 88px;
}
.tm-lesson {
  background: var(--ink-floor);
  border: 1px solid var(--hairline);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.tm-lesson-frame {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse at 50% 50%, color-mix(in oklch, var(--cheshire) 10%, transparent) 0%, transparent 65%),
    var(--ink-void);
  border: 1px solid var(--hairline-bright);
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  position: relative;
}
.tm-lesson-frame::before {
  content: "▶";
  font-size: 32px;
  color: var(--cheshire);
  opacity: 0.7;
}
.tm-lesson-frame .tm-lesson-status {
  position: absolute;
  bottom: 12px; right: 12px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chain);
  background: color-mix(in oklab, var(--ink-void) 80%, transparent);
  border: 1px solid var(--hairline);
  padding: 4px 8px;
}
.tm-lesson-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--cheshire);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.tm-lesson-title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.2;
  color: var(--bone);
  margin: 0 0 8px;
}
.tm-lesson-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--bone-fade);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  text-transform: uppercase;
}

/* Adjacent corridor strip — for "Architecture of Worth" link on class page */
.tm-adjacent {
  margin-top: 64px;
  padding: 28px 32px;
  border: 1px solid var(--hairline-bright);
  background: color-mix(in oklab, var(--ink-floor) 70%, var(--ink-void));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
}
.tm-adj-sym {
  font-family: var(--font-display);
  font-size: 42px;
  color: var(--maze);
  font-style: italic;
  line-height: 1;
}
.tm-adj-body p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.5;
  color: var(--bone-dim);
}
.tm-adj-body strong { color: var(--bone); font-weight: 500; }
.tm-adj-walk {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cheshire);
  white-space: nowrap;
  border: 1px solid var(--cheshire);
  padding: 12px 18px;
  transition: background 0.15s, color 0.15s;
}
.tm-adj-walk:hover { background: var(--cheshire); color: var(--ink-void); }


/* ═══════════════════════════════════════════════════════════════
   HEALING PAGE — sigil cards, all "coming soon"
   ═══════════════════════════════════════════════════════════════ */
.tm-healing {
  padding: 96px 56px 120px;
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in oklch, var(--maze) 5%, transparent), transparent 55%),
    var(--ink-void);
  border-bottom: 1px solid var(--hairline);
}
.tm-healing-inner { max-width: 1280px; margin: 0 auto; }
.tm-healing-intro {
  max-width: 60ch;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.6;
  color: var(--bone-dim);
  margin: 0 0 72px;
}
.tm-healing-intro em { font-style: italic; color: var(--bone); }
.tm-healing-intro strong { color: var(--bone); font-weight: 500; }

.tm-sigil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 88px;
}
.tm-sigil-card {
  position: relative;
  background: var(--ink-floor);
  border: 1px solid var(--hairline);
  padding: 32px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 260px;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.tm-sigil-card:hover {
  border-color: var(--cheshire);
  transform: translateY(-2px);
}
.tm-sigil-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: var(--cheshire);
  background: var(--ink-void);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--hairline-bright),
              0 0 20px color-mix(in oklch, var(--cheshire) 20%, transparent);
}
.tm-sigil-mark svg { width: 38px; height: 38px; }
.tm-sigil-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--bone);
  margin: 0;
}
.tm-sigil-title em { font-style: italic; color: var(--cheshire); font-weight: 400; }
.tm-sigil-dek {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.5;
  color: var(--bone-dim);
  margin: 0;
}
.tm-sigil-status {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chain);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tm-sigil-status .tm-sigil-eta { color: var(--bone-ghost); }
.tm-sigil-card[data-status="ready"]   .tm-sigil-status { color: var(--cheshire); }
.tm-sigil-card[data-status="testing"] .tm-sigil-status { color: var(--tea); }

/* Crisis card — visually distinct, never marked coming-soon */
.tm-crisis {
  margin-top: 24px;
  padding: 32px 36px;
  background: color-mix(in oklab, var(--ink-floor-up) 80%, var(--ink-void));
  border: 1px solid var(--chain);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
}
.tm-crisis-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 64px;
  line-height: 1;
  color: var(--chain);
  filter: drop-shadow(0 0 20px color-mix(in oklch, var(--chain) 35%, transparent));
}
.tm-crisis-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.1;
  color: var(--bone);
  margin: 0 0 12px;
}
.tm-crisis-body {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.5;
  color: var(--bone-dim);
  margin: 0 0 16px;
  max-width: 60ch;
}
.tm-crisis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.tm-crisis-actions a {
  padding: 10px 16px;
  border: 1px solid var(--hairline-bright);
  color: var(--bone);
}
.tm-crisis-actions a.is-primary {
  border-color: var(--chain);
  color: var(--chain);
}
.tm-crisis-actions a:hover {
  border-color: var(--cheshire);
  color: var(--cheshire);
}


/* ═══════════════════════════════════════════════════════════════
   NEWS PAGE — mixed voice: atmospheric + dispatch
   ═══════════════════════════════════════════════════════════════ */
.tm-news {
  padding: 96px 56px 120px;
  border-bottom: 1px solid var(--hairline);
}
.tm-news-inner { max-width: 1100px; margin: 0 auto; }
.tm-news-list { list-style: none; margin: 0; padding: 0; }
.tm-news-item {
  display: grid;
  grid-template-columns: 140px 1fr 120px;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--hairline);
}
.tm-news-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cheshire);
  padding-top: 6px;
}
.tm-news-date .tm-news-year { display: block; color: var(--bone-ghost); margin-top: 4px; }
.tm-news-body { max-width: 60ch; }
.tm-news-kind {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-fade);
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 10px;
  border: 1px solid var(--hairline-bright);
}
.tm-news-kind.is-personal { color: var(--cheshire); border-color: color-mix(in oklch, var(--cheshire) 35%, transparent); }
.tm-news-kind.is-project { color: var(--maze); border-color: color-mix(in oklch, var(--maze) 35%, transparent); }
.tm-news-kind.is-dispatch { color: var(--chain); border-color: color-mix(in oklch, var(--chain) 35%, transparent); }
.tm-news-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: var(--bone);
  margin: 0 0 12px;
}
.tm-news-title em { font-style: italic; color: var(--cheshire); font-weight: 400; }
.tm-news-excerpt {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.55;
  color: var(--bone-dim);
  margin: 0;
}
.tm-news-excerpt em { font-style: italic; color: var(--bone); }
.tm-news-item.is-atmospheric .tm-news-excerpt {
  font-style: italic;
  color: var(--bone-dim);
}
.tm-news-actions {
  align-self: start;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cheshire);
}
.tm-news-actions a:hover { color: var(--bone); }


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — pages collapse on narrow screens
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .tm-page { padding: 64px 28px 48px; }
  .tm-curriculum { padding: 64px 28px 80px; }
  .tm-healing { padding: 64px 28px 80px; }
  .tm-news { padding: 64px 28px 80px; }
  .tm-module {
    grid-template-columns: 60px 1fr;
    grid-template-areas:
      "num   name"
      "blank status"
      "blank walk";
    row-gap: 8px;
  }
  .tm-mod-num    { grid-area: num; }
  .tm-mod-name   { grid-area: name; font-size: 22px; }
  .tm-mod-status { grid-area: status; }
  .tm-mod-walk   { grid-area: walk; text-align: left; justify-self: start; }
  .tm-lessons { grid-template-columns: 1fr; }
  .tm-adjacent { grid-template-columns: 1fr; }
  .tm-news-item { grid-template-columns: 1fr; gap: 12px; }
  .tm-news-actions { text-align: left; }
  .tm-crisis { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .tm-volumes { grid-template-columns: 1fr; gap: 18px; }
  .tm-vol-cover { aspect-ratio: auto; height: 180px; }
  .tm-vol-cover .tm-vol-glyph { font-size: 120px; }
}

/* ─────────────────────────────────────────────────────────────────────
   LIBRARY page tokens
   Extends .tm-curriculum / .tm-volumes for the dedicated /library/ page.
   ──────────────────────────────────────────────────────────────────── */

/* A quieter curriculum band — used for "Companion Pieces" so it reads
   as a lower-key shelf beneath Daedalus's Six. Same column grid, just
   muted ground and a hairline above. */
.tm-curriculum-quiet {
  background: color-mix(in oklch, var(--ink-floor) 70%, transparent);
  border-top: 1px solid var(--hairline);
  margin-top: 0;
  padding-top: 96px;
}

/* The companion grid is two-up — visually smaller shelf than the six. */
.tm-companions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 780px) {
  .tm-companions { grid-template-columns: 1fr; }
}

/* A muted cover treatment for companion volumes — same shape, less
   saturation, so they recede from Daedalus's Six visually. */
.tm-vol-cover-quiet {
  background:
    linear-gradient(135deg,
      color-mix(in oklch, var(--ink-floor) 92%, var(--ink-void)) 0%,
      color-mix(in oklch, var(--ink-floor) 80%, var(--ink-void)) 100%);
  border-color: var(--hairline);
}
.tm-vol-cover-quiet .tm-vol-glyph {
  color: color-mix(in oklch, var(--bone-dim) 55%, transparent);
  -webkit-text-stroke: 1px color-mix(in oklch, var(--cheshire) 22%, transparent);
}
.tm-vol-cover-quiet .tm-vol-stamp {
  color: var(--bone-dim);
  border-color: var(--hairline);
}

/* Status pill inside .tm-vol-meta — replaces the static "Read" badge.
   Three states: ready (a book whose markdown is in the repo), pending
   (placeholder while we transcribe), quiet (open/reserved shelf). */
.tm-vol-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--hairline-bright);
  border-radius: 999px;
  color: var(--bone-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tm-vol-status.is-ready {
  color: var(--cheshire);
  border-color: color-mix(in oklch, var(--cheshire) 40%, transparent);
  background: color-mix(in oklch, var(--cheshire) 6%, transparent);
}
.tm-vol-status.is-ready::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cheshire);
  box-shadow: 0 0 8px var(--cheshire);
}
.tm-vol-status.is-pending {
  color: var(--bone-dim);
}
.tm-vol-status.is-pending::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  border: 1px solid var(--bone-dim);
}
.tm-vol-status.is-quiet {
  color: var(--bone-dim);
  border-style: dashed;
}

/* Two actions per volume on the Library page: download + view source.
   Stack them so each gets a full line; .tm-vol-actions overrides any
   inline-flex coming from .tm-vol-meta usage on the Class page. */
.tm-vol-actions {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

/* "View source (.md)" — quieter than the download CTA. */
.tm-vol-src {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-dim);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in oklch, var(--bone-dim) 55%, transparent);
  padding: 2px 0;
  transition: color 0.15s, border-color 0.15s;
}
.tm-vol-src:hover {
  color: var(--bone);
  border-bottom-color: var(--bone);
}

/* Disabled state — for volumes whose markdown hasn't landed yet.
   Reads as "this shelf is reserved" rather than "this is broken". */
.tm-vol-dl.is-disabled,
.tm-vol-src.is-disabled {
  color: color-mix(in oklch, var(--bone-dim) 70%, transparent);
  border-bottom-color: transparent;
  cursor: not-allowed;
  pointer-events: none;
}

/* Busy state — set by library.js while jsPDF builds the file. */
.tm-vol-dl[aria-busy="true"] {
  color: var(--tea);
  border-bottom-color: color-mix(in oklch, var(--tea) 40%, transparent);
}
.tm-vol-dl[aria-busy="true"]::after {
  content: " \2022\2022\2022";
  letter-spacing: 0.1em;
  animation: tm-dl-pulse 1.2s ease-in-out infinite;
}
@keyframes tm-dl-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1.0; }
}

/* Placeholder card on the companion shelf — "more to come". */
.tm-volume.is-placeholder {
  opacity: 0.7;
}
.tm-volume.is-placeholder .tm-vol-cover {
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in oklch, var(--ink-floor) 80%, transparent) 0 8px,
      color-mix(in oklch, var(--ink-floor) 90%, transparent) 8px 16px);
}
.tm-volume.is-placeholder .tm-vol-glyph {
  color: var(--bone-dim);
  font-size: 140px;
}

/* ─────────────────────────────────────────────────────────────────
   LIBRARY page — per-book cover artwork
   Each book gets its own background pattern, sigil, and accent. The
   sigil sits as a watermark behind the italic glyph, which moves to
   the upper-right and shrinks; the stamp stays top-left; a small mono
   spine sits at the bottom. Built from gradients + inline SVG so the
   covers stay <2kb each.
   ─────────────────────────────────────────────────────────────────*/

/* Common art-cover scaffold (overrides the default stripe + giant glyph
   layout from .tm-vol-cover above). Activate by adding .cover-art. */
.tm-vol-cover.cover-art {
  --cover-accent: var(--cheshire);
  background: var(--ink-void);
  isolation: isolate;
  overflow: hidden;
}

/* The sigil layer — centered SVG, ~58% of the cover, drawn in the
   book's accent color via currentColor. Sits behind everything else. */
.tm-vol-cover.cover-art .tm-vol-sigil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--cover-accent);
  pointer-events: none;
  z-index: 1;
}
.tm-vol-cover.cover-art .tm-vol-sigil svg {
  width: 58%;
  height: 58%;
  opacity: 0.82;
  filter: drop-shadow(0 0 14px color-mix(in oklch, var(--cover-accent) 28%, transparent));
}

/* Glyph drops to the upper-right corner as a quiet identifier. */
.tm-vol-cover.cover-art .tm-vol-glyph {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 56px;
  line-height: 0.85;
  opacity: 0.55;
  filter: none;
  z-index: 3;
}

/* Top-right volume tag (no. / role), top-left stamp stays as-is. */
.tm-vol-cover.cover-art .tm-vol-stamp {
  z-index: 3;
}

/* Bottom mono spine — author · title. */
.tm-vol-cover.cover-art .tm-vol-spine {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-fade);
  z-index: 3;
}
.tm-vol-cover.cover-art .tm-vol-spine .tm-spine-r {
  color: var(--cover-accent);
}

/* Thin hairline rule above the spine for typographic anchor. */
.tm-vol-cover.cover-art::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 26px;
  height: 1px;
  background: color-mix(in oklch, var(--cover-accent) 20%, transparent);
  z-index: 2;
}

/* ─── 1. Architecture of Worth — blueprint grid, tea/amber */
.tm-vol-cover.cover-worth {
  --cover-accent: var(--tea);
  background:
    /* fine 16px grid (architectural) */
    linear-gradient(0deg, color-mix(in oklch, var(--tea) 6%, transparent) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(90deg, color-mix(in oklch, var(--tea) 6%, transparent) 1px, transparent 1px) 0 0 / 16px 16px,
    radial-gradient(ellipse at 50% 40%,
      color-mix(in oklch, var(--tea) 8%, transparent),
      transparent 70%),
    var(--ink-void);
}

/* ─── 2. Breath Premise — concentric glow, cheshire/cyan */
.tm-vol-cover.cover-breath {
  --cover-accent: var(--cheshire);
  background:
    radial-gradient(circle at 50% 50%,
      color-mix(in oklch, var(--cheshire) 14%, transparent) 0%,
      color-mix(in oklch, var(--cheshire) 6%, transparent) 30%,
      transparent 65%),
    var(--ink-void);
}

/* ─── 3. Great Lockout — vertical bars, chain/magenta */
.tm-vol-cover.cover-lockout {
  --cover-accent: var(--chain);
  background:
    repeating-linear-gradient(90deg,
      transparent 0 22px,
      color-mix(in oklch, var(--chain) 9%, transparent) 22px 23px),
    linear-gradient(180deg,
      color-mix(in oklch, var(--chain) 10%, transparent),
      transparent 50%),
    var(--ink-void);
}

/* ─── 4. Great Disconnect — broken diagonal hairlines, maze/violet */
.tm-vol-cover.cover-disconnect {
  --cover-accent: var(--maze);
  background:
    repeating-linear-gradient(135deg,
      transparent 0 18px,
      color-mix(in oklch, var(--maze) 8%, transparent) 18px 19px,
      transparent 19px 24px,
      color-mix(in oklch, var(--maze) 4%, transparent) 24px 25px),
    var(--ink-void);
}

/* ─── 5. Great Repair — horizontal seam lines, cheshire/cyan */
.tm-vol-cover.cover-repair {
  --cover-accent: var(--cheshire);
  background:
    repeating-linear-gradient(0deg,
      transparent 0 20px,
      color-mix(in oklch, var(--cheshire) 8%, transparent) 20px 21px),
    linear-gradient(180deg, transparent 0%,
      color-mix(in oklch, var(--cheshire) 8%, transparent) 100%),
    var(--ink-void);
}

/* ─── 6. Autopsy — austere, bone hairline, one horizontal rule */
.tm-vol-cover.cover-autopsy {
  --cover-accent: var(--bone-dim);
  background:
    linear-gradient(180deg,
      transparent 49.7%,
      color-mix(in oklch, var(--bone-dim) 22%, transparent) 49.7% 50.3%,
      transparent 50.3%),
    linear-gradient(180deg,
      color-mix(in oklch, var(--ink-floor) 60%, transparent),
      var(--ink-void) 70%),
    var(--ink-void);
}
.tm-vol-cover.cover-autopsy::after {
  /* override spine rule to bone */
  background: color-mix(in oklch, var(--bone-dim) 22%, transparent);
}

/* ─── 7. Observation Theorem — dotted matrix, maze/violet */
.tm-vol-cover.cover-observation {
  --cover-accent: var(--maze);
  background:
    radial-gradient(
      circle at 1px 1px,
      color-mix(in oklch, var(--maze) 30%, transparent) 1px,
      transparent 1.5px
    ) 0 0 / 14px 14px,
    radial-gradient(ellipse at 50% 50%,
      color-mix(in oklch, var(--maze) 10%, transparent),
      transparent 65%),
    var(--ink-void);
}

/* When the art-cover variant is in play, override the muted
   companion-cover styling so Observation Theorem still gets full art. */
.tm-vol-cover.cover-art.tm-vol-cover-quiet {
  background: var(--ink-void);
}
.tm-vol-cover.cover-art.tm-vol-cover-quiet .tm-vol-glyph {
  color: var(--bone-dim);
  -webkit-text-stroke: 0;
}

/* On narrow screens the cover squishes to height:180; lift the spine
   and shrink the glyph so they still read. */
@media (max-width: 720px) {
  .tm-vol-cover.cover-art .tm-vol-glyph { font-size: 36px; top: 6px; right: 10px; }
  .tm-vol-cover.cover-art .tm-vol-spine { font-size: 7.5px; bottom: 8px; }
  .tm-vol-cover.cover-art::after { bottom: 20px; }
  .tm-vol-cover.cover-art .tm-vol-sigil svg { width: 44%; height: 70%; }
}

/* Foot caption explaining the markdown convention. */
.tm-books-foot code {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 12px;
  color: var(--cheshire);
  background: color-mix(in oklch, var(--cheshire) 8%, transparent);
  padding: 1px 6px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}

/* ═════════════════════════════════════════════════════════════════
   404 / ERROR PAGE — themed "out of the corridor"
   ═════════════════════════════════════════════════════════════════ */
.tm-error-body {
  background: var(--ink-void);
  color: var(--bone);
  min-height: 100vh;
}
.tm-error-page {
  position: relative;
  min-height: calc(100vh - 0px);
  display: grid;
  place-items: center;
  padding: 80px 24px;
  overflow: hidden;
}
.tm-error-sigil {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(80vw, 720px);
  height: min(80vw, 720px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}
.tm-error-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  text-align: center;
  display: grid;
  gap: 22px;
}
.tm-error-eyebrow {
  justify-content: center;
  color: var(--bone-dim);
}
.tm-error-code {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(120px, 22vw, 240px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--cheshire);
  margin: 0;
  text-shadow:
    0 0 40px color-mix(in oklch, var(--cheshire) 20%, transparent);
}
.tm-error-lede {
  font-family: var(--font-serif, Georgia, serif);
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.35;
  color: var(--bone);
  margin: 0 auto;
  max-width: 22ch;
  text-wrap: balance;
}
.tm-error-lede em {
  color: var(--cheshire);
  font-style: italic;
}
.tm-error-body-line {
  font-size: 15px;
  line-height: 1.55;
  color: var(--bone-dim);
  margin: 0 auto;
  max-width: 56ch;
  text-wrap: pretty;
}
.tm-error-path {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--chain);
  background: color-mix(in oklch, var(--chain) 10%, transparent);
  padding: 1px 6px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}
.tm-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
}
.tm-error-back {
  /* primary anchor — uses existing .tm-btn-primary */
}
.tm-error-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: color-mix(in oklch, var(--bone-dim) 70%, transparent);
}
.tm-error-foot-rule {
  flex: 0 1 80px;
  height: 1px;
  background: color-mix(in oklch, var(--bone-dim) 35%, transparent);
}

/* ═════════════════════════════════════════════════════════════════
   DAEDALUS ORACLE — floating sigil + modal
   ═════════════════════════════════════════════════════════════════ */

/* Honor [hidden] on every oracle subnode. Without this, the display:grid
   / display:flex rules below override the user-agent [hidden] rule and
   render every state simultaneously. */
.tm-oracle [hidden],
.tm-oracle-modal[hidden],
[data-tm-oracle-answer][hidden],
[data-tm-oracle-pending][hidden],
[data-tm-oracle-error][hidden],
[data-tm-oracle-form][hidden] {
  display: none !important;
}

.tm-oracle {
  /* hidden by default; site-chrome.js removes [hidden] only when
     window.claude.complete is available. */
}
.tm-oracle-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  background: color-mix(in oklch, var(--ink-floor) 95%, transparent);
  border: 1px solid color-mix(in oklch, var(--cheshire) 28%, transparent);
  border-radius: 999px;
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 8px 30px -10px rgba(0,0,0,0.6),
    0 0 0 0 color-mix(in oklch, var(--cheshire) 30%, transparent);
  transition: transform 200ms ease,
              box-shadow 200ms ease,
              border-color 200ms ease;
  backdrop-filter: blur(6px);
}
.tm-oracle-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklch, var(--cheshire) 55%, transparent);
  box-shadow:
    0 14px 40px -10px rgba(0,0,0,0.7),
    0 0 30px 0 color-mix(in oklch, var(--cheshire) 25%, transparent);
}
.tm-oracle-button svg {
  width: 40px;
  height: 40px;
  flex: none;
  animation: tmOracleBreath 4.2s ease-in-out infinite;
}
@keyframes tmOracleBreath {
  0%, 100% { opacity: 0.82; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.04); }
}
.tm-oracle-button-label {
  white-space: nowrap;
}

/* MODAL */
.tm-oracle-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}
.tm-oracle-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%,
      color-mix(in oklch, var(--ink-void) 60%, transparent),
      var(--ink-void) 80%);
  backdrop-filter: blur(4px);
  animation: tmOracleFadeIn 200ms ease both;
}
@keyframes tmOracleFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.tm-oracle-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--ink-floor);
  border: 1px solid color-mix(in oklch, var(--cheshire) 22%, transparent);
  padding: 40px 36px 32px;
  box-shadow:
    0 40px 80px -20px rgba(0,0,0,0.7),
    0 0 0 1px color-mix(in oklch, var(--cheshire) 8%, transparent);
  animation: tmOraclePanelIn 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes tmOraclePanelIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tm-oracle-head {
  position: relative;
  margin-bottom: 24px;
}
.tm-oracle-eyebrow {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 14px;
}
.tm-oracle-title {
  font-family: var(--font-display, var(--font-serif, Georgia, serif));
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--bone);
  text-wrap: balance;
}
.tm-oracle-title em {
  font-style: italic;
  color: var(--cheshire);
}
.tm-oracle-lede {
  font-size: 14px;
  line-height: 1.55;
  color: var(--bone-dim);
  margin: 0;
  max-width: 50ch;
}
.tm-oracle-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--bone-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: color 150ms ease, background 150ms ease;
}
.tm-oracle-close:hover {
  color: var(--bone);
  background: color-mix(in oklch, var(--cheshire) 10%, transparent);
}

.tm-oracle-form {
  display: grid;
  gap: 12px;
}
.tm-oracle-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.tm-oracle-input {
  width: 100%;
  background: color-mix(in oklch, var(--ink-void) 70%, transparent);
  border: 1px solid var(--hairline);
  color: var(--bone);
  padding: 14px 16px;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
  min-height: 84px;
  border-radius: 2px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.tm-oracle-input:focus {
  outline: none;
  border-color: color-mix(in oklch, var(--cheshire) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--cheshire) 10%, transparent);
}
.tm-oracle-input::placeholder {
  color: color-mix(in oklch, var(--bone-dim) 70%, transparent);
  font-style: italic;
}
.tm-oracle-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
}
.tm-oracle-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in oklch, var(--bone-dim) 70%, transparent);
}
.tm-oracle-submit {
  /* uses existing .tm-btn-primary */
}

.tm-oracle-pending {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-dim);
  padding: 18px 0;
}
.tm-oracle-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in oklch, var(--cheshire) 30%, transparent);
  border-top-color: var(--cheshire);
  border-radius: 50%;
  animation: tmOracleSpin 700ms linear infinite;
}
@keyframes tmOracleSpin {
  to { transform: rotate(360deg); }
}

.tm-oracle-answer {
  display: grid;
  gap: 14px;
}
.tm-oracle-answer-stamp {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.tm-oracle-answer-body {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--bone);
  border-left: 2px solid var(--cheshire);
  padding-left: 18px;
  text-wrap: pretty;
}
.tm-oracle-answer-body p {
  margin: 0 0 12px;
}
.tm-oracle-answer-body p:last-child {
  margin-bottom: 0;
}
.tm-oracle-answer-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid var(--hairline);
}

.tm-oracle-error {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  font-size: 14px;
  color: var(--bone-dim);
}

/* Body lock-ish: when modal is open, prevent scroll bleed */
body.tm-oracle-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .tm-oracle-button-label { display: none; }
  .tm-oracle-button { padding: 4px; gap: 0; }
  .tm-oracle-panel { padding: 28px 22px 22px; }
}

/* ═════════════════════════════════════════════════════════════════
   LANTERN HOVER PREVIEW — floating card built by site-chrome.js
   ═════════════════════════════════════════════════════════════════ */
.tm-preview-card {
  position: absolute;
  z-index: 80;
  width: min(360px, calc(100vw - 32px));
  background: color-mix(in oklch, var(--ink-floor) 96%, transparent);
  border: 1px solid color-mix(in oklch, var(--cheshire) 22%, transparent);
  padding: 14px 16px 16px;
  box-shadow:
    0 24px 60px -16px rgba(0,0,0,0.7),
    0 0 0 1px color-mix(in oklch, var(--cheshire) 6%, transparent);
  opacity: 0;
  transform: translateY(-4px) scale(0.985);
  transform-origin: top left;
  transition: opacity 160ms ease, transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
  backdrop-filter: blur(6px);
}
.tm-preview-card.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.tm-preview-eyebrow {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cheshire);
  margin-bottom: 8px;
}
.tm-preview-eyebrow .tm-dot { color: var(--bone-dim); }
.tm-preview-body {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--bone);
  text-wrap: pretty;
}
.tm-preview-body p {
  margin: 0;
}
.tm-preview-body p + p {
  margin-top: 8px;
}
.tm-preview-loading,
.tm-preview-empty {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-dim);
  font-style: normal;
}

@media (hover: none), (pointer: coarse) {
  /* never show on touch — JS already skips it, this is belt-and-braces */
  .tm-preview-card { display: none !important; }
}

/* ─── Per-tag archive hero (tag-architecture/observation/class/healing) ──
   Inherits .tm-page chrome from existing rules; adds the action row. */
.tm-tagpage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
  margin-top: 22px;
}
.tm-archive-tagpage .tm-page-title em {
  font-style: italic;
  color: var(--cheshire);
}
.tm-archive-tagpage.tm-tagpage-architecture .tm-page-title em { color: var(--tea); }
.tm-archive-tagpage.tm-tagpage-observation  .tm-page-title em { color: var(--maze); }
.tm-archive-tagpage.tm-tagpage-class        .tm-page-title em { color: var(--cheshire); }
.tm-archive-tagpage.tm-tagpage-healing      .tm-page-title em { color: var(--cheshire); }

/* ═════════════════════════════════════════════════════════════════
   COMPANION LANTERNS — small clickable sigils dropped under each
   Book Card. Each lantern represents one companion article. Click
   scrolls to the matching #articles-{book-slug} group below.
   Each lantern picks up its book's --cover-accent so the row reads
   as a small constellation of that book's color.
   ═════════════════════════════════════════════════════════════════ */

.tm-vol-lanterns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 4px 0 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--hairline);
}
.tm-vol-lanterns-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-ghost);
  margin-right: 2px;
}
.tm-vol-lanterns-label .tm-dot { margin: 0 4px; color: var(--bone-ghost); }
.tm-vol-lanterns-label em {
  font-style: normal;
  color: var(--cover-accent, var(--cheshire));
}

.tm-vol-lantern {
  position: relative;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--cover-accent, var(--cheshire));
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease;
  isolation: isolate;
}
.tm-vol-lantern::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in oklch, currentColor 32%, transparent) 0%,
    color-mix(in oklch, currentColor 10%, transparent) 38%,
    transparent 70%);
  pointer-events: none;
  transition: background 0.18s ease, transform 0.18s ease;
  z-index: -1;
}
.tm-vol-lantern svg {
  width: 16px;
  height: 16px;
  display: block;
}
.tm-vol-lantern .tm-lantern-ring  { fill: none; stroke: currentColor; stroke-width: 1.2; opacity: 0.7; }
.tm-vol-lantern .tm-lantern-mid   { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: 0.95; }
.tm-vol-lantern .tm-lantern-core  { fill: currentColor; }

.tm-vol-lantern:hover {
  transform: translateY(-2px);
}
.tm-vol-lantern:hover::before {
  background: radial-gradient(
    circle,
    color-mix(in oklch, currentColor 60%, transparent) 0%,
    color-mix(in oklch, currentColor 22%, transparent) 45%,
    transparent 78%);
  transform: scale(1.1);
}
.tm-vol-lantern:hover .tm-lantern-ring { opacity: 1; }

/* Tooltip — article title appears above the lantern on hover. */
.tm-vol-lantern-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-floor-up);
  color: var(--bone);
  border: 1px solid var(--hairline-bright);
  padding: 6px 10px 7px;
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  line-height: 1.15;
  white-space: nowrap;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
  z-index: 6;
  box-shadow: 0 12px 28px -14px rgb(0 0 0 / 0.6);
}
.tm-vol-lantern-tip .tm-tip-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-fade);
  margin-top: 3px;
}
.tm-vol-lantern-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink-floor-up);
}
.tm-vol-lantern:hover .tm-vol-lantern-tip,
.tm-vol-lantern:focus-visible .tm-vol-lantern-tip { opacity: 1; }

/* "All N →" walkthrough link sits at the end of the lantern row. */
.tm-vol-lanterns-walk {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-fade);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
  transition: color 0.18s, border-color 0.18s;
}
.tm-vol-lanterns-walk:hover {
  color: var(--cover-accent, var(--cheshire));
  border-bottom-color: var(--cover-accent, var(--cheshire));
}

/* ═════════════════════════════════════════════════════════════════
   COMPANION ARTICLES — articles grouped by book.
   Lives between "Daedalus's Six" and "Companion Pieces" on the
   Library page. Each book has an anchored group; lanterns above
   scroll here on click.
   ═════════════════════════════════════════════════════════════════ */

.tm-companion-articles {
  position: relative;
  padding: 80px 56px 90px;
  background:
    linear-gradient(180deg,
      var(--ink-void) 0%,
      var(--ink-floor) 12%,
      var(--ink-floor) 88%,
      var(--ink-void) 100%);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.tm-companion-articles-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.tm-companion-articles-intro {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  color: var(--bone-dim);
  max-width: 60ch;
  margin: 0 0 48px;
}
.tm-companion-articles-intro em { font-style: italic; color: var(--bone); }

.tm-articles-group {
  --accent-color: var(--cheshire);
  position: relative;
  padding: 44px 0 48px;
  border-bottom: 1px dashed var(--hairline);
  scroll-margin-top: 100px;
}
.tm-articles-group:last-child { border-bottom: none; padding-bottom: 0; }
.tm-articles-group:first-of-type { padding-top: 0; }

/* Per-book accent — mirrors the cover-* tokens. */
.tm-articles-group[data-book="architecture-of-worth"] { --accent-color: var(--tea); }
.tm-articles-group[data-book="breath-premise"]        { --accent-color: var(--cheshire); }
.tm-articles-group[data-book="great-lockout"]         { --accent-color: var(--chain); }
.tm-articles-group[data-book="great-disconnect"]      { --accent-color: var(--maze); }
.tm-articles-group[data-book="great-repair"]          { --accent-color: var(--cheshire); }
.tm-articles-group[data-book="autopsy"]               { --accent-color: var(--bone-dim); }

.tm-articles-group-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 16px 24px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}
.tm-articles-group-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in oklch, var(--accent-color) 50%, transparent);
  background: color-mix(in oklch, var(--accent-color) 8%, transparent);
  color: var(--accent-color);
  border-radius: 50%;
}
.tm-articles-group-mark svg { width: 24px; height: 24px; }
.tm-articles-group-titleblock { min-width: 0; }
.tm-articles-group-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 4px;
}
.tm-articles-group-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--bone);
  margin: 0;
}
.tm-articles-group-title em {
  font-style: italic;
  color: var(--accent-color);
  font-weight: 400;
}
.tm-articles-group-tools {
  display: flex;
  gap: 18px;
  align-items: center;
  white-space: nowrap;
}
.tm-articles-group-tools a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-fade);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.18s, border-color 0.18s;
}
.tm-articles-group-tools a:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

/* Article cards — 2-up grid. */
.tm-articles-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.tm-article-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 18px 22px;
  background: var(--ink-floor-up);
  border: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.tm-article-item:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow:
    0 20px 40px -25px color-mix(in oklch, var(--accent-color) 35%, transparent);
}
.tm-article-sigil {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--accent-color);
  align-self: center;
}
.tm-article-sigil svg { width: 30px; height: 30px; }

/* ── Composite sigil layers ──
   When an article belongs to multiple books, each book contributes
   a <g class="tm-sigil-layer"> inside a single SVG. The first layer
   renders at full opacity; subsequent layers are ghosted behind it,
   creating a 'double stamp' watermark effect. On hover the secondary
   layers emerge so the reader can see the cross-book affiliation. */

.tm-sigil-layer {
  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* Second and subsequent layers: ghosted, slightly offset */
.tm-sigil-layer:nth-child(n+2) {
  opacity: 0.3;
  transform: translate(1.5px, -1.5px);
}

/* On hover, the secondary layers strengthen — the reader sees both */
.tm-article-item:hover .tm-sigil-layer:nth-child(n+2) {
  opacity: 0.65;
  transform: translate(0.5px, -0.5px);
}

/* Per-book accent colors for sigil layers */
.tm-sigil-layer[data-book="architecture-of-worth"] { color: var(--tea); }
.tm-sigil-layer[data-book="breath-premise"]        { color: var(--cheshire); }
.tm-sigil-layer[data-book="great-lockout"]         { color: var(--chain); }
.tm-sigil-layer[data-book="great-disconnect"]      { color: var(--maze); }
.tm-sigil-layer[data-book="great-repair"]          { color: var(--cheshire); }
.tm-sigil-layer[data-book="autopsy"]               { color: var(--bone-dim); }

/* When the article only has one sigil layer, keep it centered and
   fully opaque — no composite offset needed. */
.tm-sigil-layer:only-child {
  opacity: 1;
  transform: none;
}

/* Fallback layer (no book tags) uses the group accent color */
.tm-sigil-layer.tm-sigil-fallback {
  color: var(--accent-color);
  opacity: 0.75;
}
.tm-article-body { min-width: 0; }
.tm-article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-ghost);
  margin-bottom: 8px;
}
.tm-article-meta .tm-art-num { color: var(--accent-color); }
.tm-article-meta .tm-art-date { color: var(--bone-fade); margin-left: auto; }
.tm-article-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--bone);
  margin: 0 0 6px;
}
.tm-article-title em { font-style: italic; color: var(--bone-dim); font-weight: 400; }
.tm-article-item:hover .tm-article-title { color: var(--accent-color); }
.tm-article-item:hover .tm-article-title em { color: var(--accent-color); }
.tm-article-excerpt {
  font-family: var(--font-display);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--bone-dim);
  margin: 0;
}
.tm-article-walk {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-color);
  white-space: nowrap;
  opacity: 0.75;
  transition: opacity 0.18s, letter-spacing 0.18s;
}
.tm-article-item:hover .tm-article-walk { opacity: 1; letter-spacing: 0.22em; }

.tm-companion-articles-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px 18px;
  align-items: baseline;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}

@media (max-width: 900px) {
  .tm-articles-list { grid-template-columns: 1fr; }
  .tm-articles-group-head { grid-template-columns: auto 1fr; grid-template-rows: auto auto; }
  .tm-articles-group-tools { grid-column: 1 / -1; }
  .tm-companion-articles { padding: 56px 24px 64px; }
  .tm-article-item { padding: 16px 18px; grid-template-columns: 36px 1fr; }
  .tm-article-walk { grid-column: 2; margin-top: 4px; }
}

/* Highlight the targeted group when navigated to via #anchor. */
.tm-articles-group:target .tm-articles-group-mark {
  box-shadow: 0 0 0 1px var(--accent-color),
              0 0 24px color-mix(in oklch, var(--accent-color) 45%, transparent);
}
.tm-articles-group:target .tm-articles-group-title { color: var(--accent-color); }

/* Pre-publication empty state (no posts tagged with this book yet). */
.tm-articles-empty {
  padding: 24px 22px;
  border: 1px dashed var(--hairline);
  background: color-mix(in oklch, var(--ink-floor-up) 60%, transparent);
  color: var(--bone-fade);
  font-family: var(--font-display);
  font-size: 14px;
  font-style: italic;
  line-height: 1.45;
}
.tm-articles-empty code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--bone-dim);
  background: color-mix(in oklch, var(--ink-void) 60%, transparent);
  padding: 1px 6px;
  border: 1px solid var(--hairline);
  font-style: normal;
}

/* Lantern row in pre-publication state — just the label, no dots. */
.tm-vol-lanterns.is-empty .tm-vol-lanterns-quiet {
  color: var(--bone-fade);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-display);
  font-size: 11.5px;
}
