/* ---------- Global utility: honor [hidden] over component display rules ----
   Components like .chatbox__voice, .chatbox__attach, .chatbox__reckon, and
   .chatbox__voice-hint set explicit display:inline-flex / inline-grid /
   flex. Per the HTML spec the [hidden] attribute applies display:none, but
   any explicit `display:` in CSS WINS over the spec’s default. Result before
   this rule: non-members saw mic / attach / reckon even though the HTML had
   them marked hidden by default (Doug 5/17/26, mobile screenshot). One
   global rule with !important fixes every member-only affordance in one
   stroke and keeps the contract simple: if [hidden] is on the element, it
   is not rendered, full stop. -------------------------------------------- */
[hidden] { display: none !important; }

/* ---------- Tokens ---------- */
/* Reckoning palette — see .mobile-nav__row--reckon for usage.
   Light mode: crisp deep crimson + warm primary gold (matches
   --color-primary already in the palette so the row stays in family).
   Dark mode is overridden below in [data-theme='dark']. */
:root,
[data-theme='light'] {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Surfaces — clean white, immersive feather backdrop layered behind */
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-2: #ffffff;
  --color-surface-offset: #f4f1ea;
  --color-divider: #ece8df;
  --color-border: #e0dccf;

  /* Ink */
  --color-text: #1f1d18;
  --color-text-muted: #6f6c63;
  --color-text-faint: #b3aea1;
  --color-text-inverse: #fbfaf6;
  /* Placeholder color for input/textarea. Distinct from --color-text-faint
     because faint is used for tiny captions on light surfaces where low
     contrast is fine; placeholders need to remain readable as instruction
     text. Light theme reuses the faint value (already readable); dark
     theme overrides to a brighter tone (Doug 5/21/26). */
  --color-placeholder: #b3aea1;
  /* Emphasis: used wherever *...* markdown renders as <em>. Body color +
     semibold so the phrase stands out without shouting. Theme-aware so
     light and dark both inherit it correctly — Doug 5/17/26: "Define the
     emphasis style using a CSS variable so it adapts automatically
     across both light and dark themes — one fix covers both." */
  --color-text-emphasis: var(--color-text);
  --font-weight-emphasis: 600;

  /* Accent — pale gold, almost paper-warm */
  --color-primary: #b08a3e;
  --color-primary-hover: #8c6c2c;
  /* Active-playground indicator. Dark navy provides hue contrast with the
     warm primary (yellow-gold) used for new-playground actions. */
  --color-accent: #1f3a8a;
  --color-accent-hover: #16306f;

  /* Light wash colors used in the halo gradient */
  --halo-warm: #fff6dc;
  --halo-cool: #eef3ff;

  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  --transition-interactive: 220ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 80 / 0.05);
  --shadow-md: 0 8px 24px oklch(0.2 0.02 80 / 0.06);
  --shadow-lg: 0 28px 60px oklch(0.2 0.02 80 / 0.08);

  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  /* c174: app-wide chrome/body font token. Brand wordmark stays on
     --font-display; everything else routes through --font-app so a single
     localStorage write (gabriel.fontApp) can re-skin the app. */
  --font-app: var(--font-body);

  /* Reckoning palette (light). Deep crimson reads against the cream
     drawer; gold label keeps the alchemical thread. */
  --color-reckon-bg:           #6b1a1a;  /* deep crimson */
  --color-reckon-bg-hover:     #7a1e1e;  /* slightly hotter on hover */
  --color-reckon-bg-active:    #5a1414;  /* press-down: deeper */
  --color-reckon-fg:           #d9a441;  /* warm primary gold */
  --color-reckon-fg-hover:     #f0bf5c;  /* brighter on hover */
  --color-reckon-edge:         color-mix(in oklab, #d9a441 35%, transparent);
  --color-reckon-edge-hover:   color-mix(in oklab, #f0bf5c 55%, transparent);
}

[data-theme='dark'] {
  /* Reckoning palette (dark). Doug 5/26/26: "dark mode should deepen the
     intensity — darker red, brighter gold." Crimson goes deeper so it
     reads as embered, not Christmas-y, against the warm-black drawer.
     Gold goes brighter so the label still pops at low ambient. */
  --color-reckon-bg:           #4a0f0f;  /* embered crimson */
  --color-reckon-bg-hover:     #5c1414;
  --color-reckon-bg-active:    #3a0a0a;
  --color-reckon-fg:           #f4c96b;  /* brighter gold */
  --color-reckon-fg-hover:     #ffd987;
  --color-reckon-edge:         color-mix(in oklab, #f4c96b 30%, transparent);
  --color-reckon-edge-hover:   color-mix(in oklab, #ffd987 50%, transparent);

  --color-bg: #14130f;
  --color-surface: #1a1815;
  --color-surface-2: #211f1b;
  --color-surface-offset: #1d1b17;
  --color-divider: #29261f;
  --color-border: #3a362c;
  --color-text: #ece8d8;
  --color-text-muted: #908b7c;
  --color-text-faint: #5a574e;
  --color-text-inverse: #1a1815;
  /* Brighter than --color-text-faint so placeholder text stays legible
     on dark backgrounds. Doug 5/21/26: first try at #7a766a was still too
     close to the input background — bumping toward --color-text-muted
     (#908b7c) so the hint actually reads. */
  --color-placeholder: #908b7c;
  /* Emphasis vars mirror the light theme — they resolve to whatever
     --color-text + --font-weight-emphasis are in this scope, so the
     same .message__body em rule renders correctly in either theme
     without per-theme duplication. */
  --color-text-emphasis: var(--color-text);
  --font-weight-emphasis: 600;
  --color-primary: #d8b66a;
  --color-primary-hover: #efcf86;
  /* Dark mode accent: lighter navy for legibility on dark surfaces. */
  --color-accent: #93b4ff;
  --color-accent-hover: #aec5ff;
  --halo-warm: #2a2418;
  --halo-cool: #181c26;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 8px 24px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 28px 60px oklch(0 0 0 / 0.45);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  /* Prevent horizontal page scroll on mobile when fixed/absolute decorations
     (halos, glows, SVG blooms) paint past the viewport edge.
     IMPORTANT: must be `clip`, not `hidden`. `overflow-x: hidden` silently
     forces overflow-y to `auto`, making <html>/<body> a scrolling container,
     which breaks `position: sticky` on the composer dock so the footer
     scrolls away on mobile instead of pinning to the viewport bottom.
     `overflow: clip` clips paint without creating a scroll container. */
  overflow-x: clip;
}
body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-app);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  position: relative;
  overflow-x: clip;
}

/* Immersive wings — a soft, photographic feather backdrop covering the whole sky.
   Sits behind every page; never competes with content. */
.wings {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
/* Wings background — a still room (Doug 5/21/26).

   PRESENCE CONSTRAINT: the room holds space, it does not perform. Earlier
   revisions animated opacity 0.22 -> 0.32 over 22s in addition to a scale
   breath, which read as a shimmer on a full-screen photographic image and
   pulled the user out of contact with Gabriel. The nervous system reads
   that motion even when the conscious mind does not.

   What we keep: a very slow scale breath (1.02 -> 1.05 over 22s). Almost
   imperceptible — felt, not seen. Just enough that the room is alive.

   What we removed:
     - opacity animation on the <img> entirely (was the primary shimmer)
     - transform: translateZ(0) on the <img> (it forced a separate GPU
       layer that fought the wrapper's animated transform every frame)

   Compositing: only the wrapper gets the GPU layer. The <img> rides on
   the wrapper's transform, sampled once and resampled only when the
   wrapper's scale changes. No nested composite layers, no fighting. */
.wings {
  will-change: transform;
  transform: translateZ(0) scale(1.02);
  animation: wings-breathe 22s ease-in-out infinite;
}
.wings img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.25;
  /* Stop sub-pixel rendering differences between frames. No transform
     here — see the block comment above for why. */
  backface-visibility: hidden;
}
@keyframes wings-breathe {
  0%, 100% { transform: translateZ(0) scale(1.02); }
  50%      { transform: translateZ(0) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .wings { animation: none; transform: translateZ(0) scale(1.04); }
}
[data-theme='dark'] .wings img { opacity: 0.10; }

/* Halo veil — soft white wash behind the central content so type stays crisp. */
.halo-veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% 50%,
      rgba(255,255,255,0.55) 0%,
      rgba(255,255,255,0.20) 45%,
      rgba(255,255,255,0.0) 80%);
}
[data-theme='dark'] .halo-veil {
  background:
    radial-gradient(ellipse 60% 40% at 50% 50%,
      rgba(20,19,15,0.55) 0%,
      rgba(20,19,15,0.25) 45%,
      rgba(20,19,15,0.0) 80%);
}

/* Sparkles container — viewport-sized fixed layer above the wings.

   The container was previously unstyled, which meant the absolutely-
   positioned .sparkle children resolved against whatever the nearest
   positioned ancestor happened to be — sometimes the body, sometimes
   a content panel — producing inconsistent placement and, on the
   conversation view, putting them behind the scroll content so they
   were effectively invisible (Doug 5/21/26).

   Fixing the container to inset:0 and z-index:1 puts it above .wings
   (z:0) and .halo-veil (z:0) but below interactive content. The
   pointer-events:none lets clicks pass straight through. */
