:root {
  /* palette B — neutral near-black base, crisp text; the purple→pink gradient
     is the signature accent, used only where it counts (not painted everywhere). */
  --bg: #0b0b0e;
  --bg2: #141419;
  --ink: #f2f0f6;
  --muted: #b7b4c3;
  --accent: #c9a8ff;
  --accent2: #ff9ecb;
  --bubble-you: #1a1a21;
  --bubble-voice: transparent;
  --line: rgba(255, 255, 255, 0.10);
  --aura1: rgba(201,168,255,0.12);
  --aura2: rgba(255,158,203,0.08);
  --aura3: rgba(120,140,255,0.06);
  font-size: 17px;
}

/* ── color themes (live-swappable) ─────────────────────────── */
body[data-theme="circadian"] {
  --bg:#0a0f1e; --bg2:#121a33; --ink:#e9eefb; --muted:#9fb0d6;
  --accent:#8fb4ff; --accent2:#7fe6ff; --bubble-you:#15203a;
  --line:rgba(143,180,255,0.16);
  --aura1:rgba(143,180,255,0.20); --aura2:rgba(127,230,255,0.16); --aura3:rgba(110,130,255,0.16);
}
body[data-theme="ember"] {
  --bg:#160d0d; --bg2:#29130f; --ink:#f7ece8; --muted:#ccb0a6;
  --accent:#ffb98a; --accent2:#ff8fa3; --bubble-you:#2a1712;
  --line:rgba(255,170,140,0.16);
  --aura1:rgba(255,170,120,0.20); --aura2:rgba(255,140,160,0.16); --aura3:rgba(255,110,90,0.14);
}
body[data-theme="verdant"] {
  --bg:#0a1410; --bg2:#112a20; --ink:#e9f7ef; --muted:#9fc7b4;
  --accent:#8fe6bf; --accent2:#c2f29a; --bubble-you:#122a1f;
  --line:rgba(143,230,191,0.16);
  --aura1:rgba(143,230,191,0.20); --aura2:rgba(194,242,154,0.16); --aura3:rgba(90,200,160,0.14);
}
body[data-theme="aurora"] {
  --bg:#0a1018; --bg2:#11202b; --ink:#eafaf6; --muted:#9bc0bd;
  --accent:#7fe9d6; --accent2:#ff9ee0; --bubble-you:#14242c;
  --line:rgba(127,233,214,0.16);
  --aura1:rgba(127,233,214,0.20); --aura2:rgba(255,158,224,0.16); --aura3:rgba(110,200,255,0.14);
}
body[data-theme="noir"] {
  --bg:#0c0c10; --bg2:#18181f; --ink:#f0eef7; --muted:#a7a3bd;
  --accent:#cbc7e2; --accent2:#ece8f8; --bubble-you:#1b1b24;
  --line:rgba(200,196,226,0.14);
  --aura1:rgba(200,196,226,0.12); --aura2:rgba(220,216,240,0.10); --aura3:rgba(160,156,190,0.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;        /* no rubber-band / page bounce — feels locked, native */
  touch-action: manipulation;       /* kills the ~300ms tap delay + double-tap zoom */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
/* but let people select/copy the things that matter */
.msg, .core-text, input, textarea, [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}
/* one consistent voice: lowercase across the app's chrome. the actual conversation
   and anything you type stay in natural case for readability. */
body { text-transform: lowercase; }
.msg, .msg *, .core-text, .core-item, input, textarea, [contenteditable] { text-transform: none; }

body {
  position: fixed;
  top: 0; left: 0; right: 0;
  /* Height tracks the VISIBLE (visual) viewport via --app-h, set in JS. When the
     on-screen keyboard opens, the shell shrinks to the area above it, so the
     keyboard just slides up under the composer like a normal web page — instead
     of iOS shoving the whole position:fixed layer around (which made any text box
     feel like it took over the screen). Falls back to full height when --app-h
     isn't set, so nothing changes while the keyboard is closed. */
  height: var(--app-h, 100%);
  display: flex;
  flex-direction: column;
  padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

/* soft living background */
.aura {
  position: fixed; inset: -30%;
  background:
    radial-gradient(40% 35% at 20% 15%, var(--aura1), transparent 60%),
    radial-gradient(45% 40% at 85% 25%, var(--aura2), transparent 60%),
    radial-gradient(50% 45% at 50% 95%, var(--aura3), transparent 60%);
  filter: blur(20px);
  animation: drift 22s ease-in-out infinite alternate;
  z-index: 0; pointer-events: none;
  transition: background 0.5s ease;
}
@keyframes drift {
  from { transform: translate(-3%, -2%) scale(1); }
  to   { transform: translate(3%, 2%) scale(1.08); }
}

.topbar {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) 14px 10px;
}
#historyBtn { justify-self: start; }
.top-right { justify-self: end; display: flex; align-items: center; gap: 6px; }
#settingsBtn { padding: 4px 6px; display: grid; place-items: center; }
#settingsBtn svg { display: block; opacity: 0.6; }
.title {
  grid-column: 2; text-align: center;
  font-weight: 600; letter-spacing: 0.18em; font-size: 1rem;
  color: var(--ink); opacity: 0.85;
}
.ghost {
  background: none; border: none; color: var(--muted);
  font: inherit; font-size: 0.8rem; letter-spacing: 0.05em;
  padding: 6px 8px; cursor: pointer; border-radius: 10px;
}
.ghost:active { background: rgba(255,255,255,0.06); }
/* the two primary destinations read as clear, equal text labels */
.nav-label { color: var(--ink); opacity: 0.62; font-size: 0.82rem; letter-spacing: 0.06em; }
.ghost-icon { color: var(--muted); }

.chat {
  position: relative; z-index: 1;
  flex: 1; overflow-y: auto;
  padding: 12px 16px 24px;
  display: flex; flex-direction: column; gap: 16px;
  scroll-behavior: smooth;
}

.welcome { margin: auto 0; text-align: center; padding: 8% 6%; }
.welcome h1 {
  font-size: 2rem; font-weight: 600; margin: 0 0 14px;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: 0.01em;
}
.welcome p { color: var(--muted); line-height: 1.6; margin: 0; }

.msg { max-width: 86%; font-size: 0.85rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.you {
  align-self: flex-end;
  background: var(--bubble-you);
  border: 1px solid var(--line);
  padding: 12px 15px; border-radius: 20px 20px 6px 20px;
  color: var(--ink);
}
.msg.voice {
  align-self: flex-start;
  color: var(--ink);
  padding: 4px 2px;
  font-size: 0.85rem; /* match your own messages exactly */
}
.msg.voice::before {
  content: "";
  display: block; width: 22px; height: 2px; margin: 0 0 10px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}
.msg.voice .body { white-space: pre-wrap; }
.msg.voice .cursor { opacity: 0.6; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.msg-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
/* 'this landed' keeps its labeled pill */
.landed-btn {
  background: none; border: 1px solid var(--line);
  color: var(--muted); font: inherit; font-size: 0.72rem;
  letter-spacing: 0.04em; padding: 5px 11px; border-radius: 999px;
  cursor: pointer; opacity: 0.6; transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}
.landed-btn:hover { opacity: 1; color: var(--accent); border-color: var(--accent); }
.landed-btn.done { opacity: 1; color: var(--accent); border-color: var(--accent); cursor: default; background: rgba(201,168,255,0.1); }
/* icon-only actions: copy, play, thumbs-down */
.act {
  background: none; border: none; padding: 6px; border-radius: 8px; line-height: 0;
  color: var(--muted); opacity: 0.5; cursor: pointer;
  display: inline-grid; place-items: center;
  transition: opacity 0.2s, color 0.2s;
}
.act:hover { opacity: 1; color: var(--accent); }
.act.ok { opacity: 1; color: var(--accent); }
.act.read-btn.reading { opacity: 1; color: var(--accent2); }
.act.down-btn.on { opacity: 1; color: var(--accent2); }
/* floating read-aloud playback bar — floats at the top; content scrolls behind */
.read-bar {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 54px); transform: translateX(-50%);
  z-index: 9500; display: flex; align-items: center; gap: 4px;
  padding: 7px 9px; border-radius: 999px;
  background: rgba(28,22,42,0.97); border: 1px solid var(--ring, rgba(201,168,255,0.3));
  box-shadow: 0 12px 32px rgba(0,0,0,0.5); backdrop-filter: blur(10px);
}
.read-bar .rb-btn {
  background: none; border: none; color: var(--ink); opacity: 0.85; cursor: pointer;
  padding: 8px; border-radius: 50%; line-height: 0; display: inline-grid; place-items: center;
}
.read-bar .rb-btn:hover { opacity: 1; color: var(--accent); }
.read-bar .rb-play { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #1b1230; opacity: 1; }
.read-bar .rb-close { color: var(--muted); }
.read-bar .rb-speed {
  background: none; border: none; color: var(--ink); opacity: 0.85; cursor: pointer;
  font: inherit; font-size: 0.82rem; font-weight: 600; padding: 6px 9px; min-width: 36px;
}
.read-bar .rb-speed:hover { color: var(--accent); }

.scroll-btn {
  position: fixed; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 50;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; line-height: 0;
  display: grid; place-items: center; color: var(--accent);
  background: rgba(28,22,42,0.94); border: 1px solid var(--ring, rgba(201,168,255,0.3));
  box-shadow: 0 6px 18px rgba(0,0,0,0.45); backdrop-filter: blur(6px);
  transition: opacity 0.2s, transform 0.08s;
}
.scroll-btn:active { transform: scale(0.92); }
.scroll-btn[hidden] { display: none; }
.composer {
  position: relative; z-index: 2;
  display: flex; align-items: flex-end; gap: 10px;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(13,11,22,0.6));
}
#input {
  flex: 1; resize: none; max-height: 40vh;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line); border-radius: 22px;
  color: var(--ink); font: inherit; font-size: 0.85rem;
  padding: 13px 16px; line-height: 1.5; outline: none;
}
#input::placeholder { color: var(--muted); opacity: 0.7; }
.mic {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); cursor: pointer; font-size: 1.15rem;
  background: rgba(255,255,255,0.05); color: var(--ink);
  display: grid; place-items: center;
  transition: transform 0.12s ease, background 0.2s, border-color 0.2s;
}
.mic:active { transform: scale(0.92); }
.mic.listening {
  border-color: var(--accent2);
  background: rgba(255,158,203,0.18);
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,158,203,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(255,158,203,0); }
}
#send {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 1.3rem; color: #1b1230;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center;
  transition: transform 0.12s ease, opacity 0.2s;
}
#send:active { transform: scale(0.92); }
#send:disabled { opacity: 0.4; cursor: default; }

