/* ==========================================================================
   Eterniseed HTML port — globals.css
   --------------------------------------------------------------------------
   The universal structural layer. Loaded BEFORE any skin's theme.css.
   --------------------------------------------------------------------------
   Contents (kept in this fixed order — read top to bottom is read in load
   order, so skin overrides come AFTER everything here):
     1. Reset + box-sizing
     2. Universal scale tokens (spacing, radii, type-size, motion, z-index)
     3. Library-scoped scale overrides ([data-library="kid"])
     4. Body baseline + accessibility primitives
     5. Brand anchor (the logo container, fixed shape across skins)
     6. Typography baseline (h1-h6, p, a, img — skin-var consumers)
     7. BEM component primitives (every class in the structural contract)
   --------------------------------------------------------------------------
   §10.1 anti-pattern guard: if you add a rule here that is OPINIONATED
   about a single skin's look (a specific color, a specific font choice,
   a specific shadow strength), it belongs in theme.css instead. globals
   defines STRUCTURE; skins define EXPRESSION.
   ========================================================================== */

/* Self-hosted reading-font roster (OFL/Apache; generated by
   tools/source_fonts.js → web_html_port/fonts/). MUST stay at the top of this
   file: a CSS @import is only honored when it precedes all style rules.
   font-display:swap + lazy @font-face fetch means unused faces cost nothing. */
@import url('/fonts/fonts.css');

/* ──────────────────────────────────────────────────────────────────────────
   1. Reset
   ────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { background: none; border: none; padding: 0; font: inherit; cursor: pointer; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
img, svg, video { max-width: 100%; height: auto; display: block; }
/* HTML [hidden] vs class display: e.g. <p class="alert" hidden> — class
   selectors with explicit display (.alert { display: flex }) tie with
   the UA's [hidden] selector at (0,1,0) specificity but win on cascade
   order, so empty [data-…-error] stubs render as a thin colored bar
   pre-population. Make [hidden] authoritative. */
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }

/* ──────────────────────────────────────────────────────────────────────────
   2. Universal scale tokens
   ────────────────────────────────────────────────────────────────────────── */
:root {
  /* Spacing — 2/4/6/8/10/12/14/16/20/24/32/40/48 grid */
  --space-1:                   2px;
  --space-2:                   4px;
  --space-3:                   6px;
  --space-4:                   8px;
  --space-5:                   10px;
  --space-6:                   12px;
  --space-7:                   14px;
  --space-8:                   16px;
  --space-9:                   20px;
  --space-10:                  24px;
  --space-11:                  32px;
  --space-12:                  40px;
  --space-13:                  48px;

  /* Border radii */
  --radius-xs:                 4px;
  --radius-sm:                 6px;
  --radius-md:                 8px;
  --radius-lg:                 10px;
  --radius-xl:                 12px;
  --radius-2xl:                14px;
  --radius-3xl:                16px;
  --radius-4xl:                20px;
  --radius-5xl:                24px;
  --radius-pill:               9999px;

  /* Type size scale (skin chooses families; scale is universal) */
  --text-xs:                   12px;
  --text-sm:                   13px;
  --text-base:                 14px;
  --text-md:                   16px;
  --text-lg:                   18px;
  --text-xl:                   20px;
  --text-2xl:                  22px;
  --text-3xl:                  24px;
  --text-4xl:                  28px;
  --text-display:              32px;
  --text-display-lg:           48px;

  /* Line heights + letter spacing */
  --leading-tight:             1.3;
  --leading-snug:              1.4;
  --leading-normal:            1.5;
  --leading-relaxed:           1.6;
  --leading-loose:             1.7;
  --leading-scripture:         1.8;
  --tracking-tight:            -0.5px;
  --tracking-normal:           0;
  --tracking-wide:             0.2px;
  --tracking-wider:            0.5px;
  --tracking-widest:           0.6px;

  /* Motion */
  --motion-instant:            120ms;
  --motion-fast:               200ms;
  --motion-normal:             300ms;
  --motion-slow:               400ms;
  --motion-hero:               800ms;
  --easing:                    cubic-bezier(0.22, 0.61, 0.36, 1);
  --easing-inout:              cubic-bezier(0.45, 0.05, 0.55, 0.95);

  /* Z-index */
  --z-base:                    0;
  --z-raised:                  10;
  --z-nav:                     50;
  --z-overlay:                 100;
  --z-modal:                   200;
  --z-toast:                   300;
  --z-debug:                   9000;

  /* Layout */
  --content-max-width:         1080px;
  --tap-target-min:            44px;
  --form-max-width:            480px;
  --bottom-nav-height:         64px;
}

/* ──────────────────────────────────────────────────────────────────────────
   3. Library-scoped scale overrides
   Kid library gets larger tap targets + a touch tighter content width
   for less overwhelm. Adult uses defaults.
   ────────────────────────────────────────────────────────────────────────── */