.sparkles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* Sparkles — lightning strikes through Gabriel's wings (Doug 5/21/26 v3).

   Previous revisions used a CSS-keyframe cycle: fixed positions, fixed
   intervals, predictable cadence. That read as "stars winking through
   atmosphere" — decorative, rhythmic, repeating. Wrong soul.

   New model: strikes are discrete events, not cycles. Light breaking
   through the wings at moments of grace, not on a schedule. Each strike
   is a cluster of 3-5 sparkles in a small zone, firing nearly together,
   with a fast rise (~80ms) and slow fade (~1.8s). Then they're removed
   from the DOM. The next strike happens whenever the scheduler decides,
   somewhere else, with genuine stillness between.

   See js/sparkles.js for the strike scheduler and cluster logic. The
   CSS here defines the visual shape (a cross-glint pinpoint with halo)
   and the one-shot strike keyframe. */
.sparkle {
  position: absolute;
  width: 14px; height: 14px;
  background: transparent;
  opacity: 0;
  /* One-shot animation — fired once when the element is appended,
     then the element is removed on animationend. No infinite cycle. */
  animation: sparkle-strike 1.9s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.85)) drop-shadow(0 0 6px rgba(255,235,180,0.55));
  pointer-events: none;
}
.sparkle::before,
.sparkle::after {
  content: '';
  position: absolute;
  background: #ffffff;
  border-radius: 1px;
}
.sparkle::before {
  left: 50%;
  top: 0;
  width: 1.5px;
  height: 100%;
  transform: translateX(-50%);
}
.sparkle::after {
  top: 50%;
  left: 25%;
  width: 50%;
  height: 1.5px;
  transform: translateY(-50%);
}
.sparkle.lg {
  width: 20px; height: 20px;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.95)) drop-shadow(0 0 9px rgba(255,235,180,0.6));
}
.sparkle.gold::before,
.sparkle.gold::after {
  background: #fff4d6;
}
.sparkle.gold {
  filter: drop-shadow(0 0 3px rgba(255,235,180,0.85)) drop-shadow(0 0 7px rgba(212,182,118,0.55));
}
/* Strike keyframe — fast rise, slow fade (Doug 5/21/26 v3).

   Lightning shape: peak brightness reached within ~80ms (4% of a 1.9s
   strike), then a slow fade-out over the remaining ~1.8s. The asymmetry
   is what makes it read as "a strike that lingers" rather than "a flash."

   Used as a one-shot animation — the element is appended, plays once,
   and is removed on animationend by the scheduler in js/sparkles.js. */
@keyframes sparkle-strike {
  0%   { opacity: 0;    transform: scale(0.4); }
  4%   { opacity: 0.95; transform: scale(1.05); }
  10%  { opacity: 0.80; transform: scale(1.0); }
  100% { opacity: 0;    transform: scale(0.9); }
}
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

a, button, input, textarea {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

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

/* ---------- Shell ---------- */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* prevent min-content from blowing the column past viewport on mobile */
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
}
/* Belt-and-suspenders: every grid child should be allowed to shrink below its
   min-content width (textareas, flex rows, etc. otherwise force grid to expand). */
.app-shell > * { min-width: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;                   /* stays pinned as the thread scrolls */
  top: 0;
  z-index: 3;                         /* above wings + halo + thread */
  padding: var(--space-4) var(--space-6) var(--space-3);
  /* Doug 11/21/26 (phone): "Please put the pull down on top" -- the name
     dropdown opened UNDER the message box. The header's z-index makes it a
     stacking context, so its menus (.user-menu z 50, .header-time-menu z 50)
     can rise no higher than the header's own 3, below .compose-dock (z 20)
     and its send/ear buttons (z 25). While a header menu is open the header
     lifts to 45, above all of those; closed, it drops back to 3 so the
     thread and dock keep their usual order. Rule just below. */
  /* Mobile wrapper (Doug 2026-07-23): in a standalone WebView/PWA there is no
     browser chrome, so the header sits under the status bar / notch. Add the
     safe-area insets (they resolve to 0 in a normal browser and on non-notched
     devices, so this is inert off-device). Requires viewport-fit=cover in the
     page's viewport meta to actually engage. */
  padding-top: calc(var(--space-4) + env(safe-area-inset-top, 0px));
  padding-left: calc(var(--space-6) + env(safe-area-inset-left, 0px));
  padding-right: calc(var(--space-6) + env(safe-area-inset-right, 0px));
  /* Computer 6/6/26 PM round 48: Doug -- "sign in is occupying a whole
     column... that shouldn't happen, we want all that space available."
     Previously grid-template-columns: 1fr auto 1fr forced the left side
     to match the right side's width (theme toggle + Today + name avatar
     ~280px), wasting ~240px of left whitespace and squeezing the brand.
     Switch to flex: sides flow at their content width; brand is
     position:absolute centered on the true viewport. Side columns
     reclaim their natural width and the brand stays glued to the
     viewport horizontal center -- which is also where the title-pill
     anchors (r47), so they remain co-axial at every window width. */
  /* Computer 6/6/26 PM round 50: drop `position: relative` -- it was
     overriding `position: sticky` above (cascade winner), so the header
     stopped pinning to viewport top on scroll. Sticky elements already
     establish a containing block for absolutely-positioned children
     (the brand below), so relative was both redundant AND harmful. */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  /* Computer 6/7/26 AM round 1: Doug -- "the header gets scrunched and pushed up
     [in standard chat / space directory]. I prefer a bit more breathing room of
     the detailed space view." The rail-settings-open state sets min-height:100px
     (pages.css c172 round 29) so the eggshell bg paints fully under the
     .current-space pill; standard mode had no min-height, so the header
     collapsed to ~76-80px and the pill crowded the tagline. Unify on 100px in
     the base rule so closed-panel chat and the spaces directory get the same
     breathing room as detail view. Detail-mode override at pages.css line 3243
     becomes redundant but harmless (same value). */
  min-height: 100px;
  /* Soft fade so messages dissolve behind the brand instead of cutting hard */
  background:
    linear-gradient(to bottom,
      var(--color-bg) 0%,
      color-mix(in oklab, var(--color-bg) 88%, transparent) 70%,
      transparent 100%);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
.site-header:has(.user-menu:not([hidden])),
.site-header:has(.header-time-menu:not([hidden])) {
  z-index: 45;
}
.site-header__side {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  /* Computer 6/6/26 PM round 48: sides flow at content width (no
     1fr equal-share), so flex-basis stays 0 and they reclaim space. */
  flex: 0 0 auto;
}
.site-header__side--left { justify-content: flex-start; }
.site-header__side--right { justify-content: flex-end; gap: var(--space-3); }
/* Computer 6/6/26 PM round 48: brand floats at true viewport center,
   independent of side-column widths. Sides flow around it.
   Computer 6/6/26 PM round 49: width:max-content so the brand-text
   column sizes to its widest child (the wordmark/tagline) -- without
   this the absolute-positioned brand collapses to min-content (the
   single chip dot) and the .current-space name truncates to "...". */
.site-header__brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  z-index: 1;
}

/* Journal date badge — top-chrome "Sunday, May 17, 2026" anchor.
   The user's persistent orientation in time. Sits at the outer edge of the header
   (far-RIGHT since Doug 11/15/26 -- see the side-swap rule near
   .header-time-block--left)
   so it doesn't crowd the centered Gabriel mark.

   Typography matches the .header-link--wordmark idiom (About / Membership)
   so the badge reads as soft chrome — same display family, same weight,
   same letter-spacing, same muted color. Doug 5/17/26: "it doesn't need to
   be too dominant, not all caps, not bold, similar font as about/
   membership." Day, date, year all share one register; no internal
   hierarchy that would make any segment shout. */
.journal-date {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.78rem;
  /* Slightly tighter tracking than .header-link--wordmark (0.22em) because
     we're rendering mixed case + numerals, not all-caps, so the eye needs
     less letter air to read it as a unit. */
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  line-height: 1;
  user-select: none;
  padding-left: var(--space-1);
  white-space: nowrap;
}
.journal-date[hidden] { display: none; }
.journal-date__day,
.journal-date__date,
.journal-date__year {
  /* All segments inherit the badge typography. No per-segment weight or
     size changes — the date should feel like one soft phrase. */
  font: inherit;
  color: inherit;
}
.journal-date__sep {
  color: var(--color-text-faint);
  /* Single source of truth for inter-segment spacing: comma + a hair of air. */
  margin: 0 0.32em 0 0;
}
/* Compact on narrow viewports: drop the year first (the day + date alone
   are enough orientation on mobile), and reduce padding so the badge fits
   alongside theme toggle + member nav without crowding. */
