/* ============================================================
   Legacy Journal — Member-Selector + Conscious-Orb prototype.
   Landing-page DNA: italic Fraunces, fireplace gold on midnight,
   parchment ink overlays, slow ember breath. No flat pills, no
   bouncy springs, no card chrome — drift, fade, resolve.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: #000;                   /* PURE black so the hero PNG's
                                         alpha edges merge with the page */
  color: var(--lj-fg);
  font-family: var(--lj-font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  overscroll-behavior: none;
  position: fixed; inset: 0;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

/* ============================================================ */
/* AMBIENT ROOM — pure black void with sweeping forest-green     */
/* atmosphere. No brown, no warm cream — color comes from the    */
/* landing's forest palette and a cool moonlight kiss top-right. */
/* ============================================================ */
.lj-room {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: #000;
}
.lj-room-mesh {
  position: absolute; inset: -10%;
  background:
    /* forest mist along the bottom horizon — landing's `--lj-forest-mid` */
    radial-gradient(ellipse 100% 38% at 50% 105%, rgba(26, 44, 31, 0.55) 0%, transparent 72%),
    radial-gradient(ellipse 50% 32% at 22% 100%, rgba(13, 26, 16, 0.45) 0%, transparent 70%),
    radial-gradient(ellipse 50% 32% at 78% 100%, rgba(13, 26, 16, 0.40) 0%, transparent 70%),
    /* moonlight wash — top-right, cool */
    radial-gradient(ellipse 70% 60% at 82%  6%, rgba(200, 216, 255, 0.06) 0%, transparent 70%),
    /* secondary moonlight pinhole top-left for asymmetry */
    radial-gradient(ellipse 36% 40% at 12%  4%, rgba(220, 232, 255, 0.04) 0%, transparent 70%),
    /* slow diagonal forest shadow sweep, drives the gradient feel */
    linear-gradient(135deg, rgba(0, 0, 0, 0) 0%, rgba(13, 26, 16, 0.0) 35%, rgba(26, 44, 31, 0.20) 100%),
    /* base black */
    #000;
  filter: blur(0.4px);
  animation: lj-mesh-drift 38s linear infinite;
}
.lj-room-fog {
  /* slow drifting forest mist at the floor — pure forest, no warm tones */
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 18% at 30% 100%, rgba(20, 36, 24, 0.55), transparent 70%),
    radial-gradient(ellipse 70% 18% at 70% 100%, rgba(13, 26, 16, 0.45), transparent 70%);
  mix-blend-mode: screen;             /* additive light, not multiply: lifts
                                         the floor a hair without darkening */
  opacity: 0.65;
  animation: lj-fog-drift 42s ease-in-out infinite alternate;
}
.lj-room-noise {
  /* faint cool-cream grain — keeps surface from looking sterile */
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.28;
  mix-blend-mode: overlay;
  pointer-events: none;
}
@keyframes lj-mesh-drift {
  0%   { transform: translate(0, 0) scale(1.00); }
  50%  { transform: translate(2vw, -1vh) scale(1.03); }
  100% { transform: translate(0, 0) scale(1.00); }
}
@keyframes lj-fog-drift {
  0%   { transform: translateX(-2vw); }
  100% { transform: translateX( 2vw); }
}

/* ============================================================ */
/* Screen swap                                                    */
/* ============================================================ */
.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity 700ms var(--lj-ease-magical), visibility 0s linear 700ms;
  z-index: 1;
}
.screen.is-visible {
  pointer-events: auto;
  opacity: 1; visibility: visible;
  transition: opacity 700ms var(--lj-ease-magical), visibility 0s linear 0s;
}
[data-screen="session"]      { z-index: 4; background: #000; }
[data-screen="memories"]     { z-index: 4; }
[data-screen="sealing"]      { z-index: 5; background: #000; }
[data-screen="edit-sheet"],
[data-screen="edit-member"],
[data-screen="add-member"],
[data-screen="settings"]     { z-index: 6; }
[data-screen="lock"]         { z-index: 8; background: #000; }

/* ============================================================ */
/* LOCK SCREEN — canvas ember kindles into a tree silhouette, then  */
/* crossfades into nav. Pure black, no video, no old-tree leakage.  */
/* ============================================================ */
.lock-screen { display: grid; place-items: center; background: #000; }
.lock-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  background: #000;
}
.lock-title {
  position: absolute;
  top: 16vh;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  animation: lj-lock-title-rise 2200ms var(--lj-ease-magical) 600ms forwards;
}
.lock-eyebrow {
  display: block;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(28px, 4.5vw, 44px);
  color: var(--lj-cream);
  letter-spacing: 0.02em;
  text-shadow: var(--lj-glow-ember);
}
.lock-sub {
  display: block;
  margin-top: 8px;
  font-family: var(--lj-font-small-caps);
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--lj-gold);
  text-transform: uppercase;
}
@keyframes lj-lock-title-rise {
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.lock-fade {
  position: absolute; inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s var(--lj-ease-magical);
  z-index: 2;
}
.lock-screen.is-fading .lock-fade { opacity: 1; }
.lock-screen.is-fading .lock-title { opacity: 0; transition: opacity 0.8s; }
.lock-skip {
  position: absolute; bottom: 6vh;
  left: 50%; transform: translateX(-50%);
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.32em;
  text-transform: lowercase;
  color: rgba(255, 230, 175, 0.65);
  text-shadow: var(--lj-glow-ember);
  padding: 10px 22px;
  background: rgba(18, 12, 5, 0.35);
  border: 1px solid rgba(220, 192, 128, 0.28);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  transition: color 240ms, border-color 240ms;
  z-index: 4;
}
.lock-skip:hover { color: #fff5d8; border-color: rgba(220, 192, 128, 0.55); }
.lock-screen.is-fading .lock-skip { opacity: 0; transition: opacity 0.6s; }

/* ============================================================ */
/* LEGAL SCREEN                                                  */
/* ============================================================ */
[data-screen="legal"] {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  display: grid; place-items: center;
  padding: 24px;
  z-index: 7;
}
.legal-card {
  width: min(620px, 96vw);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--lj-night-3) 0%, var(--lj-night-2) 100%);
  border: 1px solid rgba(245, 234, 212, 0.10);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65),
              0 1px 0 rgba(255, 220, 155, 0.06) inset;
  padding: 28px 32px 22px;
  transform: translateY(8px) scale(0.99);
  opacity: 0;
  transition: opacity 360ms var(--lj-ease-out), transform 360ms var(--lj-ease-out);
}
[data-screen="legal"].is-visible .legal-card { opacity: 1; transform: translateY(0) scale(1); }
.legal-head { padding-bottom: 12px; border-bottom: 1px solid rgba(245, 234, 212, 0.10); margin-bottom: 12px; }
.legal-head .tl-eyebrow {
  font-family: var(--lj-font-small-caps);
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--lj-gold);
  text-transform: uppercase;
}
.legal-title {
  margin: 6px 0 0;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 34px);
  color: var(--lj-cream);
  text-shadow: var(--lj-glow-ember);
}
.legal-body {
  flex: 1;
  overflow: auto;
  padding: 4px 0;
}
.legal-body p {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 16px;
  line-height: 1.62;
  color: rgba(245, 234, 212, 0.85);
  margin: 0 0 14px;
}
.legal-rule {
  text-align: center;
  font-family: var(--lj-font-chapter);
  color: var(--lj-gold);
  font-style: normal;
  letter-spacing: 0.4em;
  margin: 18px 0;
}
.legal-tiny {
  font-size: 12.5px !important;
  color: rgba(245, 234, 212, 0.55) !important;
  letter-spacing: 0.02em;
}
.legal-tiny a { color: var(--lj-gold); text-decoration: underline; text-decoration-color: rgba(220, 192, 128, 0.4); }
.legal-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(245, 234, 212, 0.10);
  margin-top: 8px;
}

