/* ═══════════════════════════════════════════════════════════════
   FLOW SCHOOL — Global Design System
   global.css

   SECTIONS
   0.  Fonts
   1.  Design Tokens (:root)
   1b. Dark Mode Tokens
   1c. Theme Transition
   2.  Base Reset
   3.  Typography
   4.  Layout (.inner, .wrap)
   4b. Sticky CTA Bar
   6.  Header / Navigation
   7.  Hero
   8.  Buttons (ghost, primary, secondary, icon)
   9.  Chips / Toggle Selectors
   10. Cards / Panels
   11. Inputs
   12. Range Sliders
   12b.Saved / Favorites Sections
   13. Toast
   14. Nav Auth
   15. Animations
   16. Utilities
   17. Responsive
   18. Tool Cards (home page grid)
   19. Auth Pages
   20. App Shell / Sidebar
   21. Auth Form
   22. Dark Mode Element Overrides
   23. Tool Page Components (controls-bar, modal, card-actions, search)
   24. Site Footer (injected by lib/nav.js)

   HOW TO ADD A NEW TOOL PAGE
   1. Copy the page shell from any existing tool (e.g. arbitrary-rule-generator.html)
   2. Include: global.css → lib/nav.js → lib/toast.js → lib/tracker.js
      (library pages also: lib/confirm-delete.js → lib/library.js —
      shared esc/fmtDate/sort/date-stamp/discard-modal helpers)
   3. Use <main> to wrap hero + content
   4. Use .controls-bar for filter/action row, .ctl-label for control labels
   5. Use .card-actions for the action row inside a tool output card
   6. Use .modal-backdrop / .modal-card for any save/load dialogs
   7. Add page-specific CSS only in a <style> block in the page head

   URL VOCABULARY (library pages)
   ?id=<n>    view an item        ?edit=<n>   edit an item
   ?new=1     compose (flows: &type=<key>; stories: ?new=<starterId|blank>)
   pushState on view changes; replaceState after create/save.

   CONTENT WIDTH — TWO REGIMES (deliberate)
   READING pages (default): .wrap / .inner at 820px, centered. Every
   generator, library, and reading surface lives on this grid.
   WORKBENCH pages (two-zone: writing/working column + a tool panel
   in the right margin) may widen their wrap — the class editor
   (1060px) and the V/YBP/D worksheet (1140px) do. The wider page's
   hero should match its own wrap so headline and content align
   within the page. This width jump between page types is a chosen
   trade-off (2026-07): the panels earn their room; don't "fix" it
   by squeezing a panel into 820, and don't widen reading pages.
   ═══════════════════════════════════════════════════════════════ */

/* Material Symbols Sharp is loaded via <link> tags in each page's <head>
   (preconnect + stylesheet, in parallel with global.css) — not @import,
   which forces a slow sequential fetch chain and was causing the icon
   font (and therefore the sidebar nav) to visibly reflow in ~1s after
   first paint. */

/* ─── 0. FONTS ───────────────────────────────────────────────── */