@media (max-width: 720px) {
  .journal-date { font-size: 0.72rem; letter-spacing: 0.04em; }
}
@media (max-width: 540px) {
  /* Last comma + year drop on phone. "Sunday, May 17" is enough. */
  .journal-date__year,
  .journal-date__sep--year { display: none; }
}
.site-header__nav,
.site-header__member-nav {
  display: inline-flex;
  align-items: center;
  /* Tight horizontal spacing between links. */
  gap: 2px;
}
/* Honor the HTML `hidden` attribute even though `display: inline-flex` is set
   on the nav containers above. Without this, members-only links would leak
   onto the page for signed-out visitors. */
.site-header__nav[hidden],
.site-header__member-nav[hidden] { display: none; }
/* Doug 5/27/26 (3rd pass): "still centering on gabriel, tagline, journal...
   just want it centered on the top two." The .site-header__brand-text column
   contains three rows (wordmark, tagline, active-playground pill), so
   align-items: center put the mark at the midpoint of all three — which sat
   low when the Journal pill was visible. Switched to flex-start and pinned
   the mark with margin-top below so its top edge aligns with "Gabriel" and
   its bottom edge aligns with the tagline, regardless of whether the pill
   shows. */
.site-header__brand {
  display: inline-flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  line-height: 1;
  user-select: none;
  text-decoration: none;
  color: inherit;
}
.site-header__brand-text {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.brand-mark {
  /* Doug 5/27/26 (3rd pass): sized to match wordmark + 2px gap + tagline
     only (excluding the playground pill below). Shrunk from 2.6em -> 2em
     so the mark doesn't crowd "Gabriel" — it sits as a quiet companion,
     not a competitor. margin-top: 2px nudges it down to align with the
     wordmark's visual top (capital letters sit ~2px below their box-top). */
  height: clamp(30px, 2em + 0.3vw, 38px);
  margin-top: 2px;
  width: auto;
  aspect-ratio: 1 / 1;
  color: var(--color-text);
  flex-shrink: 0;
  display: block;
  /* Crisp counterpart to the fuzzy hero halo — uses currentColor so it
     auto-inverts: white in dark mode, near-black in light mode. */
}
a.site-header__brand:hover .wordmark__name,
a.site-header__brand:hover .brand-mark { color: var(--color-primary); transition: color 200ms ease; }
.site-header__brand .wordmark__name {
  /* Compact, persistent wordmark — tuned down from the giant landing size */
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 0.95rem + 0.9vw, 1.6rem);
  letter-spacing: 0.42em;
  padding-left: 0.42em;                 /* optical centering offset */
  color: var(--color-text);
}
.tagline--header {
  display: block;
  font-size: clamp(0.9rem, 0.75rem + 0.3125vw, 1.025rem);
  letter-spacing: 0.32em;
  margin-top: 2px;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Current playground indicator. Sits below the tagline; quiet presence.
   Hidden by default (hidden attribute); JS reveals when a playground is active.
   The dot has a slow pulse so the chip reads as a living presence, not a label.
   --------------------------------------------------------------------------- */
.current-playground {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 6px;
  padding: 3px 10px 3px 8px;
  border: 1px solid color-mix(in srgb, var(--color-text) 14%, transparent);
  border-radius: 999px;
  font-size: clamp(0.72rem, 0.65rem + 0.18vw, 0.82rem);
  letter-spacing: 0.08em;
  font-weight: 500;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
  background: color-mix(in srgb, var(--color-text) 4%, transparent);
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 280ms ease, transform 280ms ease;
}
.current-playground[hidden] { display: none; }
.current-playground__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-primary, #b08a4d);
  box-shadow: 0 0 6px color-mix(in srgb, var(--color-primary, #b08a4d) 60%, transparent);
  animation: playground-dot-pulse 3.6s ease-in-out infinite;
  flex-shrink: 0;
}
.current-playground__name {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Briefly emphasize when the playground changes (added/removed by JS). */
.current-playground.is-changing {
  transform: scale(1.04);
  background: color-mix(in srgb, var(--color-primary, #b08a4d) 12%, transparent);
}
/* Journal is the user's trunk: a quieter, more personal presence than a
   shared playground. Slightly desaturated border + a steady (non-pulsing)
   dot so it reads as "home base" rather than an active room. */
.current-playground.is-journal {
  border-color: color-mix(in srgb, var(--color-text) 10%, transparent);
  background: color-mix(in srgb, var(--color-text) 3%, transparent);
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
  font-style: italic;
}
.current-playground.is-journal .current-playground__dot {
  animation: none;
  opacity: 0.7;
  background: color-mix(in srgb, var(--color-text) 45%, transparent);
  box-shadow: none;
}
@keyframes playground-dot-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .current-playground__dot { animation: none; opacity: 0.9; }
  .current-playground { transition: none; }
}
@media (max-width: 540px) {
  .current-playground {
    font-size: 0.72rem;
    padding: 2px 8px 2px 6px;
    max-width: 180px;
  }
}

/* Inline clarification options rendered as pill buttons inside Gabriel's
   reply bubble (e.g. "Which playground would you like to switch to?"). */
.intent-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: 0.75em;
}
.intent-option-btn {
  font: inherit;
  font-size: 0.92em;
  color: var(--ink, #1a1a1a);
  background: color-mix(in oklab, var(--accent, #b89464) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent, #b89464) 28%, transparent);
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 80ms ease;
}
.intent-option-btn:hover {
  background: color-mix(in oklab, var(--accent, #b89464) 22%, transparent);
  border-color: color-mix(in oklab, var(--accent, #b89464) 48%, transparent);
}
.intent-option-btn:active { transform: scale(0.97); }
@media (max-width: 540px) {
  .tagline--header { display: none; }   /* keep header lean on narrow screens */
  /* Hide the crisp logomark on phones — the wordmark alone is plenty of
     brand at this size and we need room for the right-side controls. */
  .brand-mark { display: none; }
  .site-header__brand { gap: 0; }
}
.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.icon-btn:hover { background: color-mix(in oklab, var(--color-surface-offset) 70%, transparent); color: var(--color-text); }
.icon-btn--small { width: 22px; height: 28px; margin-left: -6px; }

/* ---------- Voice picker ---------- */
.voice-controls {
  position: relative;
  display: inline-flex;
  align-items: center;
  /* Computer 6/11/26 PM round 16: create a fresh stacking context so the
     .voice-menu popover (z-index:200) can rise above the wings background
     and any sibling chatbox layers. Without isolation, the menu's z-index
     was being trapped inside an ancestor stacking context and rendering
     behind the wings image. */
  isolation: isolate;
}
.voice-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  max-width: min(360px, 92vw);
  /* Cap the menu height so it never extends past the top of the viewport.
     The dock sits at the bottom, the menu floats upward (via .voice-menu--above),
     and on short windows or with many voices the top of the menu could clip.
     70vh leaves room for the header above and the dock below. The inner
     .voice-menu__list keeps its own 280px scroll cap, so this only triggers
     when the toggle + header + list together would overflow. */
  max-height: min(70vh, 480px);
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-2);
  /* Computer 6/11/26 PM round 16: 50 -> 1000. Doug reported the picker menu
     rendering behind the wings background image even though z-index was set.
     Combined with isolation:isolate on .voice-controls above, this guarantees
     the menu paints over everything in the composer dock. */
  z-index: 1000;
  font-family: var(--font-app);
  animation: voiceMenuIn 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
/* Computer 6/11/26 PM round 17: switch .voice-menu--above to position:fixed
   so it ESCAPES .compose-dock's isolation:isolate stacking context (pages.css
   line 942). The dock's isolation + clip-path + 100vmax box-shadow together
   trap any absolutely-positioned descendant — that's why the menu was rendering
   behind the wings even with z-index:1000. position:fixed lifts the menu out
   of the dock into the viewport, where z-index:1000 actually competes against
   .wings (z-index:0). voice.js sets --voice-menu-bottom / --voice-menu-right
   from the caret button's getBoundingClientRect() when the menu opens. */
.voice-menu--above {
  position: fixed;
  top: auto;
  left: auto;
  bottom: var(--voice-menu-bottom, 64px);
  right: var(--voice-menu-right, 16px);
  transform-origin: bottom right;
  animation: voiceMenuInUp 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes voiceMenuInUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Mute / unmute toggle row at the top of the menu */
.voice-menu__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.55rem 0.7rem;
  margin-bottom: var(--space-1);
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background var(--transition-interactive);
}
.voice-menu__toggle:hover { background: var(--color-surface-offset); }
.voice-menu__toggle-label { color: var(--color-text); }
.voice-menu__toggle-state {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--color-surface-offset);
}
.voice-menu__toggle[aria-pressed="true"] .voice-menu__toggle-state {
  color: var(--color-primary);
  background: color-mix(in oklab, var(--color-primary) 14%, transparent);
}

/* Speed slider row — sits just under the mute toggle. */
/* 2026-10-12 (Doug): label, slider and value on one row, to save room; the
   volume row uses the same classes. */
.voice-menu__speed {
  display: grid;
  grid-template-columns: 3.6rem 1fr auto;
  align-items: center;
  column-gap: 0.6rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.92rem;
}
.voice-menu__volume { margin-bottom: var(--space-1); }
/* Speed can't be applied on Polly Generative (AWS has no prosody rate there);
   dim + disable the row so it reads as intentionally unavailable, not broken. */
.voice-menu__speed--disabled { opacity: 0.5; }
.voice-menu__speed--disabled .voice-menu__speed-slider { cursor: not-allowed; }
.voice-menu__speed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--color-text);
  margin-bottom: 0.3rem;
}
.voice-menu__speed-label { color: var(--color-text); }
.voice-menu__speed-value {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--color-surface-offset);
  font-variant-numeric: tabular-nums;
}
.voice-menu__speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--color-surface-offset);
  outline: none;
  cursor: pointer;
}
.voice-menu__speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 0;
  cursor: pointer;
  transition: transform var(--transition-interactive);
}
.voice-menu__speed-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.voice-menu__speed-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 0;
  cursor: pointer;
}
.voice-menu__speed-slider:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--color-primary) 35%, transparent);
}

