:root {
  --paper: #f6f1e7;
  --ink: #2d2a26;
  --muted: #7d7365;
  --green: #3f5f4b;
  --rose: #c9786a;
  --gold: #e8a96a;
  --line: #e2d7c3;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 17px/1.55 var(--sans); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
.wash { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom)); }
.screen { min-height: calc(100dvh - 48px); display: flex; flex-direction: column; }
.screen[hidden], [hidden] { display: none !important; }
h1 { font: 500 30px/1.18 var(--serif); margin: .2em 0 .55em; letter-spacing: -.01em; }
p { margin: 0 0 .9em; }
.kicker { font: 600 12px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--green); margin: 0; }
.aside { color: var(--muted); font-size: 15px; }
b { font-weight: 600; }

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; -webkit-tap-highlight-color: transparent; }
.primary { background: var(--green); color: #fbf8f1; padding: 14px 22px; border-radius: 999px; font-weight: 600; }
.primary:disabled { opacity: .35; cursor: default; }
.ghost { padding: 14px 18px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); background: rgba(251, 248, 241, .6); }
.link { color: var(--green); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; padding: 6px 0; }
.small { font-size: 14px; }
.danger { color: #9a4a3c; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* onboarding */
#intro .card { flex: 1; padding-top: 4vh; }
.sunpath { width: 100%; max-width: 360px; display: block; margin: 0 auto 18px; color: var(--green); }
.steps { padding-left: 1.2em; margin: 0; }
.steps li { margin-bottom: 1em; }
.gets, .facts { list-style: none; padding: 0; margin: 0 0 1em; }
.gets li { display: flex; gap: 14px; margin-bottom: 1.1em; }
.ico { font-size: 22px; line-height: 1.3; }
.facts li { padding: 10px 0 10px 18px; border-bottom: 1px solid var(--line); position: relative; font-size: 16px; }
.facts li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 8px; font-weight: 500; }
.consent input { width: 22px; height: 22px; accent-color: var(--green); flex: none; margin-top: 2px; }
.introNav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 26px 0 10px; position: sticky; bottom: 0; background: linear-gradient(to bottom, rgba(246, 241, 231, 0), var(--paper) 22px); }
.introNav .ghost[hidden] { display: block !important; visibility: hidden; }
.dots { display: flex; gap: 7px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--green); }

/* record */
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4vh; }
.brand { font: italic 17px var(--serif); color: var(--green); }
#record h1 { font-size: 32px; margin-bottom: .2em; }
#toggleFree { align-self: flex-start; }
.recorder { display: flex; flex-direction: column; align-items: center; margin: 5vh 0 3vh; gap: 8px; }
.rec { position: relative; width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center; }
.rec svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.rec .track { fill: rgba(251, 248, 241, .7); stroke: var(--line); stroke-width: 3; }
.rec .progress { fill: none; stroke: var(--rose); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.rec .dot { position: relative; width: 70px; height: 70px; border-radius: 50%; background: var(--rose); transition: transform .08s, border-radius .2s, width .2s, height .2s; box-shadow: 0 6px 18px rgba(201, 120, 106, .35); }
[data-state="recording"] .rec .dot { width: 46px; height: 46px; border-radius: 10px; }
[data-state="sending"] .rec { display: none; }
.timer { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; margin: 6px 0 0; }
audio { width: 100%; max-width: 360px; margin: 10px 0; }
.error { color: #9a4a3c; text-align: center; font-size: 15px; }
.you { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.you summary { cursor: pointer; color: var(--muted); font-size: 15px; }
.you label { display: block; font-size: 14px; color: var(--muted); margin-top: 12px; }
.you input { display: block; width: 100%; margin-top: 4px; font: 17px var(--sans); padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fbf8f1; color: var(--ink); }
.foot { align-self: center; margin-top: 14px; }

/* sent */
#sent { align-items: center; text-align: center; justify-content: center; }
.stampWrap .stamp { width: 150px; filter: drop-shadow(0 3px 6px rgba(60, 40, 20, .25)); animation: land .7s cubic-bezier(.2, 1.4, .4, 1) both; margin-bottom: 18px; }
@keyframes land { from { opacity: 0; transform: translateY(-30px) scale(1.3) rotate(-14deg); } }

/* journal */
#entries { list-style: none; padding: 0; margin: 0; }
.entry { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.entryStamp .stamp { width: 66px; filter: drop-shadow(0 1px 2px rgba(60, 40, 20, .25)); }
.entryBody { flex: 1; min-width: 0; }
.entryBody .when { font-weight: 600; margin: 0; }
.entryBody .q { color: var(--muted); font: italic 15px var(--serif); margin: 2px 0 0; }
.entryBody audio { margin: 8px 0 2px; }

/* v2: language picker, sign-in, done state, settings, illustrated stamps */
.loading { color: var(--muted); text-align: center; margin-top: 40vh; }
.langs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lang { font-size: 14px; padding: 5px 11px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); background: rgba(251, 248, 241, .6); color: var(--muted); }
.lang.on { background: var(--green); color: #fbf8f1; box-shadow: none; }
#alreadyJoined { margin-top: 4px; }
.signin { margin: 14px 0 6px; display: flex; flex-direction: column; gap: 10px; }
#gsi { min-height: 44px; }
.top nav { display: flex; gap: 14px; align-items: center; }
.icon { text-decoration: none; font-size: 20px; padding: 4px; }
.done { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 4vh 0 2vh; }
.done h2 { font: 500 24px/1.2 var(--serif); margin: 0 0 .4em; }
.wide { width: 100%; max-width: 360px; margin: 6px 0; }
.stamp.ill { position: relative; display: inline-block; }
.stamp.ill img { width: 100%; display: block; }
.stamp.ill .pm { position: absolute; width: 58%; right: -12%; bottom: 6%; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--muted); }
.form label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); }
.form label.check input { width: 22px; height: 22px; accent-color: var(--green); }
.form select, .form input:not([type]) { font: 17px var(--sans); padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fbf8f1; color: var(--ink); }
.saved { color: var(--green); font-size: 14px; margin: 0; }
.account { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; border-top: 1px solid var(--line); }
.entryBody .story { display: block; }