@font-face {
  font-family: 'ABC Monument Grotesk';
  src: url('./fonts/ABCMonumentGroteskPlusVariable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ABC Monument Grotesk Mono';
  src: url('./fonts/ABCMonumentGroteskMonoVariable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}


/*
   ICON VOCABULARY — one glyph per meaning (Jul 2026):
     arrow_back      navigate back            close        dismiss/detach/remove
     add             create                   edit         edit
     delete          destructive delete       content_copy copy / duplicate
     favorite        favorites (FILL 1 = on)  check        confirmed / selected
     restart_alt     reset / start over       refresh      regenerate (rebuild)
     swap_horiz      swap one item            search       search
   Sizes: three tokens only (--icon-sm/md/lg via .i-sm/.i-md/.i-lg).
*/

/* ─── 1. DESIGN TOKENS ───────────────────────────────────────── */

:root {
  /* Native UI (scrollbars, form controls) follows the theme */
  color-scheme: light;

  /* Background */
  --bg: #F5F4F0;

  /* Ink / Paper tokens — swap in [data-theme="dark"] */
  --ink-rgb:     22, 22, 18;
  --ink-solid:   #161614;
  --paper-solid: #F5F4F0;
  /* Paper as RGB — for translucent paper surfaces (headers, toggles, veils) */
  --paper-rgb:   245, 244, 240;
  /* Sidebar surface — slightly warmer than paper */
  --sidebar-bg:  rgba(243, 241, 237, .96);

  /* Surfaces */
  --surface:   rgba(var(--ink-rgb), .035);
  --surface-2: rgba(var(--ink-rgb), .065);

  /* Borders */
  --border:       rgba(var(--ink-rgb), .13);
  --border-light: rgba(var(--ink-rgb), .07);

  /* Text */
  --text-1: #1B1B1B;
  --text-2: #555555;
  --text-3: #A5A5A5;

  /* Accent — cobalt in light mode: the daylight equivalent of volt,
     so state stays visibly LIT instead of collapsing into ink */
  --volt:          #618FEA;
  --volt-rgb:      97, 143, 234;
  --accent:        #618FEA;
  --accent-dim:    rgba(97, 143, 234, .10);
  --accent-border: rgba(97, 143, 234, .30);

  /* Primary button hover fill */
  --btn-hover: #2C2C28;

  /* Semantic status */
  --danger: #E05252;

  /* Slider fill — the highlight, both modes */
  --slider-fill: var(--volt);

  /* Radius — geometric */
  --r:  0px;  /* cards, inputs, panels */
  --rf: 2px;  /* fine detail (beta tag) */
  --rs: 0px;  /* small controls */
  --rb: 8px;  /* buttons, badges, toast — all buttons carry 8px (Jul 2026) */

  /* ELEVATION (Jul 2026): exactly two shadows. FLOAT for anything
     hovering over content (menus, panels, FAB, floating CTAs);
     PRESS for modal cards only. Flat everything else — LED glows
     (volt state dots) are emission, not elevation, and are exempt. */
  --shadow-float: 0 4px 20px rgba(var(--ink-rgb), .12);
  --shadow-press: 0 4px 32px rgba(var(--ink-rgb), .16), 0 20px 60px rgba(var(--ink-rgb), .10);

  /* SPACING SCALE (Jul 2026): 4 · 8 · 12 · 16 · 20 · 24 · 28 · 32 ·
     40 · 48 · 56 · 64 · 72. Margins, paddings, and gaps sit on these
     stops (1–3px are optical nudges, exempt). Don't invent 13s. */

  /* icon sizes — the only three; use .i-sm/.i-md/.i-lg in markup,
     never inline font-size on a glyph */
  --icon-sm: 14px;  /* inline with mono meta, row actions */
  --icon-md: 16px;  /* inline with body text, buttons */
  --icon-lg: 20px;  /* standalone: nav, hero actions, FAB */
  --r-cta: 8px;  /* rounded CTAs, callouts, text-button hover pills */

  /* Button padding */
  --btn-pad-h: 24px;
  --btn-pad-v: 16px;

  /* Card padding */
  --card-pad:       36px 40px;
  --card-pad-light: 32px;

  /* Shadows */
  --shadow: 0 2px 16px rgba(var(--ink-rgb), .10),
            0 1px 4px  rgba(var(--ink-rgb), .06);

  /* Effects */
  --glass: blur(20px);

  /* Typography — font families */
  --font:      'ABC Monument Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'ABC Monument Grotesk Mono', 'SF Mono', 'Fira Code', 'Courier New', monospace;

  /* Typography — weights */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* Typography — scale (new) */
  --fs-h1:      80px;
  --fs-h2:      64px;
  --fs-h3:      48px;
  --fs-h4:      32px;
  --fs-h5:      24px;
  --fs-h6:      20px;
  --fs-h7:      16px;
  --fs-body:    16px;
  --fs-label-1: 12px;
  --fs-label-2: 12px;
  --fs-btn:     16px;
  --fs-chip:    14px;

  /* Typography — scale (legacy, still used in page-specific CSS) */
  --text-display:  clamp(2.2rem, 5vw, 3.4rem);
  --text-card-title: clamp(1.875rem, 5vw, 2.75rem);
  --text-section:  1.5rem;
  --text-body-lg:  1.125rem;
  --text-body:     1rem;
  --text-body-sm:  .9375rem;
  --text-ui:       .875rem;
  --text-small:    .8125rem;
  --text-label:    .6875rem;
  --text-micro:    .625rem;
  --text-nano:     .5625rem;

  /* Typography — line heights */
  --lh-display: 1.06;
  --lh-heading: 1.15;
  --lh-body:    1.4;
  --lh-tight:   1.25;

  /* Typography — letter spacing */
  --ls-tight:   -.04em;
  --ls-heading: -.025em;
  --ls-body:    0em;
  --ls-label:   .10em;
  --ls-micro:   .12em;

  /* Transitions */
  /* MOTION SPEC (Jul 2026): two durations, one curve. fast = hover/
     focus feedback; base = state changes & reveals. Keyframe
     animations (pageEnter, card-turn) are set pieces, not spec'd here.
     Never `transition: all` — name the properties. */
  --transition-fast: .12s ease-out;
  --transition-base: .2s ease-out;
  --transition-slow: .25s ease;

  /* Z-index scale */
  --z-overlay:         45;
  --z-sidebar:         50;
  --z-sidebar-raised:  60;   /* mobile drawer above overlay */
  --z-cta:             90;   /* sticky CTA bar, below header */
  --z-sticky:         100;
  --z-fab:            200;   /* floating controls (sidebar toggle) */
  --z-toast:          200;
  --z-modal:          300;
  --z-grain:          999;   /* grain texture above everything */
}


/* ─── 1b. DARK MODE TOKENS ───────────────────────────────────── */

[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #1B1B1B;
  --ink-rgb:       239, 239, 239;
  --ink-solid:     #EFEFEF;
  --paper-solid:   #1B1B1B;
  --surface:       #262626;
  --surface-2:     #333333;
  --border:        #333333;
  --border-light:  #262626;
  --accent:        #FFF55F;
  --accent-dim:    rgba(255, 245, 95, .10);
  --accent-border: rgba(255, 245, 95, .25);
  --text-1:        #EFEFEF;
  --text-2:        #C3C3C3;
  --text-3:        #A5A5A5;
  --volt:          #FFF55F;
  --volt-rgb:      255, 245, 95;
  --slider-fill:   var(--volt);
  --paper-rgb:     27, 27, 27;
  --sidebar-bg:    rgba(21, 21, 21, .96);
  --btn-hover:     #EFEFEF;
}

/* ─── 1c. THEME TRANSITION ───────────────────────────────────── */

.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease !important;
}


/* ─── 1d. PAGE TRANSITIONS ───────────────────────────────────── */
/* Opts every same-origin navigation into the browser's native cross-document
   View Transition — a soft crossfade instead of an instant hard white-flash
   swap. Browsers without support (older Safari/Firefox) just navigate
   normally, no fallback needed. */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
  animation-timing-function: ease;
}

/* Chrome's default UA styles composite the old/new snapshots over a white
   background — invisible in light mode, but it's exactly the white flash
   seen when transitioning between two dark pages. */
::view-transition-group(root),
::view-transition-image-pair(root) {
  background-color: var(--bg);
}

/* The sidebar is effectively identical from page to page (only the active
   link differs) — naming it lets the browser treat it as one persistent
   element that stays put during the transition, instead of crossfading it
   along with the rest of the page. This is the piece that stops the nav
   itself from feeling like it "jumps" on every click. */
.app-sidebar {
  view-transition-name: app-sidebar;
}

/* Named groups still crossfade by default, which reads as a flicker/reload
   on an element that's supposed to look untouched. Cut the animation
   entirely so the sidebar just stays put — only the main content area
   transitions. */
::view-transition-group(app-sidebar) {
  animation: none;
}


/* ─── 2. BASE RESET ──────────────────────────────────────────── */

/* every counter, timer, and stat keeps its column — no jiggle */
html { font-variant-numeric: tabular-nums; }

/* text selection wears the highlight — volt on ink in the dark,
   cobalt behind ink in the light */
::selection {
  background: rgba(var(--volt-rgb), .30);
  color: var(--text-1);
}

[data-theme="dark"] ::selection {
  background: var(--volt);
  color: var(--paper-solid); /* near-black on volt */
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  /* Matches body's themed background so the outer canvas never shows its
     default white — otherwise it can flash through for a frame during a
     cross-document view transition, especially in dark mode. */
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  /* main absorbs leftover height so the footer sits at the viewport
     bottom on short pages (fixed children — sidebar, toasts, modals —
     are out of flow and unaffected) */
  display: flex;
  flex-direction: column;
}

/* width:100% because auto margins on a flex item disable stretch —
   pages styled as <main class="wrap"> would shrink to fit content */
main { flex: 1 0 auto; width: 100%; }

/* nothing outside the viewport is pannable — internal scrollers
   (filter rows, tables) keep their own overflow */
html, body { overflow-x: clip; }

/* Global grain texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-grain);
  opacity: 0.038;
  /* one layer, both themes — theme-invariant by construction */
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='256' height='256'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='256' height='256' filter='url(%23n)'/></svg>");
  background-size: 256px 256px;
}


/* Keyboard focus — visible and consistent; mouse clicks stay quiet.
   Components with their own focus treatment (boxed fields) opt out
   via their explicit outline: none. */
:focus-visible {
  outline: 2px solid rgba(var(--ink-rgb), .55);
  outline-offset: 2px;
}

/* ─── 3. TYPOGRAPHY ──────────────────────────────────────────── */

h1 {
  font-family: var(--font);
  font-size: var(--fs-h1);
  font-weight: var(--weight-regular) !important;
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-display);
  color: var(--text-1);
}

h2 {
  font-family: var(--font);
  font-size: var(--fs-h2);
  font-weight: var(--weight-regular) !important;
  letter-spacing: -.03em;
  line-height: var(--lh-heading);
  color: var(--text-1);
}

