:root {
  --bg: #070605;
  --surface: rgba(22, 19, 15, 0.78);
  --surface-solid: #14110d;
  --text: #f3ead8;
  --muted: #9b8d76;
  --dim: #6d6354;
  --gold: #d4b36a;
  --gold-bright: #ead7a2;
  --ink: #1b150c;
  --wine: #7a2e38;
  --ok: #b7c9a3;
  --err: #d27a7a;
  --line: rgba(234, 215, 162, 0.12);
  --fill: rgba(234, 215, 162, 0.08);
  --user-fill: rgba(212, 179, 106, 0.18);
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --display: "Cinzel", "Iowan Old Style", Palatino, "Times New Roman", serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --bar-h: 56px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 var(--ui);
  letter-spacing: -0.011em;
}
body { overflow: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }
code { color: var(--gold-bright); font-size: 0.92em; }
.column { width: min(720px, 100%); margin: 0 auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

.tui {
  position: relative;
  height: 100%;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  isolation: isolate;
}
.scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("/static/hero.jpg?v=8") 88% 30% / auto 78% no-repeat;
}
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 6, 5, 0.28) 0%, rgba(7, 6, 5, 0.08) 28%, rgba(7, 6, 5, 0.55) 62%, #070605 100%);
}
.tui:not(.at-home) .scene::after {
  background: linear-gradient(180deg, rgba(7, 6, 5, 0.82) 0%, #070605 48%);
}
.shine {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.shine-wash {
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(ellipse 58% 48% at 50% 46%, rgba(255, 228, 168, 0.3), transparent 58%),
    radial-gradient(ellipse 86% 70% at 50% 48%, rgba(212, 175, 55, 0.14), transparent 72%);
  animation: kind-wash 16s ease-in-out infinite;
}
.shine-ring {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 90px;
  height: 90px;
  margin: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 232, 180, 0.28);
  box-shadow: 0 0 24px rgba(241, 215, 122, 0.18), inset 0 0 18px rgba(255, 236, 190, 0.08);
  transform: translate(-50%, -50%) scale(0.25);
  opacity: 0;
  animation: kind-ring 11s ease-out infinite;
}
.shine-ring.r2 { animation-delay: 3.6s; }
.shine-ring.r3 { animation-delay: 7.2s; }
.shine-ray {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 140vmax;
  height: 2px;
  margin-left: 0;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgba(255, 236, 190, 0.42), rgba(241, 215, 122, 0.12) 28%, transparent 72%);
  filter: blur(1.2px);
  opacity: 0;
  animation: kind-ray 18s ease-in-out infinite;
}
.shine-ray.a { transform: rotate(-18deg); animation-delay: 0s; }
.shine-ray.b { transform: rotate(16deg); animation-delay: 4s; height: 1px; }
.shine-ray.c { transform: rotate(148deg); animation-delay: 8s; }
.shine-ray.d { transform: rotate(198deg); animation-delay: 12s; height: 1px; }
.tui:not(.at-home) .shine { opacity: 0.28; }
.lamps {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.lamp {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d2 0%, #ffd36a 32%, rgba(255, 168, 52, 0.45) 58%, transparent 74%);
  box-shadow:
    0 0 10px 4px rgba(255, 196, 90, 0.7),
    0 0 26px 12px rgba(255, 150, 40, 0.28);
  mix-blend-mode: screen;
  animation: lamp-flicker 2.8s ease-in-out infinite;
}
.lamp.lantern {
  left: 31%;
  top: 16%;
  width: 18px;
  height: 22px;
  background: radial-gradient(circle, #fff8dc 0%, #ffcc66 38%, rgba(255, 170, 50, 0.4) 62%, transparent 78%);
  box-shadow:
    0 0 16px 8px rgba(255, 200, 90, 0.75),
    0 0 42px 18px rgba(255, 150, 40, 0.32);
  animation-duration: 3.6s;
}
.lamp.w1 { left: 14%; top: 19%; animation-delay: 0.4s; animation-duration: 3.1s; }
.lamp.w2 { left: 22%; top: 17.5%; width: 7px; height: 7px; animation-delay: 1.1s; animation-duration: 2.4s; }
.lamp.w3 { left: 39%; top: 18%; animation-delay: 0.7s; }
.lamp.w4 { left: 58%; top: 17%; width: 8px; height: 8px; animation-delay: 1.6s; animation-duration: 3.3s; }
.lamp.w5 { left: 67%; top: 19%; animation-delay: 0.2s; animation-duration: 2.6s; }
.lamp.w6 { left: 74%; top: 18.5%; width: 6px; height: 6px; animation-delay: 2s; }
.lamp.glow {
  width: 70px;
  height: 48px;
  background: radial-gradient(ellipse, rgba(255, 196, 90, 0.28), transparent 70%);
  box-shadow: none;
  filter: blur(6px);
  animation-duration: 4.8s;
}
.lamp.g1 { left: 24%; top: 14%; }
.lamp.g2 { left: 60%; top: 13%; animation-delay: 1.8s; }
.lamp.reflect {
  width: 5px;
  height: 42px;
  border-radius: 40px;
  background: linear-gradient(180deg, rgba(255, 214, 120, 0.55), rgba(255, 180, 70, 0.12) 55%, transparent);
  box-shadow: 0 0 12px 3px rgba(255, 180, 70, 0.25);
  filter: blur(1.5px);
  animation-name: lamp-reflect;
  animation-duration: 3.2s;
}
.lamp.r1 { left: 31.4%; top: 22%; height: 56px; }
.lamp.r2 { left: 22.2%; top: 21%; animation-delay: 1.1s; }
.lamp.r3 { left: 67.2%; top: 22%; animation-delay: 0.2s; }
@keyframes lamp-flicker {
  0%, 100% { opacity: 0.62; transform: scale(0.88); filter: brightness(0.88); }
  18% { opacity: 0.95; transform: scale(1.06); filter: brightness(1.12); }
  32% { opacity: 0.7; transform: scale(0.94); filter: brightness(0.92); }
  55% { opacity: 1; transform: scale(1.1); filter: brightness(1.18); }
  78% { opacity: 0.78; transform: scale(0.96); filter: brightness(0.95); }
}
@keyframes lamp-reflect {
  0%, 100% { opacity: 0.28; transform: scaleY(0.92); }
  50% { opacity: 0.55; transform: scaleY(1.08); }
}
.tui:not(.at-home) .lamps { opacity: 0.35; }
@keyframes kind-wash {
  0%, 100% { opacity: 0.35; transform: scale(1) translate3d(0, 0, 0); }
  50% { opacity: 0.7; transform: scale(1.08) translate3d(0, -2%, 0); }
}
@keyframes kind-ring {
  0% { transform: translate(-50%, -50%) scale(0.18); opacity: 0.55; }
  18% { opacity: 0.32; }
  100% { transform: translate(-50%, -50%) scale(7.4); opacity: 0; }
}
@keyframes kind-ray {
  0%, 100% { opacity: 0; filter: blur(2px); }
  22% { opacity: 0.55; }
  50% { opacity: 0.18; }
  72% { opacity: 0.4; }
}
@keyframes bloom-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes bloom-glow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.35));
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.22), 0 0 48px rgba(241, 215, 122, 0.12);
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(241, 215, 122, 0.72));
    box-shadow: 0 0 36px rgba(241, 215, 122, 0.42), 0 0 80px rgba(212, 175, 55, 0.22);
  }
}
@keyframes bloom-glow-soft {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.28)); }
  50% { filter: drop-shadow(0 0 14px rgba(241, 215, 122, 0.6)); }
}
.tui > *:not(.scene) { position: relative; z-index: 1; }

