:root {
  --bg: #0f0817;
  --bg2: #170d22;
  --card: #1d1229;
  --card2: #26183a;
  --line: #3a2752;
  --text: #f6eefc;
  --muted: #b7a6c9;
  --pink: #ff4d8d;
  --purple: #8b5cf6;
  --grad: linear-gradient(120deg, #ff4d8d 0%, #c04df5 55%, #8b5cf6 100%);
  --good: #3ddc97;
  --warn: #ffb547;
  --bad: #ff5d6c;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #3b1240 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 10%, #24124a 0%, transparent 55%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: #ff9cc2; }
button, input, textarea, select { font: inherit; color: inherit; }
main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 16px 48px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; max-width: 1000px; margin: 0 auto; width: 100%; gap: 8px; }
.logo { font-weight: 800; font-size: 1.35rem; text-decoration: none; color: var(--text); letter-spacing: -0.02em; white-space: nowrap; direction: ltr; }
.logo span:not(.logo-heart) { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav { display: flex; gap: 8px; }
.chip { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 6px 14px; text-decoration: none; font-size: .9rem; cursor: pointer; }
.chip:hover { border-color: var(--pink); }

h1 { font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.1; margin: 28px 0 12px; letter-spacing: -0.03em; }
h1 .grad, .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 1.35rem; margin: 28px 0 12px; }
h3 { margin: 0 0 8px; font-size: 1.1rem; }
.sub { color: var(--muted); font-size: 1.08rem; margin: 0 0 24px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; text-align: start; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; text-decoration: none; color: var(--text); display: block; }
.cat:hover, .cat:focus-visible { transform: translateY(-2px); border-color: var(--pink); background: var(--card2); outline: none; }
.cat .emoji { font-size: 2rem; display: block; margin-bottom: 6px; }
.cat b { display: block; font-size: 1.08rem; }
.cat small { color: var(--muted); }

.steps { display: grid; gap: 10px; margin: 28px 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.steps li::before { counter-increment: s; content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; display: grid; place-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 14px 0; }
.promise { border-color: #4b2e66; background: linear-gradient(180deg, #23152f, #1a1024); display: flex; gap: 12px; }
.promise::before { content: '🔐'; font-size: 1.5rem; }

textarea, input[type=text], input[type=email], input[type=password] {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none;
}
textarea { min-height: 220px; resize: vertical; font-size: .95rem; unicode-bidi: plaintext; }
textarea:focus, input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px #8b5cf633; }
label { display: block; margin: 14px 0 6px; font-weight: 500; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 14px 26px; font-weight: 700; font-size: 1.05rem; cursor: pointer; text-decoration: none; color: #fff; background: var(--grad); box-shadow: 0 8px 30px #ff4d8d40; transition: transform .15s, filter .15s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border: 1px solid var(--line); box-shadow: none; color: var(--text); font-weight: 500; font-size: .95rem; padding: 10px 18px; }
.btn.ghost:hover { border-color: var(--pink); }
.btn.danger { background: transparent; border: 1px solid #6b2232; color: #ff8a98; box-shadow: none; font-weight: 500; font-size: .95rem; padding: 10px 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.file { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; color: var(--muted); cursor: pointer; font-size: .95rem; }
.file input { display: none; }
.file span { text-decoration: underline; }
details { margin-top: 12px; color: var(--muted); }
details summary { cursor: pointer; color: #ff9cc2; }
details p { margin: 8px 0; font-size: .92rem; }

.detect { margin-top: 12px; font-size: .95rem; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pill { border: 1px solid var(--line); background: var(--bg2); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.pill[aria-pressed=true] { background: var(--grad); border-color: transparent; color: #fff; }
.preview { background: var(--bg2); border-radius: 12px; padding: 12px; font-size: .85rem; max-height: 220px; overflow: auto; white-space: pre-wrap; unicode-bidi: plaintext; margin-top: 8px; color: #d8c9e8; }

.consent { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0; font-size: .9rem; color: var(--muted); font-weight: 400; }
.consent input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--pink); flex: none; }
.error { color: #ff8a98; margin: 10px 0; min-height: 1.2em; }

.loader { text-align: center; padding: 80px 0; }
.heart { font-size: 4rem; display: inline-block; animation: beat 1s infinite; }
@keyframes beat { 0%,100% { transform: scale(1); } 30% { transform: scale(1.18); } 60% { transform: scale(.96); } }
.loader p { color: var(--muted); font-size: 1.1rem; min-height: 1.6em; }

.headline { font-size: clamp(1.8rem, 6vw, 2.6rem); margin: 18px 0 6px; }
.verdict { font-size: 1.12rem; white-space: pre-wrap; }
.tag { display: inline-block; font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--card2); color: var(--muted); }

.meter { margin: 18px 0; }
.meter .top-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.meter .name { color: var(--muted); font-size: .9rem; }
.meter .label { font-weight: 700; }
.bar { position: relative; height: 14px; border-radius: 999px; background: var(--bg2); overflow: hidden; margin-top: 8px; border: 1px solid var(--line); }
.bar .fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--grad); border-radius: 999px; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.bar.flags .fill { background: linear-gradient(90deg, var(--good), var(--warn), var(--bad)); background-size: var(--bgw, 100%) 100%; }
.bar.balance .fill { display: none; }
.bar.balance .dot { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px var(--pink); inset-inline-start: 50%; transition: inset-inline-start 1.2s cubic-bezier(.2,.8,.2,1); }
.bar.balance { background: linear-gradient(90deg, #ff4d8d55, #2a1b3a 50%, #8b5cf655); }
[dir=rtl] .bar.balance { background: linear-gradient(270deg, #ff4d8d55, #2a1b3a 50%, #8b5cf655); }
.ends { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.score { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }

.locked { position: relative; overflow: hidden; border: 1px solid #5a3478; background: linear-gradient(180deg, #2a1640, #1c1029); }
.locked ul { padding-inline-start: 20px; margin: 10px 0 18px; }
.locked li { margin: 6px 0; }
.locked li::marker { content: '✦  '; color: var(--pink); }
.blurred { filter: blur(6px); user-select: none; color: var(--muted); margin: 0 0 14px; }
.notice { font-size: .88rem; color: var(--muted); margin-top: 12px; }

.section-title { display: flex; align-items: center; gap: 8px; }
.prose p { margin: 0 0 12px; white-space: pre-wrap; }
.timeline { list-style: none; padding: 0; margin: 0; border-inline-start: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 18px 16px; }
.timeline li::before { content: ''; position: absolute; inset-inline-start: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--grad); }
.timeline b { display: block; color: #ff9cc2; font-size: .9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--bg2); border-radius: 12px; padding: 12px; }
.stat .k { color: var(--muted); font-size: .8rem; }
.stat .v { font-weight: 700; font-size: 1.05rem; }

.safety { border-color: #6a4bd1; background: #1b1838; }
.safety ul { margin: 8px 0 0; padding-inline-start: 18px; }

.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list a { color: var(--text); text-decoration: none; font-weight: 500; }

.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px 36px; border-top: 1px solid #241633; }
.foot p { margin: 6px 0; }
.foot a { color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--pink); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; z-index: 10; }

@media (max-width: 420px) {
  .cats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat { padding: 14px 12px; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.linkish { background: none; border: 0; color: #ff9cc2; cursor: pointer; padding: 0; margin-top: 10px; font-size: .95rem; text-decoration: underline; }

.facts, .receipts { margin: 0; padding-inline-start: 18px; }
.facts li, .receipts li { margin: 8px 0; }
.receipts q { font-style: italic; unicode-bidi: plaintext; }

/* Upload screen */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 28px 16px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--pink); background: var(--card2); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .dz-icon { font-size: 2rem; }
.dropzone b { font-size: 1.1rem; }
.dropzone small { color: var(--muted); }
.dropzone[hidden] { display: none; }
.loaded:not(:empty) { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.loaded span { overflow-wrap: anywhere; }
.picker:not(:empty) { margin-top: 12px; }
.guide { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.guide summary { font-weight: 500; }
.guide[open] summary { margin-bottom: 12px; }
.guide-tabs { margin-bottom: 12px; }
.guide-steps { margin: 0; padding-inline-start: 0; list-style: none; counter-reset: g; display: grid; gap: 10px; }
.guide-steps li { counter-increment: g; display: flex; gap: 12px; align-items: flex-start; }
.guide-steps li::before { content: counter(g); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--pink); color: #fff; font-weight: 700; font-size: .9rem; display: grid; place-items: center; }
.guide-tip { margin: 12px 0 0; color: var(--muted); font-size: .92rem; }

/* ── Home ── */
.center { text-align: center; }
.hero { text-align: center; padding: 18px 0 8px; }
.hero h1 { margin-top: 18px; }
.hero .sub { max-width: 560px; margin-inline: auto; }
.hero-apps { display: flex; justify-content: center; }
.hero-emoji { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: var(--card2); border: 3px solid var(--bg); margin-inline: -6px; box-shadow: 0 6px 18px #0006; }
.btn.cta { padding: 16px 34px; font-size: 1.12rem; }
.btn.cta .arrow { transition: transform .15s; }
.btn.cta:hover .arrow { transform: translateX(3px); }
[dir=rtl] .btn.cta:hover .arrow { transform: translateX(-3px); }
.final { text-align: center; padding: 26px 0 8px; }
.final h2 { font-size: clamp(1.5rem, 5vw, 2rem); margin-bottom: 18px; }

/* Chat demo */
.demo { position: relative; height: 340px; margin: 30px auto 10px; max-width: 520px; overflow: hidden; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(180deg, #1a0f26, #140b1e); }
.demo::before, .demo::after { content: ''; position: absolute; inset-inline: 0; height: 60px; z-index: 2; pointer-events: none; }
.demo::before { top: 0; background: linear-gradient(#1a0f26, transparent); }
.demo::after { bottom: 0; background: linear-gradient(transparent, #140b1e); }
.demo-track { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; animation: demo-scroll 26s linear infinite; }
@keyframes demo-scroll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.bubble { max-width: 75%; padding: 7px 12px 5px; border-radius: 16px; font-size: .92rem; line-height: 1.35; display: flex; flex-direction: column; unicode-bidi: plaintext; }
.bubble b { font-size: .75rem; color: #ff9cc2; }
.bubble time { font-size: .68rem; color: var(--muted); align-self: flex-end; }
.bubble.theirs { align-self: flex-start; background: var(--card2); border-end-start-radius: 4px; }
.bubble.mine { align-self: flex-end; background: #4a1d45; border-end-end-radius: 4px; }
.demo-scan { position: absolute; z-index: 3; inset-inline: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--pink), transparent); animation: scan 4.5s ease-in-out infinite alternate; }
@keyframes scan { from { top: 18%; } to { top: 78%; } }
.demo-orb { position: absolute; left: 50%; top: -22px; margin-left: -22px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); font-size: 1.3rem; box-shadow: 0 0 0 6px #ff4d8d33, 0 8px 24px #000a; }
.demo-label { position: absolute; left: 50%; transform: translateX(-50%); top: 28px; font-size: .78rem; background: #000a; color: #fff; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.demo-result { position: absolute; z-index: 3; inset-inline-end: 14px; bottom: 14px; background: var(--card); border: 1px solid #5a3478; border-radius: 14px; padding: 8px 14px; display: flex; flex-direction: column; box-shadow: 0 10px 30px #000a; animation: pop 4.5s ease-in-out infinite; }
.demo-result small { color: var(--muted); font-size: .72rem; }
@keyframes pop { 0%, 40% { opacity: 0; transform: translateY(8px); } 55%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* Supported apps */
.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 520px; margin: 0 auto; }
.app { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500; }
.app-tile { display: block; width: 56px; height: 56px; }
.app-tile svg { width: 100%; height: 100%; display: block; border-radius: 14px; box-shadow: 0 6px 18px #0006; }

/* ── Step-by-step flow ── */
.stepbar { display: flex; align-items: center; gap: 12px; margin: 12px 0 6px; }
.step-back { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; text-decoration: none; color: var(--text); font-size: 1.2rem; }
a.step-back:hover { background: var(--card); }
.progress { flex: 1; height: 8px; border-radius: 999px; background: var(--card2); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.step-count { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.step-title { font-size: clamp(1.5rem, 5vw, 2rem); margin: 22px 0 18px; }
.options { display: grid; gap: 12px; }
.option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 16px; text-decoration: none; color: var(--text); transition: transform .12s, border-color .12s, background .12s; }
.option:hover, .option:focus-visible { border-color: var(--pink); background: var(--card2); transform: translateY(-1px); outline: none; }
.option:active { transform: translateY(1px); border-bottom-width: 1px; margin-bottom: 2px; }
.option-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 1.6rem; border-radius: 12px; background: var(--card2); }
.option-icon .app-tile { width: 44px; height: 44px; }
.option-icon .app-tile svg { border-radius: 12px; box-shadow: none; }
.option-text { display: flex; flex-direction: column; }
.option-text small { color: var(--muted); }
.private-note { color: var(--muted); font-size: .9rem; text-align: center; margin: 14px 0 0; }
.center-row { justify-content: center; }
.summary { display: grid; gap: 6px; }
@media (max-width: 420px) {
  .apps { gap: 6px; }
  .app-tile { width: 48px; height: 48px; }
  .demo { height: 300px; }
}

/* Full Report: letter + sections */
.letter { border-color: #6b3a8f; background: linear-gradient(180deg, #24132f, var(--card)); font-size: 1.05rem; }
.chat-quote { margin: 10px 0 14px; padding: 10px 14px; border-inline-start: 3px solid var(--pink); background: #2a1838; border-radius: 10px; font-style: italic; unicode-bidi: plaintext; }
.dialect { margin: 0; display: grid; gap: 12px; }
.dialect dt { font-weight: 700; color: #ff9cc2; }
.dialect dd { margin: 2px 0 0; color: var(--text); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
.two h4, .prose h4 { margin: 0 0 6px; color: var(--muted); font-size: .85rem; text-transform: none; }
.pattern-image { margin: 0 0 8px; font-size: 1.15rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cycle { margin: 8px 0 0; padding-inline-start: 22px; }
.cycle li { margin-bottom: 6px; }
.points { margin: 0; padding-inline-start: 22px; }
.points li { margin-bottom: 10px; }
.points li p { margin: 0 0 6px; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }

/* Continue with Google */
.btn.google { background: #fff; color: #1f1f1f; box-shadow: 0 4px 18px #0005; }
.btn.google .g-icon { display: inline-flex; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin-top: 8px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.center { text-align: center; }

/* Extra chapters */
.chapter h3 { margin: 0 0 8px; }
.chapter .teaser { color: var(--text); font-style: italic; margin: 0 0 14px; }
.chapter:not(.open) { border-style: dashed; }
.draft { margin: 16px 0; padding: 14px 16px; border-radius: 14px; background: #2a1838; border: 1px solid #6b3a8f; }
.draft p { white-space: pre-wrap; unicode-bidi: plaintext; }
.closing-line { font-weight: 700; color: #ff9cc2; margin-top: 14px; }