/* drawer */
.scrim {
  position: fixed; inset: 0; z-index: 5;
  background: rgba(6,5,12,0.6); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 6; inset: 0 0 0 auto;
  bottom: auto; height: var(--app-h, 100%); /* track visible viewport so keyboard slides up under drawer inputs */
  width: min(440px, 92vw); transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  border-left: 1px solid var(--line);
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }
.drawer.left {
  inset: 0 auto 0 0; transform: translateX(-100%);
  border-left: none; border-right: 1px solid var(--line);
}
.drawer.left.open { transform: translateX(0); }

/* three settled zones: pinned head, scrolling middle, pinned foot */
.drawer-panel { display: flex; flex-direction: column; height: 100%; }
.drawer-top {
  flex: 0 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 20px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(22, 18, 42, 0.4);
}
.drawer-scroll {
  flex: 1 1 auto; overflow-y: auto;
  padding: 18px 20px 8px;
  -webkit-overflow-scrolling: touch;
}
.drawer-bottom {
  flex: 0 0 auto;
  padding: 8px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13,11,22,0), rgba(13,11,22,0.55));
}
.primary.full { width: 100%; margin: 14px 0 0; }

.convo-actions { display: flex; gap: 8px; margin: 14px 0 0; }
.convo-actions .primary { flex: 1; }
.icon-square {
  flex: 0 0 auto; width: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(201,168,255,0.12); color: var(--accent);
  border: 1px solid var(--line); cursor: pointer;
}
.icon-square svg { display: block; }
.icon-square:active { transform: scale(0.97); }
.icon-square.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #1b1230; border-color: transparent; }
.convo-search { margin-top: 10px; }
.convo-search[hidden] { display: none; }
.convo-search input {
  width: 100%; font: inherit; font-size: 0.92rem;
  padding: 11px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  color: var(--ink); outline: none;
}
.convo-search input:focus { border-color: var(--accent); }
.convo-search input::placeholder { color: var(--muted); }
.convo-empty-search { color: var(--muted); font-size: 0.85rem; padding: 16px 4px; text-align: center; }