/* Voice engine selector — appears only under the "User's choice" admin lever.
   Sits above the voice roster; styled to match the menu's other controls. */
.voice-menu__engine {
  padding: 0.15rem 0.7rem 0.35rem;
}
.voice-menu__engine-select {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-surface-offset);
  border: 1px solid color-mix(in oklab, var(--color-text) 12%, transparent);
  border-radius: var(--radius-sm, 8px);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}
.voice-menu__engine-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--color-primary) 35%, transparent);
}

@keyframes voiceMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.voice-menu__header {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  padding: var(--space-2) var(--space-3) var(--space-1);
}
/* Note under the Voice header (Doug + Claude Code 2026-08-06). One line saying
   what the roster choice actually does -- masculine voices answer to Gabriel,
   feminine to Gabriella -- so the rename isn't a riddle. Sentence case and
   normal weight so it reads as a note, not a second header. */
.voice-menu__note {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--color-text-faint);
  padding: 0 var(--space-3) var(--space-2);
}
.voice-menu__list { max-height: 280px; overflow-y: auto; }
.voice-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 0;
  color: var(--color-text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-interactive);
}
.voice-option:hover { background: var(--color-surface-offset); }
.voice-option[aria-checked="true"] { color: var(--color-primary); font-weight: 500; }
.voice-option__name { flex: 0 0 auto; white-space: nowrap; }
.voice-option__lang { font-size: 0.72rem; color: var(--color-text-faint); margin-left: 0.6rem; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.voice-option__check { width: 14px; flex-shrink: 0; opacity: 0; }
.voice-option[aria-checked="true"] .voice-option__check { opacity: 1; }
.voice-menu__empty { padding: 0.75rem 0.9rem; font-size: 0.85rem; color: var(--color-text-muted); font-style: italic; }

.signin-btn {
  /* Match the wordmark-style header links (About, Membership) for typography,
   then add the warm halo-yellow background so the button stands out softly. */
  display: inline-flex; align-items: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  color: var(--color-text);
  background: #f9f0d6;                  /* same warm yellow as inner halo */
  border: 1px solid color-mix(in oklab, #f9f0d6 70%, var(--color-primary) 30%);
}
.signin-btn:hover {
  background: #f3eccd;                  /* slightly warmer on hover */
  color: var(--color-text);
}
[data-theme='dark'] .signin-btn {
  /* Keep the warm-yellow glow in dark mode but darken the text so it reads. */
  background: #f3eccd;
  color: #14130f;
  border-color: color-mix(in oklab, #f3eccd 70%, var(--color-primary) 30%);
}
[data-theme='dark'] .signin-btn:hover { background: #fff5dc; }
@media (max-width: 720px) {
  .signin-btn { font-size: 0.7rem; letter-spacing: 0.18em; padding: var(--space-1) var(--space-2); }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-align: center;
  letter-spacing: 0.04em;
}
.site-footer .tagline,
.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
}
.tagline--stage {
  display: block;
  margin-top: 0;
}

/* ---------- Admin overlay (Ctrl/Cmd + Shift + G) ---------- */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  font-family: var(--font-app);
}
.admin-overlay[hidden] { display: none; }
.admin-overlay__backdrop {
  position: absolute; inset: 0;
  background: color-mix(in oklab, var(--color-text) 65%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.admin-overlay__panel {
  position: relative;
  width: min(960px, 100%);
  max-height: min(85vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: adminOverlayIn 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes adminOverlayIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}
.admin-overlay__head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.admin-overlay__title {
  font-family: var(--font-display, var(--font-body));
  font-size: 1rem;
  letter-spacing: 0.18em;
  margin: 0;
  flex: 1;
  color: var(--color-text);
}
.admin-overlay__tools { display: inline-flex; align-items: center; gap: var(--space-2); }
.admin-overlay__status { font-size: 0.78rem; color: var(--color-text-faint); }
.admin-overlay__search {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-offset);
  color: var(--color-text);
  width: 180px;
  outline: none;
}
.admin-overlay__search:focus { border-color: color-mix(in oklab, var(--color-primary) 50%, var(--color-border)); }
.admin-overlay__btn {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-interactive), color var(--transition-interactive);
}
.admin-overlay__btn:hover { background: var(--color-surface-offset); }
.admin-overlay__btn--close {
  font-size: 1.2rem; line-height: 1;
  width: 32px; height: 32px;
  padding: 0;
  display: inline-grid; place-items: center;
  border-color: transparent;
  color: var(--color-text-faint);
}
.admin-overlay__btn--close:hover { color: var(--color-text); background: var(--color-surface-offset); }

.admin-overlay__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.admin-stat {
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-offset);
}
.admin-stat__label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: 0.15rem;
}
.admin-stat__value {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text);
}
.admin-stat__unit { font-size: 0.55em; opacity: 0.55; margin-left: 0.15rem; }

.admin-overlay__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.admin-empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-text-faint);
  font-style: italic;
}

.admin-list { display: flex; flex-direction: column; gap: var(--space-3); }

.admin-conv {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  background: var(--color-surface);
}
.admin-conv__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 0.5rem;
}
.admin-conv__time { font-size: 0.78rem; color: var(--color-text-muted); }
.admin-conv__chips { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; }
.admin-chip {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
}
.admin-chip--error { color: #b85; background: color-mix(in oklab, #b85 12%, transparent); }
.admin-conv__row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.2rem 0;
}
.admin-conv__label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  padding-top: 0.15rem;
}
.admin-conv__user, .admin-conv__reply {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.admin-conv__reply { color: var(--color-text-muted); }

/* Gate */
.admin-gate {
  display: grid;
  gap: var(--space-3);
  width: min(360px, 100%);
  margin: var(--space-6) auto;
}
.admin-gate__hint { margin: 0; color: var(--color-text-faint); font-size: 0.88rem; text-align: center; }
.admin-gate__input {
  font: inherit;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-offset);
  color: var(--color-text);
  outline: none;
}
.admin-gate__input:focus { border-color: color-mix(in oklab, var(--color-primary) 50%, var(--color-border)); }
.admin-gate__submit {
  font: inherit;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-text);
  color: var(--color-text-inverse);
  cursor: pointer;
}
.admin-gate__submit:hover { background: var(--color-primary-hover); }
.admin-gate__err {
  margin: 0;
  font-size: 0.85rem;
  color: #b85;
  text-align: center;
}