/* ============================================================ */
/* LOGIN SCREEN                                                  */
/* ============================================================ */
[data-screen="login"] {
  background: #000;
  display: grid; place-items: center;
  padding: 24px;
  z-index: 7;
}
.login-card {
  width: min(420px, 96vw);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 32px 28px;
}
.login-mark {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%,
    rgba(255, 240, 200, 1) 0%,
    rgba(255, 215, 0, 0.85) 28%,
    rgba(220, 192, 128, 0.5) 55%,
    transparent 80%);
  box-shadow: 0 0 30px rgba(255, 200, 115, 0.45),
              0 0 80px rgba(255, 200, 115, 0.18);
  animation: lj-mic-breath 4.5s ease-in-out infinite;
  margin-bottom: 22px;
}
.login-title {
  margin: 0;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(36px, 5vw, 52px);
  color: var(--lj-cream);
  text-shadow: var(--lj-glow-ember);
}
.login-sub {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 15px;
  color: rgba(245, 234, 212, 0.62);
  margin: 6px 0 28px;
}
.login-btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  margin-top: 8px;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--lj-cream);
  background: rgba(18, 12, 5, 0.55);
  border: 1px solid rgba(245, 234, 212, 0.18);
  border-radius: 999px;
  transition: color 200ms, background 200ms, border-color 200ms;
}
.login-btn:hover {
  color: #fff5d8;
  background: rgba(20, 36, 26, 0.65);     /* forest-tinted dark, not warm-brown */
  border-color: rgba(255, 220, 155, 0.45);
  box-shadow: 0 0 24px rgba(255, 200, 115, 0.18);
}
.login-g {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-style: normal;
  font-family: var(--lj-font-mono);
  font-weight: 700;
  font-size: 13px;
}
.login-tiny {
  margin-top: 22px;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 12.5px;
  color: rgba(245, 234, 212, 0.45);
}
.login-tiny a { color: var(--lj-gold); text-decoration: underline; text-decoration-color: rgba(220, 192, 128, 0.4); }

/* ============================================================ */
/* NAV                                                            */
/* ============================================================ */
[data-screen="nav"].tl-stage {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  border-radius: 0;
  box-shadow: none;
  background: transparent;        /* let the ambient room show through */
  isolation: isolate;
  overflow: hidden;
}
[data-screen="nav"].tlA { background: transparent; }

.tlA-tree-wrap {
  position: absolute;
  left: 50%;
  top: clamp(120px, 18vh, 220px);
  transform: translateX(-50%);
  width:  min(560px, 88vmin);
  height: min(560px, 88vmin);
  z-index: 5;
  /* Soft radial mask hides any residual square edge from the PNG —
     the canopy/trunk fades into the void instead of cutting at a box. */
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 55%, transparent 95%);
          mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 55%, transparent 95%);
}
.tlA-tree-img {
  mix-blend-mode: screen;
  /* No amber/warm halo. Subtle moonlit cool glow — keeps the tree
     reading as luminous against the forest void without painting brown. */
  filter: drop-shadow(0 0 60px rgba(180, 220, 200, 0.10));
  transition: filter 700ms var(--lj-ease-magical), opacity 700ms var(--lj-ease-magical);
}