h3 {
  font-family: var(--font);
  font-size: var(--fs-h3);
  font-weight: var(--weight-regular) !important;
  letter-spacing: -.015em;
  line-height: var(--lh-heading);
  color: var(--text-1);
}

h4 {
  font-family: var(--font);
  font-size: var(--fs-h4);
  font-weight: var(--weight-regular) !important;
  letter-spacing: -.015em;
  line-height: var(--lh-heading);
  color: var(--text-1);
}

h5 {
  font-family: var(--font);
  font-size: var(--fs-h5);
  font-weight: var(--weight-regular) !important;
  line-height: var(--lh-heading);
  color: var(--text-1);
}

h6 {
  font-family: var(--font);
  font-size: var(--fs-h6);
  font-weight: var(--weight-regular) !important;
  line-height: var(--lh-heading);
  color: var(--text-1);
}

.h7 {
  font-family: var(--font);
  font-size: var(--fs-h7);
  font-weight: var(--weight-regular);
  line-height: var(--lh-heading);
  color: var(--text-1);
}

p {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-2);
}

li {
  color: var(--text-2);
}

/* ── Typography utilities ── */

.label-1 {
  font-family: var(--font);
  font-size: var(--fs-label-1);
  font-weight: var(--weight-regular);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.label-2 {
  font-family: var(--font-mono);
  font-size: var(--fs-label-2);
  color: var(--text-3);
}

/* Eyebrow label — spacing for small labels that sit above content */
.eyebrow-label {
  margin-bottom: 12px;
}

.button-text {
  font-family: var(--font);
  font-size: var(--fs-btn);
  font-weight: var(--weight-medium);
  color: var(--text-1);
}

/* ── Material Symbols Sharp ── */
/* size utilities — the sanctioned way to size a glyph in markup */
.material-symbols-sharp.i-sm { font-size: var(--icon-sm); }
.material-symbols-sharp.i-md { font-size: var(--icon-md); }
.material-symbols-sharp.i-lg { font-size: var(--icon-lg); }

.material-symbols-sharp {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  font-size: var(--icon-lg);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  user-select: none;
  pointer-events: none;
  /* Fixed, font-size-relative box so the pre-load fallback text (e.g.
     "space_dashboard") never renders at its natural (much wider) size and
     then reflows everything around it once the icon font finishes loading
     and collapses to a single glyph — this is what caused the sidebar nav
     to visibly shift on first load. */
  width: 1em;
  height: 1em;
  overflow: hidden;
}

/* ─── 4. LAYOUT ──────────────────────────────────────────────── */

.inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 28px;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 28px 140px;
}

/* Elevate page content above ambient layer */
header,
section,
.wrap,
.inner,
.content,
.results-inner,
footer {
  position: relative;
  z-index: 1;
}


/* ─── 4b. STICKY CTA BAR ─────────────────────────────────────── */

.cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-cta);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px 20px;
  background: none;
  pointer-events: none;
}

body.has-sidebar .cta-bar {
  left: 224px;
}

.cta-bar > * {
  pointer-events: all;
  box-shadow: var(--shadow-float);
}

@media (max-width: 580px) {
  .cta-bar {
    padding: 12px 20px 16px;
  }

  .cta-bar .btn-primary,
  .cta-bar .generate-btn,
  .cta-bar .shuffle-btn,
  .cta-bar .start-btn {
    width: 100%;
    justify-content: center;
  }
}


/* ─── 6. HEADER / NAVIGATION ─────────────────────────────────── */

.hdr {
  background: rgba(var(--paper-rgb), .88);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-bottom: 1px solid rgba(var(--ink-rgb), .10);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.hdr-i {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 28px;
  height: 58px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.hdr-i .btn-ghost {
  justify-self: start;
}

.hdr-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: center;
  align-self: center;
}

.hdr-logo {
  font-size: var(--text-ui);
  font-weight: var(--weight-bold);
  letter-spacing: -.01em;
  color: var(--text-1);
  text-decoration: none;
}

.beta-tag {
  font-size: 10px;
  font-weight: var(--weight-semibold);
  font-variant-caps: all-small-caps;
  letter-spacing: .08em;
  color: var(--text-3);
  border: 1px solid rgba(var(--ink-rgb), .20);
  border-radius: var(--rf);
  padding: 2px 8px 3px 8px;
  user-select: none;
}

.hdr-tool {
  font-size: var(--text-ui);
  color: var(--text-3);
  text-align: right;
  justify-self: end;
}

.hdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}


/* ─── 7. HERO ────────────────────────────────────────────────── */

.hero {
  padding: 64px 0 40px;
}

.hero p {
  margin-top: 8px;
  color: var(--text-2);
}

.page-eyebrow {
  font-family: var(--font-mono) !important;
  display: block;
  font-size: var(--text-label) !important;
  font-weight: var(--weight-regular);
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 8px;
}


/* ─── 8. BUTTONS ─────────────────────────────────────────────── */

/* Ghost — text-only, low emphasis */
.btn-ghost {
  background: none;
  border: none;
  color: var(--text-3);
  padding: 8px 12px;
  border-radius: var(--r-cta);
  font-size: var(--text-ui);
  cursor: pointer;
  transition: color var(--transition-base), background var(--transition-base);
  font-family: var(--font);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-ghost:hover {
  color: var(--text-1);
  background: rgba(var(--ink-rgb), .05);
}

.btn-ghost.sm {
  padding: 8px 12px;
  font-size: var(--text-small);
}

/* Primary — solid dark fill */
.btn-primary,
.generate-btn,
.shuffle-btn,
.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink-solid);
  color: var(--paper-solid);
  border: none;
  padding: var(--btn-pad-v) var(--btn-pad-h);
  border-radius: var(--rb);
  font-size: var(--fs-btn);
  font-weight: var(--weight-medium);
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition-base), transform .1s, box-shadow var(--transition-base);
  box-shadow: none;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary:hover,
.generate-btn:hover,
.shuffle-btn:hover,
.start-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
}

.btn-primary:active,
.generate-btn:active,
.shuffle-btn:active,
.start-btn:active {
  transform: translateY(0);
}

.btn-primary:disabled,
.generate-btn:disabled,
.shuffle-btn:disabled,
.start-btn:disabled {
  background: rgba(var(--ink-rgb), .22);
  color: rgba(var(--paper-rgb), .55);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Secondary — outlined, low-key */
.btn-secondary,
.btn-regen,
.btn-outline {
  background: transparent;
  color: var(--text-2);
  border: 1px solid rgba(var(--ink-rgb), .18);
  padding: 12px 24px;
  border-radius: var(--rb);
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  font-family: var(--font);
  cursor: pointer;
  transition: color var(--transition-base), background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
  text-decoration: none;
}

.btn-secondary:hover,
.btn-regen:hover,
.btn-outline:hover {
  background: rgba(var(--ink-rgb), .05);
  color: var(--text-1);
  border-color: rgba(var(--ink-rgb), .35);
}

.btn-secondary:disabled {
  opacity: .3;
  cursor: not-allowed;
}

/* Icon — square icon-only button */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: transparent;
  border: 1px solid rgba(var(--ink-rgb), .14);
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--transition-base), background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
  flex-shrink: 0;
}