@media (max-width: 640px) {
  .admin-overlay { padding: var(--space-2); }
  .admin-overlay__stats { grid-template-columns: repeat(2, 1fr); }
  .admin-overlay__search { width: 130px; }
  .admin-conv__row { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ----- Auth slot in header ----- */
.auth-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  /* Computer 6/6/26 PM round 54: Doug -- "text is still squished into
     the border." Bumping BOTH the avatar-to-name gap AND the horizontal
     padding so the name has clear air on both sides. r53 left padding
     at 0.65rem which still felt tight; raise to 0.85rem each side and
     bump gap from 0.5 -> 0.75rem so the D avatar isn't crowding the
     name either. */
  gap: 0.75rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.user-chip:hover {
  background: var(--color-surface-hover, rgba(0, 0, 0, 0.04));
}
.user-chip__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-grid;
  place-items: center;
  background: var(--color-primary, #c8a85a);
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
}
.user-chip__avatar--initial {
  font-family: var(--font-display, ui-serif, Georgia, serif);
}
.user-chip__name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.01em;
}
@media (max-width: 540px) {
  .user-chip__name { display: none; }
  .user-chip { padding: 0.3rem; }
}

.user-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  padding: 0.35rem;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
  border-radius: 10px;
  background: var(--color-surface, white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  z-index: 50;
}
.user-menu__item {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
}
.user-menu__item:hover {
  background: var(--color-surface-hover, rgba(0, 0, 0, 0.04));
}
/* Link items (Master Steps Library) read the same as the button items. */
a.user-menu__item {
  display: block;
  box-sizing: border-box;
  text-decoration: none;
}

/* Doug 11/15/26: the spaces directory as a flat list inside the user menu
   ("the rail structure becomes a drop down connected with Doug Hay... no
   tree structure, just journal with every other space dropping down the
   line"). auth.js renders the empty holder; space-rail.js renderMenu()
   fills it, and the practice space (Master Steps, 11/16/26) in a second holder
   (.user-menu__spaces--practice) under the library link, which reuses these
   rules and so also draws the hairline above Sign out. The Usage and Master
   Steps Library links and Sign out stay below the main list, separated by
   a hairline (the hairline rides on whichever item follows the list). On pages that
   don't load space-rail.js the holder is empty and takes no space. */
.user-menu__spaces {
  display: flex;
  flex-direction: column;
  gap: 1px;
  /* Use the screen: header above (~90px) + Sign out below (~60px) + air.
     Long directories scroll inside the menu instead of off the page. */
  max-height: max(160px, calc(100vh - 270px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.user-menu__spaces:empty { display: none; }
.user-menu__spaces:not(:empty) + .user-menu__item {
  margin-top: 0.35rem;
  border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
  border-radius: 0 0 6px 6px;
  padding-top: 0.65rem;
}
.user-menu:has(.user-menu__spaces:not(:empty)) {
  min-width: 220px;
  max-width: min(320px, calc(100vw - 24px));
}
/* A row is just the space name (the per-row details chevron was removed
   11/15/26 -- details open from the current-space pill under the brand).
   flex 0 0 auto so rows keep their height and the list scrolls. */
.user-menu__space {
  flex: 0 0 auto;
  min-width: 0;
  text-align: left;
  padding: 0.3rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.user-menu__space:hover {
  background: var(--color-surface-hover, rgba(0, 0, 0, 0.04));
}
/* "You are here" -- same gold pill the rail used for its active row. */
.user-menu__space.is-active,
.user-menu__space.is-active:hover {
  background: var(--color-primary, #b08d44);
  color: var(--color-text-inverse, #fff);
  font-weight: 600;
}
.user-menu__space-lock { margin-right: 0.35em; font-size: 0.8em; }
/* Doug 11/16/26: drag to reorder the dropdown's spaces (space-rail.js
   wireMenuReorder). The row being moved lifts; a 2px gold line shows where
   it will land. Rows never select text or open iOS's long-press menu, since a
   touch hold is how a drag starts. */
.user-menu__spaces { position: relative; }
.user-menu__space[data-nav-id] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.user-menu__spaces.is-reordering .user-menu__space { cursor: grabbing; }
.user-menu__space.is-dragging,
.user-menu__space.is-dragging:hover {
  background: var(--color-surface-hover, rgba(0, 0, 0, 0.06));
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.35);
  opacity: 0.85;
}
.user-menu__drop-line {
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  height: 2px;
  border-radius: 2px;
  background: var(--color-primary, #b08a3e);
  pointer-events: none;
  z-index: 2;
}
.user-menu__space-new {
  margin-top: 0.25rem;
  flex: 0 0 auto;
  padding: 0.4rem 0.7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted, inherit);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}
.user-menu__space-new:hover {
  color: var(--color-text, inherit);
  background: var(--color-surface-hover, rgba(0, 0, 0, 0.04));
}

/* ============================================================
   .intro — shared block used by playground.html to show the
   playground name + description above the thread. Doug's landing
   note was removed 5/15/26; About page now carries that context.
   Kept modest and tight so it doesn't push the thread down.
   ============================================================ */
.intro {
  max-width: 640px;
  margin: clamp(40px, 6vh, 70px) auto 1.25rem;
  padding: 1rem 1.5rem;
  text-align: center;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 480ms ease, transform 480ms ease, max-height 480ms ease, margin 480ms ease, padding 480ms ease;
  max-height: 600px;
  overflow: hidden;
}
.intro__attr {
  font-family: var(--font-serif, Georgia, 'Times New Roman', serif);
  font-style: italic;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted, rgba(0, 0, 0, 0.5));
  margin: 0 0 0.6rem;
}
.intro__body {
  font-family: var(--font-serif, Georgia, 'Times New Roman', serif);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--color-text, rgba(0, 0, 0, 0.78));
  margin: 0;
}
body.has-conversation .intro {
  opacity: 0;
  transform: translateY(-8px);
  max-height: 0;
  margin: 0 auto;
  padding: 0 1.5rem;
  pointer-events: none;
}
@media (max-width: 640px) {
  .intro { padding: 0.85rem 1.25rem; margin-top: clamp(28px, 4vh, 50px); margin-bottom: 1rem; }
  .intro__body { font-size: 0.96rem; }
}

/* ============================================================
   Header text link (About, etc.) — matches the visual weight
   of the Sign in pill so they sit beside each other comfortably.
   ============================================================ */
.header-link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
  text-decoration: none;
}
.header-link:hover {
  color: var(--color-text);
  background: color-mix(in oklab, var(--color-surface-offset) 70%, transparent);
}

/* Wordmark-style nav links: same display font as Gabriel, smaller and tighter.
   Used in the right-side primary nav (About / Projects / Search / Membership). */
.header-link--wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-2);
  color: var(--color-text-muted);
}
.header-link--wordmark:hover {
  color: var(--color-text);
  background: transparent;
}
@media (max-width: 720px) {
  .header-link--wordmark { font-size: 0.7rem; letter-spacing: 0.18em; padding: var(--space-1); }
}
@media (max-width: 540px) {
  /* Hide BOTH the primary right-side nav (About / Membership) AND the
     left-side member nav (Playgrounds dropdown). Mobile users access these
     through the hamburger drawer. Without this rule, signed-in users see
     the Playgrounds dropdown crowding the header and pushing content
     horizontally off-screen. */
  .site-header__nav,
  .site-header__member-nav { display: none; }
}

/* ----- Mobile nav drawer ------------------------------------------------
   Hamburger toggle on the left of the header (now on both desktop and
   mobile — the journal context lives in here, not in a bottom strip).
   Injected by js/mobile-nav.js so every page picks it up automatically. */
.mobile-nav__toggle { display: inline-flex; }

.mobile-nav__panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: var(--space-12) var(--space-6) var(--space-5);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  animation: mobileNavSlide 180ms ease-out;
}
@keyframes mobileNavSlide {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.mobile-nav__panel[hidden] { display: none; }

.mobile-nav__link {
  display: block;
  padding: var(--space-3) var(--space-2);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-md, 6px);
}
.mobile-nav__link:hover,
.mobile-nav__link:active {
  background: color-mix(in oklab, var(--color-surface-offset) 70%, transparent);
}
.mobile-nav__link[hidden] { display: none; }

.mobile-nav__divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-2) 0;
}
.mobile-nav__divider[hidden] { display: none; }

.mobile-nav__backdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
}
.mobile-nav__backdrop[hidden] { display: none; }

/* ---- Mobile nav: journal context section (date / playground / time frame) ---- */
.mobile-nav__journal[hidden] { display: none; }
.mobile-nav__journal {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.mobile-nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-2);
  background: transparent;
  border: 0;
  border-radius: var(--radius-md, 6px);
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}
.mobile-nav__row:hover { background: color-mix(in oklab, var(--color-surface-offset) 70%, transparent); }
/* Doug 5/27/26: "playgrounds and journal font size is bigger than [the headers].
   We either need to increase the font size / height of the headers, or reduce
   the font size of the playgrounds or both so it matches stylistically."
   Met in the middle — headers up from 0.7rem → 0.78rem, sub-items down from
   0.92rem → 0.85rem (see .mobile-nav__sub-item below). Same family now. */
.mobile-nav__row-label {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--color-text-muted, var(--color-text));
  font-size: 0.78rem;
  flex: 0 0 auto;
}
.mobile-nav__row-value {
  flex: 1 1 auto;
  text-align: right;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-nav__chev {
  flex: 0 0 auto;
  color: var(--color-text-muted, var(--color-text));
  transition: transform 160ms ease;
}
.mobile-nav__row[aria-expanded="true"] .mobile-nav__chev { transform: rotate(180deg); }

/* Split row variant (Doug 5/26/26): the Playgrounds admin row is a <div>
   that contains an <a> label-link and a <button> chevron toggle, instead
   of being a single <button>. The <div> needs the same flex layout as a
   .mobile-nav__row, but the cursor and hover only apply to the children
   so each can fire its own action. */
.mobile-nav__row--split { cursor: default; }
.mobile-nav__row--split:hover { background: transparent; }
/* Doug 5/27/26: after chevron removal, the entire Playgrounds-admin row is
   itself an <a>. The whole row is the link — hover/highlight fills the
   column above and below the text, matching the Time Filter button. Reset
   the default anchor decoration so the inherited .mobile-nav__row look
   (padding, hover background, rhythm) carries the visual treatment. */
.mobile-nav__row--link { text-decoration: none; color: inherit; }
.mobile-nav__row--link:hover { text-decoration: none; }
/* Doug 5/26/26: the Playgrounds-admin label is an <a>, but visually it should
   read as a quiet section header identical to TIME FILTER — not an underlined
   link. Inherit the .mobile-nav__row-label treatment (small / tracked / muted)
   and drop the underline. Hover gives the same subtle background shift as the
   surrounding row, so all quiet rows behave as one family. */
.mobile-nav__row-label--link {
  text-decoration: none;
  padding: 0;
  flex: 1 1 auto;
  cursor: pointer;
  /* match .mobile-nav__row-label exactly so the three quiet headers line up */
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--color-text-muted, var(--color-text));
}
.mobile-nav__row-label--link:hover {
  color: var(--color-text);
  text-decoration: none;
  background: color-mix(in oklab, var(--color-surface-offset) 70%, transparent);
  border-radius: var(--radius-md, 6px);
}
.mobile-nav__chev-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Doug 5/26/26: tap target was too small (4px 8px = ~19px square) so users
     kept missing the chevron and hitting the row link instead. Bumped to
     match the row's vertical rhythm (~44px hit box) which clears the iOS
     and Material minimum without changing the visible icon size. */
  padding: var(--space-3) var(--space-3);
  min-width: 44px;
  min-height: 36px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-md, 6px);
  color: var(--color-text-muted, var(--color-text));
  cursor: pointer;
}
.mobile-nav__chev-btn:hover { background: color-mix(in oklab, var(--color-surface-offset) 70%, transparent); }
.mobile-nav__chev-btn[aria-expanded="true"] .mobile-nav__chev { transform: rotate(180deg); }