.status {
  min-height: var(--bar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 10px 8px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  border-bottom: 1px solid var(--line);
}
.tui:not(.at-home) .status { border-bottom-color: var(--line); }
.status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.brand-center {
  justify-self: auto;
}
.logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
  animation: bloom-glow-soft 4.8s ease-in-out infinite;
}
.nav-title { display: none; }
.nav-sub {
  display: none;
  max-width: min(72vw, 280px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.tui:not(.at-home) .nav-sub { display: block; }
.icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 248, 230, 0.16);
  border: 1px solid rgba(234, 215, 162, 0.22);
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn:active { transform: scale(0.94); opacity: 0.85; }
.account-pill {
  background: var(--fill);
  color: var(--gold-bright);
  font: 600 14px/1 var(--ui);
  letter-spacing: 0;
  text-transform: none;
}
.account-pill.has-user {
  background: linear-gradient(180deg, #ead7a2, #c9a054);
  color: var(--ink);
}
.account-pill.has-user .account-guest-icon { display: none; }
.account-pill:not(.has-user) #account-initial { display: none !important; }

.scrollback {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 16px 20px;
}
.at-home .scrollback {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
}
.welcome {
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12px 4px 16px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font: 580 11px/1.2 var(--ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hero-mark {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  margin: 0 0 14px;
  animation: bloom-float 6.4s ease-in-out infinite, bloom-glow 4.2s ease-in-out infinite;
  will-change: transform, filter, box-shadow;
}
.wordmark {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: clamp(26px, 7vw, 40px);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 0 22px rgba(241, 215, 122, 0.35);
  animation: kind-letter 7s ease-in-out infinite;
}
@keyframes kind-letter {
  0%, 100% { text-shadow: 0 0 16px rgba(241, 215, 122, 0.22); }
  50% { text-shadow: 0 0 28px rgba(241, 215, 122, 0.5); }
}
.welcome .slogan {
  margin: 0 auto 8px;
  color: var(--gold);
  font: 500 17px/1.35 var(--display);
  max-width: 20rem;
}
.welcome .lede {
  margin: 0 auto 18px;
  color: color-mix(in srgb, var(--text) 88%, transparent);
  max-width: 20.5rem;
  padding: 0 6px;
  font-size: 15px;
  line-height: 1.45;
}
.daily-card {
  width: min(520px, 100%);
  margin: 0 0 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, #1a1610 62%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  color: inherit;
  cursor: pointer;
}
.daily-copy { flex: 1; min-width: 0; }
.daily-card .eyebrow { margin-bottom: 4px; }
.daily-title {
  display: block;
  font: 600 17px/1.25 var(--ui);
  letter-spacing: -0.02em;
  color: var(--gold-bright);
}
.daily-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}
.chevron {
  width: 8px;
  height: 8px;
  border-right: 1.6px solid var(--muted);
  border-top: 1.6px solid var(--muted);
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.daily-card:active, .path-board button:active, .ask-open:active { transform: scale(0.985); }

.path-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(520px, 100%);
  margin: 0 0 16px;
}
.path-board button {
  min-height: 108px;
  min-width: 0;
  padding: 14px 12px 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, #1a1610 62%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--text);
  border-radius: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  cursor: pointer;
}
.path-kicker {
  margin-bottom: 8px;
  color: var(--gold);
  font: 580 11px/1 var(--ui);
  letter-spacing: 0.14em;
}
.path-board button > span:nth-of-type(2) {
  font: 600 15px/1.2 var(--ui);
  letter-spacing: -0.02em;
}
.path-board small {
  font: 400 12px/1.35 var(--ui);
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ask-open {
  width: min(520px, 100%);
  min-height: 50px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, #1a1610 70%, transparent);
  color: var(--muted);
  font: 500 16px/1 var(--ui);
  letter-spacing: 0;
  text-transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: none;
}
.ask-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(212, 179, 106, 0.55);
}

.app-note {
  margin: 0 0 8px;
  color: var(--err);
  font-size: 13px;
  text-align: center;
}

.block {
  display: flex;
  margin: 0 auto 10px;
  width: 100%;
  max-width: 640px;
}
.block .rail { display: none; }
.block.user { justify-content: flex-end; }
.block.assistant { justify-content: flex-start; }
.block .body {
  max-width: min(92%, 520px);
  padding: 11px 14px 12px;
  border-radius: 18px 18px 18px 6px;
  background: color-mix(in srgb, #1c1813 88%, transparent);
  border: 1px solid var(--line);
}
.block.user .body {
  border-radius: 18px 18px 6px 18px;
  background: var(--user-fill);
  border-color: color-mix(in srgb, var(--gold) 28%, transparent);
}
.block.crisis .body {
  border-color: color-mix(in srgb, var(--err) 50%, transparent);
  color: #ffd6d8;
}
.who-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.who {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.block.user .who { color: var(--gold); }
.listen {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.listen.on, #listen-last.on { color: var(--gold); }
.body p { margin: 0 0 8px; }
.body p:last-child { margin-bottom: 0; }
.body ul, .body ol { margin: 0 0 8px; padding-left: 1.15em; }
.body h3, .body h4, .body h5 {
  margin: 12px 0 6px;
  font: 650 16px/1.25 var(--ui);
  letter-spacing: -0.02em;
  color: var(--gold-bright);
}
.thinking {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 18px;
}
.thinking span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.35;
  animation: think 1.1s ease-in-out infinite;
}
.thinking span:nth-child(2) { animation-delay: 0.15s; }
.thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes think {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.prompt-wrap {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  padding: 8px 12px calc(10px + var(--safe-bottom));
}
.player-bar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--fill);
  border-radius: 16px;
}
.player-bar[hidden] { display: none !important; }
.player-bar .icon-btn, #player-stop {
  width: auto;
  min-width: 56px;
  height: 36px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
}
#player-toggle { color: var(--ink); background: var(--gold); }
.player-meta { min-width: 0; }
.player-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#player-seek { width: 100%; accent-color: var(--gold); height: 16px; }
.player-time { font-size: 11px; color: var(--muted); min-width: 4.6rem; text-align: right; }

.composer-slot { width: min(640px, 100%); margin: 0 auto; }
.at-home #home-composer { display: none; }
.at-home.asking #home-composer { display: block; }
.at-home.asking .ask-open { display: none; }
.at-home:not(.asking) #chat-composer { display: none; }
.at-home:not(.asking) .prompt-wrap:has(#player-bar[hidden]) {
  padding-top: 0;
  padding-bottom: var(--safe-bottom);
}
.at-home #chat-composer:empty { display: none; }

#composer {
  display: grid;
  grid-template-columns: minmax(104px, 28%) 1fr 44px 44px;
  gap: 6px;
  align-items: end;
  padding: 6px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, #14110d 82%, transparent);
  border-radius: 22px;
}
#composer:focus-within { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.voice-field { min-width: 0; }
#voice {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: var(--fill);
  color: var(--text);
  font: 600 13px/1.2 var(--ui);
  padding: 8px 10px;
  border-radius: 16px;
  appearance: none;
}
#listen-last {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--gold-bright);
}
#send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #ead7a2, #c9a054);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(201, 160, 84, 0.28);
}
#send:disabled { opacity: 0.45; cursor: wait; }
textarea {
  width: 100%;
  resize: none;
  min-height: 28px;
  max-height: 120px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 10px 4px;
}