/* ── vision board: the launch flash ─────────────────────────── */
.vision {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  opacity: 0; pointer-events: none;
  transition: opacity 0.6s ease;
}
.vision.show { opacity: 1; pointer-events: auto; }
.vision-img {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: 0; transition: opacity 0.28s ease;
}
.vision-img.on { opacity: 1; }
/* blurred wash of the same photo: fills the screen with its own colors */
.vision-bg {
  position: absolute; inset: -8%;
  background-size: cover; background-position: center;
  filter: blur(32px) brightness(0.46) saturate(1.15);
  transform: scale(1.04);
}
/* the photo in a consistent TALL card (any source crops to portrait — cleanest,
   most uniform look) framed by a theme gradient, over a blurred wash of itself */
.vision-frame {
  position: relative; z-index: 1; box-sizing: border-box;
  width: min(88vw, 50.6vh); aspect-ratio: 9 / 16;
  padding: 1.5px; border-radius: 26px; overflow: hidden; line-height: 0;
  background: linear-gradient(140deg, var(--accent), var(--accent2));
  box-shadow: 0 24px 70px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06) inset;
}
.vision-frame img {
  display: block; width: 100%; height: 100%;
  border-radius: 25px; object-fit: cover;
}
.vision::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 50%, transparent 55%, rgba(6,5,12,0.45) 100%);
}
.vision-skip {
  position: absolute; z-index: 2;
  left: 0; right: 0; bottom: calc(26px + env(safe-area-inset-bottom));
  text-align: center; color: rgba(255,255,255,0.6);
  font-size: 0.78rem; letter-spacing: 0.08em; pointer-events: none;
}