.btn-icon:hover {
  background: rgba(var(--ink-rgb), .05);
  border-color: rgba(var(--ink-rgb), .28);
  color: var(--text-1);
}

.btn-icon:disabled,
.btn-icon:disabled:hover {
  opacity: .35;
  cursor: not-allowed;
  background: transparent;
  border-color: rgba(var(--ink-rgb), .14);
  color: var(--text-3);
}

.save-icon { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20; }
.saved .save-icon { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20; }

.btn-icon.saved {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--volt);
}

.btn-icon .material-symbols-sharp {
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

/* bare glyph buttons (song swap) join the tooltip component */
.btn-icon[data-tooltip],
.song-swap-btn[data-tooltip] {
  position: relative;
}

.btn-icon[data-tooltip]::before,
.song-swap-btn[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  white-space: nowrap;
  font-family: var(--font);
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--paper-solid);
  background: var(--ink-solid);
  border: none;
  border-radius: var(--rb);
  padding: 4px 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: var(--z-sticky);
}

.btn-icon[data-tooltip]:hover::before,
.song-swap-btn[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition-delay: 350ms;
}


/* ─── 9. CHIPS / TOGGLE SELECTORS ────────────────────────────── */

/* filter chips row — horizontal, scrolls on overflow */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

/* sort toggle sits on its own quiet row; a result count may ride right */
.sort-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

/* favorited marker — filled volt heart beside a title */
.fav-mark {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  color: var(--volt);
  font-size: var(--icon-sm);
  margin-left: 8px;
  vertical-align: 1px;
}

.fav-mark.lg {
  font-size: 17px;
  margin-left: 12px;
  vertical-align: 3px;
}

/* favorites-only filter toggle */
.fav-filter.on { color: var(--text-1); }
.fav-filter.on .material-symbols-sharp {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  color: var(--volt);
}

.result-count {
  margin-left: auto;
  font-size: var(--text-small);
  color: var(--text-3);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

/* the row that holds a set of chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 8px;
}

.filter-chip,
.chip,
.count-btn,
.time-btn {
  background: transparent;
  border: 1px solid rgba(var(--ink-rgb), .14);
  color: var(--text-3);
  border-radius: var(--r);
  font-family: var(--font);
  font-size: var(--fs-chip);
  font-weight: var(--weight-regular);
  cursor: pointer;
  transition: color var(--transition-base), background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
}

/* LED-dot selection chips */
.chip,
.filter-chip {
  position: relative;
  padding: 4px 12px 4px 24px;
}
.chip,
.filter-chip { white-space: nowrap; }

.chip::before,
.filter-chip::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid rgba(var(--ink-rgb), .22);
  background: transparent;
  transition: background var(--transition-base), border-color var(--transition-base);
}

.chip:hover,
.filter-chip:hover {
  border-color: rgba(var(--ink-rgb), .28);
  color: var(--text-2);
  background: rgba(var(--ink-rgb), .03);
}

.count-btn:hover,
.time-btn:hover {
  border-color: rgba(var(--ink-rgb), .32);
  color: var(--text-2);
  background: rgba(var(--ink-rgb), .04);
}

.chip.on,
.filter-chip.active {
  background: rgba(var(--ink-rgb), .06);
  border-color: rgba(var(--ink-rgb), .35);
  color: var(--text-1);
}
.chip.on::before,
.filter-chip.active::before {
  background: var(--volt);
  border-color: var(--volt);
}

/* Count + time btns are compact controls — keep full contrast.
   (.time-btn now serves breath-pace only; the library pages use
   LED .chip selectors.) */
.count-btn.active,
.time-btn.active {
  background: var(--ink-solid);
  border-color: var(--ink-solid);
  color: var(--paper-solid);
}

.count-btn {
  width: 38px;
  height: 38px;
  font-size: var(--text-body-sm);
}

.time-btn {
  height: 40px;
  padding: 0 16px;
  white-space: nowrap;
  font-weight: var(--weight-semibold);
}

.count-btn:disabled,
.time-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}


/* ─── 10. CARDS / PANELS ─────────────────────────────────────── */

/* Glass card — primary surface */
.card,
.challenge-card,
.experiment-card,
.controls-card {
  border: 1px solid rgba(var(--ink-rgb), .12);
  border-top-color: rgba(var(--ink-rgb), .22);
  border-radius: var(--r);
  padding: var(--card-pad);
  background: rgba(var(--ink-rgb), .02);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Light card */
.card-light,
.practice-card,
.why-card {
  border: 1px solid rgba(var(--ink-rgb), .08);
  border-radius: var(--r);
  padding: var(--card-pad-light);
  background: rgba(var(--ink-rgb), .018);
}

/* Eyebrow — small uppercase label */
.card-eyebrow {
  font-size: var(--text-nano);
  font-weight: var(--weight-bold);
  letter-spacing: var(--ls-micro);
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}

/* Tags — category/type label */
.tag,
.rule-cat-tag,
.exp-tag {
  font-size: var(--text-micro);
  font-weight: var(--weight-bold);
  letter-spacing: var(--ls-micro);
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--r);
  background: rgba(var(--ink-rgb), .06);
  color: var(--text-2);
  border: 1px solid rgba(var(--ink-rgb), .14);
  display: inline-block;
}


/* ─── 11. INPUTS ─────────────────────────────────────────────── */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
textarea,
select {
  border-radius: var(--r);
}

/* ─── 12. RANGE SLIDERS ──────────────────────────────────────── */

.range-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* Numeric readout above a slider — mono, h5 scale
   (single source for both slider tools) */
.range-val {
  font-family: var(--font-mono);
  font-size: var(--fs-h5);
  font-weight: var(--weight-regular);
  letter-spacing: .02em;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 8px;
}

input[type=range].range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  border-radius: var(--r);
  outline: none;
  cursor: pointer;
  margin: 8px 0;
  background: rgba(var(--ink-rgb), .12);
}

input[type=range].range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: var(--r);
  background: var(--ink-solid);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}

input[type=range].range-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

input[type=range].range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: var(--r);
  background: var(--ink-solid);
  border: none;
  cursor: pointer;
}

input[type=range].range-slider:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
}

.range-ticks span {
  display: block;
  width: 1px;
  height: 5px;
  background: rgba(var(--ink-rgb), .16);
  border-radius: var(--r);
}

.range-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}


/* ─── 12b. SAVED / FAVORITES SECTION ─────────────────────────── */

.saved-section,
.favorites-section {
  border-top: 1px solid rgba(var(--ink-rgb), .08);
  padding-top: 48px;
  margin-top: 8px;
}

.saved-header,
.favs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.saved-toggle,
.favs-toggle {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: var(--text-body-sm);
  font-family: var(--font);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  transition: color var(--transition-base);
}

.saved-toggle:hover,
.favs-toggle:hover {
  color: var(--text-1);
}