dialog.modal,
.modal {
  background: #16130f !important;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 18px 20px;
  width: min(430px, calc(100vw - 24px));
  max-height: min(86dvh, 720px);
  overflow: auto;
  font: inherit;
  margin: auto;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}
.modal::backdrop { background: rgba(4, 3, 2, 0.62); }
.modal[open] { animation: rise 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
.modal[open]::backdrop { animation: fade 0.22s ease-out; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.grabber {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: rgba(234, 215, 162, 0.28);
  margin: 4px auto 10px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-title {
  color: var(--text);
  font: 650 18px/1.2 var(--ui);
  letter-spacing: -0.02em;
}
.x {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: var(--fill);
  color: var(--muted);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.modal p { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.modal label { display: block; color: var(--muted); margin: 10px 0 6px; font-size: 13px; }
.modal input, .modal select {
  width: 100%;
  background: var(--fill);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 16px;
  padding: 12px 12px;
  min-height: 46px;
  border-radius: 12px;
}
.modal menu {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 0;
}
.modal menu button, .modal button[type="submit"], #restore-iap, .btn-plus {
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  color: var(--text);
  font: 600 15px/1 var(--ui);
  cursor: pointer;
}
.modal menu button[type="submit"],
#account-submit,
#pray-go,
#daily-ask,
.lookup button {
  background: linear-gradient(180deg, #ead7a2, #c9a054);
  color: var(--ink);
}
.danger {
  color: var(--err) !important;
  background: color-mix(in srgb, var(--err) 12%, transparent) !important;
}
.err { color: var(--err); }
.muted { color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; min-height: 22px; }

#thread-list { display: flex; flex-direction: column; gap: 6px; }
#thread-list button {
  text-align: left;
  width: 100%;
  min-height: 52px;
  background: var(--fill);
  border: 1px solid transparent;
  color: var(--text);
  font: 500 16px/1.3 var(--ui);
  padding: 12px 14px;
  cursor: pointer;
  border-radius: 14px;
}
#thread-list button.on { background: var(--user-fill); color: var(--gold-bright); }
.thread-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: stretch; }
.thread-row .drop {
  width: 44px;
  min-width: 44px;
  color: var(--muted);
  background: transparent;
}
.lookup {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0 0 12px;
}
.lookup input {
  width: 100%;
  background: var(--fill);
  border: 1px solid var(--line);
  padding: 12px;
  min-height: 46px;
  border-radius: 12px;
}
#pray-input {
  width: 100%;
  background: var(--fill);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 12px;
  min-height: 96px;
  resize: vertical;
  font-size: 16px;
}
.passage { width: min(560px, calc(100vw - 20px)); }
.passage-body { max-height: 56dvh; overflow: auto; text-align: left; padding-right: 4px; }
.passage-body .verse { margin: 0 0 10px; color: var(--text); font-size: 17px; line-height: 1.5; }
.passage-body .verse.on {
  background: var(--user-fill);
  padding: 8px 10px;
  border-radius: 10px;
}
.passage-body sup { color: var(--gold); margin-right: 6px; font-size: 11px; font-weight: 700; }
.tabs { display: flex; gap: 4px; margin: 4px 0 14px; padding: 3px; background: var(--fill); border-radius: 12px; }
.tabs button {
  flex: 1;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 600 14px/1 var(--ui);
}
.tabs button.on { background: color-mix(in srgb, #2a241c 90%, var(--gold)); color: var(--text); }
.plan-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin: 0 0 10px;
  text-align: left;
  background: var(--fill);
}
.plan-card strong { color: var(--gold-bright); }
.plan-card a, .plan-card .btn-plus {
  display: inline-block;
  margin-top: 10px;
  color: var(--ink);
  background: linear-gradient(180deg, #ead7a2, #c9a054);
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 600;
}
.google-slot { margin-top: 12px; min-height: 44px; display: flex; justify-content: center; }

@media (max-width: 640px) {
  dialog.modal, .modal, .passage {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
    max-height: 92dvh;
    padding-bottom: calc(18px + var(--safe-bottom));
  }
  .modal[open] { animation: sheet 0.32s cubic-bezier(0.22, 1, 0.36, 1); }
  @keyframes sheet {
    from { transform: translateY(18%); }
    to { transform: none; }
  }
}

@media (max-width: 980px) {
  .tui { overflow-x: hidden; }
  .at-home .scrollback { align-items: flex-start; }
  #composer {
    grid-template-columns: 1fr 44px 44px;
    grid-template-areas:
      "voice voice voice"
      "input listen send";
  }
  .voice-field { grid-area: voice; }
  #input { grid-area: input; }
  #listen-last { grid-area: listen; }
  #send { grid-area: send; }
  .welcome { min-height: auto; padding: 8px 2px 12px; }
  .hero-mark { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 10px; }
  .wordmark { font-size: 26px; letter-spacing: 0.05em; }
  .welcome .slogan { font-size: 15px; }
  .welcome .lede { font-size: 14px; margin-bottom: 14px; }
  .path-board { grid-template-columns: 1fr; gap: 8px; }
  .path-board button {
    min-height: 64px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 10px;
    padding: 12px 14px;
  }
  .path-kicker { margin-bottom: 0; }
  .path-board button > span:nth-of-type(2) { flex: 1; }
  .path-board small { flex: 1 1 100%; -webkit-line-clamp: 2; }
  .scene { background-position: 92% 18%; background-size: auto 72%; }
}

@media (max-height: 760px) {
  .hero-mark { width: 64px; height: 64px; margin-bottom: 8px; }
  .welcome .lede { font-size: 13px; margin-bottom: 10px; max-width: 20rem; }
  .path-board button { min-height: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mark, .logo, .wordmark, .thinking span, .modal[open], .modal[open]::backdrop,
  .shine-wash, .shine-ring, .shine-ray, .lamp { animation: none; }
  .shine { display: none; }
  .daily-card:active, .path-board button:active, .ask-open:active, .icon-btn:active { transform: none; }
}