/* Top corners */
.tl-back, .tl-edit, .tl-settings {
  position: absolute;
  top: 22px;
  z-index: 40;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: rgba(220, 192, 128, 0.7);
  background: transparent;
  border: 0;
  padding: 8px 14px;
  cursor: pointer;
  transition: color 240ms var(--lj-ease-magical), text-shadow 240ms var(--lj-ease-magical);
  text-transform: lowercase;
}
.tl-back:hover, .tl-edit:hover, .tl-settings:hover {
  color: #fff5d8;
  text-shadow: var(--lj-glow-ember-bright);
}
.tl-back { left: 14px; }
.tl-top-actions {
  position: absolute;
  top: 22px; right: 14px;
  z-index: 40;
  display: inline-flex; gap: 6px;
}
.tl-top-actions .tl-edit, .tl-top-actions .tl-settings {
  position: static;
}

/* Heading */
.tlA-head {
  position: absolute;
  top: clamp(56px, 7vh, 110px);
  left: 0; right: 0;
  z-index: 10;
  text-align: center;
  pointer-events: none;
}
.tlA-head .tl-eyebrow {
  font-family: var(--lj-font-small-caps);
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: 0.42em;
  color: var(--lj-gold);
  opacity: 0.85;
  text-transform: uppercase;
}
.tlA-head .tl-h {
  margin-top: 6px;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(22px, 3.2vw, 30px);
  color: var(--lj-cream);
  text-shadow: 0 0 16px rgba(255, 200, 115, 0.32),
               0 2px 14px rgba(0, 0, 0, 0.55);
}

/* ============================================================ */
/* TOASTS (the right-column rules from the design screenshot)     */
/* ============================================================ */
.lj-toasts {
  position: absolute;
  top: clamp(74px, 9vh, 130px);
  right: clamp(14px, 2vw, 28px);
  z-index: 20;
  display: flex; flex-direction: column; gap: 8px;
  width: min(320px, 36vw);
  pointer-events: none;
}
.lj-toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(20, 36, 26, 0.62), rgba(8, 18, 12, 0.72));
  border: 1px solid rgba(220, 192, 128, 0.30);
  border-radius: 8px;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 13px;
  color: rgba(245, 234, 212, 0.88);
  text-shadow: 0 0 8px rgba(255, 200, 115, 0.18);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(8px);
  animation: lj-toast-rise 600ms var(--lj-ease-magical) forwards;
}
.lj-toast .lj-bullet {
  color: var(--lj-gold-bright);
  font-style: normal;
  margin-top: 1px;
  font-size: 12px;
}
@keyframes lj-toast-rise {
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================ */
/* Bottom layer                                                   */
/* ============================================================ */
.tlA-bottom {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(28px, 5vh, 56px);
  z-index: 30;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.tlA-bottom > * { grid-column: 1; grid-row: 1; }

.tl-mic-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--lj-font-small-caps);
  font-size: 9.5px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(245, 234, 212, 0.55);
  pointer-events: none;
  transition: opacity 600ms var(--lj-ease-magical);
}
.tlA-bottom.is-picked .tl-mic-hint { opacity: 0; }
.tl-mic-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lj-gold);
  box-shadow: 0 0 6px rgba(255, 220, 155, 0.85);
  animation: lj-mic-breath 2s ease-in-out infinite;
}
.tl-mic-dot.is-listening { background: #fff5d8; box-shadow: 0 0 10px rgba(255, 240, 200, 1), 0 0 24px rgba(255, 200, 115, 0.6); }
@keyframes lj-mic-breath {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.35); }
}
.tl-mic-heard {
  position: absolute;
  top: 32px;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 14px;
  color: rgba(255, 230, 175, 0.72);
  text-shadow: 0 0 8px rgba(255, 200, 115, 0.5);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 300ms var(--lj-ease-magical);
}
.tl-mic-heard.is-on { opacity: 1; }

.tlA-picked-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms var(--lj-ease-magical), transform 700ms var(--lj-ease-magical);
}
.tlA-bottom.is-picked .tlA-picked-bar { opacity: 1; transform: translateY(0); }
.tlA-picked-bar[hidden] { display: none; }

.tlA-chips {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  max-width: 80vw;
}
.tlA-chip {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--lj-cream);
  text-shadow: 0 0 12px rgba(255, 220, 155, 0.45);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 0;
  border: 0;
  cursor: pointer;
  transition: color 240ms var(--lj-ease-magical), text-shadow 240ms var(--lj-ease-magical);
}
.tlA-chip:hover { color: #fff5d8; text-shadow: var(--lj-glow-ember-bright); }
.tlA-chip-x {
  font-family: var(--lj-font-display);
  font-size: 12px;
  color: rgba(220, 192, 128, 0.55);
  font-style: normal;
  margin-left: 2px;
}

.tlA-role-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 18px;
  color: rgba(245, 234, 212, 0.72);
}
.tlA-role-row[hidden] { display: none; }
.tlA-role {
  background: transparent;
  border: 0;
  padding: 6px 4px;
  cursor: pointer;
  font: inherit;
  color: rgba(245, 234, 212, 0.72);
  transition:
    color 240ms var(--lj-ease-magical),
    text-shadow 240ms var(--lj-ease-magical),
    letter-spacing 240ms var(--lj-ease-magical);
  letter-spacing: 0.01em;
}
.tlA-role:hover { color: #fff5d8; text-shadow: 0 0 10px rgba(255, 220, 155, 0.55); letter-spacing: 0.04em; }
.tlA-role.is-active {
  color: #fff5d8;
  text-shadow: var(--lj-glow-ember-bright);
}
.tlA-role-sep {
  color: rgba(220, 192, 128, 0.4);
  font-style: normal;
  font-size: 14px;
}

/* Curator-mode tints: fruit halos go cool-blue */
[data-screen="nav"][data-mode="curator"] .tlA-fruit.selected .tlA-fruit-halo {
  background: radial-gradient(circle, rgba(220,232,255,0.35) 0%, rgba(160,200,255,0.18) 40%, transparent 75%);
}
[data-screen="nav"][data-mode="curator"] .tlA-fruit.selected .tlA-fruit-orb {
  background: #ffffff;
  box-shadow:
    0 0 8px rgba(255, 255, 255, 1),
    0 0 22px rgba(220, 232, 255, 0.95),
    0 0 44px rgba(160, 200, 255, 0.6);
}

/* Persistent name labels under each fruit — subtle browse affordance.
   Always visible at low opacity; brighten on hover/select so users can
   read the tree without voice navigation. */
.tlA-fruit .tlA-fruit-name {
  opacity: 0.32 !important;            /* override bundle's hover-only rule */
  font-style: italic;
  font-size: 11px;
  font-family: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(245, 234, 212, 0.95);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.85),
               0 0 14px rgba(255, 200, 115, 0.18);
  transition: opacity 240ms var(--lj-ease-magical),
              transform 240ms var(--lj-ease-magical);
}
.tlA-fruit:hover .tlA-fruit-name { opacity: 1 !important; transform: translateX(-50%) translateY(-2px); }
.tlA-fruit.selected .tlA-fruit-name { opacity: 1 !important; }
.tlA-fruit.dim .tlA-fruit-name      { opacity: 0.12 !important; }