[data-library="kid"] {
  --tap-target-min:            56px;
  --content-max-width:         920px;
  --bottom-nav-height:         72px;
  /* Larger default text in kid library */
  --text-base:                 16px;
  --text-md:                   18px;
  --text-lg:                   20px;
}

/* ──────────────────────────────────────────────────────────────────────────
   4. Body baseline + accessibility
   ────────────────────────────────────────────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Native control theming must follow the APP's theme, not the OS. The skin sets
   [data-theme] on <html>; without an explicit color-scheme the browser paints native
   controls in the OS scheme — so a native <input type="date"> renders dark mm/dd/yyyy
   text + a dark calendar-picker icon on the dark --skin-surface-sunken field, going
   invisible whenever the app is in dark mode while the OS is light (the auth-age-gate
   DOB report, 2026-06-06). color-scheme is inherited from :root, so this one rule
   themes EVERY native control app-wide (date/time inputs, selects, checkboxes,
   scrollbars). */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--skin-bg);
  color: var(--skin-ink-primary);
  font-family: var(--skin-font-body);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lesson Audio Arc §2.2 — body-reading surfaces honor user_settings.font_family
   via the --reader-font-family custom property set by preferences.js. Display
   chrome (skin-token --skin-font-display) stays put. Falls back to skin-token
   body font when no pref set. The reader-font roster's @font-face declarations
   are self-hosted at /fonts/fonts.css (imported at the TOP of this file — an
   @import after rules is silently dropped by the CSS spec, which is exactly why
   the prior mid-file Google CDN import never loaded and every choice fell back
   to serif). Roster: web_html_port/scripts/components/font-families.js. */

[data-reader-body],
[data-lesson-body],
[data-curriculum-lesson-body],
.curriculum-beat__body,
.scripture,
.reader-body,
.lesson-detail__body,
.community-post__body {
  font-family: var(--reader-font-family, var(--skin-font-body));
}