.saved-badge,
.fav-badge {
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  background: rgba(var(--ink-rgb), .09);
  color: var(--text-2);
  border: 1px solid rgba(var(--ink-rgb), .14);
  padding: 2px 8px;
  border-radius: var(--rb);
  line-height: 1.5;
}

.saved-badge.empty,
.fav-badge.empty {
  background: rgba(var(--ink-rgb), .04);
  color: var(--text-3);
  border-color: rgba(var(--ink-rgb), .08);
}

.saved-arrow,
.favs-arrow {
  color: var(--text-3);
  font-size: var(--text-small);
  transition: transform .2s;
  display: inline-block;
}

.saved-toggle.open .saved-arrow,
.favs-toggle.open .favs-arrow {
  transform: rotate(180deg);
}

.clear-btn,
.clear-all-btn {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: var(--text-small);
  font-family: var(--font);
  cursor: pointer;
  transition: color var(--transition-base);
  padding: 0;
}

.clear-btn:hover,
.clear-all-btn:hover {
  color: var(--text-2);
}

.saved-body,
.favs-body {
  padding-top: 8px;
}

.saved-empty,
.favs-empty {
  color: var(--text-3);
  font-size: var(--text-body-sm);
  padding: 16px 0;
}

.saved-item,
.fav-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--r);
  transition: background var(--transition-base);
  gap: 12px;
  border-bottom: 1px solid rgba(var(--ink-rgb), .06);
}

.saved-item:last-child,
.fav-item:last-child {
  border-bottom: none;
}

.saved-item:hover,
.fav-item:hover {
  background: rgba(var(--ink-rgb), .03);
}

.saved-btns,
.fav-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}

.saved-view-btn,
.saved-rm-btn,
.fav-view-btn,
.fav-rm-btn {
  background: none;
  border: none;
  font-size: var(--text-small);
  font-family: var(--font);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--r-cta);
  transition: color var(--transition-base), background var(--transition-base), border-color var(--transition-base), opacity var(--transition-base), transform var(--transition-base);
}

.saved-view-btn,
.fav-view-btn {
  color: var(--text-3);
}

.saved-view-btn:hover,
.fav-view-btn:hover {
  color: var(--text-1);
  background: rgba(var(--ink-rgb), .05);
}

.saved-rm-btn,
.fav-rm-btn {
  color: var(--text-3);
}

.saved-rm-btn:hover,
.fav-rm-btn:hover {
  color: rgba(180, 50, 50, .8);
}


/* ─── 13. TOAST ──────────────────────────────────────────────── */

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  background: var(--ink-solid);
  border: none;
  color: var(--paper-solid);
  padding: 12px 24px;
  border-radius: var(--rb);
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .3s ease;
  opacity: 0;
  z-index: var(--z-toast);
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}


/* ─── 14. NAV AUTH ───────────────────────────────────────────── */

.hdr-auth {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.nav-auth-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-nav-signup {
  background: none;
  border: 1px solid rgba(var(--ink-rgb), .18);
  color: var(--text-2);
  padding: 8px 16px;
  border-radius: var(--rb);
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
  font-family: var(--font);
  cursor: pointer;
  transition: border-color var(--transition-base), color var(--transition-base), background var(--transition-base);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.btn-nav-signup:hover {
  border-color: rgba(var(--ink-rgb), .35);
  color: var(--text-1);
  background: rgba(var(--ink-rgb), .04);
}

.nav-avatar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-initial {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(var(--ink-rgb), .07);
  border: 1px solid rgba(var(--ink-rgb), .18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-label);
  font-weight: var(--weight-bold);
  color: var(--text-1);
  transition: background var(--transition-base), border-color var(--transition-base);
}

.nav-avatar-btn:hover .nav-initial {
  background: rgba(var(--ink-rgb), .12);
  border-color: rgba(var(--ink-rgb), .32);
}

.nav-user-id {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.nav-user-name {
  font-size: var(--text-small);
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.nav-user-email {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}


/* ─── 15. ANIMATIONS ─────────────────────────────────────────── */

/* the reveal — every floating panel enters with the same move */
@keyframes fsReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tv-menu:not([hidden]),
.fl-menu:not([hidden]),
.st-menu:not([hidden]),
.sh-suggest:not([hidden]),
.cw-type-menu:not([hidden]),
.lg-class-menu:not([hidden]),
.modal-card {
  animation: fsReveal var(--transition-base) both;
}

@media (prefers-reduced-motion: reduce) {
  .tv-menu, .fl-menu, .st-menu, .sh-suggest, .cw-type-menu,
  .lg-class-menu, .modal-card { animation: none; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px) }
  to   { opacity: 1; transform: translateY(0) }
}

/* ── Page entrance ─────────────────────────────────────────────
   One restrained motion on arrival: main content fades in and
   settles up 8px. The sidebar never moves (pinned via
   view-transition-name), so navigation reads as the workspace
   holding still while the page changes. Layers under the
   cross-document crossfade in browsers that support it. */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  main {
    /* fill "backwards", not "both": a retained fill keeps a live
       transform on main forever, and a transformed ancestor kills
       backdrop-filter (the bars' glass) in Chromium */
    animation: pageEnter .38s cubic-bezier(.2, .6, 0, 1) backwards;
  }
}

.fade-up {
  animation: fadeUp .42s ease both;
}

.challenge-card.animate,
.experiment-card.animate {
  animation: fadeUp .4s cubic-bezier(.22, .68, 0, 1.2);
}


/* ─── 16. UTILITIES ──────────────────────────────────────────── */

.hidden {
  display: none !important;
}


/* ─── 17. RESPONSIVE ─────────────────────────────────────────── */

@media (max-width: 580px) {
  .inner {
    padding: 0 20px;
  }

  .wrap {
    padding: 24px 20px 72px;
  }

  .hero {
    padding: 48px 0 28px;
  }

  h1 {
    font-size: clamp(2.4rem, 10vw, 4rem);
  }

  h2 {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }

  h3 {
    font-size: clamp(1.75rem, 7vw, 2.75rem);
  }

  h4 {
    font-size: clamp(1.375rem, 5vw, 2rem);
  }
}

/* ─── 18. TOOL CARDS ─────────────────────────────────────────── */

.tools {
  padding-bottom: 100px;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid rgba(var(--ink-rgb), .10);
  background: rgba(var(--ink-rgb), .10);
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 40px;
  border: none;
  border-radius: var(--r);
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-decoration: none;
  color: inherit;
  transition: background .18s;
  min-height: 280px;
}

.tool-card:hover {
  background: rgba(var(--ink-rgb), .03);
}

.tool-num {
  margin-bottom: 40px;
}

.tool-name {
  margin-bottom: 12px;
}

.tool-desc {
  font-size: var(--text-body-sm);
  color: var(--text-2);
  line-height: var(--lh-body);
  flex: 1;
  margin-bottom: 28px;
}

.tool-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  color: var(--text-3);
  transition: gap var(--transition-base), color var(--transition-base);
}

.tool-card:hover .tool-cta {
  gap: 12px;
  color: var(--text-1);
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: auto;
    padding: 28px 24px;
  }
}


/* ─── 19. AUTH PAGES ─────────────────────────────────────────── */

