/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ── Design tokens ── */
:root {
  --cream:  #F7F3EC;   /* page / screen background */
  --cream2: #EDE6D9;   /* card bg, outcome tiles, input bg */
  --tc:     #C1440E;   /* terracotta — primary brand, CTAs */
  --tcL:    #F5EBE5;   /* terracotta light — pill bg, user bubbles */
  --sage:   #7A9268;   /* section labels, status */
  --sageL:  #ECF1E8;   /* sage light — rule lines */
  --dark:   #2C2218;   /* primary text */
  --mid:    #7A6E65;   /* secondary text */
  --lt:     #B0A69E;   /* tertiary text, placeholders */
  --bdr:    #E2D9CE;   /* borders, dividers */
  --wht:    #FFFFFF;   /* cards, bot bubbles */
}

/* ── Page shell ── */
html, body {
  background: #CFC8BB;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px 64px;
  font-family: 'DM Sans', -apple-system, sans-serif;
}

/* ── Phone frame ── */
#phone {
  width: 375px;
  height: 790px;
  background: var(--cream);
  border-radius: 48px;
  overflow: hidden;
  box-shadow:
    0 0 0 2px #B5ADA0,
    0 32px 80px rgba(0, 0, 0, .22),
    inset 0 1px 0 rgba(255, 255, 255, .6);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── Status bar ── */
#sb {
  height: 46px;
  padding: 14px 26px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
  background: var(--cream);
  z-index: 20;
  position: relative;
}
.sb-t  { font-size: 14px; font-weight: 500; color: var(--dark); letter-spacing: -.02em; }
.sb-ic { display: flex; gap: 5px; align-items: center; padding-top: 1px; }

/* ── Screen container ── */
#sc { flex: 1; position: relative; overflow: hidden; }

/* ── Screen base ── */
.scr {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  transform: translateY(10px);
}
.scr.on { opacity: 1; pointer-events: all; transform: translateY(0); }

/* ── Wordmark ── */
.wm      { display: flex; align-items: baseline; gap: 7px; }
.wm-w    { font-family: 'Playfair Display', Georgia, serif; font-weight: 500; color: var(--tc); letter-spacing: -.01em; line-height: 1; }
.wm-f    { font-size: 9px; font-weight: 400; letter-spacing: .11em; text-transform: uppercase; color: var(--lt); line-height: 1.3; }

/* ── Back button ── */
.bk {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream2);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: var(--dark);
  font-size: 15px;
  transition: background .15s;
  flex-shrink: 0;
  font-family: inherit;
}
.bk:hover { background: var(--bdr); }


/* ════════════════════════════════════
   S0 — HOMEPAGE
════════════════════════════════════ */
.s0-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 36px 24px 28px;
  overflow: hidden;
}
.s0-top { flex: 1; }

.s0-brand    { margin-bottom: 26px; }
.s0-wm-row   { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.s0-wm       { font-family: 'Playfair Display', Georgia, serif; font-size: 38px; font-weight: 500; color: var(--tc); line-height: 1; letter-spacing: -.02em; }
.s0-beta     { background: var(--tcL); color: var(--tc); font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 20px; letter-spacing: .04em; align-self: flex-end; margin-bottom: 6px; }
.s0-subtag   { font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--mid); font-weight: 400; }

.s0-hed      { font-family: 'Playfair Display', Georgia, serif; font-size: 24px; font-weight: 500; color: var(--dark); line-height: 1.3; margin-bottom: 14px; }

.s0-bdy      { font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--mid); line-height: 1.72; margin-bottom: 22px; display: flex; flex-direction: column; gap: 7px; }
.s0-hook     { color: var(--dark); font-weight: 500; }

.s0-learn    { font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; color: var(--mid); margin-bottom: 11px; }

.s0-list     { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 9px; }
.s0-list li  { font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--dark); line-height: 1.5; padding-left: 18px; position: relative; }
.s0-list li::before { content: '—'; position: absolute; left: 0; color: var(--tc); font-weight: 400; }

.s0-tags     { font-family: 'DM Sans', sans-serif; font-size: 11px; color: var(--mid); line-height: 1.5; }