/* Lesson Audio Arc §2.6 — lesson-audio component (kid + adult lessons). */
.lesson-audio {
  display: block;
  margin: var(--space-7, 12px) 0;
}
.lesson-audio__row {
  display: flex;
  align-items: center;
  gap: var(--space-4, 8px);
  flex-wrap: wrap;
}
.lesson-audio__status {
  font-size: var(--text-sm);
  color: var(--skin-ink-secondary);
}
.lesson-audio__status--error {
  color: var(--skin-error, #c0392b);
}
.lesson-audio__audio {
  display: none;
}

*:focus-visible {
  outline: 2px solid var(--skin-accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

[tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  border: 0; overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   5. Brand anchor
   The logo container shape is fixed across all skins. The image inside
   is per-skin (via THEME_INFO.json's assets.logo path). data-skin-asset
   attribute on <img> resolves at runtime via skinAssetUrl().
   ────────────────────────────────────────────────────────────────────────── */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--skin-surface);
  overflow: hidden;
}
.brand-mark--xs { width: 32px; height: 32px; }
.brand-mark--sm { width: 40px; height: 40px; }
.brand-mark--md { width: 56px; height: 56px; }
.brand-mark--lg { width: 80px; height: 80px; }
.brand-mark--xl { width: 120px; height: 120px; }
.brand-mark__img {
  width: 100%; height: 100%;
  object-fit: cover;
}
img.brand-mark {
  /* When the brand-mark class is on the <img> itself (e.g. data-skin-asset
     usage), the img provides its own pixel content — strip the surface fill
     so the actual logo PNG is the only visible layer. */
  background: transparent;
  object-fit: cover;
}

/* ──────────────────────────────────────────────────────────────────────────
   6. Typography baseline
   ────────────────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--skin-font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--skin-ink-primary);
  letter-spacing: var(--tracking-tight);
}
h1 { font-size: var(--text-display); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { line-height: var(--leading-relaxed); }

a {
  color: var(--skin-accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--skin-accent-soft);
}
a:hover, a:focus {
  color: var(--skin-ink-primary);
  text-decoration-color: var(--skin-accent);
}

/* ──────────────────────────────────────────────────────────────────────────
   7. BEM component primitives
   Every class here consumes --skin-* variables. Skins do NOT override
   these rules; skins only redefine the variables.
   --------------------------------------------------------------------------
   Component contract — see SITE_SKIN_CONTRACT.md §2 for the canonical
   list with descriptions. Order matches the contract.
   ────────────────────────────────────────────────────────────────────────── */

/* ─── 7.1 Layout containers ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: var(--space-8);
}

.stack > * + * { margin-top: var(--space-8); }
.stack--sm > * + * { margin-top: var(--space-4); }
.stack--lg > * + * { margin-top: var(--space-10); }
.stack--xl > * + * { margin-top: var(--space-13); }

.row {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--wrap { flex-wrap: wrap; }

.grid { display: grid; gap: var(--space-8); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

@media (max-width: 640px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .container { padding-inline: var(--space-6); }
  /* Admin data tables → horizontally scrollable on phones instead of blowing
     out the page width. The admin substrate is desktop-first; multi-column
     tables can't reflow, so make them scroll within their container rather than
     overflow the viewport (2026-06-09 mobile pass). Scoped to admin table
     classes so the mobile-clean consumer pages are untouched. */
  .obs-table, .acct-table, .bl-table, .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
}

/* ─── 7.2 Button ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  min-height: var(--tap-target-min);
  padding: var(--space-5) var(--space-9);
  border-radius: var(--radius-xl);
  font-family: var(--skin-font-body);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  cursor: pointer;
  transition: transform var(--motion-fast) var(--easing),
              box-shadow var(--motion-fast) var(--easing),
              background var(--motion-fast) var(--easing);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn[hidden] { display: none; }

.btn--primary {
  background: var(--skin-brand-mark);
  color: var(--skin-ink-on-brand);
}
.btn--primary:hover { background: var(--skin-brand-mark-soft); }

.btn--accent {
  background: var(--skin-accent);
  color: var(--skin-ink-on-accent);
}
.btn--accent:hover { background: var(--skin-accent-soft); }

.btn--outline {
  background: transparent;
  color: var(--skin-ink-primary);
  border: 1.5px solid var(--skin-border-strong);
}
.btn--outline:hover { border-color: var(--skin-ink-primary); background: var(--skin-accent-tint-bg); }

.btn--ghost {
  background: transparent;
  color: var(--skin-ink-secondary);
}
.btn--ghost:hover { color: var(--skin-ink-primary); background: var(--skin-accent-tint-bg); }

.btn--danger {
  background: var(--skin-danger);
  color: #FFFFFF;
}

.btn--sm { padding: var(--space-3) var(--space-7); font-size: var(--text-sm); min-height: 36px; }
.btn--lg { padding: var(--space-7) var(--space-11); font-size: var(--text-lg); min-height: 56px; }
.btn--block { display: flex; width: 100%; }

/* Kid library — buttons are softer, rounder, more tactile */
[data-library="kid"] .btn {
  border-radius: var(--radius-4xl);
  font-weight: 700;
  box-shadow: var(--skin-shadow-card);
}
[data-library="kid"] .btn:hover { box-shadow: var(--skin-shadow-elevated); }

/* ─── 7.3 Card ──────────────────────────────────────────────────────────── */
.card {
  background: var(--skin-surface);
  border-radius: var(--radius-3xl);
  padding: var(--space-10);
  box-shadow: var(--skin-shadow-card);
}
.card--elevated { box-shadow: var(--skin-shadow-elevated); }
.card--featured { border-top: 4px solid var(--skin-accent); }
.card--ghost { background: transparent; box-shadow: none; border: 1px solid var(--skin-border); }
.card__header { margin-bottom: var(--space-6); }
.card__title { font-family: var(--skin-font-display); font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.card__subtitle { color: var(--skin-ink-secondary); font-size: var(--text-base); }
.card__body { color: var(--skin-ink-secondary); }
.card__footer { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--skin-divider); }

/* ─── 7.4 Tile (home grid items) ────────────────────────────────────────── */
.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-9);
  background: var(--skin-surface);
  border-radius: var(--radius-3xl);
  box-shadow: var(--skin-shadow-card);
  cursor: pointer;
  transition: transform var(--motion-fast) var(--easing),
              box-shadow var(--motion-fast) var(--easing);
  color: inherit;
  text-decoration: none;
  min-height: 140px;
  position: relative;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--skin-shadow-elevated); }