/* Pending-prompt — subtle ember pulse on the fruit */
.tlA-fruit.has-prompt .tlA-fruit-orb {
  animation: lj-prompt-breath 2.6s ease-in-out infinite;
}
@keyframes lj-prompt-breath {
  0%, 100% { box-shadow: 0 0 4px rgba(255, 220, 155, 0.9), 0 0 10px rgba(255, 200, 115, 0.6); }
  50%      { box-shadow: 0 0 10px rgba(255, 240, 200, 1),  0 0 26px rgba(255, 200, 115, 0.85); }
}

/* ============================================================ */
/* Particle-fly transition canvas                                 */
/* ============================================================ */
.tlA-fly-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  transition: opacity 220ms var(--lj-ease-magical);
}
.tlA-fly-canvas.is-flying { opacity: 1; }
[data-screen="nav"].is-flying .tlA-tree-img,
[data-screen="nav"].is-flying .tlA-head,
[data-screen="nav"].is-flying .tl-back,
[data-screen="nav"].is-flying .tl-top-actions,
[data-screen="nav"].is-flying .tlA-bottom,
[data-screen="nav"].is-flying .lj-toasts,
[data-screen="nav"].is-flying .tlA-fruits {
  opacity: 0;
  transition: opacity 600ms var(--lj-ease-magical);
}
[data-screen="nav"].is-flying { background: #000; }

/* ============================================================ */
/* Edit Family — slide-up sheet on parchment                      */
/* ============================================================ */
[data-screen="edit-sheet"] {
  background: rgba(6, 4, 2, 0.62);
  backdrop-filter: blur(10px);
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 24px;
}
/* All modals use the same dark floating-panel aesthetic — gold-bordered
   night surface, ember-glow text, no parchment. Matches landing-page DNA. */
.edit-sheet-card {
  width: min(440px, 96vw);
  max-height: 78vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--lj-night-3) 0%, var(--lj-night-2) 100%);
  border: 1px solid rgba(245, 234, 212, 0.10);
  color: var(--lj-cream);
  border-radius: 20px 20px 16px 16px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.65),
    0 1px 0 rgba(255, 220, 155, 0.06) inset;
  padding: 18px 20px 16px;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 360ms var(--lj-ease-out), opacity 360ms var(--lj-ease-out);
  position: relative;
}
[data-screen="edit-sheet"].is-visible .edit-sheet-card {
  transform: translateY(0);
  opacity: 1;
}
.edit-sheet-head {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(245, 234, 212, 0.10);
}
.edit-sheet-head .tl-eyebrow {
  font-family: var(--lj-font-chapter);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--lj-gold);
  text-transform: uppercase;
}
.ghost-x {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(245, 234, 212, 0.62);
  font-family: var(--lj-font-display);
  font-size: 18px;
  transition: color 200ms, background 200ms;
}
.ghost-x:hover { color: var(--lj-cream); background: rgba(245, 234, 212, 0.06); }

.edit-sheet-list {
  list-style: none; margin: 0; padding: 8px 0; overflow: auto;
}
.edit-sheet-list li {
  display: grid; grid-template-columns: 32px 1fr 18px;
  align-items: center; gap: 14px;
  padding: 12px 6px;
  border-bottom: 1px solid rgba(245, 234, 212, 0.08);
  cursor: pointer;
  border-radius: 6px;
  transition: background 200ms;
}
.edit-sheet-list li:hover { background: rgba(245, 234, 212, 0.05); }
.edit-sheet-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fff5d8 0%, var(--lj-gold) 30%, transparent 90%);
  box-shadow: 0 0 8px rgba(255, 200, 115, 0.55);
  margin-inline: auto;
}
.edit-sheet-dot.is-self     { background: radial-gradient(circle at 38% 38%, #fff, var(--lj-moon) 35%, transparent 70%); box-shadow: 0 0 8px rgba(180, 210, 255, 0.65); }
.edit-sheet-dot.is-deceased { filter: saturate(0.2) brightness(0.7); }
.edit-sheet-dot.is-pending  { animation: lj-prompt-breath 2.4s var(--lj-ease-magical) infinite; }
.edit-sheet-name {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--lj-cream);
}
.edit-sheet-rel {
  display: block;
  font-family: var(--lj-font-small-caps);
  font-size: 9px;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--lj-gold);
  opacity: 0.78;
  margin-top: 2px;
}
.edit-sheet-list li::after { content: '›'; color: var(--lj-gold); opacity: 0.55; font-family: var(--lj-font-display); font-size: 18px; }