.s0-foot     { padding-top: 24px; flex-shrink: 0; }
.s0-cta {
  width: 100%;
  padding: 14px;
  background: var(--tc);
  color: var(--wht);
  border: none;
  border-radius: 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .15s, transform .1s;
  margin-bottom: 14px;
}
.s0-cta:hover  { background: #A83A0C; }
.s0-cta:active { transform: scale(.98); }

.s0-social   { font-family: 'DM Sans', sans-serif; font-size: 11.5px; color: var(--mid); text-align: center; margin-bottom: 8px; font-weight: 500; }
.s0-notice   { font-family: 'DM Sans', sans-serif; font-size: 11px; color: var(--lt); line-height: 1.65; text-align: center; }
.s0-link     { color: var(--tc); cursor: pointer; }


/* ════════════════════════════════════
   S1 — PERSONA SELECTOR
════════════════════════════════════ */
.s1-wrap { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.s1-head { padding: 22px 22px 16px; }
.s1-hed  {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--dark);
  margin-top: 16px;
  margin-bottom: 9px;
  line-height: 1.3;
}
.s1-sub  { font-size: 13px; color: var(--mid); line-height: 1.65; }
.s1-cards { padding: 4px 18px 48px; display: flex; flex-direction: column; gap: 10px; }

/* Persona card */
.pc {
  background: var(--wht);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1.5px solid var(--bdr);
  cursor: pointer;
  transition: all .18s;
  position: relative;
}
.pc.live { border-color: var(--tc); }
.pc.live:hover  { box-shadow: 0 4px 18px rgba(193, 68, 14, .13); transform: translateY(-1px); }
.pc.live:active { transform: scale(.98); }
.pc.dim  { opacity: .42; cursor: not-allowed; }

/* "Soon" tag */
.cs-tag {
  position: absolute;
  top: 10px;
  right: 11px;
  background: var(--cream2);
  color: var(--mid);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 20px;
}

.pc-ill  { width: 66px; height: 66px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.pc-bd   { flex: 1; }
.pc-tag  { font-size: 9px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--tc); margin-bottom: 3px; }
.pc-ttl  { font-family: 'Playfair Display', Georgia, serif; font-size: 14px; font-weight: 500; color: var(--dark); margin-bottom: 3px; line-height: 1.3; }
.pc-dsc  { font-size: 11.5px; color: var(--mid); line-height: 1.45; }
.pc-arr  { color: var(--tc); font-size: 20px; flex-shrink: 0; line-height: 1; }


/* ════════════════════════════════════
   S2 — EDITORIAL
════════════════════════════════════ */
.ed-hd {
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--bdr);
  flex-shrink: 0;
  background: var(--cream);
  z-index: 5;
}
.ed-scroll { flex: 1; overflow-y: auto; padding-bottom: 80px; -webkit-overflow-scrolling: touch; }

/* Hero */
.ed-hero   { padding: 22px 22px 20px; border-bottom: 1px solid var(--bdr); }
.ed-pill   {
  display: inline-flex;
  align-items: center;
  background: var(--tcL);
  color: var(--tc);
  font-size: 9px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 11px;
}
.ed-ttl    { font-family: 'Playfair Display', Georgia, serif; font-size: 25px; font-weight: 500; color: var(--dark); line-height: 1.2; margin-bottom: 10px; }
.ed-lead   { font-size: 13px; color: var(--mid); line-height: 1.75; }

/* Section */
.ed-sec  { padding: 22px; border-bottom: 1px solid var(--bdr); }
.ed-lbl  { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.ed-lbl span { font-size: 8.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--sage); white-space: nowrap; }
.ed-lbl::after { content: ''; flex: 1; height: 1px; background: var(--sageL); }
.ed-sttl { font-family: 'Playfair Display', Georgia, serif; font-size: 17px; font-weight: 500; color: var(--dark); margin-bottom: 13px; line-height: 1.35; }
.ed-bdy  { font-size: 13px; line-height: 1.78; color: var(--mid); }
.ed-bdy + .ed-bdy { margin-top: 12px; }

/* Fear list */
.fl { display: flex; flex-direction: column; }
.fi {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bdr);
}
.fi:last-child { border-bottom: none; }
.fi-pct { font-family: 'Playfair Display', Georgia, serif; font-size: 17px; font-weight: 500; color: var(--tc); min-width: 38px; line-height: 1.2; flex-shrink: 0; }
.fi-txt { font-size: 12px; color: var(--dark); line-height: 1.6; flex: 1; }

/* Outcome tiles */
.oi         { background: var(--cream2); border-radius: 11px; padding: 13px 15px; margin-bottom: 8px; }
.oi:last-child { margin-bottom: 0; }
.oi-stat    { font-family: 'Playfair Display', Georgia, serif; font-size: 19px; color: var(--sage); font-weight: 500; margin-bottom: 4px; }
.oi-txt     { font-size: 11.5px; color: var(--mid); line-height: 1.55; }

/* Wish quotes */
.wb       { padding: 13px 15px; border-left: 3px solid var(--tc); background: var(--tcL); border-radius: 0 10px 10px 0; margin-bottom: 9px; }
.wb:last-of-type { margin-bottom: 0; }
.wb-txt   { font-size: 12.5px; color: var(--dark); line-height: 1.68; font-style: italic; }
.wb-close { font-size: 13px; line-height: 1.78; color: var(--mid); margin-top: 13px; }