.tile:active { transform: translateY(0); }
.tile__icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--skin-accent-tint-bg);
  border-radius: var(--radius-xl);
  color: var(--skin-accent-strong);
  font-size: var(--text-xl);
}
.tile__title {
  font-family: var(--skin-font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--skin-ink-primary);
}
.tile__caption {
  color: var(--skin-ink-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* Tile color variants — accent rail on the left */
.tile--gold { background: linear-gradient(135deg, var(--skin-accent-tint-bg), var(--skin-surface)); }
.tile--teal { background: linear-gradient(135deg, var(--skin-info-soft), var(--skin-surface)); }
.tile--success { background: linear-gradient(135deg, var(--skin-success-soft), var(--skin-surface)); }

[data-library="kid"] .tile {
  border-radius: var(--radius-5xl);
  min-height: 180px;
  padding: var(--space-10);
}
[data-library="kid"] .tile__icon { width: 64px; height: 64px; font-size: var(--text-3xl); }
[data-library="kid"] .tile__title { font-size: var(--text-2xl); }

/* ─── 7.5 Pill / badge ──────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-7);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  background: var(--skin-surface-sunken);
  color: var(--skin-ink-secondary);
  border: 1px solid var(--skin-border);
}
.pill--accent { background: var(--skin-accent-tint-bg); color: var(--skin-ink-primary); border-color: var(--skin-accent-soft); }
.pill--success { background: var(--skin-success-soft); color: var(--skin-ink-primary); border-color: transparent; }
.pill--warning { background: var(--skin-warning-soft); color: var(--skin-ink-primary); border-color: transparent; }
.pill--danger { background: var(--skin-danger-soft); color: var(--skin-ink-primary); border-color: transparent; }
.pill--info { background: var(--skin-info-soft); color: var(--skin-ink-primary); border-color: transparent; }
.pill--brand { background: var(--skin-brand-mark); color: var(--skin-ink-on-brand); border-color: transparent; }
/* Dark-mode pill legibility (Joe 2026-06-03): the soft-tint pill backgrounds are
   10-18% washes that vanish over the dark surface, so chips read as faint
   floating text (the transparent-border variants worst of all). Give every pill
   a visible boundary and composite its color hint over the opaque sunken surface
   so each badge is a clear, legible chip with high-contrast text. */
[data-theme="dark"] .pill { border-color: var(--skin-border); }
[data-theme="dark"] .pill--accent  { background: linear-gradient(var(--skin-accent-tint-bg), var(--skin-accent-tint-bg)), var(--skin-surface-sunken); border-color: var(--skin-accent-soft); }
[data-theme="dark"] .pill--info     { background: linear-gradient(var(--skin-info-soft),    var(--skin-info-soft)),    var(--skin-surface-sunken); }
[data-theme="dark"] .pill--success  { background: linear-gradient(var(--skin-success-soft), var(--skin-success-soft)), var(--skin-surface-sunken); }
[data-theme="dark"] .pill--warning  { background: linear-gradient(var(--skin-warning-soft), var(--skin-warning-soft)), var(--skin-surface-sunken); }
[data-theme="dark"] .pill--danger   { background: linear-gradient(var(--skin-danger-soft),  var(--skin-danger-soft)),  var(--skin-surface-sunken); }
.pill__dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-pill);
  background: currentColor;
}
.pill--option {
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.pill--option:hover { border-color: var(--skin-accent-soft); }
.pill--option:focus-within {
  outline: 2px solid var(--skin-accent);
  outline-offset: 2px;
}
.pill--option:has(input:checked) {
  background: var(--skin-accent-tint-bg);
  color: var(--skin-ink-primary);
  border-color: var(--skin-accent);
}

/* ─── 7.6 Modal / sheet ─────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}
.modal[data-open="true"] { display: flex; }
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}
.modal__panel {
  position: relative;
  background: var(--skin-surface-elevated);
  border-radius: var(--radius-3xl);
  padding: var(--space-11);
  max-width: 560px;
  width: 100%;
  max-height: 90dvh;
  overflow: auto;
  box-shadow: var(--skin-shadow-float);
  animation: modalIn var(--motion-normal) var(--easing);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal__header { margin-bottom: var(--space-8); }
.modal__title { font-family: var(--skin-font-display); font-size: var(--text-2xl); }
.modal__body { color: var(--skin-ink-secondary); }
.modal__footer { display: flex; gap: var(--space-4); justify-content: flex-end; margin-top: var(--space-10); padding-top: var(--space-6); border-top: 1px solid var(--skin-divider); }
.modal__close {
  position: absolute; top: var(--space-6); right: var(--space-6);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--skin-ink-tertiary);
  background: transparent;
}
.modal__close:hover { background: var(--skin-surface-sunken); color: var(--skin-ink-primary); }

/* ─── 7.7 Form field ────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--space-3); }
.field__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--skin-ink-primary);
}
.field__input,
.field__textarea,
.field__select {
  width: 100%;
  min-height: var(--tap-target-min);
  padding: var(--space-5) var(--space-7);
  background: var(--skin-surface-sunken);
  color: var(--skin-ink-primary);
  border: 1.5px solid var(--skin-border);
  border-radius: var(--radius-xl);
  font-family: var(--skin-font-body);
  font-size: var(--text-md);
  transition: border-color var(--motion-fast) var(--easing),
              box-shadow var(--motion-fast) var(--easing);
}
.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  outline: none;
  border-color: var(--skin-accent);
  box-shadow: var(--skin-shadow-focus-ring);
}
.field__textarea { min-height: 120px; resize: vertical; line-height: var(--leading-relaxed); }
.field__hint { color: var(--skin-ink-tertiary); font-size: var(--text-sm); }
.field__error { color: var(--skin-danger); font-size: var(--text-sm); font-weight: 600; }
/* α.K addendum 2026-05-13: hide .field__error when JS has not written textContent.
   Previously each template carried an inline style="display: none;" plus JS that
   was expected to toggle display on error. auth.js (login/register handler) only
   wrote textContent and never flipped display — invisible errors. The :empty
   selector hides while blank, shows once populated, no JS toggle needed.
   Templates that already flip style.display via JS (forgot-password, reset-
   password, age-gate, chat, co-parents, kids-home, kids-picker, account-request-
   deletion) keep working: inline style.display='block' wins on specificity when
   populated; :empty doesn't match populated nodes anyway. */
.field__error:empty { display: none; }
.field--error .field__input,
.field--error .field__textarea,
.field--error .field__select { border-color: var(--skin-danger); }

.field--checkbox { flex-direction: row; align-items: flex-start; gap: var(--space-5); }
.field--checkbox .field__label { font-weight: 400; color: var(--skin-ink-secondary); cursor: pointer; }
.field--checkbox input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--skin-accent); margin-top: 3px; flex: 0 0 auto; }

