:root {
  --bg: #0c0b12;
  --bg-2: #13121b;
  --card: #17161f;
  --card-2: #1e1d28;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f4f1ea;
  --muted: #a39fae;
  --faint: #6e6a7a;
  --gold: #f3c98b;
  --rose: #e894b4;
  --lilac: #b4a5f0;
  --good: #8fd6a8;
  --warn: #f0a37a;
  --grad: linear-gradient(135deg, #f3c98b 0%, #e894b4 55%, #b4a5f0 100%);
  --radius: 22px;
  --radius-sm: 14px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }

/* Soft starfield + glow */
.sky {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 400px at 85% -10%, rgba(232, 148, 180, 0.16), transparent 60%),
    radial-gradient(500px 380px at -10% 20%, rgba(180, 165, 240, 0.12), transparent 60%),
    radial-gradient(1px 1px at 20% 30%, #fff8, transparent),
    radial-gradient(1px 1px at 70% 12%, #fff6, transparent),
    radial-gradient(1px 1px at 40% 70%, #fff5, transparent),
    radial-gradient(1.5px 1.5px at 85% 55%, #fff7, transparent),
    radial-gradient(1px 1px at 10% 85%, #fff5, transparent),
    radial-gradient(1px 1px at 55% 40%, #fff4, transparent);
}

#app {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  min-height: 100dvh;
  padding: 0 16px calc(96px + var(--safe-b));
}

/* ---------- Type ---------- */
.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
.eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1.serif { font-size: 30px; line-height: 1.12; }
h2.serif { font-size: 22px; line-height: 1.2; }
h3 { font-size: 15px; font-weight: 600; }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 0 10px;
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 21px; font-weight: 500; }
.logo svg { width: 22px; height: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line-2); background: var(--card);
}
.pill.pro { background: var(--grad); color: #1a1420; border: 0; }
.pill svg { width: 14px; height: 14px; }

/* ---------- Cards ---------- */
.stack { display: grid; gap: 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.card.tap { cursor: pointer; transition: transform .15s ease, border-color .15s; }
.card.tap:active { transform: scale(0.985); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.greet { padding: 8px 2px 16px; }
.greet h1 { margin: 4px 0 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 12.5px; padding: 6px 11px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip b { color: var(--text); font-weight: 500; }

/* Hero */
.hero { padding: 22px; background: linear-gradient(160deg, #221d2c 0%, #17161f 60%); border-color: var(--line-2); }
.hero::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: var(--grad); opacity: .45;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.hero-row { display: flex; gap: 16px; align-items: flex-start; }
.hero-row > div:first-child { flex: 1; min-width: 0; }
.hero h2 { margin: 6px 0 10px; }
.hero p { color: #d6d1dc; font-size: 14.5px; }

.ring { width: 84px; height: 84px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .num b { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1; }
.ring .num small { display: block; font-size: 10px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }

/* Area meters */
.meter { padding: 14px 16px; }
.meter .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.meter .row span { font-size: 13px; color: var(--muted); }
.meter .row b { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.bar { height: 5px; border-radius: 9px; background: rgba(255,255,255,.06); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transform-origin: left; animation: grow .9s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.tag.best { background: rgba(143,214,168,.14); color: var(--good); }
.tag.low { background: rgba(240,163,122,.14); color: var(--warn); }

/* Prep timeline */
.timeline { display: grid; gap: 14px; }
.tl-item { display: grid; grid-template-columns: 74px 1fr; gap: 12px; }
.tl-when { font-size: 12px; color: var(--muted); padding-top: 2px; }
.tl-when b { display: block; color: var(--text); font-weight: 600; font-size: 13px; }
.tl-text { font-size: 14.5px; border-left: 1px solid var(--line-2); padding-left: 14px; position: relative; }
.tl-text::before { content: ''; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

.list { list-style: none; display: grid; gap: 9px; font-size: 14px; }
.list li { display: flex; gap: 9px; align-items: flex-start; }
.list .dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 8px; flex: none; }

.lucky { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 0; }
.lucky > div { padding: 16px 14px; text-align: center; }
.lucky > div + div { border-left: 1px solid var(--line); }
.lucky b { display: block; font-family: var(--serif); font-size: 18px; font-weight: 500; margin-top: 6px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; display: inline-block; vertical-align: -3px; margin-right: 6px; border: 1px solid var(--line-2); }

/* Locked / cliffhanger */
.blur { filter: blur(6px); user-select: none; pointer-events: none; opacity: .75; }
.fade-lock { position: relative; }
.fade-lock::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 70%; background: linear-gradient(transparent, var(--card)); }
.unlock {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; border-radius: 14px; margin-top: 14px;
  background: var(--grad); color: #1a1420; font-weight: 600; font-size: 15px;
  box-shadow: 0 8px 30px -10px rgba(232,148,180,.6);
  transition: transform .15s;
}
.unlock:active { transform: scale(.98); }
.unlock svg { width: 16px; height: 16px; }
.unlock.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.lock-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(243,201,139,.12); color: var(--gold); flex: none; }
.lock-ico svg { width: 14px; height: 14px; }
.cliff { background: linear-gradient(150deg, #1f1a26, #17161f); }
.cliff .line { font-family: var(--serif); font-size: 19px; line-height: 1.35; margin: 8px 0 2px; }
.cliff .line em { font-style: normal; color: var(--muted); }

/* Week */
.days { display: grid; gap: 10px; }
.day { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.day .d { width: 44px; text-align: center; flex: none; }
.day .d small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.day .d b { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.day .mid { flex: 1; min-width: 0; }
.day .mid h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day .mid p { font-size: 13px; color: var(--muted); }
.score { font-family: var(--serif); font-size: 17px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); flex: none; }
.day.open .detail { margin-top: 10px; font-size: 14px; color: #d6d1dc; }
.day-wrap { flex-direction: column; align-items: stretch; }
.day-wrap .day-top { display: flex; align-items: center; gap: 14px; }

/* Ask */
.chat { display: grid; gap: 10px; margin: 6px 0 14px; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; }
.msg.user { justify-self: end; background: var(--card-2); border: 1px solid var(--line-2); border-bottom-right-radius: 6px; }
.msg.bot { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.bot.locked .more { margin-top: 8px; }
.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.suggest { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest button { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); font-size: 13.5px; }
.composer {
  position: fixed; left: 50%; transform: translateX(-50%); width: min(480px, 100%);
  bottom: calc(72px + var(--safe-b)); padding: 10px 16px; z-index: 6;
  background: linear-gradient(transparent, var(--bg) 30%);
}
.composer form { display: flex; gap: 8px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 6px 6px 18px; }
.composer input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 16px; }
.composer button { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #1a1420; display: grid; place-items: center; flex: none; }
.composer button svg { width: 18px; height: 18px; }

/* Profile */
.big-signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.big-signs > div { padding: 14px 6px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }
.glyph { font-size: 26px; line-height: 1; display: block; margin-bottom: 6px; font-variant-emoji: text; }
.big-signs b { display: block; font-family: var(--serif); font-weight: 500; font-size: 16px; }
.big-signs small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
select.field, input.field {
  width: 100%; padding: 14px 16px; border-radius: 14px; font-size: 16px;
  background: var(--bg-2); border: 1px solid var(--line-2); outline: none; appearance: none;
}
input.field:focus, select.field:focus { border-color: var(--gold); }
.link { color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* Bottom nav */
.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(480px, 100%); z-index: 7;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 10px calc(8px + var(--safe-b));
  background: rgba(16, 15, 22, 0.86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.nav button { display: grid; justify-items: center; gap: 3px; padding: 6px 0; font-size: 11px; color: var(--faint); font-weight: 500; }
.nav button svg { width: 22px; height: 22px; }
.nav button.on { color: var(--text); }
.nav button.on svg { color: var(--gold); }

/* ---------- Onboarding ---------- */
.onb { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(28px + env(safe-area-inset-top, 0px)) 4px calc(28px + var(--safe-b)); }
.onb .grow { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.onb h1.serif { font-size: 40px; line-height: 1.05; margin: 14px 0 14px; }
.onb p.lead { color: var(--muted); font-size: 16px; max-width: 34ch; }
.onb .progress { display: flex; gap: 6px; margin-bottom: 24px; }
.onb .progress i { height: 3px; flex: 1; border-radius: 3px; background: var(--line-2); }
.onb .progress i.on { background: var(--gold); }
.onb label { display: block; margin: 22px 0 8px; font-size: 13px; color: var(--muted); }
.onb .cta { margin-top: 24px; }
.orbit { width: 180px; height: 180px; margin: 0 auto 10px; position: relative; }
.orbit .core { position: absolute; inset: 50px; border-radius: 50%; background: var(--grad); filter: blur(.3px); box-shadow: 0 0 80px 10px rgba(232,148,180,.35); }
.orbit .o { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line-2); animation: spin 18s linear infinite; }
.orbit .o::after { content: ''; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.orbit .o.two { inset: 22px; animation-duration: 11s; animation-direction: reverse; }
.orbit .o.two::after { background: var(--lilac); }
@keyframes spin { to { transform: rotate(360deg); } }
.features { display: grid; gap: 10px; margin-top: 28px; }
.features div { display: flex; gap: 12px; align-items: center; font-size: 14px; color: #d6d1dc; }
.features svg { width: 18px; height: 18px; color: var(--gold); flex: none; }
.reveal .signs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 14px; }
.reveal .signs-row .card { text-align: center; padding: 22px 12px; }
.reveal .glyph { font-size: 36px; }
.computing { text-align: center; color: var(--muted); }

/* ---------- Paywall sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: none; }
.sheet.show { display: block; }
.sheet .scrim { position: absolute; inset: 0; background: rgba(5,4,10,.6); backdrop-filter: blur(4px); animation: fade .25s both; }
.sheet .panel {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(480px, 100%); max-height: 94dvh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 28px 28px 0 0; padding: 12px 20px calc(22px + var(--safe-b));
  animation: up .35s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes up { from { transform: translate(-50%, 100%); } }
@keyframes fade { from { opacity: 0; } }
.grabber { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 14px; }
.x { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 50%; background: var(--card); display: grid; place-items: center; color: var(--muted); }
.x svg { width: 16px; height: 16px; }
.pw-head { text-align: center; padding: 8px 8px 18px; }
.pw-head h2 { font-size: 28px; margin: 8px 0 6px; }
.perks { display: grid; gap: 11px; margin: 4px 0 20px; }
.perks div { display: flex; gap: 12px; align-items: center; font-size: 14.5px; }
.perks .ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--gold); flex: none; }
.perks .ic svg { width: 15px; height: 15px; }
.plans { display: grid; gap: 10px; }
.plan {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 16px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--line-2);
  position: relative; transition: border-color .15s, background .15s;
}
.plan.on { border-color: var(--gold); background: #1f1b22; }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; display: grid; place-items: center; }
.plan.on .radio { border-color: var(--gold); }
.plan.on .radio::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }
.plan .info { flex: 1; }
.plan .info b { display: block; font-size: 15.5px; }
.plan .info small { color: var(--muted); font-size: 13px; }
.plan .price { text-align: right; }
.plan .price b { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.plan .price small { display: block; color: var(--muted); font-size: 12px; }
.save { position: absolute; top: -10px; right: 16px; background: var(--grad); color: #1a1420; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; letter-spacing: .03em; }
.fine { text-align: center; font-size: 12px; color: var(--faint); margin-top: 12px; }

.toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -140%);
  background: var(--card-2); border: 1px solid var(--line-2); padding: 11px 18px; border-radius: 999px;
  font-size: 14px; z-index: 30; transition: transform .35s cubic-bezier(.2,.8,.2,1); white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); }

.fadein { animation: fadeUp .45s cubic-bezier(.2,.8,.2,1) both; }
.fadein:nth-child(2) { animation-delay: .04s; } .fadein:nth-child(3) { animation-delay: .08s; }
.fadein:nth-child(4) { animation-delay: .12s; } .fadein:nth-child(5) { animation-delay: .16s; }
.fadein:nth-child(6) { animation-delay: .2s; } .fadein:nth-child(7) { animation-delay: .24s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 2px 2px; }

@media (min-width: 720px) {
  body { font-size: 15.5px; }
  #app { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