/* Sticky CTA */
.sc-ft {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 18px 20px;
  background: linear-gradient(to top, var(--cream) 62%, rgba(247, 243, 236, 0));
  z-index: 5;
}
.tk-btn {
  width: 100%;
  padding: 14px;
  background: var(--tc);
  color: var(--wht);
  border: none;
  border-radius: 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, transform .1s;
  letter-spacing: .01em;
}
.tk-btn:hover  { background: #A83A0C; }
.tk-btn:active { transform: scale(.98); }


/* ════════════════════════════════════
   S3 — ORIENTATION
════════════════════════════════════ */
.ori-wrap { flex: 1; overflow-y: auto; padding: 24px 22px 32px; -webkit-overflow-scrolling: touch; }
.ori-bk {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--mid);
  font-size: 12.5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 26px;
  font-family: inherit;
}
.ori-ic {
  width: 50px;
  height: 50px;
  background: var(--tcL);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.ori-hed  { font-family: 'Playfair Display', Georgia, serif; font-size: 23px; font-weight: 500; color: var(--dark); margin-bottom: 10px; line-height: 1.3; }
.ori-bdy  { font-size: 13px; color: var(--mid); line-height: 1.75; margin-bottom: 22px; }
.ori-rules { margin-bottom: 28px; display: flex; flex-direction: column; gap: 12px; }
.ori-rule  { display: flex; align-items: flex-start; gap: 10px; }
.ori-dot   { width: 5px; height: 5px; border-radius: 50%; background: var(--sage); flex-shrink: 0; margin-top: 7px; }
.ori-rt    { font-size: 13px; color: var(--dark); line-height: 1.6; }
.ori-cta {
  width: 100%;
  padding: 14px;
  background: var(--tc);
  color: var(--wht);
  border: none;
  border-radius: 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  margin-bottom: 14px;
}
.ori-cta:hover { background: #A83A0C; }
.ori-priv { text-align: center; font-size: 10px; color: var(--lt); line-height: 1.5; }


/* ════════════════════════════════════
   S4 — CHAT
════════════════════════════════════ */
.ch-hd {
  padding: 11px 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--bdr);
  flex-shrink: 0;
  background: var(--cream);
}
.ch-av {
  width: 32px;
  height: 32px;
  background: var(--tcL);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  color: var(--tc);
  font-weight: 500;
  margin-left: 10px;
  flex-shrink: 0;
}
.ch-inf    { flex: 1; margin-left: 9px; }
.ch-nm     { font-size: 13px; font-weight: 500; color: var(--dark); }
.ch-st     { font-size: 10px; color: var(--sage); }

.ch-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.msg              { display: flex; flex-direction: column; }
.msg.u            { align-items: flex-end; }
.msg.b            { align-items: flex-start; }
.msg-row          { display: flex; align-items: flex-end; gap: 6px; }
.msg.b .msg-row   { flex-direction: row; }
.msg.u .msg-row   { flex-direction: row-reverse; }

.m-av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tcL);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 10px;
  color: var(--tc);
  font-weight: 500;
  flex-shrink: 0;
}
.m-bbl          { padding: 10px 13px; border-radius: 16px; font-size: 12.5px; line-height: 1.68; max-width: 224px; }
.msg.u .m-bbl   { background: var(--tc); color: var(--wht); border-radius: 16px 16px 3px 16px; }
.msg.b .m-bbl   { background: var(--wht); color: var(--dark); border: 1px solid var(--bdr); border-radius: 16px 16px 16px 3px; }
.m-bbl ul, .m-bbl ol { padding-left: 15px; margin: 3px 0; }
.m-bbl li       { margin: 3px 0; }

/* Typing indicator */
.t-row  { display: flex; align-items: center; gap: 6px; }
.t-bbl  {
  background: var(--wht);
  border: 1px solid var(--bdr);
  border-radius: 16px 16px 16px 3px;
  padding: 12px 14px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.td {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lt);
  animation: tda 1.15s infinite;
}
.td:nth-child(2) { animation-delay: .17s; }
.td:nth-child(3) { animation-delay: .34s; }
@keyframes tda {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* Suggestion chips */
.ch-chips {
  padding: 7px 16px 6px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ch-chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 18px;
  border: 1px solid var(--bdr);
  background: var(--wht);
  font-family: 'DM Sans', sans-serif;
  font-size: 11.5px;
  color: var(--dark);
  cursor: pointer;
  transition: all .14s;
  flex-shrink: 0;
}
.chip:hover           { border-color: var(--tc); color: var(--tc); background: var(--tcL); }
.chip.used            { opacity: .35; pointer-events: none; }

/* Chat input row */
.ch-in {
  padding: 9px 14px 22px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  border-top: 1px solid var(--bdr);
  background: var(--cream);
}
.ch-inp {
  flex: 1;
  padding: 10px 15px;
  border-radius: 22px;
  border: 1.5px solid var(--bdr);
  background: var(--wht);
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  color: var(--dark);
  outline: none;
  transition: border-color .18s;
}
.ch-inp:focus       { border-color: var(--tc); }
.ch-inp::placeholder { color: var(--lt); }
.snd-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--tc);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .14s;
}
.snd-btn:hover { background: #A83A0C; }


/* ════════════════════════════════════
   MOBILE — full-screen on real devices
   Desktop keeps the phone-frame chrome
════════════════════════════════════ */
@media (max-width: 430px) {
  html, body {
    padding: 0;
    background: var(--cream);
    align-items: stretch;
  }

  #phone {
    width: 100%;
    height: 100dvh; /* dvh tracks browser chrome on mobile */
    border-radius: 0;
    box-shadow: none;
  }

  /* hide the fake iOS status bar — real device has its own */
  #sb { display: none; }
}