/* ── vision board: settings pane ────────────────────────────── */
.vision-count { display: flex; gap: 8px; margin: 4px 0 16px; }
.vision-count button {
  flex: 1; font: inherit; font-size: 0.92rem; font-weight: 600;
  padding: 9px 0; border-radius: 11px; cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--muted);
}
.vision-count button.on {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #1b1230; border-color: transparent;
}
.vision-slots {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.vision-slot {
  position: relative; aspect-ratio: 1; border-radius: 14px;
  background: rgba(255,255,255,0.04); border: 1px dashed var(--line);
  display: grid; place-items: center; cursor: pointer; overflow: hidden;
  color: var(--muted); font-size: 1.6rem;
}
.vision-slot.filled { border-style: solid; }
.vision-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vision-slot .vision-del {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(6,5,12,0.6); color: #fff; font-size: 0.85rem;
  display: grid; place-items: center; backdrop-filter: blur(4px);
}

.convo-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.convo-row {
  display: flex; align-items: center; gap: 6px;
  border-radius: 12px; border: 1px solid transparent;
}
.convo-row.active { border-color: var(--line); background: rgba(201,168,255,0.08); }
.convo-title {
  flex: 1; text-align: left; background: none; border: none;
  color: var(--ink); font: inherit; font-size: 0.92rem;
  padding: 12px 12px; cursor: pointer; border-radius: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.convo-row:not(.active) .convo-title { color: var(--muted); }
.convo-title:active { background: rgba(255,255,255,0.05); }
.convo-row { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.convo-pin { flex: 0 0 auto; display: grid; place-items: center; color: var(--accent); opacity: 0.85; padding-left: 10px; }
.convo-pin svg { display: block; }
.convo-group-label {
  margin: 16px 4px 4px; font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); opacity: 0.8;
}
.convo-group-label:first-child { margin-top: 6px; }
.convo-rename-input {
  flex: 1; font: inherit; font-size: 0.92rem; padding: 11px 12px;
  border-radius: 12px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--accent); color: var(--ink); outline: none;
}

/* press-and-hold action sheet */
.sheet { position: fixed; inset: 0; z-index: 20; visibility: hidden; }
.sheet.open { visibility: visible; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(7,5,14,0.6); opacity: 0; transition: opacity 0.2s ease; }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 520px; margin: 0 auto;
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 8px 14px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(101%); transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
}
.sheet.open .sheet-panel { transform: translateY(0); }
.sheet-title {
  color: var(--muted); font-size: 0.82rem; text-align: center;
  padding: 12px 8px 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-menu { display: flex; flex-direction: column; gap: 7px; }
.sheet-item {
  width: 100%; text-align: left; font: inherit; font-size: 1rem;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  color: var(--ink); border-radius: 14px; padding: 15px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 13px;
}
.sheet-item:active { background: rgba(255,255,255,0.09); }
.sheet-ic { flex: 0 0 auto; display: grid; place-items: center; width: 20px; color: var(--accent); }
.sheet-ic svg { display: block; }
.sheet-item.danger, .sheet-item.danger .sheet-ic { color: #ff9a9a; }
.sheet-item.cancel { justify-content: center; color: var(--muted); background: none; border-color: transparent; margin-top: 4px; }
.sheet-input {
  width: 100%; font: inherit; font-size: 1rem; padding: 14px 16px;
  border-radius: 14px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--line); color: var(--ink); outline: none;
}
.sheet-input:focus { border-color: var(--accent); }

/* detail confirm card */
.detail-card {
  align-self: stretch; max-width: 86%; margin: 4px auto 0;
  background: rgba(201,168,255,0.07);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 16px;
}
.detail-card.done { background: rgba(160,255,200,0.06); }
.dc-count { font-size: 0.7rem; letter-spacing: 0.06em; color: var(--muted); opacity: 0.7; margin-bottom: 6px; }
.dc-count:empty { display: none; }
@keyframes dcSlide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.detail-card.dc-slide { animation: dcSlide 0.26s ease; }
.dc-head { font-size: 0.8rem; letter-spacing: 0.04em; color: var(--accent); margin-bottom: 8px; }
.dc-quote { font-size: 1.02rem; line-height: 1.5; color: var(--ink); margin-bottom: 12px; }
.dc-edit {
  width: 100%; resize: vertical; min-height: 64px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  border-radius: 12px; color: var(--ink); font: inherit; font-size: 1rem;
  padding: 10px 12px; line-height: 1.5; outline: none; margin-bottom: 12px;
}
.dc-actions { display: flex; gap: 8px; }
.dc-btn {
  font: inherit; font-size: 0.85rem; border-radius: 12px;
  padding: 9px 16px; cursor: pointer; border: 1px solid var(--line); background: none; color: var(--ink);
}
.dc-btn:active { transform: scale(0.96); }
.dc-yes { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #1b1230; border: none; font-weight: 600; }
.dc-no { color: var(--muted); }
.dc-back { margin-left: auto; border: none; color: var(--muted); padding-left: 6px; padding-right: 6px; opacity: 0.8; }
.dc-back:hover { opacity: 1; }
.dc-btn:disabled { opacity: 0.5; cursor: default; }
/* "the way" reflective card — a softer, mirror-toned variant of the detail card */
.way-card { background: rgba(143,180,255,0.06); }
.way-card.done { background: rgba(160,255,200,0.06); }
.way-card .dc-quote { font-style: italic; }
.dc-note { font-size: 0.86rem; line-height: 1.5; color: var(--muted); margin-bottom: 12px; }
.dc-actions { flex-wrap: wrap; }
.dc-explore { color: var(--accent); border-color: var(--line); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-head h2 { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: 0.02em; }
/* give the reality title life (not flat white) — the signature gradient */
#drawer .drawer-head h2 {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.head-actions { display: flex; align-items: center; gap: 10px; }
.hint { color: var(--muted); font-size: 0.82rem; line-height: 1.5; margin: 0 0 16px; }
.core-count { display: block; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; margin-top: 8px; }
.core-count:empty { display: none; }
.core-bar-actions { display: flex; gap: 8px; align-items: center; }
.core-bar-actions[hidden] { display: none; }
.chip {
  font: inherit; font-size: 0.8rem; letter-spacing: 0.02em;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  background: rgba(201,168,255,0.12); color: var(--accent);
  border: 1px solid var(--line);
  transition: transform 0.12s ease, background 0.2s, color 0.2s;
}
.chip:active { transform: scale(0.95); }
.chip-go { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #1b1230; border: none; font-weight: 600; }
.ghost-chip { background: none; color: var(--muted); }

/* secondary stack below the list */
.more { margin-top: 24px; padding-top: 6px; display: flex; flex-direction: column; }
.more .soft.full { width: 100%; }
.drawer label {
  display: block; margin: 16px 0 6px;
  font-size: 0.74rem; letter-spacing: 0.08em; text-transform: lowercase;
  color: var(--accent); opacity: 0.85;
}
.drawer textarea {
  width: 100%; resize: vertical;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); font: inherit; font-size: 0.95rem;
  padding: 11px 13px; line-height: 1.5; outline: none;
}
.drawer textarea:focus { border-color: var(--accent); }
.core-doc {
  width: 100%; resize: vertical; min-height: 240px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line); border-radius: 16px;
  color: var(--ink); font: inherit; font-size: 1rem;
  padding: 16px; line-height: 1.65; outline: none;
}
.core-doc:focus { border-color: var(--accent); }

/* core memory — Manifesto list (view) + edit mode */
.core-list { display: flex; flex-direction: column; min-height: 56px; margin-bottom: 2px; }
.core-empty { color: var(--muted); font-size: 0.95rem; line-height: 1.65; text-align: center; max-width: 21rem; margin: 13vh auto 0; padding: 0 12px; }

/* Manifesto: no boxes — each truth reads like a line of scripture */
.core-list.man .core-item {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 10px 2px; line-height: 1.45;
  font-size: 0.92rem; color: var(--ink);
  border-bottom: 1px solid rgba(201,168,255,0.10);
}
.core-list.man .core-item:last-child { border-bottom: none; }
.core-dot { color: var(--accent); flex: 0 0 auto; opacity: 0.8; }
.core-text { white-space: pre-wrap; }

/* edit mode keeps the same airy rhythm, just reveals controls */
.core-list.man.editing .core-item { align-items: center; gap: 10px; padding: 13px 2px; }
.core-list .core-item-input {
  flex: 1; resize: none; overflow: hidden;
  background: transparent; border: none; outline: none;
  color: var(--ink); font: inherit; font-size: 1.08rem; line-height: 1.5; padding: 0;
}
.core-del {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); background: none; color: var(--muted);
  cursor: pointer; font-size: 0.82rem; line-height: 1; display: grid; place-items: center;
}
.core-del:hover { color: var(--accent2); border-color: var(--accent2); }
.core-chat {
  display: flex; align-items: flex-end; gap: 9px;
}
#coreInput {
  flex: 1; resize: none; max-height: 30vh;
  background: rgba(201,168,255,0.08);
  border: 1px solid var(--line); border-radius: 18px;
  color: var(--ink); font: inherit; font-size: 0.95rem;
  padding: 11px 14px; line-height: 1.45; outline: none;
}
#coreInput::placeholder { color: var(--muted); opacity: 1; }
#coreInput:focus { border-color: var(--accent); }