/* ─── 7.8 Toggle switch ─────────────────────────────────────────────────── */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  cursor: pointer;
}
.toggle__input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track {
  width: 44px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--skin-border-strong);
  position: relative;
  transition: background var(--motion-fast) var(--easing);
  flex: 0 0 auto;
}
.toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--skin-surface-elevated);
  box-shadow: var(--skin-shadow-card);
  transition: left var(--motion-fast) var(--easing);
}
.toggle__input:checked + .toggle__track { background: var(--skin-accent); }
.toggle__input:checked + .toggle__track .toggle__thumb { left: 21px; }
.toggle__label { color: var(--skin-ink-primary); font-size: var(--text-md); }

/* ─── 7.9 Divider ───────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  border: none;
  background: var(--skin-divider);
  margin: var(--space-9) 0;
}

/* ─── 7.10 Section card (the EterniseedSectionCard equivalent) ──────────── */
.section-card {
  background: var(--skin-surface);
  border-radius: var(--radius-3xl);
  padding: var(--space-10);
  box-shadow: var(--skin-shadow-card);
}
.section-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}
.section-card__icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--skin-accent-tint-bg);
  color: var(--skin-accent-strong);
  border-radius: var(--radius-xl);
}
.section-card__title { font-family: var(--skin-font-display); font-size: var(--text-xl); font-weight: 700; }
.section-card__subtitle { color: var(--skin-ink-secondary); font-size: var(--text-sm); margin-top: var(--space-2); }
.section-card__body { color: var(--skin-ink-secondary); }

/* ─── 7.11 List tile (the EterniseedListTile equivalent) ────────────────── */
.list-tile {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  padding: var(--space-7) var(--space-8);
  background: transparent;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: background var(--motion-fast) var(--easing);
  color: inherit;
  text-decoration: none;
  width: 100%;
  text-align: left;
}
.list-tile:hover { background: var(--skin-accent-tint-bg); }
.list-tile__leading {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: var(--skin-ink-secondary);
}
.list-tile__content { flex: 1 1 auto; min-width: 0; }
.list-tile__title { font-size: var(--text-md); font-weight: 600; color: var(--skin-ink-primary); }
.list-tile__subtitle { font-size: var(--text-sm); color: var(--skin-ink-secondary); margin-top: var(--space-1); }
.list-tile__trailing { color: var(--skin-ink-tertiary); flex: 0 0 auto; }
/* Phase C Tail Closure 2026-05-27 (N2): explicit action pill for tiles
   whose chevron-only affordance is too subtle — the font-picker tile is
   one such case. Pill renders inline before the chevron, signals
   interactivity, complements the title's action-oriented copy. */
.list-tile__action-pill {
  flex: 0 0 auto;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--skin-accent-tint-bg);
  color: var(--skin-accent-strong);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.list-tile[hidden] { display: none; }

/* ─── 7.12 Screen header ────────────────────────────────────────────────── */
.screen-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-7);
  padding: var(--space-10) 0;
}
.screen-header__icon {
  width: 56px; height: 56px;
  flex: 0 0 auto;
  background: var(--skin-accent-tint-bg);
  color: var(--skin-accent-strong);
  border-radius: var(--radius-2xl);
  display: flex; align-items: center; justify-content: center;
}
.screen-header__content { flex: 1 1 auto; }
.screen-header__title { font-family: var(--skin-font-display); font-size: var(--text-3xl); font-weight: 700; }
.screen-header__subtitle { color: var(--skin-ink-secondary); font-size: var(--text-md); margin-top: var(--space-3); }