.edit-sheet-add {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 10px;
  padding: 14px;
  font-family: var(--lj-font-display);
  font-style: italic;
  letter-spacing: 0.04em;
  font-size: 16px;
  color: var(--lj-gold);
  background: transparent;
  border: 1px dashed rgba(220, 192, 128, 0.35);
  border-radius: 10px;
  transition: color 200ms, border-color 200ms, background 200ms;
}
.edit-sheet-add:hover { color: #fff5d8; border-color: rgba(255, 220, 155, 0.55); background: rgba(255, 215, 0, 0.04); }
.add-glyph { font-family: var(--lj-font-chapter); font-size: 22px; font-weight: 300; color: var(--lj-gold-bright); margin-bottom: 2px; }

/* ============================================================ */
/* Edit / Add member forms — same dark-panel aesthetic           */
/* ============================================================ */
[data-screen="edit-member"],
[data-screen="add-member"] {
  background: rgba(6, 4, 2, 0.72);
  backdrop-filter: blur(12px);
  display: grid; place-items: center;
  padding: 24px;
}
.edit-member-card {
  width: min(440px, 92vw);
  background: linear-gradient(180deg, var(--lj-night-3) 0%, var(--lj-night-2) 100%);
  border: 1px solid rgba(245, 234, 212, 0.10);
  color: var(--lj-cream);
  border-radius: 16px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.65),
    0 1px 0 rgba(255, 220, 155, 0.06) inset;
  padding: 20px 22px 18px;
  transform: translateY(8px) scale(0.985);
  transition: transform 320ms var(--lj-ease-out);
}
.is-visible .edit-member-card { transform: translateY(0) scale(1); }
.edit-member-head {
  display: grid; grid-template-columns: 36px 1fr 36px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(245, 234, 212, 0.10);
}
.edit-member-head .tl-eyebrow {
  text-align: center;
  font-family: var(--lj-font-chapter);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--lj-gold);
  text-transform: uppercase;
}
.edit-member-body { display: grid; gap: 14px; padding: 16px 0; }
.field { display: grid; gap: 4px; }
.field-label {
  font-family: var(--lj-font-small-caps);
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--lj-gold);
  opacity: 0.85;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 234, 212, 0.12);
  border-radius: 8px;
  color: var(--lj-cream);
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 16px;
  outline: none;
  transition: border-color 200ms, background 200ms;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(255, 220, 155, 0.55);
  background: rgba(255, 215, 0, 0.04);
}
.edit-member-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 4px;
}
.primary-pill {
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(255, 220, 155, 0.92) 0%, rgba(220, 192, 128, 0.92) 100%);
  color: var(--lj-night);
  font-family: var(--lj-font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
  /* sentence-case capitalization preserved — labels use proper case in HTML */
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(255, 200, 115, 0.30);
  transition: filter 180ms, transform 180ms var(--lj-ease-out);
  min-height: 44px;          /* mobile tap-target minimum */
}
.primary-pill:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ghost-link {
  padding: 10px 14px;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: rgba(245, 234, 212, 0.62);
  min-height: 44px;
}
.ghost-link:hover { color: var(--lj-cream); }
.ghost-link.danger { color: rgba(232, 130, 110, 0.85); }
.ghost-link.danger:hover { color: rgba(255, 160, 130, 1); }
.ghost-link.danger.is-confirming {
  color: #ffa085;
  text-shadow: 0 0 12px rgba(255, 130, 90, 0.4);
}

/* ============================================================ */
/* SETTINGS — dark sheet (matches your screenshot)                */
/* ============================================================ */
[data-screen="settings"] {
  background: rgba(6, 4, 2, 0.7);
  backdrop-filter: blur(12px);
  display: grid; place-items: center;
  padding: 24px;
}
.settings-card {
  width: min(560px, 96vw);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--lj-night-3) 0%, var(--lj-night-2) 100%);
  border: 1px solid rgba(245, 234, 212, 0.10);
  border-radius: 16px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.65),
    0 1px 0 rgba(255, 220, 155, 0.06) inset;
  padding: 20px 24px 22px;
  transform: translateY(12px) scale(0.985);
  opacity: 0;
  transition: opacity 360ms var(--lj-ease-out), transform 360ms var(--lj-ease-out);
}
[data-screen="settings"].is-visible .settings-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.settings-head {
  display: grid; grid-template-columns: 36px 1fr 36px;
  align-items: center;
  padding-bottom: 6px;
}
.settings-head .ghost-x {
  width: 32px; height: 32px;
  color: rgba(245, 234, 212, 0.62);
}
.settings-head .ghost-x:hover { color: var(--lj-cream); background: rgba(245, 234, 212, 0.06); }
.settings-title {
  margin: 0;
  text-align: left;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--lj-cream);
  text-shadow: 0 0 12px rgba(255, 200, 115, 0.25);
}
.settings-section { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 12px 4px;
}
.setting-row.vertical { flex-direction: column; align-items: stretch; gap: 6px; }
.setting-row.toggle { padding: 14px 4px; }
.setting-label {
  font-family: var(--lj-font-small-caps);
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(220, 192, 128, 0.85);
}
.setting-name {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--lj-cream);
}
.setting-sub {
  display: block;
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: rgba(245, 234, 212, 0.55);
  margin-top: 2px;
}
.setting-toggle-text { display: flex; flex-direction: column; }
.settings-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 234, 212, 0.12);
  border-radius: 8px;
  color: var(--lj-cream);
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 16px;
  outline: none;
  transition: border-color 200ms, background 200ms;
}
.settings-input:focus {
  border-color: rgba(255, 220, 155, 0.55);
  background: rgba(255, 215, 0, 0.04);
}
.setting-rule {
  border: 0;
  border-top: 1px solid rgba(245, 234, 212, 0.08);
  margin: 0;
}