/* Toggle switch row (Previous day). The row has the same shape as the others
   so it sits flush in the drawer; the chevron slot is replaced by a small
   pill switch on the right. */
.mobile-nav__row--toggle { cursor: pointer; }
/* Inner spans are decorative — keep clicks landing on the <button> itself
   so the click handler always fires (iOS Safari is twitchy about nested
   spans inside <button> when CSS transforms are animating). */
.mobile-nav__row--toggle > * { pointer-events: none; }
.mobile-nav__toggle-switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--color-text-muted, #888) 35%, transparent);
  transition: background 160ms ease;
  margin-left: auto;
}
.mobile-nav__toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  transition: transform 160ms ease;
}
.mobile-nav__row--toggle[aria-checked="true"] .mobile-nav__toggle-switch {
  background: var(--color-accent, #5b67ff);
}
.mobile-nav__row--toggle[aria-checked="true"] .mobile-nav__toggle-thumb {
  transform: translateX(14px);
}

.mobile-nav__sub {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-2) var(--space-3);
  margin: 0 var(--space-1) var(--space-2);
  background: color-mix(in oklab, var(--color-surface-offset) 50%, transparent);
  border-radius: var(--radius-md, 6px);
}
.mobile-nav__sub[hidden] { display: none; }
.mobile-nav__sub-item {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: 0;
  border-radius: var(--radius-md, 6px);
  font-family: 'Nunito', var(--font-body);
  /* Doug 5/27/26: was 0.92rem/500 — too loud next to the 0.78rem tracked headers.
     Dropped to 0.85rem/500 so playground names sit in the same visual family as
     PLAYGROUNDS ADMIN / TIME FILTER / RECKONING. */
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}
.mobile-nav__sub-item.is-current { font-weight: 600; }
.mobile-nav__sub-item:hover { background: color-mix(in oklab, var(--color-surface-offset) 90%, transparent); }
.mobile-nav__sub-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md, 6px);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9rem;
}
.mobile-nav__sub-link:hover { background: color-mix(in oklab, var(--color-surface-offset) 90%, transparent); }
.mobile-nav__sub-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-1) var(--space-2);
}

.mobile-nav__date-input {
  font: inherit;
  font-family: var(--font-app);
  font-size: 0.9rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 6px);
  background: var(--color-bg);
  color: var(--color-text);
  width: 100%;
  min-width: 0;
}
.mobile-nav__custom[hidden] { display: none; }
.mobile-nav__custom {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  margin-top: var(--space-1);
  border-top: 1px solid var(--color-border);
}
.mobile-nav__custom-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.mobile-nav__custom-row > span {
  flex: 0 0 3.25rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-muted, var(--color-text));
}
.mobile-nav__sub-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-1);
}
.mobile-nav__sub-action {
  font: inherit;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 6px);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}
.mobile-nav__sub-action:hover { background: var(--color-surface-offset); }
.mobile-nav__sub-action--primary {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}
.mobile-nav__sub-action--primary:hover {
  background: var(--color-text);
  opacity: 0.88;
}
.mobile-nav__sub-item[aria-current="true"],
.mobile-nav__sub-item.is-current {
  background: color-mix(in oklab, var(--color-surface-offset) 90%, transparent);
  font-weight: 500;
}

/* Scrollable list variant of .mobile-nav__sub — used for the Playgrounds
   expandable list (up to ~50 entries) and the Active-playground switcher.

   Doug 5/26/26: drop the beige fill the parent .mobile-nav__sub applies.
   The surrounding drawer surface already provides container framing; the
   inner fill made the list feel like a separate panel pasted into the
   drawer. With background:transparent the playground rows float on the
   drawer's own surface, the chevron-collapsed state reads cleaner, and
   each row's own hover/current-state color carries the visual weight.
   The default .mobile-nav__sub (used for the Time filter menu) keeps its
   subtle background so the expanded picker still reads as grouped. */
.mobile-nav__sub--list {
  background: transparent;
  padding: var(--space-1) 0;
  margin: 0;
}
.mobile-nav__list-scroll {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(50vh, 22rem);
  overflow-y: auto;
  padding: var(--space-1) var(--space-2);
  /* iOS momentum scroll inside fixed drawer */
  -webkit-overflow-scrolling: touch;
}
.mobile-nav__list-scroll::-webkit-scrollbar { width: 6px; }
.mobile-nav__list-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--color-text) 18%, transparent);
  border-radius: 3px;
}
.mobile-nav__sub-footer {
  display: block;
  margin: var(--space-1) var(--space-2) 0;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
}
.mobile-nav__sub-footer:hover { background: color-mix(in oklab, var(--color-surface-offset) 90%, transparent); }

/* ----- Header Playgrounds dropdown -------------------------------------
   The "PLAYGROUNDS" header link is a dropdown that lists the user's
   journals (Journal default + each playground) plus "+ New playground" and
   "Manage playgrounds…". Wired by js/journal.js. */
.header-playgrounds {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.header-playgrounds__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.header-playgrounds__menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 240px;
  max-width: 320px;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-text-faint);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  z-index: 60;
  flex-direction: column;
  gap: 2px;
}
.header-playgrounds__menu:not([hidden]) { display: flex; }
/* Regular playground rows: match the bottom strip switcher (xs / 400 /
   faint / non-italic), tight rows. The + New action and the Manage link
   keep their own treatments below. */
.header-playgrounds__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 3px 10px;
  border-radius: 8px;
  background: none;
  border: 0;
  text-align: left;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--color-text-faint);
  cursor: pointer;
}
.header-playgrounds__item:hover {
  color: var(--color-text-muted);
  background: color-mix(in srgb, var(--color-text) 5%, transparent);
}
/* Active playground: dark navy — contrasts with the warm primary used by
   the + New action. */
.header-playgrounds__item.is-current {
  color: var(--color-accent);
  font-weight: 500;
}
/* + New playground: keep the primary (warm gold) treatment so the new
   action stays visually distinct from the active-state navy. */
.header-playgrounds__item--new {
  color: var(--color-primary);
  font-weight: 500;
  font-size: 0.85rem;
}
.header-playgrounds__item--new:hover { color: var(--color-primary-hover); }
.header-playgrounds__role {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.header-playgrounds__divider {
  height: 1px;
  background: var(--color-text-faint);
  opacity: 0.35;
  margin: 4px 2px;
}
.header-playgrounds__link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  text-decoration: none;
}
.header-playgrounds__link:hover {
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
  color: var(--color-text);
}

/* ------------------------------------------------------------------
   Scope-color signaling (Doug 5/25/26, refined 5/25/26 PM)
   Sage = Journal scope. Dusty slate = playground scope.

   Color tokens (locked here so all three surfaces stay in sync):
     --scope-journal-current      #c9d9c0   sage, used when Journal is
                                            the current scope
     --scope-journal-resting      #f3f7f1   journal sage lightened ~50%
                                            (was #e8efe4 before refinement;
                                            Doug: "journal should go 50%
                                            when it's not selected")
     --scope-playground-current   #cfe2ef   light sky blue (Doug 5/27/26:
                                            "grey is also stark for the
                                            activated playground.
                                            Suggestion a light blue, like
                                            the sky"). Replaces the prior
                                            dusty slate #d3dce2 which read
                                            as cold/grey. Sky blue keeps
                                            the no-clash-with-bronze rule
                                            and lives in the same
                                            lightness envelope as the sage
                                            so Journal and playground
                                            tints feel like siblings.
                                            Prior chain for reference:
                                            slate base #a8b8c5 was itself
                                            a replacement for lavender,
                                            which clashed with the bronze
                                            brand palette.

   Surfaces:
     1. Header pill (.current-playground)
     2. Hamburger drawer rows (.mobile-nav__sub-item)
     3. Admin cards on projects.html (.project-card)

   The pill is the source of truth for "current scope". On admin and
   in the hamburger, current matches whichever scope the pill shows.
   ------------------------------------------------------------------ */