/* ─── 7.13 Bottom nav (5-tab adult bar) ─────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  background: var(--skin-surface-elevated);
  border-top: 1px solid var(--skin-border);
  box-shadow: var(--skin-shadow-nav);
  padding: var(--space-2) 0 max(var(--space-2), env(safe-area-inset-bottom));
}
.bottom-nav__inner {
  max-width: var(--content-max-width);
  margin-inline: auto;
  display: flex;
  align-items: stretch;
}
.bottom-nav__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-2);
  min-height: var(--bottom-nav-height);
  color: var(--skin-ink-secondary);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  transition: color var(--motion-fast) var(--easing);
}
.bottom-nav__item:hover { color: var(--skin-ink-primary); }
.bottom-nav__item--active { color: var(--skin-accent-strong); }
.bottom-nav__icon { font-size: var(--text-xl); }
.bottom-nav__label { line-height: 1; }
.bottom-nav__item { position: relative; }
.bottom-nav__badge {
  position: absolute;
  top: var(--space-3);
  right: 50%;
  transform: translateX(220%);
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--skin-accent-strong);
  color: var(--skin-ink-on-brand, #fff);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  letter-spacing: 0;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--skin-surface-elevated);
}

/* ─── 7.14 Floating action button (Feedback FAB) ────────────────────────── */
.fab {
  position: fixed;
  z-index: calc(var(--z-nav) + 1);
  bottom: calc(var(--bottom-nav-height) + var(--space-7));
  right: var(--space-9);
  width: 56px; height: 56px;
  border-radius: var(--radius-pill);
  background: var(--skin-brand-mark);
  color: var(--skin-ink-on-brand);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--skin-shadow-float);
  cursor: pointer;
  transition: transform var(--motion-fast) var(--easing),
              box-shadow var(--motion-fast) var(--easing);
}
.fab:hover { transform: translateY(-2px); }
.fab:active { transform: translateY(0); }
.fab__icon { font-size: var(--text-xl); }

/* When no bottom nav, FAB sits at viewport bottom */
.fab--no-nav { bottom: var(--space-9); }

/* ─── 7.15 Brand chrome (logo placement helpers) ────────────────────────── */
.brand-row {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.brand-row__name {
  font-family: var(--skin-font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--skin-ink-primary);
}

/* ─── 7.16 Skin-attributed gradient surfaces ────────────────────────────── */
.surface-gradient-warm { background: var(--skin-gradient-warm); }
.surface-gradient-brand { background: var(--skin-gradient-brand); color: var(--skin-ink-on-brand); }
.surface-gradient-accent { background: var(--skin-gradient-accent); color: var(--skin-ink-on-accent); }

/* ─── 7.17 Toast / inline alert ─────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  padding: var(--space-7) var(--space-9);
  border-radius: var(--radius-xl);
  background: var(--skin-info-soft);
  color: var(--skin-info);
  border-left: 4px solid var(--skin-info);
}
.alert--success { background: var(--skin-success-soft); color: var(--skin-success); border-left-color: var(--skin-success); }
.alert--warning { background: var(--skin-warning-soft); color: var(--skin-warning); border-left-color: var(--skin-warning); }
.alert--danger { background: var(--skin-danger-soft); color: var(--skin-danger); border-left-color: var(--skin-danger); }
.alert__icon { font-size: var(--text-xl); flex: 0 0 auto; }
.alert__body { flex: 1 1 auto; color: var(--skin-ink-primary); }
.alert__title { font-weight: 700; margin-bottom: var(--space-1); }

/* ─── 7.18 Loading spinner ──────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--skin-border);
  border-top-color: var(--skin-accent);
  border-radius: var(--radius-pill);
  animation: spin var(--motion-hero) linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner--lg { width: 40px; height: 40px; border-width: 4px; }

/* ─── 7.19 Body content padding (when bottom-nav present) ───────────────── */
.app-shell--with-nav { padding-bottom: calc(var(--bottom-nav-height) + var(--space-9)); }

/* ─── 7.20 Eyebrow / kicker text ────────────────────────────────────────── */
.eyebrow {
  font-family: var(--skin-font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--skin-accent-strong);
}

/* ─── 7.21 Scripture text (for Bible reader) ────────────────────────────── */
/* Pre-Phase-D defect sweep 2026-05-27 (D3): --reader-font-family wins over
   skin-font-scripture so the user's font_family pref applies to verse body.
   Without this, the .scripture rule wins the cascade (later in source order)
   and locks the scripture font to skin-token Literata; the body-reading
   surface rule at line ~173 never reaches the verse element. */
.scripture {
  font-family: var(--reader-font-family, var(--skin-font-scripture));
  font-size: var(--text-lg);
  line-height: var(--leading-scripture);
  color: var(--skin-ink-primary);
}
.scripture__verse-num {
  font-family: var(--skin-font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--skin-accent-strong);
  vertical-align: super;
  margin-right: var(--space-2);
}

/* ─── 7.22 Inline audio (Daily Verse, Guide replies, lessons, museum) ──── */
/* Hosted on any element with [data-inline-audio]; the script paints a
   button + hidden audio + status. Defaults are skin-aware so the player
   inherits surface tones. Use modifier classes per-surface for tweaks. */
.inline-audio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  vertical-align: middle;
}
.inline-audio__btn {
  display: inline-flex; align-items: center;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  border: 1px solid var(--skin-divider, currentColor);
  background: transparent;
  color: inherit;
  font-family: var(--skin-font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--motion-fast) var(--easing),
              opacity var(--motion-fast) var(--easing);
}
.inline-audio__btn:hover { background: rgba(0,0,0,0.06); }
.inline-audio__btn:disabled { opacity: 0.6; cursor: progress; }
.inline-audio__rewind {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--skin-divider, currentColor);
  background: transparent;
  color: inherit;
  font-size: var(--text-base);
  line-height: 1;
  cursor: pointer;
  transition: background var(--motion-fast) var(--easing);
}
.inline-audio__rewind:hover { background: rgba(0,0,0,0.06); }
.inline-audio__rewind[hidden] { display: none; }
.inline-audio__error {
  font-size: var(--text-xs);
  color: var(--skin-error, #6a1f1f);
}
.inline-audio__el { display: none; }

/* Variant: solid (for Daily Verse hero where button sits over a gold gradient) */
.inline-audio--solid .inline-audio__btn {
  background: rgba(255,255,255,0.20);
  border-color: rgba(255,255,255,0.45);
  color: var(--skin-ink-on-accent);
}
.inline-audio--solid .inline-audio__btn:hover { background: rgba(255,255,255,0.32); }
.inline-audio--solid .inline-audio__rewind {
  background: rgba(255,255,255,0.20);
  border-color: rgba(255,255,255,0.45);
  color: var(--skin-ink-on-accent);
}
.inline-audio--solid .inline-audio__rewind:hover { background: rgba(255,255,255,0.32); }
.inline-audio--solid .inline-audio__error { color: rgba(255,255,255,0.85); }

/* ─── 7.99 Circles (Batch 3 Cluster A) ─────────────────────────────────────
   Family-directory aesthetic — kid rows softer-accented, oversight pills
   read at a glance. Tokens only; no hardcoded colors. */
.circle-vis-badge {
  display: inline-flex; align-items: center;
  padding: var(--space-1) var(--space-5);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid var(--skin-divider, currentColor);
  color: var(--skin-ink-secondary);
  background: transparent;
  vertical-align: middle;
}
.circle-vis-badge--discoverable {
  background: var(--skin-accent-tint-bg);
  border-color: var(--skin-accent-soft);
  color: var(--skin-accent-strong);
}
.circle-vis-badge--private {
  background: transparent;
  color: var(--skin-ink-tertiary);
}

.circle-role-badge {
  display: inline-flex; align-items: center;
  padding: var(--space-1) var(--space-5);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--skin-accent-tint-bg);
  color: var(--skin-accent-strong);
  vertical-align: middle;
}
.circle-role-badge--moderator { opacity: 0.85; }