/* ── live tour (coach-marks over the real app) ─────────────── */
.tour { position: fixed; inset: 0; z-index: 9500; }
.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(7,7,11,0.84);
  transition: top .26s ease, left .26s ease, width .26s ease, height .26s ease;
}
.tour-card {
  position: fixed; left: 50%; transform: translateX(-50%);
  width: min(20rem, 88vw);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 16px 13px; box-shadow: 0 14px 44px rgba(0,0,0,0.55);
}
.tour-card-center { top: 50%; transform: translate(-50%, -50%); }
.tour-title {
  font-size: 1.06rem; font-weight: 600; margin-bottom: 6px; letter-spacing: 0.01em;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.tour-body { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.tour-cta {
  margin-top: 13px; width: 100%; border: none; border-radius: 13px; padding: 11px;
  font: inherit; font-weight: 600; color: #1b1230; cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
}
.tour-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .2s; }
.tour-dots span.on { background: var(--accent); }
.tour-next {
  border: none; border-radius: 12px; padding: 9px 20px; font: inherit; font-weight: 600;
  color: #1b1230; cursor: pointer; background: linear-gradient(120deg, var(--accent), var(--accent2));
}
.tour-skip {
  background: none; border: none; padding: 0;
  color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer;
}
.tour-email {
  width: 100%; margin: 6px 0 10px; padding: 12px 14px; font: inherit; font-size: 0.95rem;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
}
.invite-link {
  width: 100%; word-break: break-all; text-align: center;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 12px; margin: 2px 0;
  color: var(--ink); font-size: 0.9rem;
}
#coreSend {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 1.05rem; color: #1b1230;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center;
}
#coreSend:active { transform: scale(0.92); }
#coreSend:disabled { opacity: 0.4; }
.primary, .soft {
  font: inherit; font-size: 0.9rem; border-radius: 14px;
  padding: 12px 18px; cursor: pointer; border: none;
}
.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #1b1230; font-weight: 600; }
.soft { background: rgba(201,168,255,0.12); color: var(--accent); border: 1px solid var(--line); }
.primary:active, .soft:active { transform: scale(0.97); }
.status { color: var(--muted); font-size: 0.82rem; margin-top: 12px; min-height: 1.2em; }
.lands { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.lands summary {
  cursor: pointer; color: var(--accent); font-size: 0.85rem;
  letter-spacing: 0.04em; list-style: none; opacity: 0.9;
}
.lands summary::-webkit-details-marker { display: none; }
.lands .hint { margin: 10px 0 12px; }

.voice-pick {
  margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.voice-pick label {
  color: var(--accent); font-size: 0.85rem; letter-spacing: 0.04em; opacity: 0.9;
}
.voice-pick select {
  width: 100%; appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,0.04); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; font-size: 0.92rem; font-family: inherit; cursor: pointer;
}
.voice-pick select:focus { border-color: var(--accent); outline: none; }
.voice-pick select:disabled { opacity: 0.5; cursor: default; }
.voice-hint { color: var(--muted); font-size: 0.76rem; line-height: 1.4; }

/* ── appearance: theme + icon pickers ─────────────────────── */
.set-label {
  display: block; margin: 18px 0 10px;
  font-size: 0.74rem; letter-spacing: 0.08em; color: var(--accent); opacity: 0.85;
}
.set-label:first-of-type { margin-top: 8px; }
.opt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.opt {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
}
.opt .chip-preview {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 18px;
  border: 2px solid transparent; position: relative;
  background-size: cover; background-position: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: border-color 0.2s, transform 0.12s ease;
}
.opt:active .chip-preview { transform: scale(0.95); }
.opt.selected .chip-preview { border-color: var(--ink); }
.opt.selected .chip-preview::after {
  content: "✓"; position: absolute; right: 7px; bottom: 5px;
  font-size: 0.82rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.55);
}
.opt-name { font-size: 0.72rem; letter-spacing: 0.02em; color: var(--muted); }
.opt.selected .opt-name { color: var(--ink); }
.appearance .voice-pick { margin-top: 16px; border-top: none; padding-top: 0; }