:root {
  --scope-journal-current:    #c9d9c0;
  --scope-journal-resting:    #f3f7f1;
  --scope-playground-current: #cfe2ef;
}

/* 1. Header pill ---------------------------------------------------- */
/* Doug 5/30/26: green for both Journal AND playground when they're the
   current scope -- the meaning is unified ("this is where I'm playing").
   Previously playgrounds used sky blue here; that role moves to the
   click-to-inspect highlight on admin cards. */
.current-playground.is-journal {
  background: var(--scope-journal-current);
  border-color: color-mix(in srgb, var(--scope-journal-current) 70%, var(--color-text) 20%);
  color: var(--color-text);
  font-style: normal;
}
.current-playground.is-journal .current-playground__dot {
  background: color-mix(in srgb, var(--color-text) 55%, transparent);
  opacity: 0.85;
}
.current-playground.is-playground {
  background: var(--scope-journal-current);
  border-color: color-mix(in srgb, var(--scope-journal-current) 70%, var(--color-text) 20%);
  color: var(--color-text);
}

/* 2. Hamburger drawer rows ----------------------------------------- */
/* Mirror admin cards exactly (Doug 5/26/26): all rows white when
   inactive; the active row tints -- green for Journal, slate for any
   playground. One-of-many highlighting, same shape as the header pill
   and the admin card list. */
.mobile-nav__sub-item.is-journal-row.is-current {
  background: var(--scope-journal-current);
  font-weight: 500;
}
/* Playground rows: green tint when current (Doug 5/30/26: unified with
   Journal so both scope types read the same when active). The
   :not(.is-journal-row) guard is preserved for selector specificity
   even though both rules now resolve to the same token, in case we
   ever split them again. */
.mobile-nav__sub-item.is-current:not(.is-journal-row) {
  background: var(--scope-journal-current);
  font-weight: 500;
}

/* 3. Admin cards (projects.html) ----------------------------------- */
/* All cards (Journal + playgrounds) are white when inactive. The active
   scope gets a green tint -- unified for Journal and playgrounds because
   the meaning is the same: "this is where I'm playing right now". Sky
   blue is reserved for the click-to-inspect highlight (.is-active) so
   the two states read distinctly:
     green   = active scope (chatting in this playground)
     blue    = currently inspecting (detail panel docked)
   Doug 5/30/26: "green should be the same for playgrounds as it is for
   journal (they are now playing in the dirt)". Prior chain: 5/26/26 set
   green-for-Journal-only; 5/27/26 set playground sky blue; 5/30/26
   unified to green for both. */
.project-card.is-journal-card.is-active-scope,
.project-card.is-active-scope:not(.is-journal-card) {
  background: var(--scope-journal-current);
}

/* ------------------------------------------------------------------
   Reckoning drawer row (Doug 5/25/26: "on reckoning… it should have
   its own line just like time filter… just the scales symbol on it
   with the word reckoning"). Tap-to-fire (Doug 5/25/26 PM):
   pressing posts "Reckoning." with reckon:true on the same /api/chat
   call. No arming step, no value text.

   Shape mirrors .mobile-nav__row but with an icon slot on the left,
   the label sitting RIGHT NEXT TO the scales (Doug 5/25/26 PM:
   "reckoning beside the scales"), and no chevron / value on the right.
   ------------------------------------------------------------------ */
.mobile-nav__row--toggle {
  /* Reset button defaults so the row matches .mobile-nav__row visually. */
  width: 100%;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  /* override .mobile-nav__row's space-between so icon+label hug each other */
  justify-content: flex-start;
  gap: var(--space-2);
  /* Match .mobile-nav__row padding exactly so Reckoning is the same row
     height as Time filter / Playgrounds admin. (Doug 5/26/26) */
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-md, 6px);
  transition: background-color 120ms ease, color 120ms ease;
}
.mobile-nav__row--toggle:hover {
  background: color-mix(in srgb, var(--color-text) 4%, transparent);
}
/* Inner spans are decorative — keep clicks landing on the <button> itself
   so the delegated click handler always fires. Without this, iOS Safari
   can deliver e.target as the inner <svg> / <span> and closest() still
   matches, but pointer-events:none on children removes a whole class of
   edge cases (especially with the SVG's stroke painting). */
.mobile-nav__row--toggle > * { pointer-events: none; }
.mobile-nav__row--toggle .mobile-nav__row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  flex: 0 0 auto;
}
.mobile-nav__row--toggle .mobile-nav__row-label {
  /* Align to the quiet-row spec (.mobile-nav__row-label) so Reckoning is the
     same family as Playgrounds admin and Time filter — just charged with
     color, not a different font. (Doug 5/26/26)

     Important: .mobile-nav__row--toggle does `font: inherit` which pulls
     Inter from <body>. The sibling rows get Cormorant via .mobile-nav__row's
     `font-family: var(--font-display)`. Without an explicit family here,
     RECKONING would render in Inter while PLAYGROUNDS ADMIN / TIME FILTER
     render in Cormorant — the ransom-note effect. Force the display font. */
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* Doug 5/26/26: breathing room between TIME FILTER and RECKONING. The
   .mobile-nav__journal container uses gap:var(--space-1) which leaves them
   visually squished now that RECKONING is a filled crimson block. A bit
   more vertical separation lets Reckoning read as its own deliberate
   element rather than a footer to Time filter. */
.mobile-nav__row--reckon {
  margin-top: var(--space-2);
}

/* ------------------------------------------------------------------ */
/* RECKONING — charged variant of the quiet row family.                */
/*                                                                    */
/* Same row shape, same label spec as Time filter / Playgrounds admin */
/* (so it doesn't read as a ransom-note font). What sets it apart is  */
/* the palette: deep crimson background, gold label, gold scales.     */
/*                                                                    */
/* Why: Reckoning is a deliberate, high-stakes mode — a pressure-test */
/* against delusion. Red signals "this will be direct", gold signals  */
/* alchemical transmutation (refining, not just tearing down).        */
/* (Doug 5/26/26: "red — intensity, pressure, heat. Gold tempers the   */
/*  red with purpose. Together: this will be uncomfortable AND it's   */
/*  in service of truth.")                                            */
/* ------------------------------------------------------------------ */
.mobile-nav__row--reckon {
  /* Tokens defined at :root (light) / [data-theme='dark'] below. */
  background: var(--color-reckon-bg);
  color: var(--color-reckon-fg);
  /* Subtle gold edge so it reads as a sealed, intentional element
     rather than a flat color block. */
  box-shadow: inset 0 0 0 1px var(--color-reckon-edge);
}
.mobile-nav__row--reckon:hover {
  background: var(--color-reckon-bg-hover);
  color: var(--color-reckon-fg-hover);
  box-shadow: inset 0 0 0 1px var(--color-reckon-edge-hover);
}
.mobile-nav__row--reckon:active {
  /* Press-down: deepen the red one more notch so a tap feels committed. */
  background: var(--color-reckon-bg-active, var(--color-reckon-bg-hover));
}
.mobile-nav__row--reckon .mobile-nav__row-icon,
.mobile-nav__row--reckon .mobile-nav__row-label {
  color: var(--color-reckon-fg);
}
.mobile-nav__row--reckon:hover .mobile-nav__row-icon,
.mobile-nav__row--reckon:hover .mobile-nav__row-label {
  color: var(--color-reckon-fg-hover);
}

/* ------------------------------------------------------------------ */
/* RECKONING -- locked / earned state (Doug 5/31/26 PM round 7,        */
/* commit 46).                                                         */
/*                                                                    */
/* Reckoning is a deliberate, earned tool. It unlocks at 12 user      */
/* messages in scope and then enters an 8-message cooldown after each */
/* fire. The server is the source of truth (see /api/history          */
/* gates.reckoning); chat.js paints data-gate-locked="true" on the    */
/* button while it's not available.                                    */
/*                                                                    */
/* Visual: desaturate the crimson toward a flat near-black, dim the   */
/* gold to a tarnished tone, kill the hover. The button is still      */
/* visible (the user should know the affordance exists) but reads as  */
/* dormant rather than active. Doug 5/31/26 PM round 16, commit 59:   */
/* the label itself now reads 'Not Yet' (commit 58), so the           */
/* not-allowed cursor was redundant noise -- it read as 'broken'      */
/* when the button is just doing a different job. Cursor falls back   */
/* to default; aria-disabled still carries the a11y signal.            */
/* ------------------------------------------------------------------ */
.mobile-nav__row--reckon[data-gate-locked="true"] {
  background: color-mix(in oklab, var(--color-reckon-bg) 35%, #1a0606 65%);
  color: color-mix(in oklab, var(--color-reckon-fg) 40%, transparent 60%);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-reckon-edge) 35%, transparent 65%);
  cursor: default;
  opacity: 0.55;
}
.mobile-nav__row--reckon[data-gate-locked="true"]:hover,
.mobile-nav__row--reckon[data-gate-locked="true"]:active {
  /* Suppress all hover/active feedback so the button visibly does not
     respond to clicks. */
  background: color-mix(in oklab, var(--color-reckon-bg) 35%, #1a0606 65%);
  color: color-mix(in oklab, var(--color-reckon-fg) 40%, transparent 60%);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-reckon-edge) 35%, transparent 65%);
}
.mobile-nav__row--reckon[data-gate-locked="true"] .mobile-nav__row-icon,
.mobile-nav__row--reckon[data-gate-locked="true"] .mobile-nav__row-label {
  color: color-mix(in oklab, var(--color-reckon-fg) 40%, transparent 60%);
}