.circle-archived-pill {
  display: inline-flex; align-items: center;
  padding: var(--space-1) var(--space-5);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  background: transparent;
  color: var(--skin-ink-tertiary);
  border: 1px dashed var(--skin-divider, currentColor);
  vertical-align: middle;
}

.circle-member-count {
  color: var(--skin-ink-secondary);
}

.circle-empty {
  text-align: center;
  color: var(--skin-ink-tertiary);
  padding: var(--space-9);
}

.circle-member__avatar {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--skin-accent-tint-bg);
  color: var(--skin-accent-strong);
  font-weight: 700;
  font-size: var(--text-md);
}
.circle-member__avatar--anon {
  background: transparent;
  color: var(--skin-ink-tertiary);
  border: 1px dashed var(--skin-divider, currentColor);
}
.circle-member__avatar--kid {
  /* Soft accent — parental-oversight signal, not infantilizing. */
  background: var(--skin-surface);
  color: var(--skin-accent-strong);
  outline: 2px solid var(--skin-accent-soft);
  outline-offset: -2px;
}

.circle-member--kid .list-tile__title { color: var(--skin-ink-primary); }
.circle-member__unnamed {
  color: var(--skin-ink-tertiary);
  font-style: italic;
  font-weight: 500;
}

/* ── Circle member rows — breathing room (Joe 2026-06-14: "text crammed") ──── */
/* The rows are a family directory, not clickable list items: kill the
   inherited pointer cursor + hover wash, top-align the kid avatar against its
   taller oversight block, and separate adjacent members with a soft rule. */
.circle-member { cursor: default; align-items: flex-start; padding-block: var(--space-6); }
.circle-member:hover { background: transparent; }
.circle-member + .circle-member { border-top: 1px solid var(--skin-divider); }
/* Stack the name above the "role · joined" line. The spans are inline by
   default, so without a column they render jammed together ("ScarlettKid ·
   joined" — Joe 2026-06-14). Column + the subtitle's margin-top gives the gap. */
.circle-member .list-tile__content { display: flex; flex-direction: column; padding-top: var(--space-1); }

