@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/dm-sans-400.ttf') format('truetype'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/dm-sans-500.ttf') format('truetype'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/dm-sans-600.ttf') format('truetype'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/dm-sans-700.ttf') format('truetype'); }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/oswald-400.ttf') format('truetype'); }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/oswald-500.ttf') format('truetype'); }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/oswald-600.ttf') format('truetype'); }

:root {
  --ink: #171513;
  --cream: #f7f0e7;
  --paper: #fffaf3;
  --orange: #f05b18;
  --orange-dark: #bf3e0e;
  --line: #d6cbbf;
  --muted: #81786f;
  --soft: #eee4d8;
  --white: #fffdf9;
  --shadow: 0 22px 60px rgba(24, 18, 13, .14);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #cfc7bc; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 50% 0%, #e2dacf, #c9c0b6 72%); font-family: 'DM Sans', Arial, sans-serif; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }

#app { min-height: 100vh; display: flex; justify-content: center; padding: 24px; }
.shell { width: min(100%, 460px); min-height: calc(100vh - 48px); position: relative; overflow: hidden; background: var(--cream); box-shadow: var(--shadow); }
.shell.dark { background: var(--ink); color: var(--white); }

.screen { min-height: calc(100vh - 48px); display: flex; flex-direction: column; position: relative; }
.screen.dark.welcome-screen { background: var(--orange); color: #fff; }
.screen-inner { width: 100%; flex: 1; display: flex; flex-direction: column; padding: 22px 25px 25px; }
.brand { font-family: 'Oswald', Impact, sans-serif; letter-spacing: .12em; line-height: .8; text-align: center; font-size: 19px; }
.brand small { display: block; margin-top: 6px; font-family: 'DM Sans', Arial, sans-serif; font-size: 8px; letter-spacing: .34em; font-weight: 700; }
.topbar { display: grid; grid-template-columns: 36px 1fr 36px; align-items: start; min-height: 48px; }
.top-action { border: 0; background: transparent; color: inherit; font-size: 25px; line-height: 1; padding: 1px; }
.top-action span { display: block; transform: translateY(-2px); }
.top-action.close { font-size: 28px; font-weight: 300; }

.eyebrow { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.dark .eyebrow { color: #c6bbb0; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(30px, 8vw, 42px); line-height: 1.03; letter-spacing: -.045em; margin-bottom: 18px; font-weight: 600; }
h2 { font-size: clamp(26px, 7vw, 36px); line-height: 1.05; letter-spacing: -.045em; margin-bottom: 13px; font-weight: 500; }
h3 { font-size: 18px; line-height: 1.1; margin-bottom: 10px; }
p { line-height: 1.45; }
.lede { font-size: 15px; color: #49423c; max-width: 330px; }
.dark .lede { color: #e7ddd3; }
.accent { color: var(--orange); }
.muted { color: var(--muted); }

.welcome-content { flex: 1; position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 84px 22px 42px; }
.welcome-brand { position: absolute; top: 26px; left: 25px; text-align: left; z-index: 2; color: #171513; font-family: 'Oswald'; font-size: 23px; letter-spacing: .11em; }
.welcome-brand small { font-family: 'DM Sans'; display: block; letter-spacing: .26em; font-size: 8px; margin-top: 7px; }
.welcome-title { font-family: 'DM Sans', Arial, sans-serif; font-weight: 700; font-size: clamp(34px, 9vw, 49px); line-height: 1.02; letter-spacing: -.045em; max-width: 360px; margin-bottom: 15px; }
.welcome-subtitle { max-width: 290px; margin-bottom: 28px; color: #fffaf3; font-size: 15px; line-height: 1.35; }
.welcome-screen .primary { background: #171513; color: #fffaf3; }
.welcome-screen .primary:hover { background: #000; }

.primary { width: 100%; border: 0; background: var(--orange); color: #fff; padding: 16px 20px; border-radius: 999px; text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: .15em; transition: transform .2s, background .2s; }
.primary:hover { background: var(--orange-dark); transform: translateY(-1px); }
.primary:disabled { background: #cfc5bb; color: #f5eee6; cursor: not-allowed; transform: none; }
.secondary { width: 100%; border: 1px solid var(--line); color: var(--ink); background: transparent; padding: 14px 18px; border-radius: 999px; text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .11em; }
.secondary:hover { background: rgba(255,255,255,.55); }
.dark .secondary { color: var(--white); border-color: #6a5f56; }
.ghost { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 12px 5px; text-decoration: underline; text-underline-offset: 3px; }
.button-stack { margin-top: auto; display: grid; gap: 10px; }

.progress-wrap { margin: 24px 0 24px; }
.progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 9px; }
.progress { height: 5px; background: #ded5cb; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--orange); border-radius: inherit; transition: width .3s ease; }
.question-screen .screen-inner { min-height: calc(100vh - 48px); }
.question-copy { max-width: 385px; }
.question-copy h2 { margin-bottom: 9px; }
.support { font-size: 13px; color: var(--muted); margin-bottom: 18px; max-width: 340px; }
.answer { width: 100%; min-height: 150px; resize: vertical; border: 1px solid var(--line); background: rgba(255,253,249,.38); border-radius: 17px; padding: 17px; color: var(--ink); outline: none; line-height: 1.5; transition: border .2s, box-shadow .2s; }
.answer:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240,91,24,.12); }
.answer::placeholder { color: #a39a91; }
.voice-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 11px; background: rgba(255,253,249,.26); }
.voice-toggle { width: 100%; border: 0; background: transparent; text-align: left; color: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 0; }
.voice-instructions { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; color: #61584f; line-height: 1.45; }
.voice-box.open .voice-instructions { display: block; }
.helper-link { border: 0; padding: 10px 0 0; background: transparent; color: var(--orange-dark); font-size: 11px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.examples { display: none; padding: 11px 13px; margin-top: 9px; border-left: 3px solid var(--orange); background: #f1e7dc; font-size: 11px; color: #62594f; line-height: 1.45; }
.examples.open { display: block; }
.field-error { color: #b83e1b; font-size: 12px; font-weight: 600; margin: 9px 2px 0; }

.divider { height: 1px; background: var(--line); margin: 24px 0; }
.intro-card { border: 1px solid var(--line); border-radius: 17px; padding: 17px; background: rgba(255,253,249,.3); }
.intro-card strong { display:block; font-size: 17px; margin-bottom: 7px; }
.consent-choice { display:grid; grid-template-columns:24px 1fr; gap:11px; align-items:start; margin-top:16px; padding:14px; border:1px solid var(--line); border-radius:14px; background:rgba(255,253,249,.55); color:var(--ink); font-size:12px; line-height:1.5; cursor:pointer; }
.consent-choice input { width:20px; height:20px; margin:0; accent-color:var(--orange); }
.consent-choice input:focus-visible { outline:3px solid rgba(240,91,24,.4); outline-offset:2px; }
.decor-lines { display: flex; gap: 7px; margin: 0 0 31px; }
.decor-lines span { height: 7px; width: 44px; background: var(--orange); display: block; }
.decor-lines span:nth-child(2) { width: 81px; background: var(--ink); }
.decor-lines span:nth-child(3) { width: 17px; background: var(--orange); }
.prep-layout { justify-content: space-between; }

.loading { justify-content: center; align-items: center; text-align: center; padding: 35px; }
.loader-mark { width: 105px; height: 105px; border: 1px solid var(--ink); margin: 0 auto 29px; transform: rotate(45deg); position: relative; }
.loader-mark:before, .loader-mark:after { content:''; position:absolute; inset: 15px; border: 1px solid var(--orange); }
.loader-mark:after { inset: 30px; border-color: var(--ink); }
.loading .loader-mark { animation: rotate 4s linear infinite; }
@keyframes rotate { to { transform: rotate(405deg); } }

.result-screen .screen-inner { padding-bottom: 30px; }
.result-header { margin: 17px 0 18px; }
.spark { color: var(--orange); font-size: 27px; letter-spacing: -.2em; margin-bottom: 5px; }
.result-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px 17px; margin-bottom: 10px; background: rgba(255,253,249,.4); }
.result-card h3 { font-family: Georgia, serif; font-weight: 400; font-size: 22px; margin-bottom: 9px; }
.result-card p { margin-bottom: 0; font-size: 13px; color: #4e463e; }
.result-card.featured { border-color: #d9a27d; background: #fff9f2; }
.result-footnote { font-size: 11px; color: var(--muted); line-height: 1.45; margin: 3px 0 20px; }

.rating { margin-top: 14px; border: 1px solid var(--line); border-radius: 17px; padding: 16px 15px 13px; background: rgba(255,253,249,.28); }
.rating h3 { font-family: Georgia, serif; font-weight: 400; font-size: 20px; margin-bottom: 13px; }
.rating-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.rating-row.rating-five { grid-template-columns: repeat(5, 1fr); }
.rating-choice { border: 1px solid var(--line); background: transparent; border-radius: 50%; width: 39px; height: 39px; color: var(--ink); font-size: 13px; justify-self: center; }
.rating-choice.selected { background: var(--orange); color: #fff; border-color: var(--orange); }
.rating-legend { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); margin-top: 9px; }
.rating-submit { margin-top: 15px; }
.rating-guidance { margin-top: 16px; }
.rating-note { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--orange); color: #000; font-size: 12px; line-height: 1.45; font-weight: 700; }
.rating-download { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.download-preview { flex: 0 0 68px; width: 68px; height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--ink); }
.download-preview svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.download-preview span { font-size: 8px; line-height: 1; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.rating-download-copy { flex: 1; margin: 0; color: #39312b; font-size: 12px; line-height: 1.45; }

.permission { margin-top: auto; }
.notice { border-left: 3px solid var(--orange); padding: 3px 0 3px 15px; margin: 17px 0 24px; color: #50483f; font-size: 14px; line-height: 1.5; }
.contact-field { width: 100%; border: 1px solid var(--line); background: rgba(255,253,249,.42); border-radius: 13px; padding: 14px; outline: none; }
.contact-field:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240,91,24,.12); }
.privacy { font-size: 10px; color: var(--muted); line-height: 1.45; margin-top: 14px; }
.final { justify-content: center; text-align: center; padding: 28px; }
.final .screen-inner { justify-content: center; align-items: center; text-align: center; }
.final .lede { width: 100%; max-width: none; text-align: center; }
.final .button-stack { width: 100%; margin-top: 12px; }
.final .decor-lines { justify-content: center; margin-bottom: 28px; }
.final h2 { font-family: Georgia, serif; font-weight: 400; }
.final-heart { color: var(--orange); font-size: 43px; line-height: 1; margin: 2px 0 28px; }

.dev-panel { position: fixed; z-index: 20; left: 12px; bottom: 12px; padding: 9px; border: 1px solid rgba(0,0,0,.14); border-radius: 12px; background: rgba(255,250,243,.94); box-shadow: 0 8px 25px rgba(0,0,0,.1); font-size: 10px; color: var(--ink); }
.dev-panel strong { display: block; margin-bottom: 5px; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.dev-panel button { border: 0; background: var(--ink); color: white; border-radius: 99px; padding: 6px 9px; font-size: 10px; margin-right: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid #1d5f9e; outline-offset: 3px; }
.top-action, .rating-choice { min-width: 44px; min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media (max-width: 520px) {
  body { min-height: 100vh; min-height: 100svh; }
  #app { padding: 0; min-height: 100vh; min-height: 100svh; }
  .shell, .screen { min-height: 100vh; min-height: 100svh; }
  .shell { box-shadow: none; }
  .screen-inner { padding-left: 22px; padding-right: 22px; }
  .welcome-content { padding: 56px 22px max(44px, env(safe-area-inset-bottom)); }
  .button-stack { margin-top: clamp(14px, 3vh, 26px); }
  .prep-layout { justify-content: flex-start; }
  .permission { margin-top: 0; }
}
@media (max-width: 900px) {
  .button-stack { margin-top: clamp(14px, 3vh, 26px); }
  .prep-layout { justify-content: flex-start; }
  .permission { margin-top: 0; }
}
@media (min-width: 700px) {
  .shell { border-radius: 24px; }
  .screen { min-height: calc(100vh - 48px); }
}