/* ------------------------------------------------------------------ */
/* FREE TIER GATE OVERLAY  (Doug 5/26/26 PM)                          */
/*                                                                    */
/* When an anonymous visitor hits the 10-pair conversation limit, the */
/* server returns 402 from /api/chat (or { gated:true } from          */
/* /api/preauth/status on boot) and chat.js hides the composer + mounts*/
/* this overlay. It is intentionally NOT a hard modal — we keep the    */
/* transcript readable behind it (the conversation they just had is   */
/* the whole point), and the backdrop is a soft fade, not an opaque    */
/* curtain. The decision is "sign up" or "maybe later"; the card sits  */
/* low + centered so it reads as an invitation, not an alert.          */
/* ------------------------------------------------------------------ */
.gabriel-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-6) var(--space-4) calc(var(--space-8) + env(safe-area-inset-bottom));
  background: linear-gradient(
    to top,
    color-mix(in oklab, var(--color-bg) 92%, transparent) 0%,
    color-mix(in oklab, var(--color-bg) 70%, transparent) 60%,
    transparent 100%
  );
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
  animation: gabriel-gate-fade-in 240ms ease-out;
  pointer-events: auto;
}
@keyframes gabriel-gate-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gabriel-gate-card {
  max-width: 36rem;
  width: 100%;
  background: var(--color-surface);
  border: 1px solid color-mix(in oklab, var(--color-text) 8%, transparent);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-6) var(--space-5);
  box-shadow: 0 12px 40px -12px color-mix(in oklab, var(--color-text) 22%, transparent);
}
.gabriel-gate-body p {
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text);
  margin: 0 0 var(--space-3);
}
.gabriel-gate-body .gabriel-gate-tagline {
  font-style: italic;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}
.gabriel-gate-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.gabriel-gate-primary {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  color: var(--color-text);
  background: #f9f0d6;
  border: 1px solid color-mix(in oklab, #f9f0d6 70%, var(--color-primary) 30%);
  text-decoration: none;
  transition: background 160ms ease;
}
.gabriel-gate-primary:hover {
  background: #f3eccd;
  color: var(--color-text);
}
[data-theme='dark'] .gabriel-gate-primary {
  background: #f3eccd;
  color: #14130f;
  border-color: color-mix(in oklab, #f3eccd 70%, var(--color-primary) 30%);
}
[data-theme='dark'] .gabriel-gate-primary:hover { background: #fff5dc; }
.gabriel-gate-secondary {
  appearance: none;
  background: transparent;
  border: none;
  font-family: var(--font-app);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  transition: color 160ms ease, background 160ms ease;
}
.gabriel-gate-secondary:hover {
  color: var(--color-text);
  background: color-mix(in oklab, var(--color-text) 4%, transparent);
}
@media (max-width: 480px) {
  .gabriel-gate-card { padding: var(--space-5) var(--space-4) var(--space-4); border-radius: var(--radius-lg); }
  .gabriel-gate-actions { flex-direction: column-reverse; align-items: stretch; gap: var(--space-2); }
  .gabriel-gate-primary { justify-content: center; }
  .gabriel-gate-secondary { text-align: center; }
}

/* ---------------------------------------------------------------------------
   Doug 6/19/26 cosmetics:
   - Make .journal-date clickable when it doubles as the time-filter trigger.
   - Position the header-time-block on the left so its dropdown anchors below
     the journal-date instead of overflowing right.
   - .compose-dock__reckon: small left-aligned row above the textarea so the
     Reckoning trigger lives in the chat surface, not the header chrome.
   --------------------------------------------------------------------------- */
.journal-date--button {
  /* Strip the user-agent <button> chrome so the date reads as type, not UI.
     Keep the same baseline-aligned inline-flex from .journal-date itself. */
  background: transparent;
  border: 0;
  margin: 0;
  cursor: pointer;
  /* Subtle interactive hint — the chevron + cursor do most of the talking. */
  transition: color 160ms ease, opacity 160ms ease;
}
.journal-date--button:hover,
.journal-date--button:focus-visible {
  color: var(--color-text);
  outline: none;
}
.journal-date__chev {
  margin-left: 0.45em;
  opacity: 0.55;
  transform: translateY(0.05em);
  transition: transform 160ms ease, opacity 160ms ease;
}
.journal-date--button[aria-expanded="true"] .journal-date__chev {
  transform: translateY(0.05em) rotate(180deg);
  opacity: 0.85;
}

/* Left-side wrapper for the header-time-block so its absolute-positioned
   .header-time-menu anchors to the left under the date instead of the right. */
.header-time-block--left {
  position: relative;
  display: inline-flex;
  align-items: baseline;
}
.header-time-block--left .header-time-menu {
  /* Anchor below the journal-date and align to its left edge. */
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
}

/* Doug 11/15/26: swap the header sides on the date-bearing headers (index,
   space). "Doug is on the left and the date is on the right." The user pill
   cluster (Dream, moon, user chip) moves to the left edge and the journal
   date moves to the right edge. Visual-only via flex `order` so the DOM
   hooks stay put: dream.js still prepends into .site-header__side--right,
   mobile-nav.js still reads .site-header__side--left. row-reverse mirrors
   the pill cluster so the user chip sits at the outer edge (where the date
   was) and Dream stays brand-adjacent. Both dropdowns re-anchor to the
   edge they now live on so neither runs off-screen. */
.site-header:has(.header-time-block--left) > .site-header__side--left { order: 2; }
.site-header:has(.header-time-block--left) > .site-header__side--right {
  order: 0;
  flex-direction: row-reverse;
}
.site-header:has(.header-time-block--left) .header-time-block--left .header-time-menu {
  left: auto;
  right: 0;
}
.site-header:has(.header-time-block--left) .auth-slot .user-menu {
  right: auto;
  left: 0;
}

/* Reckoning strip: sits in the cream/wings area immediately ABOVE the
   white compose-dock. Doug 6/19/26 round 2: "reckoning should be in the
   wings area (gabriel space, not the user textarea, that is the users
   space)... reckoning just above like you had it in the good version".
   Sticky so it tracks the dock as the page scrolls; transparent so the
   wings background shows through. Hidden until auth.js reveals the
   [data-members-only] container. */
.reckon-strip {
  /* Normal flow: the .compose-dock below is position:sticky bottom:0 so
     the dock anchors to the viewport floor regardless of where this
     strip sits in flow. The strip ends up immediately above the dock
     because they're adjacent siblings inside .stage. No sticky needed. */
  display: flex;
  /* c149 (Doug 6/19/26): "I would right justify it vs left". The pill
     now lands above the right end of the textarea where the mic / send
     controls sit. */
  justify-content: flex-end;
  /* Match .chatbox's max-width so the Reckoning sits at the same right
     edge as the textarea -- not flush against the page wings. */
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  /* c149 (Doug 6/19/26): "I would make it as tight as it was to the
     text area before". Drop the bottom padding so the pill kisses the
     top of the compose dock; keep zero horizontal padding so the pill
     aligns with the textarea's right edge. */
  padding: 0;
  background: transparent;
}
.reckon-strip[hidden] { display: none; }
.reckoning-trigger--compose {
  /* Override the .reckoning-trigger--compact icon-only sizing — in the
     compose dock we have horizontal room for the label, so show both. */
  padding: 4px 12px;
  gap: 6px;
}
.reckoning-trigger--compose .mobile-nav__row-label {
  /* Force-show the label even though sibling --compact rules hide it. */
  display: inline-flex !important;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* Night toggle sits between Dream and the user chip (the right cluster renders
   mirrored on the LEFT since Doug 11/15/26). Originally placed to balance the
   journal date on the far left. The bare class is a positional hook only —
   no visual overrides; the base .icon-btn styling carries through. */
.icon-btn--brand-adjacent {
  margin-left: var(--space-1);
}

/* c150 (Doug 6/19/26): "no + for files anything else to make that area
   breathe" -- hid attach + PiP-popout on mobile because they crowded the
   single-line composer.
   c151 (Doug 6/19/26): "Since that gives us extra space, lets reintroduce
   the + (versus paperclip)." The c151 compose-dock is now stacked (textarea
   on top, icons on a dedicated toolbar row below), so there's plenty of room
   for the [+]. Mobile attach is REVEALED again. The PiP popout stays hidden
   on phones (no second window to pop into). */
@media (max-width: 720px) {
  .chatbox__voice-popout,
  [data-voice-popout] {
    display: none !important;
  }
}