/* Switch — gold thumb on fireplace track */
.lj-switch { position: relative; flex-shrink: 0; width: 48px; height: 26px; }
.lj-switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.lj-switch-track {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: rgba(40, 28, 16, 0.85);
  border: 1px solid rgba(245, 234, 212, 0.14);
  transition: background 240ms, border-color 240ms;
}
.lj-switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(220, 192, 128, 0.65);
  box-shadow: 0 0 6px rgba(255, 200, 115, 0.4);
  transition: transform 240ms var(--lj-ease-out), background 240ms, box-shadow 240ms;
}
.lj-switch input:checked ~ .lj-switch-track {
  background: linear-gradient(180deg, rgba(255, 200, 115, 0.45), rgba(120, 75, 30, 0.65));
  border-color: rgba(255, 220, 155, 0.45);
}
.lj-switch input:checked ~ .lj-switch-track .lj-switch-thumb {
  transform: translateX(22px);
  background: #fff5d8;
  box-shadow: 0 0 8px rgba(255, 240, 200, 1), 0 0 18px rgba(255, 200, 115, 0.7);
}
.lj-switch-track .lj-switch-thumb {
  /* nudge thumb because it's nested for animation */
  position: absolute; top: 3px; left: 3px;
}

/* ============================================================ */
/* Pills (component) — used in toasts, edit list, settings        */
/* ============================================================ */
.lj-pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(220, 192, 128, 0.35);
  background: rgba(20, 36, 26, 0.55);
  color: rgba(255, 230, 175, 0.92);
  font-family: var(--lj-font-small-caps);
  font-size: 9.5px; letter-spacing: 0.32em;
  text-transform: uppercase;
}
.lj-pill.cool { border-color: rgba(180, 210, 255, 0.45); color: rgba(220, 232, 255, 0.92); }
.lj-pill.success { border-color: rgba(136, 184, 122, 0.55); color: rgba(200, 230, 180, 0.92); }
.lj-pill.warn    { border-color: rgba(232, 181, 98, 0.55); color: rgba(255, 220, 155, 0.92); }

/* ============================================================ */
/* Session — conscious orb                                       */
/* ============================================================ */
[data-screen="session"] {
  /* Same forest+moonlight ambient as the nav, so the orb feels like
     the same room — only the tree has receded. */
  background:
    radial-gradient(ellipse 100% 38% at 50% 105%, rgba(26, 44, 31, 0.55) 0%, transparent 72%),
    radial-gradient(ellipse 50% 32% at 22% 100%, rgba(13, 26, 16, 0.45) 0%, transparent 70%),
    radial-gradient(ellipse 50% 32% at 78% 100%, rgba(13, 26, 16, 0.40) 0%, transparent 70%),
    radial-gradient(ellipse 70% 60% at 82%  6%, rgba(200, 216, 255, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 36% 40% at 12%  4%, rgba(220, 232, 255, 0.04) 0%, transparent 70%),
    #000;
}
.session-bar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px 0;
}
.session-state {
  font-family: var(--lj-font-small-caps);
  font-size: 10.5px; letter-spacing: 0.32em; text-transform: uppercase;
  color: rgba(245, 234, 212, 0.55);
}
.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--lj-cream); opacity: 0.65;
  transition: opacity 200ms, background 200ms;
}
.ghost-btn:hover { opacity: 1; background: rgba(245, 234, 212, 0.06); }
.ghost-btn.back-btn { font-family: var(--lj-font-display); font-size: 22px; line-height: 1; }

/* Slightly smaller orb so it breathes inside the forest atmosphere
   instead of filling every edge. The canvas itself scales to its
   parent; we shrink the parent. */
/* Orb floats over the page's forest+moonlight gradient. The shader
   itself paints alpha — outside-the-orb pixels are now transparent
   (after the CA pass alpha fix). A radial CSS mask softens any
   residual canvas edge. The drop-shadow gives the orb 3D depth — a
   warm glow halo bleeds into the background like real light. */
.orb-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  transform: scale(0.86);
  transform-origin: 50% 50%;
  pointer-events: auto;
  /* Soft circular fade on the canvas edges so the orb doesn't read
     as a rectangle even if the shader leaves trace alpha at corners. */
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 38%, transparent 64%);
          mask-image: radial-gradient(circle at 50% 50%, #000 38%, transparent 64%);
}
.orb-canvas canvas {
  display: block;
  background: transparent;
  /* Outer glow that bleeds onto the page — gives the orb a 3D presence
     by spilling light into the surrounding forest gradient. The glow
     is gentle pearl-warm, complementing the listening palette. */
  filter:
    drop-shadow(0 0 32px rgba(255, 230, 200, 0.18))
    drop-shadow(0 0 80px rgba(255, 200, 130, 0.10));
}

.orb-whisper {
  position: absolute; bottom: 18%;
  left: 50%; transform: translateX(-50%);
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 16px;
  color: rgba(245, 234, 212, 0.62);
  margin: 0; max-width: 70vw; text-align: center;
  opacity: 0;
  transition: opacity 600ms var(--lj-ease-magical);
  z-index: 2; pointer-events: none;
}
.orb-whisper.is-visible { opacity: 1; }

