:root {
  --bg: #1a0f1f; --surface: #2a1830; --surface-2: #3a2242; --line: #4a2f52;
  --ink: #fff4e8; --muted: #cbb8c4; --accent: #ff4f7b; --accent-dark: #e63864; --on-accent: #1a0f1f;
  --link: #ff9fb6; --ok: #8fe3b0; --bad: #ff9a8a; --warn-bg: #3d2a1c; --warn-ink: #ffd9a8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 1.0625rem; line-height: 1.5; }
main { max-width: 480px; margin: 0 auto; padding: 24px 18px 48px; }
h1 { font-size: min(2rem, 10vw); line-height: 1.15; margin: 8px 0 8px; letter-spacing: -0.02em; }
/* UI text wraps between words only. User-supplied strings (notes, handles, keys, links) may break anywhere so they never overflow. */
.token, .note p, #who { overflow-wrap: anywhere; }
h2 { font-size: 1.25rem; margin: 0 0 8px; }
p { margin: 0 0 14px; }
a { color: var(--link); }
.logo { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.logo span { color: var(--accent); }
.lead { color: var(--muted); font-size: 1.05rem; }
.card { background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 18px; margin: 18px 0; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.field { display: flex; flex-wrap: wrap; align-items: center; border: 2px solid var(--line); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.field:focus-within, textarea:focus, select:focus, input:not([type=checkbox]):focus { border-color: var(--link); outline: none; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
::placeholder { color: var(--muted); opacity: 1; }
.field span { padding-left: 14px; color: var(--muted); white-space: nowrap; }
.field input { border: 0; flex: 1; min-width: 6rem; padding: 12px 14px 12px 2px; }
input, textarea, select { font: inherit; color: inherit; min-height: 48px; width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); }
textarea { min-height: 150px; resize: vertical; }
.check { display: flex; gap: 12px; align-items: center; font-weight: 500; margin: 14px 0; min-height: 44px; cursor: pointer; }
.check input { width: 26px; height: 26px; min-height: 0; flex: none; accent-color: var(--accent); }
/* The font shrinks on very narrow screens so a label never has to split a word. */
button, .button { font: inherit; font-size: min(1em, 7.5vw); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px clamp(10px, 5vw, 20px); border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--accent-dark); }
button:disabled { opacity: .55; cursor: default; }
.wide { width: 100%; }
.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.ghost:hover { background: var(--surface-2); }
.small { min-height: 44px; padding: 8px 14px; font-size: .95rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; margin-top: 6px; }
.optional { color: var(--muted); font-weight: 500; }
.helper { color: var(--muted); font-size: .9rem; text-align: center; margin: 10px 0 0; }
#count { margin-left: auto; }
.msg { min-height: 1.5em; margin: 10px 0 0; font-weight: 600; }
.msg.error { color: var(--bad); }
.msg.ok { color: var(--ok); }
.token { font-family: ui-monospace, Menlo, monospace; font-size: .95rem; background: var(--bg); border: 2px dashed var(--accent); border-radius: 14px; padding: 12px; margin: 10px 0; }
.warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: 14px; padding: 12px 14px; font-size: .95rem; }
.badge { display: inline-block; background: var(--surface-2); color: var(--link); font-weight: 700; border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.note { background: var(--surface-2); border: 2px solid var(--line); border-radius: 20px; padding: 16px; margin: 14px 0; }
.note p { font-size: 1.1rem; white-space: pre-wrap; }
.note .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.note .actions button { flex: 1 1 auto; }
.flag { color: var(--bad); font-weight: 600; font-size: .9rem; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
footer { color: var(--muted); font-size: .9rem; text-align: center; margin-top: 30px; }
footer a { display: inline-flex; min-height: 44px; min-width: 44px; justify-content: center; align-items: center; padding: 0 6px; }
footer p { margin: 0; }
.legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6px; }
.sheet-links { display: flex; flex-wrap: wrap; gap: 0 12px; margin: 4px 0 0; font-size: .9rem; }
.sheet-links a { display: inline-flex; min-height: 44px; align-items: center; }
/* Long-form pages: about, contact, pricing, terms, privacy, refunds. */
.doc { max-width: 40rem; }
.doc h1 { margin: 18px 0 6px; }
.doc h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.doc p, .doc li, .doc dd { color: var(--ink); }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 6px 0; }
/* Prose links keep the line height; padding gives them a 44px tap area. */
.doc article a { padding-block: 11px; }
.nowrap { white-space: nowrap; }
.doc .updated { color: var(--muted); font-size: .9rem; margin: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 16px 0; padding: 16px; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; overflow-wrap: break-word; }
@media (max-width: 380px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 10px; } }
[hidden] { display: none !important; }
.mt { margin-top: 14px; }
.msg:empty { display: none; }
.link { display: inline-flex; align-items: center; min-height: 44px; }
details.held summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.hero { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.hero > div { flex: 1 1 10em; min-width: 0; }
.hero h1 { font-size: min(1.7rem, 8vw); }

/* Prompt packs: --p1/--p2 are the pack accent, set from packs.json. */
.prompt { --p1: #ff3d7f; --p2: #ff8a3d; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 10px 0 4px; padding: 16px; border-radius: 20px; border: 3px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--p1), var(--p2)) border-box; }
.prompt .emoji { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; font-size: 1.9rem;
  background: linear-gradient(135deg, var(--p1), var(--p2)); }
.prompt h1 { flex: 1 1 6em; margin: 0; font-size: min(1.75rem, 9.5vw); min-width: 0; }
.note .answered { margin: 0 0 6px; color: var(--muted); font-size: .9rem; font-weight: 600; }

/* Landing, desktop (>= 1024px). */
@media (min-width: 1024px) {
  .landing main { max-width: none; padding: 0; }
  .landing .logo { position: absolute; top: 36px; left: max(48px, calc(50% - 660px)); z-index: 2; color: var(--on-accent); font-size: 1.6rem; }
  .landing .logo span { color: var(--cream-dot, #fff4e8); }

  /* Cream ribbon across the seam between the hero and the next band. */
  .ticker { position: relative; z-index: 1; overflow: hidden; margin: -34px -20px 0; rotate: -2deg; background: var(--ink); color: var(--on-accent);
    font-weight: 800; font-size: 1.15rem; white-space: nowrap; padding: 16px 0; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
  .ticker-track { display: inline-flex; gap: 40px; animation: ticker 60s linear infinite; }
  .ticker-track span::after { content: "•"; margin-left: 40px; color: var(--accent); }
  @keyframes ticker { to { transform: translateX(-50%); } }

  .landing main { overflow-x: clip; }
  .landing #start { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 48px; align-items: center;
    padding: 124px max(48px, calc(50% - 660px)) 110px; background: linear-gradient(120deg, #ff3d7f, #ff8a3d);
    padding-bottom: 130px; color: var(--on-accent); }
  .landing .hero { display: contents; }
  .landing .hero > div:first-child { grid-column: 1; }
  .landing .hero h1 { font-size: clamp(3rem, min(4.6vw, 8.5vh), 5.4rem); line-height: .95; letter-spacing: -0.04em; margin: 0 0 18px; }
  .landing .hero .lead { color: var(--on-accent); font-size: 1.2rem; font-weight: 500; max-width: 34em; }
  .landing #register { grid-column: 1; max-width: 480px; margin: 10px 0 8px; box-shadow: 0 30px 60px rgba(80, 10, 40, .35); color: var(--ink); }
  .landing #start > p { grid-column: 1; margin: 0; }
  .landing #start > p .link { color: var(--on-accent); font-weight: 700; }
  .landing #start .phones { grid-column: 2; grid-row: 1 / span 3; }

  .phones { --pw: clamp(170px, 15vw, 290px); position: relative; height: calc(var(--pw) * 1.78 + 110px); }
  .phone { position: absolute; width: var(--pw); padding: 9px; border-radius: 42px; background: #120a16;
    box-shadow: 0 40px 80px rgba(50, 5, 30, .45), inset 0 0 0 2px #3a2242; animation: float 7s ease-in-out infinite; }
  .phone::before { content: ""; position: absolute; top: 16px; left: 50%; width: 70px; height: 20px; margin-left: -35px; border-radius: 99px; background: #120a16; z-index: 1; }
  .phone canvas { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 34px; }
  .phone:nth-child(1) { left: 0; top: 80px; rotate: -8deg; }
  .phone:nth-child(2) { left: 50%; margin-left: calc(var(--pw) / -2); top: 0; z-index: 1; animation-delay: -2.3s; }
  .phone:nth-child(3) { right: 0; top: 90px; rotate: 8deg; animation-delay: -4.6s; }
  @keyframes float { 50% { translate: 0 -12px; } }

  .landing .packs-band { padding: 120px 48px; text-align: center; }
  .packs-band h2, .story-band h2 { font-size: clamp(3rem, 5vw, 4.8rem); line-height: .95; letter-spacing: -0.04em; margin: 0 0 40px; }
  .pack-list { list-style: none; padding: 0; margin: 0 auto; max-width: 1100px; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
  .pack-list li { font-size: 1.6rem; font-weight: 800; padding: 14px 28px; border-radius: 999px; border: 3px solid transparent;
    background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--p1), var(--p2)) border-box; }
  .pack-list li:nth-child(odd) { rotate: -1.5deg; }
  .pack-list li:nth-child(3n) { rotate: 2deg; }
  .band-lead { color: var(--muted); font-size: 1.2rem; max-width: 40em; margin: 40px auto 0; }

  .landing .story-band { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 64px; align-items: center;
    margin: 0 max(24px, calc(50% - 660px)) 40px; padding: 90px 72px; border-radius: 48px; background: var(--surface); }
  .story-band .band-lead { margin: 0 0 28px; }
  .story-band .button { padding: 14px 32px; font-size: 1.15rem; }

  .landing footer { margin: 0 0 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .phone { animation: none; }
}

@media (min-width: 1024px) {
  /* After sign-up the gradient hero is hidden, so the logo returns to the page flow and colours. */
  .landing main:has(#start[hidden]) .logo { position: static; display: block; margin: 36px max(48px, calc(50% - 660px)) 0; color: var(--ink); }
  .landing #done { max-width: 560px; margin: 0 auto; padding: 0 18px; }
}

/* Landing, mobile (< 1024px): a gradient hero card with the sign-up in thumb reach, then the same bands as desktop. */
@media (max-width: 1023px) {
  .landing main { position: relative; max-width: none; padding: 0 0 24px; overflow-x: clip; }
  .landing .logo { position: absolute; top: 26px; left: 50%; translate: -50% 0; z-index: 2; color: var(--on-accent); font-size: 1.4rem; }
  .landing .logo span { color: #fff4e8; }
  .landing #start { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 8px; padding: 74px clamp(14px, 5vw, 28px) 64px;
    border-radius: 32px; background: linear-gradient(165deg, #ff3d7f, #ff8a3d 85%); color: var(--on-accent); }
  .landing .hero { display: contents; }
  .landing .hero h1 { font-size: min(3.4rem, 11.5vw); line-height: .95; letter-spacing: -0.045em; margin: 0 0 14px; }
  .landing .hero .lead { color: var(--on-accent); font-size: 1rem; font-weight: 500; max-width: 30em; margin: 0 auto 22px; }
  .landing #register { width: 100%; max-width: 440px; margin: 0 auto; text-align: left; box-shadow: 0 24px 48px rgba(80, 10, 40, .35); color: var(--ink); }
  .landing #start > p { margin: 10px 0 0; }
  .landing #start > p .link { color: var(--on-accent); font-weight: 700; }
  .landing main:has(#start[hidden]) .logo { position: static; translate: none; display: block; margin: 24px 18px 0; text-align: left; color: var(--ink); }
  .landing #done { padding: 0 18px; }

  .phones { --pw: clamp(92px, 26vw, 190px); position: relative; width: min(100%, calc(var(--pw) * 2.7)); height: calc(var(--pw) * 1.78 + 34px); margin: 0 auto 22px; }
  .phone { position: absolute; width: var(--pw); padding: calc(var(--pw) * .035); border-radius: calc(var(--pw) * .17); background: #120a16;
    box-shadow: 0 24px 48px rgba(50, 5, 30, .45), inset 0 0 0 2px #3a2242; animation: float 7s ease-in-out infinite; }
  .phone canvas { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: calc(var(--pw) * .135); }
  .phone:nth-child(1) { left: 0; top: 26px; rotate: -9deg; }
  .phone:nth-child(2) { left: 50%; margin-left: calc(var(--pw) / -2); top: 0; z-index: 1; animation-delay: -2.3s; }
  .phone:nth-child(3) { right: 0; top: 30px; rotate: 9deg; animation-delay: -4.6s; }
  @keyframes float { 50% { translate: 0 -8px; } }

  .ticker { position: relative; z-index: 1; overflow: hidden; margin: -30px -20px 0; rotate: -3deg; background: var(--ink); color: var(--on-accent);
    font-weight: 800; font-size: 1rem; white-space: nowrap; padding: 12px 0; box-shadow: 0 14px 30px rgba(0, 0, 0, .35); }
  .ticker-track { display: inline-flex; gap: 28px; animation: ticker 45s linear infinite; }
  .ticker-track span::after { content: "•"; margin-left: 28px; color: var(--accent); }
  @keyframes ticker { to { transform: translateX(-50%); } }

  .packs-band, .story-band { text-align: center; }
  .packs-band { padding: 84px clamp(14px, 5vw, 28px) 72px; }
  .packs-band h2, .story-band h2 { font-size: min(2.9rem, 10.5vw); line-height: .95; letter-spacing: -0.045em; margin: 0 0 28px; }
  .pack-list { list-style: none; padding: 0; margin: 0 auto; max-width: 640px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
  .pack-list li { font-size: min(1.05rem, 4.6vw); font-weight: 800; padding: 10px 16px; border-radius: 999px; border: 3px solid transparent;
    background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--p1), var(--p2)) border-box; }
  .pack-list li:nth-child(odd) { rotate: -1.5deg; }
  .pack-list li:nth-child(3n) { rotate: 2deg; }
  .band-lead { color: var(--muted); font-size: 1rem; max-width: 32em; margin: 28px auto 0; }
  .story-band { margin: 0 8px 28px; padding: 56px clamp(14px, 5vw, 28px); border-radius: 32px; background: var(--surface); }
  .story-band .band-lead { margin: 0 auto 26px; }
  .story-band .button { min-width: min(100%, 260px); }
}

/* Paid hints */
.note .hint-line { margin: 6px 0 0; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink); font-size: 1rem; font-weight: 600; }
.sheet { width: min(440px, calc(100% - 24px)); margin: auto auto 12px; border: 2px solid var(--line); border-radius: 24px; padding: 22px; background: var(--surface); color: var(--ink); }
.sheet::backdrop { background: rgba(10, 5, 14, .7); }
.sheet h2 { margin: 0 0 8px; }
.sheet .price { font-size: 1.1rem; }
@media (min-width: 600px) { .sheet { margin: auto; } }