.auth-hdr {
  background: rgba(var(--paper-rgb), .88);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-bottom: 1px solid rgba(var(--ink-rgb), .10);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 80px;
  position: relative;
  z-index: 1;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.auth-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-size: var(--text-small);
  color: var(--text-3);
}

.auth-footer a { color: var(--text-1); }


/* ─── 20. APP SHELL / SIDEBAR ────────────────────────────────── */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 224px;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(var(--ink-rgb), .10);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  overflow-y: auto;
}

.app-main {
  flex: 1;
  margin-left: 224px;
  min-height: 100vh;
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* ── Sidebar logo ── */
.sidebar-logo-wrap {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(var(--ink-rgb), .09);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sidebar-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.sidebar-logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark  { display: block; }

/* ── Sidebar nav ── */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-label,
.nav-section-toggle {
  font-size: 10px;
  font-weight: var(--weight-semibold);
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 4px 12px 8px;
  display: block;
}

.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: color var(--transition-base);
}

.nav-section-toggle:hover {
  color: var(--text-2);
}

.nav-chevron {
  font-size: 14px;
  opacity: .5;
  transition: transform .22s ease, opacity var(--transition-base);
  flex-shrink: 0;
}

.nav-section-toggle:hover .nav-chevron {
  opacity: .8;
}

.nav-section-toggle[aria-expanded="false"] .nav-chevron {
  transform: rotate(-90deg);
}

.nav-section-items {
  overflow: hidden;
  max-height: 600px;
  transition: max-height .28s ease;
}

.nav-section-items.collapsed {
  max-height: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r);
  font-size: var(--text-ui);
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--transition-base), color var(--transition-base);
  line-height: 1.3;
}

.nav-section-items .nav-item {
  padding-left: 12px;
}

.nav-item:hover {
  background: rgba(var(--ink-rgb), .05);
  color: var(--text-1);
}

.nav-item.active {
  background: rgba(var(--ink-rgb), .07);
  color: var(--text-1);
}

.nav-item .material-symbols-sharp {
  font-size: 16px;
  flex-shrink: 0;
  opacity: .6;
}

.nav-item.active .material-symbols-sharp,
.nav-item:hover .material-symbols-sharp {
  opacity: 1;
}

.nav-item.nav-soon {
  opacity: .35;
  pointer-events: none;
  cursor: default;
}

.nav-item.nav-soon::after {
  content: 'Soon';
  font-size: 9px;
  font-weight: var(--weight-semibold);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-left: auto;
}

/* ── Sidebar footer ── */
.sidebar-footer {
  padding: 0;
  border-top: none;
  flex-shrink: 0;
}

.sidebar-footer .hdr-auth {
  padding: 8px 12px 16px;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  border-top: 1px solid rgba(var(--ink-rgb), .08);
}

.sidebar-footer .nav-auth-btns {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
}

.sidebar-footer .btn-ghost,
.sidebar-footer .btn-nav-signup {
  justify-content: flex-start;
  width: 100%;
  font-size: var(--text-small);
}

.sidebar-footer .nav-avatar-btn {
  padding: 8px 4px;
  gap: 12px;
  font-size: var(--text-small);
  color: var(--text-2);
  text-decoration: none;
  display: flex;
  align-items: center;
}

/* ── Theme switch in nav ── */
.nav-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.nav-theme-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: rgba(var(--ink-rgb), .38);
}

.nav-theme-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}

.nav-ts-icon {
  font-size: var(--icon-sm);
  color: rgba(var(--ink-rgb), .28);
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 16;
  transition: color 0.2s;
}

.nav-ts-rail {
  position: relative;
  width: 32px;
  height: 16px;
  background: rgba(var(--ink-rgb), .08);
  box-shadow: inset 0 1px 2px rgba(var(--ink-rgb), .10);
  flex-shrink: 0;
}

.nav-ts-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: rgba(var(--ink-rgb), .60);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .nav-ts-thumb {
  transform: translateX(16px);
}

/* Active icon brightens for current mode */
[data-theme="light"] .nav-theme-switch .nav-ts-icon:first-child,
[data-theme="dark"] .nav-theme-switch .nav-ts-icon:last-child {
  color: rgba(var(--ink-rgb), .72);
}

/* ── Mobile sidebar toggle — floats bottom-left, thumb territory ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 18px;
  left: 16px;
  z-index: var(--z-fab);
  background: rgba(var(--paper-rgb), .92);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(var(--ink-rgb), .18);
  border-radius: var(--r-cta);
  box-shadow: var(--shadow-float);
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: color var(--transition-base), border-color var(--transition-base), left .25s cubic-bezier(.4,0,.2,1);
}

.sidebar-toggle:hover {
  color: var(--text-1);
  border-color: rgba(var(--ink-rgb), .28);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(var(--ink-rgb), .35);
  z-index: var(--z-overlay);
}

.sidebar-overlay.show {
  display: block;
}

body.has-sidebar {
  padding-left: 224px;
}

@media (max-width: 768px) {
  body.has-sidebar {
    padding-left: 0;
    /* the toggle lives bottom-left now — no top clearance needed */
    padding-top: 0;
  }

  body.has-sidebar .cta-bar {
    left: 0;
  }

  .app-main {
    margin-left: 0;
  }

  .app-sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    z-index: var(--z-sidebar-raised);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  body.sidebar-open .sidebar-toggle {
    left: 232px;
  }

  /* bottom CTA bars clear the floating toggle — outranks page-local
     padding on the bar */
  body .cta-bar { padding-left: 76px; }

  .wrap {
    padding-top: 24px;
  }
}

/* ─── 21. AUTH FORM ──────────────────────────────────────────── */

.auth-card {
  /* chromeless — the form sits on the paper itself */
  width: 100%;
  max-width: 400px;
  border: none;
  background: none;
  box-shadow: none;
  padding: 0;
}

.auth-wordmark {
  height: 32px;
  width: auto;
  display: block;
  margin-bottom: 48px;
}

.auth-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}

.auth-title {
  font-size: var(--fs-h3);
  font-weight: var(--weight-regular);
  letter-spacing: -.015em;
  line-height: var(--lh-heading);
  color: var(--text-1);
  margin-bottom: 40px;
}

.auth-subtitle {
  font-size: var(--text-body-sm);
  color: var(--text-3);
  margin: -28px 0 40px;
  line-height: 1.6;
  max-width: 34ch;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: var(--text-label);
  font-weight: var(--weight-bold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-3);
}

.field-input-wrap {
  position: relative;
}

.field-input {
  width: 100%;
  background: rgba(var(--ink-rgb), .04);
  border: 1px solid rgba(var(--ink-rgb), .14);
  border-radius: var(--r);
  padding: 12px 16px;
  color: var(--text-1);
  font-size: var(--text-body-sm);
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition-base), background var(--transition-base);
}

.field-input:focus {
  border-color: rgba(var(--ink-rgb), .35);
  background: rgba(var(--ink-rgb), .06);
}

.field-input::placeholder {
  color: var(--text-3);
}

.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition-base);
}