/* Read-only oversight pills (shown to a non-parent circle owner). */
.circle-member__oversight {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  margin-top: var(--space-5);
}
.oversight-pill {
  display: inline-flex; align-items: center;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid var(--skin-divider, currentColor);
  color: var(--skin-ink-secondary);
  background: transparent;
}
.oversight-pill--on {
  background: var(--skin-accent-tint-bg);
  border-color: var(--skin-accent-soft);
  color: var(--skin-accent-strong);
}
.oversight-pill--off {
  opacity: 0.7;
  color: var(--skin-ink-tertiary);
}

/* Editable oversight cluster (shown to the kid's parent) — a tidy settings
   card of labeled switches, one control per line, well-spaced. */
.circle-member__oversight--editable {
  display: block;
  margin-top: var(--space-5);
  padding: var(--space-5) var(--space-6) var(--space-4);
  background: var(--skin-surface-soft, var(--skin-accent-tint-bg));
  border: 1px solid var(--skin-divider);
  border-radius: var(--radius-lg, 12px);
}
.circle-member__oversight-heading {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--skin-ink-tertiary);
  margin-bottom: var(--space-2);
}
.circle-member__oversight-status {
  display: block;
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--skin-ink-tertiary);
}
.circle-member__oversight-status--ok  { color: var(--skin-accent-strong); }
.circle-member__oversight-status--err { color: var(--skin-danger, #c0392b); }

/* The switch row: label left, toggle right. Native checkbox visually hidden
   but keyboard- + a11y-live. */
.oversight-switch {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-4) 0;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--skin-ink-primary);
}
.oversight-switch + .oversight-switch { border-top: 1px solid var(--skin-divider); }
.oversight-switch__label { flex: 1 1 auto; }
.oversight-switch__input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
  margin: 0; pointer-events: none;
}
.oversight-switch__track {
  flex: 0 0 auto;
  width: 42px; height: 24px;
  border-radius: var(--radius-pill);
  background: var(--skin-divider);
  position: relative;
  transition: background var(--motion-fast) var(--easing);
}
.oversight-switch__thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--skin-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform var(--motion-fast) var(--easing);
}
.oversight-switch__input:checked ~ .oversight-switch__track {
  background: var(--skin-accent-strong);
}
.oversight-switch__input:checked ~ .oversight-switch__track .oversight-switch__thumb {
  transform: translateX(18px);
}
.oversight-switch__input:focus-visible ~ .oversight-switch__track {
  outline: 2px solid var(--skin-accent-strong); outline-offset: 2px;
}
.oversight-switch__input:disabled ~ .oversight-switch__track { opacity: 0.5; }

.circle-card { display: block; }
.circle-description {
  font-size: var(--text-md);
  line-height: 1.5;
  padding: var(--space-3) 0 var(--space-7);
}

/* ─── α.2 SD-7 — Settings sub-page back-arrow + slider primitives ─── */

/* Sub-page back-arrow — small chevron link above the screen-header. */
.settings-back {
  display: inline-flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0;
  color: var(--skin-ink-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--motion-fast) var(--easing);
}
.settings-back:hover { color: var(--skin-ink-primary); }
.settings-back svg { width: 16px; height: 16px; }

/* Slider primitive — used at /settings/preferences (font_size) +
   /settings/bible (narration_speed) + /read cluster (both). */
.eterniseed-slider {
  display: flex; align-items: center; gap: var(--space-5);
  padding: var(--space-5) 0;
}
.eterniseed-slider__leading {
  flex: 0 0 auto;
  color: var(--skin-ink-secondary);
  font-weight: 600;
  min-width: 80px;
}
.eterniseed-slider__input {
  flex: 1 1 auto;
  -webkit-appearance: none; appearance: none;
  height: 4px;
  background: var(--skin-divider, rgba(44, 44, 44, 0.12));
  border-radius: var(--radius-pill);
  outline: none;
  cursor: pointer;
}
.eterniseed-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px;
  background: var(--skin-accent-strong);
  border: 0; border-radius: 50%;
  cursor: pointer;
  transition: transform var(--motion-fast) var(--easing);
}
.eterniseed-slider__input::-moz-range-thumb {
  width: 22px; height: 22px;
  background: var(--skin-accent-strong);
  border: 0; border-radius: 50%;
  cursor: pointer;
}
.eterniseed-slider__input:focus-visible::-webkit-slider-thumb { transform: scale(1.15); }
.eterniseed-slider__value {
  flex: 0 0 auto;
  color: var(--skin-ink-primary);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 56px;
  text-align: right;
}
[data-theme="dark"] .eterniseed-slider__input::-webkit-slider-thumb { background: var(--skin-accent); }
[data-theme="dark"] .eterniseed-slider__input::-moz-range-thumb { background: var(--skin-accent); }

/* Reduced-motion: disable thumb scale-up. */
@media (prefers-reduced-motion: reduce) {
  .eterniseed-slider__input::-webkit-slider-thumb { transition: none; }
}