.session-tools {
  position: absolute; bottom: 28px;
  left: 50%; transform: translateX(-50%);
  display: inline-flex; gap: 22px;
  z-index: 2;
}
.tool-btn {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: rgba(245, 234, 212, 0.55);
  padding: 6px 6px;
  background: transparent;
  border: 0;
  transition: color 200ms, text-shadow 200ms;
}
.tool-btn:hover    { color: #fff5d8; text-shadow: var(--lj-glow-ember-bright); }
.tool-btn.is-active{ color: var(--lj-gold-bright); text-shadow: var(--lj-glow-ember-bright); }
.tool-btn.primary  { color: var(--lj-gold-bright); text-shadow: 0 0 10px rgba(255, 220, 155, 0.6); }

/* ============================================================ */
/* MEMORIES                                                       */
/* ============================================================ */
[data-screen="memories"] { background: var(--lj-night); display: flex; flex-direction: column; }
[data-screen="memories"][data-mode="sanctuary"] {
  background:
    radial-gradient(ellipse 100% 100% at 50% 30%, rgba(180, 200, 240, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(20, 30, 60, 0.5), transparent 70%),
    var(--lj-deep-night-blue);
}
[data-screen="memories"][data-mode="journal"] {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(255, 200, 115, 0.10), transparent 60%),
    var(--lj-night);
}
.memories-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px 0;
}
.memories-eyebrow {
  font-family: var(--lj-font-chapter);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--lj-gold);
}
[data-screen="memories"][data-mode="sanctuary"] .memories-eyebrow { color: var(--lj-moon); }
.memories-card {
  flex: 1;
  width: min(720px, 92vw);
  margin: 16px auto 32px;
  padding: 32px 32px 28px;
  display: flex; flex-direction: column; gap: 18px;
  overflow: auto;
  position: relative;
}
.memories-title {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(34px, 5vw, 54px);
  margin: 0;
  color: var(--lj-cream);
  text-shadow: var(--lj-glow-ember);
}
[data-screen="memories"][data-mode="sanctuary"] .memories-title {
  color: var(--lj-moon);
  text-shadow: var(--lj-glow-moon);
}
.memories-sub {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 15px;
  margin: 0;
  color: rgba(245, 234, 212, 0.62);
}
.memories-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.memories-list li {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  align-items: baseline;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(245, 234, 212, 0.10);
  cursor: pointer;
  transition: background 200ms;
}
.memories-list li:hover { background: rgba(245, 234, 212, 0.04); }
.memories-list .mem-date {
  font-family: var(--lj-font-small-caps);
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  color: rgba(245, 234, 212, 0.45);
}
[data-screen="memories"][data-mode="sanctuary"] .memories-list .mem-date { color: rgba(200, 216, 255, 0.62); }
.memories-list .mem-title {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 19px;
  color: var(--lj-cream);
}
.memories-list .mem-dur {
  font-family: var(--lj-font-mono);
  font-size: 12px;
  color: rgba(245, 234, 212, 0.45);
}
.memories-empty {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 15px;
  color: rgba(245, 234, 212, 0.55);
  text-align: center;
  margin-top: 32px;
}