/* ── settings page: iOS-style grouped rows ────────────────── */
.set-group-label {
  display: block; margin: 24px 6px 9px;
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: lowercase;
  color: var(--muted); opacity: 0.8;
}
.set-group-label:first-child { margin-top: 4px; }
.set-group {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
}
.set-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left; font: inherit; color: var(--ink);
  background: none; border: none; cursor: pointer;
  padding: 14px 15px;
  border-bottom: 1px solid rgba(201,168,255,0.08);
}
.set-group .set-row:last-child { border-bottom: none; }
.set-row:active { background: rgba(255,255,255,0.05); }
.set-row.static { cursor: default; }
.set-row.static:active { background: none; }
.set-ic {
  width: 28px; height: 28px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 0.92rem;
  background: rgba(201,168,255,0.14); color: var(--accent);
}
.set-row-label { flex: 1; font-size: 1rem; }
.set-row-val {
  color: var(--muted); font-size: 0.88rem;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%;
}
.set-chev { color: var(--muted); opacity: 0.55; font-size: 1.15rem; flex: 0 0 auto; }

/* read-only memory panes ("what's going on", "my way back") — they build themselves */
.memory-view {
  white-space: pre-line; line-height: 1.62; font-size: 0.95rem; color: var(--ink);
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  border-radius: 14px; padding: 15px 16px; min-height: 4.5rem;
}
.memory-view.empty { color: var(--muted); font-style: italic; }
.memory-clear {
  margin-top: 13px; background: none; border: 1px solid var(--line);
  color: var(--muted); font: inherit; font-size: 0.85rem;
  border-radius: 11px; padding: 8px 15px; cursor: pointer;
}
.memory-clear:active { background: rgba(255,255,255,0.05); }
/* "your plan" — gently highlighted so it's findable without being a sales pitch */
.set-group-plan { border-color: rgba(201,168,255,0.5); box-shadow: 0 6px 24px rgba(201,168,255,0.12); }
.set-swatch {
  width: 24px; height: 24px; border-radius: 7px; display: inline-block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* detail panes (drilled-in views) */
.set-pane { padding-top: 4px; }
.set-pane[hidden] { display: none; }
.set-pane .voice-pick { margin-top: 0; border-top: none; padding-top: 0; }

/* cloud sync card */
.sync-card {
  border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 16px 18px;
  background: linear-gradient(160deg, rgba(201,168,255,0.06), rgba(255,158,203,0.04));
}
.sync-card[hidden] { display: none; }
.sync-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.sync-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted); opacity: 0.5; flex: none;
}
.sync-dot.on {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  opacity: 1; box-shadow: 0 0 10px var(--accent);
}
.sync-state { color: var(--ink); font-size: 0.92rem; font-weight: 600; letter-spacing: 0.01em; }
.key-row { display: flex; gap: 8px; align-items: stretch; margin-top: 4px; }
.key-field {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); font: inherit; font-size: 0.84rem;
  padding: 11px 13px; outline: none;
  letter-spacing: 0.02em;
}
.key-field:focus { border-color: var(--accent); }
.key-row .soft { flex: none; padding-left: 16px; padding-right: 16px; border-radius: 14px; }

/* header back button alignment */
#settingsBack[hidden] { display: none; }
.drawer-head #settingsTitle { flex: 1; text-align: center; }
.drawer-head #settingsBack { justify-self: start; }
.drawer-head #closeSettings { justify-self: end; }

/* rich text inside the voice's replies */
.msg.voice .body strong { font-weight: 600; color: var(--ink); }
.msg.voice .body em { font-style: italic; }
.msg.voice .body code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em;
  background: rgba(255,255,255,0.07); padding: 1px 6px; border-radius: 6px;
}
.msg.voice .body hr {
  border: none; height: 1px; margin: 14px 0;
  background: linear-gradient(90deg, transparent, rgba(201,168,255,0.35), transparent);
}