.pw-toggle:hover {
  color: var(--text-2);
}

.auth-error {
  font-size: var(--text-small);
  color: rgba(160, 40, 40, .85);
  line-height: 1.5;
  padding: 12px 16px;
  background: rgba(160, 40, 40, .06);
  border: 1px solid rgba(160, 40, 40, .18);
  border-radius: var(--r);
  display: none;
}

.auth-error.show {
  display: block;
}

.auth-success {
  font-size: var(--text-small);
  color: var(--text-2);
  line-height: 1.65;
  padding: 16px 16px;
  background: rgba(var(--ink-rgb), .04);
  border: 1px solid rgba(var(--ink-rgb), .14);
  border-radius: var(--r);
  display: none;
  text-align: center;
}

.auth-success.show {
  display: block;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 16px;
}

.auth-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: var(--text-small);
  color: var(--text-3);
}

.auth-footer a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-base);
}

.auth-footer a:hover {
  color: var(--text-1);
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 24px;
  }
}


/* ─── 22. DARK MODE — ELEMENT OVERRIDES ──────────────────────── */

/* Invert pattern: elements with solid-dark fill get solid-light fill in dark */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .generate-btn,
[data-theme="dark"] .shuffle-btn,
[data-theme="dark"] .start-btn {
  background: var(--ink-solid);
  color: var(--paper-solid);
}

[data-theme="dark"] .btn-icon {
  background: transparent;
  color: var(--text-3);
}

[data-theme="dark"] .btn-icon.saved {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--volt);
}

[data-theme="dark"] input[type=range].range-slider::-webkit-slider-thumb {
  background: var(--ink-solid);
}

[data-theme="dark"] input[type=range].range-slider::-moz-range-thumb {
  background: var(--ink-solid);
}

/* SVG text */
[data-theme="dark"] svg text {
  fill: rgba(var(--ink-rgb), .88);
}

/* Semi-transparent paper surfaces resolve per-theme via --paper-rgb /
   --sidebar-bg — no per-element dark overrides needed. */

/* Active nav icon → volt */
.nav-item.active .material-symbols-sharp {
  color: var(--volt);
  opacity: 1;
}

/* Modal backdrop + card shadow — dark */
[data-theme="dark"] .modal-backdrop {
  background: rgba(var(--paper-rgb), .85);
}

[data-theme="dark"] .modal-card {
  --shadow-press: 0 4px 32px rgba(0, 0, 0, .50), 0 20px 60px rgba(0, 0, 0, .35);
  box-shadow: var(--shadow-press);
}

/* Disabled btn text color fix in dark */
[data-theme="dark"] .btn-primary:disabled,
[data-theme="dark"] .generate-btn:disabled,
[data-theme="dark"] .shuffle-btn:disabled,
[data-theme="dark"] .start-btn:disabled {
  background: rgba(var(--ink-rgb), .22);
  color: rgba(var(--ink-rgb), .40);
}


/* ─── 23. TOOL PAGE COMPONENTS ──────────────────────────────── */

/* Controls bar — filter row + action button, at top of tool */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 0;
  margin-bottom: 16px;
}

@media (max-width: 580px) {
  .controls-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Control label — uppercase label above a form control group */
.ctl-label {
  display: block;
  margin-bottom: 12px;
}

/* Filter chips container */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 8px;
}

/* Card actions row — primary actions at bottom of a tool output card */
.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}


/* Results stats row — value/label pairs + action buttons under tool output */
.res-stats { display: flex; gap: 40px; }
.stat { display: flex; flex-direction: column; gap: 4px; }

.stat-val {
  font-family: var(--font);
  font-size: var(--fs-h5);
  font-weight: var(--weight-regular);
  line-height: var(--lh-heading);
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

.stat-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--weight-regular);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

.res-actions { display: flex; gap: 8px; align-items: center; }


/* ── Library empty state — a typographic moment, not an apology ──
   Mono counter, one editorial line, actions, and a ghost of the
   index that will exist. Used by Your Classes and Your Stories. */

.library-empty {
  text-align: center;
  padding: 72px 28px 0;
}

.library-empty-title {
  font-size: var(--fs-h4);
  font-weight: var(--weight-regular);
  letter-spacing: -.01em;
  line-height: var(--lh-heading);
  color: var(--text-1);
  max-width: 460px;
  margin: 0 auto 12px;
}

.library-empty-sub {
  font-size: var(--text-body-sm);
  color: var(--text-3);
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto 32px;
}

.library-empty-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.library-empty-actions .btn-primary { border-radius: var(--r-cta); }

/* quiet text link beneath the primary action — matches .db-view-all */
.library-empty-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  font-size: var(--text-small);
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--transition-base);
}

.library-empty-link:hover { color: var(--text-1); }

/* the future index, faintly */
.library-empty-ghost {
  max-width: 640px;
  margin: 72px auto 0;
  text-align: left;
  user-select: none;
  pointer-events: none;
}

.library-empty-ghost-row {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-light);
}

.library-empty-ghost-row:nth-child(1) { opacity: .9; }
.library-empty-ghost-row:nth-child(2) { opacity: .55; }
.library-empty-ghost-row:nth-child(3) { opacity: .26; border-bottom: none; }

.library-empty-ghost-row i {
  display: block;
  height: 13px;
  background: rgba(var(--ink-rgb), .07);
}

.library-empty-ghost-row i + i {
  height: 8px;
  margin-top: 12px;
  background: rgba(var(--ink-rgb), .045);
}

.library-empty-ghost-row:nth-child(1) i:first-child { width: 46%; }
.library-empty-ghost-row:nth-child(1) i + i         { width: 24%; }
.library-empty-ghost-row:nth-child(2) i:first-child { width: 58%; }
.library-empty-ghost-row:nth-child(2) i + i         { width: 19%; }
.library-empty-ghost-row:nth-child(3) i:first-child { width: 38%; }
.library-empty-ghost-row:nth-child(3) i + i         { width: 27%; }


/* ── Shorthand suggest — caret-anchored completion panel ── */
.sh-suggest {
  position: absolute;
  z-index: 5;
  min-width: 230px;
  max-width: 320px;
  background: var(--paper-solid);
  border: 1px solid rgba(var(--ink-rgb), .16);
  border-top-color: rgba(var(--ink-rgb), .30);
  box-shadow: var(--shadow-float);
  animation: fsReveal var(--transition-base) both;
}

.sh-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
}

.sh-row.sel,
.sh-row:hover { background: rgba(var(--ink-rgb), .05); }

.sh-code {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--text-1);
}

.sh-full {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sh-hint {
  display: flex;
  gap: 16px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--text-3);
  user-select: none;
}

/* ── Mono tag — the small uppercase artifact label. The per-page
      names (flow-tag, cc-tag, …) are one component, like the menus ── */
.flow-tag,
.cc-tag,
.cw-length-tag,
.cw-props-tag,
.lg-class-tag,
.lib-table .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-2);
  background: none;
  border: 1px solid rgba(var(--ink-rgb), .18);
  border-radius: 0;
  padding: 3px 8px;
  white-space: nowrap;
  user-select: none;
}