/* ============================================================ */
/* SEALING                                                        */
/* ============================================================ */
[data-screen="sealing"] { display: grid; place-items: center; }
.seal-card { text-align: center; max-width: 80vw; animation: lj-seal-rise 1500ms var(--lj-ease-out) both; }
.seal-line {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: clamp(24px, 4vw, 40px);
  margin: 0;
  color: var(--lj-cream);
  letter-spacing: 0.005em;
  text-shadow: var(--lj-glow-ember);
}
.seal-line span { color: var(--lj-gold-bright); }
.seal-sub {
  font-family: var(--lj-font-display);
  font-style: italic;
  font-size: 14px;
  margin-top: 14px;
  color: rgba(245, 234, 212, 0.6);
}
@keyframes lj-seal-rise {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============================================================ */
/* MOBILE — touch-first layout per 2026 best practices:           */
/*  • dynamic viewport units (`dvh`) so browser chrome doesn't    */
/*    crop the bottom row                                         */
/*  • safe-area-inset padding for notch + home-bar                */
/*  • all tap targets >= 44px high                                */
/*  • bottom-aligned actions in thumb zone                        */
/*  • larger fruit hit-area via padded bounding box               */
/* ============================================================ */
@media (max-width: 740px) {
  /* dynamic viewport so iOS Safari URL bar doesn't crop us */
  html, body { height: 100dvh; }

  /* Top chrome respects notch */
  .tl-back, .tl-edit, .tl-settings,
  .tl-top-actions {
    top: max(20px, env(safe-area-inset-top, 20px));
  }
  .tl-back     { left:  max(10px, env(safe-area-inset-left, 10px)); }
  .tl-top-actions { right: max(10px, env(safe-area-inset-right, 10px)); }

  /* Top chrome — bigger tap targets, lighter letter-spacing for legibility */
  .tl-back, .tl-edit, .tl-settings {
    font-size: 13px;
    letter-spacing: 0.12em;
    padding: 12px 14px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .tl-top-actions { gap: 2px; }

  /* Heading sized for portrait */
  .tlA-head { top: clamp(72px, 12vh, 130px); padding: 0 16px; }
  .tlA-head .tl-h { font-size: clamp(22px, 6vw, 28px); }
  .tlA-head .tl-eyebrow { font-size: 9px; letter-spacing: 0.36em; }

  /* Tree centered & breathing room */
  .tlA-tree-wrap {
    top: clamp(140px, 22vh, 200px);
    width:  92vmin;
    height: 92vmin;
  }

  /* Larger fruit hit-area on touch — ::before extends invisible target */
  .tlA-fruit { width: 44px; height: 44px; }
  .tlA-fruit::before {
    content: '';
    position: absolute;
    inset: -8px;     /* extend hit zone to 60×60 */
  }
  .tlA-fruit-name { font-size: 12px; }

  /* Toast strip below the heading, not over it */
  .lj-toasts {
    top: max(110px, calc(env(safe-area-inset-top, 0px) + 100px));
    right: 8px;
    left: auto;
    width: min(76vw, 280px);
  }

  /* Bottom row sits above the home indicator */
  .tlA-bottom {
    bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 18px));
  }
  .tlA-role-row { font-size: 17px; gap: 16px; }
  .tlA-role { padding: 8px 4px; min-height: 44px; }
  .tlA-chip { font-size: 16px; padding: 4px 0; }

  /* Session tools (Elora · seal & end) — bigger, thumb-zone */
  .session-tools {
    bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 20px));
    gap: 24px;
  }
  .tool-btn { font-size: 16px; padding: 10px 6px; min-height: 44px; }
  .session-bar {
    padding: max(20px, env(safe-area-inset-top, 20px)) 20px 0;
  }
  .ghost-btn { width: 44px; height: 44px; }

  /* Modals: take full mobile width with safe-area gutter */
  [data-screen="legal"],
  [data-screen="login"],
  [data-screen="settings"],
  [data-screen="edit-member"],
  [data-screen="add-member"],
  [data-screen="edit-sheet"] {
    padding: max(16px, env(safe-area-inset-top, 16px))
             max(12px, env(safe-area-inset-right, 12px))
             max(20px, env(safe-area-inset-bottom, 20px))
             max(12px, env(safe-area-inset-left, 12px));
  }
  .settings-card, .legal-card, .edit-sheet-card, .edit-member-card {
    width: 100%; max-height: 90dvh;
  }
  .legal-card { padding: 22px 22px 18px; }
  .legal-title { font-size: clamp(22px, 6vw, 28px); }
  .legal-body p { font-size: 15px; }

  /* Login card */
  .login-card { padding: 36px 18px 24px; width: 100%; max-width: 420px; }
  .login-title { font-size: clamp(34px, 9vw, 48px); }
  .login-btn { padding: 16px 22px; min-height: 52px; font-size: 16px; }
  .login-mark { width: 64px; height: 64px; }

  /* Settings */
  .settings-title { font-size: clamp(20px, 5.4vw, 24px); }
  .setting-label { font-size: 9.5px; letter-spacing: 0.3em; }
  .setting-name  { font-size: 17px; }
  .setting-sub   { font-size: 13px; }
  .settings-input { min-height: 48px; font-size: 16px; padding: 12px 14px; }
  .lj-switch     { width: 52px; height: 30px; }
  .lj-switch-thumb { width: 22px; height: 22px; top: 3px; left: 3px; }
  .lj-switch input:checked ~ .lj-switch-track .lj-switch-thumb { transform: translateX(22px); }

  /* Edit Family + Edit Member forms */
  .edit-sheet-list li { padding: 14px 6px; min-height: 60px; }
  .edit-sheet-name { font-size: 17px; }
  .edit-sheet-add  { padding: 16px; min-height: 52px; }
  .field input, .field select, .field textarea {
    min-height: 48px; font-size: 16px; padding: 12px 14px;
  }

  /* Memories list */
  .memories-bar {
    padding: max(20px, env(safe-area-inset-top, 20px)) 20px 0;
  }
  .memories-card { padding: 24px 18px; }
  .memories-title { font-size: clamp(28px, 7vw, 42px); }
  .memories-list li {
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    padding: 16px 0;
    min-height: 52px;
  }
  .memories-list .mem-title { font-size: 16px; }
  .memories-list .mem-date { font-size: 9px; }

  /* Buttons everywhere */
  .primary-pill { min-height: 52px; padding: 14px 26px; font-size: 15px; }
  .ghost-link, .ghost-link.danger {
    min-height: 52px; padding: 14px 18px; font-size: 15px;
    display: inline-flex; align-items: center;
  }
  .ghost-x { width: 44px; height: 44px; font-size: 22px; }

  /* Lock skip — bottom thumb zone */
  .lock-skip {
    bottom: max(8vh, calc(env(safe-area-inset-bottom, 0px) + 60px));
    padding: 14px 26px; font-size: 14px;
  }

  /* Disable hover transforms on touch — they read as flicker */
  .role-card:hover, .login-btn:hover, .primary-pill:hover {
    transform: none;
  }
}

/* Phones in landscape — tighten heading clearance */
@media (max-width: 920px) and (max-height: 480px) and (orientation: landscape) {
  .tlA-head { top: 14px; }
  .tlA-head .tl-h { font-size: 18px; margin-top: 2px; }
  .tlA-head .tl-eyebrow { font-size: 8px; }
  .tlA-tree-wrap { top: 64px; height: calc(100dvh - 168px); width: auto; aspect-ratio: 1 / 1; }
  .tlA-bottom { bottom: 8px; }
}

/* ============================================================ */
/* cursor — match the landing page (default browser cursor;       */
/* the landing intentionally uses the system pointer)              */
/* ============================================================ */
html, body { cursor: default; }
button, a, .tlA-fruit, .tlA-chip, .tlA-role, .lj-pill,
.edit-sheet-list li, .memories-list li,
.tool-btn, .ghost-btn, .ghost-x, .primary-pill,
.edit-sheet-add, .lock-skip {
  cursor: pointer;
}