/* ---------- the Window (the doorway you open into) ---------- */
.window[hidden] { display: none; }
.window {
  position: fixed; inset: 0; z-index: 9000; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 12%, var(--bg2), var(--bg) 64%);
  animation: winIn 0.6s ease both;
}
@keyframes winIn { from { opacity: 0; } to { opacity: 1; } }
/* her vision photo as a soft, dimmed wallpaper (crossfades between images) */
.win-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.6s ease; transform: scale(1.05);
  animation: winDrift 24s ease-in-out infinite alternate;
}
.win-bg.show { opacity: 0.5; }
@keyframes winDrift { from { transform: scale(1.05) translateY(0); } to { transform: scale(1.12) translateY(-2%); } }
.win-scrim { position: absolute; inset: 0; background: radial-gradient(120% 95% at 50% 32%, rgba(12,10,20,0.30), rgba(12,10,20,0.86) 78%); }
.win-content {
  position: relative; z-index: 1; height: 100%; width: 100%; max-width: 28rem; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 18px; padding: max(26px,env(safe-area-inset-top)) 26px max(34px,env(safe-area-inset-bottom));
}
.win-star { filter: drop-shadow(0 0 24px rgba(201,168,255,0.55)); }
.win-wordmark { font-size: 0.9rem; letter-spacing: 0.42em; text-indent: 0.42em; color: var(--muted); }
.win-line {
  min-height: 2.4em; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; line-height: 1.45; font-weight: 600; letter-spacing: -0.01em;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  transition: opacity 0.7s ease; opacity: 0;
}
.win-line.show { opacity: 1; }
.win-lock[hidden] { display: none; }
.win-lock { width: 100%; max-width: 17rem; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.win-lock-title { font-size: 0.95rem; color: var(--ink); opacity: 0.85; margin: 0; letter-spacing: 0.02em; }
.win-dots { display: flex; gap: 16px; }
.win-dots span { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.6); transition: background 0.15s, border-color 0.15s; }
.win-dots span.on { background: var(--accent); border-color: var(--accent); }
.win-lock.shake { animation: winShake 0.4s; }
@keyframes winShake { 0%,100%{ transform: translateX(0); } 20%,60%{ transform: translateX(-9px); } 40%,80%{ transform: translateX(9px); } }
.win-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.win-key {
  width: 72px; height: 72px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.10); border: 0.5px solid rgba(255,255,255,0.16);
  color: var(--ink); font: inherit; font-size: 1.7rem; font-weight: 400;
  display: grid; place-items: center; -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, transform 0.08s;
}
.win-key:active { background: rgba(255,255,255,0.30); transform: scale(0.95); }
.win-key.win-key-fn { background: none; border: none; font-size: 0.95rem; color: var(--muted); }
.win-key.win-key-blank { visibility: hidden; pointer-events: none; }
.win-faceid[hidden] { display: none; }
.win-faceid { background: none; border: none; color: var(--accent); font: inherit; font-size: 0.92rem; cursor: pointer; opacity: 0.9; }
/* settings: passcode lock pane */
#lockPane .key-field { margin-bottom: 10px; }
.lock-len { display: flex; gap: 10px; margin: 12px 0; }
.lock-len button { flex: 1; padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer; }
.lock-len button.on { border-color: var(--accent); color: var(--accent); background: rgba(201,168,255,0.1); }
.lock-actions { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.lock-btn { width: 100%; padding: 12px; border-radius: 14px; font: inherit; font-size: 0.9rem; cursor: pointer; background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--ink); }
.lock-btn.primary { background: linear-gradient(120deg, var(--accent), var(--accent2)); color: #1b1230; border: none; font-weight: 600; }
.lock-btn.danger { color: var(--accent2); }
.lock-msg { min-height: 1em; font-size: 0.8rem; color: var(--accent2); margin: 8px 0 0; }
.lock-faceid { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 6px; font-size: 0.92rem; color: var(--ink); }
.lk-toggle { background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 5px 16px; font: inherit; font-size: 0.8rem; cursor: pointer; }
.lk-toggle.on { background: rgba(201,168,255,0.15); border-color: var(--accent); color: var(--accent); }
.win-enter {
  margin-top: 6px; font: inherit; font-size: 1rem; font-weight: 600; color: #1b1230; letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--accent), var(--accent2)); border: none; border-radius: 999px;
  padding: 13px 34px; cursor: pointer;
}
.win-enter:active { transform: scale(0.97); }
.window.win-flash .win-enter, .window.win-flash .win-wordmark { display: none; }
.topbar .title { cursor: pointer; }

/* ---------- private access gate (lock screen) ---------- */
.access-gate {
  position: fixed; inset: 0; z-index: 100000;
  bottom: auto; height: var(--app-h, 100%); /* keep the card above the keyboard when typing email/password/code */
  background: radial-gradient(120% 90% at 50% 12%, var(--bg2), var(--bg) 70%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.access-gate .ag-card {
  width: 100%; max-width: 22rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.access-gate .ag-star {
  font-size: 2rem; line-height: 1;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(201,168,255,0.5));
}
.access-gate h1 {
  margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: 0.12em;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.access-gate p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.access-gate input {
  width: 100%; margin-top: 6px; text-align: center;
  background: rgba(255,255,255,0.05); border: 1px solid var(--ring, rgba(201,168,255,0.3));
  border-radius: 14px; color: var(--ink); font: inherit; font-size: 1rem;
  padding: 13px 14px; outline: none; letter-spacing: 0.06em;
}
.access-gate input:focus { border-color: var(--accent); }
.access-gate button {
  width: 100%; border: none; border-radius: 16px; padding: 13px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 1rem; color: #1b1230;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
}
.access-gate button:active { transform: scale(0.98); }
.access-gate button:disabled { opacity: 0.7; }
.access-gate .ag-msg { min-height: 1.1em; font-size: 0.82rem; color: var(--accent2); }
/* secondary, quiet action (i'll wait / not now) */
.access-gate button.ag-ghost {
  background: none; color: var(--muted); font-weight: 500; font-size: 0.9rem;
  padding: 8px; margin-top: 2px;
}
/* ---------- plans + limit screen ---------- */
.plan-gate .pl-wrap { max-width: 26rem; }
.pl-grid {
  width: 100%; display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 6px;
}
.pl-card {
  position: relative; text-align: center; border-radius: 16px; padding: 14px 10px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--ring, rgba(201,168,255,0.25));
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.pl-card.current { border-color: var(--accent); background: rgba(201,168,255,0.10); }
.pl-name { font-size: 1rem; font-weight: 600; letter-spacing: 0.03em; color: var(--ink); }
.pl-blurb { font-size: 0.86rem; color: var(--muted); }
.pl-fine { font-size: 0.72rem; color: var(--muted); opacity: 0.7; }
.pl-price {
  font-size: 1.15rem; font-weight: 700;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pl-price .pl-per { font-size: 0.7rem; font-weight: 500; -webkit-text-fill-color: var(--muted); }
.pl-limit { font-size: 0.78rem; color: var(--muted); }
.pl-pick {
  margin-top: 8px; width: 100%; border: none; border-radius: 12px; padding: 9px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 0.85rem; color: #1b1230;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
}
.pl-pick:active { transform: scale(0.98); }
.pl-badge { margin-top: 8px; font-size: 0.74rem; color: var(--accent2); letter-spacing: 0.04em; }
.pl-note { margin-top: 12px !important; font-size: 0.82rem; color: var(--accent2) !important; }
/* ---------- email sign-in ---------- */
.hide { display: none !important; }
.auth-gate .ag-card { position: relative; }
.auth-gate .au-x {
  position: absolute; top: -8px; right: -4px;
  width: auto !important; padding: 4px 10px; margin: 0;
  background: none; color: var(--muted); font-size: 1.7rem; line-height: 1; font-weight: 400;
}
.auth-gate .au-x:active { transform: none; }
.auth-gate #auStep2, .auth-gate #auStep1 { width: 100%; display: flex; flex-direction: column; gap: 10px; }
/* gentle 'save your world' sign-in nudge */
.signin-nudge {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 9000;
  width: calc(100% - 28px); max-width: 26rem;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 16px;
  background: rgba(28, 22, 42, 0.96); border: 1px solid var(--ring, rgba(201,168,255,0.3));
  box-shadow: 0 10px 30px rgba(0,0,0,0.45); backdrop-filter: blur(8px);
  transform: translate(-50%, 160%); opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.signin-nudge.show { transform: translate(-50%, 0); opacity: 1; }
.signin-nudge .sn-star {
  font-size: 1rem;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.signin-nudge .sn-text { flex: 1; font-size: 0.82rem; color: var(--ink); line-height: 1.3; }
.signin-nudge .sn-go {
  border: none; border-radius: 11px; padding: 8px 12px; cursor: pointer; white-space: nowrap;
  font: inherit; font-weight: 600; font-size: 0.82rem; color: #1b1230;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
}
.signin-nudge .sn-x {
  border: none; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1;
  cursor: pointer; padding: 2px 4px;
}

/* ---------- first-open click-through ---------- */
.onboard[hidden] { display: none; }
.onboard {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(120% 90% at 50% 8%, var(--bg2), var(--bg) 70%);
  display: flex; flex-direction: column;
  padding: max(28px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
}
.ob-aura {
  position: absolute; left: 50%; top: -14%; width: 480px; height: 480px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(201,168,255,0.20), transparent 62%);
  pointer-events: none; filter: blur(6px);
}
.ob-skip {
  position: absolute; top: max(20px, env(safe-area-inset-top)); right: 22px;
  background: none; border: none; color: var(--muted);
  font: inherit; font-size: 0.86rem; opacity: 0.7; cursor: pointer; z-index: 2;
}
.ob-skip:hover { opacity: 1; }
.ob-stage {
  flex: 1; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
}
.ob-slide {
  max-width: 30rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  animation: obIn 0.5s ease both;
}
.ob-slide[hidden] { display: none; }
@keyframes obIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ob-star { filter: drop-shadow(0 0 22px rgba(201,168,255,0.45)); margin-bottom: 4px; }
.ob-slide h1 {
  margin: 0; font-size: 2rem; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ob-slide p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 1.04rem; }
.ob-slide p strong { color: var(--accent); font-weight: 600; }
.ob-slide .ob-sub { font-size: 0.92rem; opacity: 0.78; }
.ob-visual { line-height: 0; margin-bottom: 2px; }
.ob-visual svg { filter: drop-shadow(0 0 16px rgba(201,168,255,0.4)); }
.ob-steps {
  list-style: none; margin: 6px 0 0; padding: 0; width: 100%;
  max-width: 26rem; text-align: left;
  display: flex; flex-direction: column; gap: 14px;
}
.ob-steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); line-height: 1.5; font-size: 1rem; }
.ob-steps li .num {
  flex: none; width: 25px; height: 25px; border-radius: 50%;
  display: grid; place-items: center; margin-top: 1px;
  font-size: 0.8rem; font-weight: 700; color: #1a1330;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
}
.ob-steps li strong { color: var(--accent); font-weight: 600; }
.ob-key-row { display: flex; gap: 10px; width: 100%; margin-top: 6px; }
.ob-key {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,168,255,0.32); border-radius: 14px;
  padding: 13px 14px; color: var(--ink); font: inherit; font-size: 0.82rem;
  letter-spacing: 0.02em; text-align: center;
}
.ob-copy {
  flex: none; padding: 0 20px; border-radius: 14px; border: none; cursor: pointer;
  font: inherit; font-weight: 600; color: #1a1330;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
}
.ob-copy:active { transform: scale(0.97); }
.ob-keystatus { font-size: 0.86rem !important; opacity: 0.85; }
.ob-foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 18px;
}
.ob-dots { display: flex; gap: 8px; }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.18); transition: all 0.25s ease; }
.ob-dot.on { background: linear-gradient(120deg, var(--accent), var(--accent2)); transform: scale(1.25); }
.ob-nav { display: flex; align-items: center; gap: 8px; }
.ob-back {
  background: none; border: none; color: var(--muted);
  font: inherit; font-size: 0.92rem; cursor: pointer; padding: 12px 14px; opacity: 0.8;
}
.ob-back[hidden] { display: none; }
.ob-back:hover { opacity: 1; }
.ob-next {
  border: none; cursor: pointer; font: inherit; font-weight: 600; color: #1a1330;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  padding: 13px 30px; border-radius: 16px; font-size: 1rem;
}
.ob-next:active { transform: scale(0.98); }