/* ── Item action menu (⋯) — the tv-/fl-/st- prefixes are per-page
      wiring; the look is one component ── */
.tv-menu, .fl-menu, .st-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 6;
  min-width: 214px;
  display: flex;
  flex-direction: column;
  background: var(--paper-solid);
  border: 1px solid rgba(var(--ink-rgb), .16);
  border-top-color: rgba(var(--ink-rgb), .30);
  box-shadow: var(--shadow-float);
  animation: fsReveal var(--transition-base) both;
}

.tv-menu-item, .fl-menu-item, .st-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: var(--text-ui);
  color: var(--text-2);
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.tv-menu-item:hover, .fl-menu-item:hover, .st-menu-item:hover {
  background: rgba(var(--ink-rgb), .05);
  color: var(--text-1);
}

.tv-menu-item .material-symbols-sharp,
.fl-menu-item .material-symbols-sharp,
.st-menu-item .material-symbols-sharp { font-size: var(--icon-md); color: var(--text-3); }

.tv-menu-item:hover .material-symbols-sharp,
.fl-menu-item:hover .material-symbols-sharp,
.st-menu-item:hover .material-symbols-sharp { color: var(--text-2); }

.tv-menu-item.armed, .tv-menu-item.armed:hover,
.fl-menu-item.armed, .fl-menu-item.armed:hover,
.st-menu-item.armed, .st-menu-item.armed:hover { color: var(--danger); }

.tv-menu-item.armed .material-symbols-sharp,
.tv-menu-item.armed:hover .material-symbols-sharp,
.fl-menu-item.armed .material-symbols-sharp,
.fl-menu-item.armed:hover .material-symbols-sharp,
.st-menu-item.armed .material-symbols-sharp,
.st-menu-item.armed:hover .material-symbols-sharp { color: var(--danger); }

/* ── Date stamp toggle — click flips Created ↔ Edited (persisted) ── */
.date-toggle {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.date-toggle:hover {
  color: var(--text-2);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

/* ── Sticky editor/reading bar — full content width, glass ────
   Sits OUTSIDE the centered .wrap so back sits at the content
   area's true upper-left and actions at the upper-right. */

.post-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  /* matches the sidebar's logo header exactly (80px + hairline,
     border-box) — the bottom line reads as one continuous seam */
  height: 81px;
  padding: 0 24px;
  margin-bottom: 40px;
  background: rgba(var(--paper-rgb), .48);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-bottom: 1px solid rgba(var(--ink-rgb), .09);
}

.post-actions { display: flex; gap: 8px; }

.post-edit-actions { display: flex; align-items: center; gap: 16px; }
.post-edit-actions .btn-primary { border-radius: var(--r-cta); }

/* desktop: heavier material — large type under a tall bar needs more
   blur AND a denser fill before it stops being readable (the
   apple/tidal look); mobile keeps the lighter mix */
@media (min-width: 769px) {
  .post-bar {
    background: rgba(var(--paper-rgb), .52);
    backdrop-filter: blur(48px) saturate(190%);
    -webkit-backdrop-filter: blur(48px) saturate(190%);
  }
}

@media (max-width: 768px) {
  /* the toggle floats bottom-left now, so the bar owns the top edge.
     20px padding = the page content grid; the leading ghost button's
     own padding is pulled back so its glyph sits on the grid line */
  .post-bar { top: 0; height: auto; padding: 12px 20px; }
  .post-bar > .btn-ghost:first-child { margin-left: -12px; }
}

@media (max-width: 480px) {
  /* narrow phones: the back label yields entirely — arrow only */
  .post-bar .post-back-label { display: none; }
}

/* ── Mobile: standalone primary CTAs span their container ──────────
   Buttons that share a row (bars, modal actions, composers) opt back
   out — full width is for buttons that own their line. */
@media (max-width: 640px) {
  .btn-primary,
  .generate-btn,
  .shuffle-btn,
  .start-btn {
    width: 100%;
    justify-content: center;
  }

  .post-bar .btn-primary,
  .modal-actions .btn-primary,
  .post-edit-actions .btn-primary,
  .lg-composer-actions .btn-primary,
  .tv-note-composer-actions .btn-primary {
    width: auto;
  }
}


/* ── Search field — icon + input (+ optional clear button) ──── */

.search-wrap {
  position: relative;
}

.search-input {
  width: 100%;
  background: rgba(var(--ink-rgb), .04);
  border: 1px solid rgba(var(--ink-rgb), .14);
  border-radius: var(--r);
  padding: 12px 40px 12px 42px;
  color: var(--text-1);
  font-family: var(--font);
  font-size: var(--text-body-sm);
  outline: none;
  transition: border-color var(--transition-base), background var(--transition-base);
}

.search-input::placeholder { color: var(--text-3); }

.search-input:focus {
  border-color: rgba(var(--ink-rgb), .38);
  background: rgba(var(--ink-rgb), .06);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-icon .material-symbols-sharp { font-size: var(--icon-md); }

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  font-size: var(--text-body-lg);
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-cta);
  transition: color var(--transition-base), background var(--transition-base);
  font-family: var(--font);
}

.search-clear:hover {
  color: var(--text-1);
  background: rgba(var(--ink-rgb), .05);
}


/* ── Modal ───────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(var(--paper-rgb), .65);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  position: relative;
  background: var(--paper-solid);
  border: 1px solid rgba(var(--ink-rgb), .16);
  border-top-color: rgba(var(--ink-rgb), .30);
  border-radius: var(--r);
  box-shadow: var(--shadow-press);
  padding: 32px;
  width: min(400px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
}

.modal-card h3  { margin: 0 0 8px; font-size: var(--fs-h6); font-weight: var(--weight-medium); color: var(--text-1); }
.modal-hint     { font-size: var(--fs-body); color: var(--text-3); margin: 0 0 20px; }

.modal-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(var(--ink-rgb), .04);
  border: 1px solid rgba(var(--ink-rgb), .14);
  border-radius: var(--r);
  color: var(--text-1);
  font-family: var(--font);
  font-size: var(--fs-h7);
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--transition-base), background var(--transition-base);
}

.modal-input::placeholder { color: rgba(var(--ink-rgb), .28); }

.modal-input:focus {
  border-color: rgba(var(--ink-rgb), .38);
  background: rgba(var(--ink-rgb), .06);
}

.modal-input.error { border-color: var(--danger); }

.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }

.modal-actions .btn-ghost,
.modal-actions .btn-primary {
  border-radius: var(--r-cta);
}


/* ─── 24. SITE FOOTER ────────────────────────────────────────── */
/* Injected on every page by lib/nav.js; login/signup carry it
   statically. Bump the version string in nav.js. */

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--text-3);
  padding: 8px 28px 48px;
  user-select: none;
}

/* stay clear of pages with a fixed CTA bar */
body:has(.cta-bar) .site-footer {
  padding-bottom: 120px;
}

/* ─── PRINT ──────────────────────────────────────────────────── */
@media print {
  body::after { display: none; } /* texture is for screens */
}
