@property --m1 { syntax: "<color>"; inherits: true; initial-value: #ff8fab; }
@property --m2 { syntax: "<color>"; inherits: true; initial-value: #7b5cff; }
@property --m3 { syntax: "<color>"; inherits: true; initial-value: #120f2a; }

:root {
  --m1: #ff8fab; --m2: #7b5cff; --m3: #120f2a;
  --ink: #fbf7ff; --ink-2: rgba(251, 247, 255, .72); --ink-3: rgba(251, 247, 255, .45);
  --glass: rgba(255, 255, 255, .08); --glass-2: rgba(255, 255, 255, .14); --line: rgba(255, 255, 255, .12);
  --mine: linear-gradient(135deg, var(--m1), var(--m2));
  --serif: "Fraunces", Georgia, serif; --sans: "Inter", system-ui, sans-serif; --mono: "JetBrains Mono", monospace;
  --r: 22px;
  transition: --m1 2.5s ease, --m2 2.5s ease, --m3 2.5s ease;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; min-height: -webkit-fill-available; overscroll-behavior: none; background: var(--m3); color: var(--ink); font: 15px/1.45 var(--sans); overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: var(--ink); }
img { display: block; max-width: 100%; }

/* ---------- mood sky ---------- */
.sky { position: fixed; inset: 0; background: radial-gradient(120% 80% at 50% 120%, var(--m2) 0%, var(--m3) 60%); z-index: 0; }
.sky i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: .42; mix-blend-mode: screen; animation: drift 28s ease-in-out infinite alternate; }
.sky i:nth-child(1) { background: var(--m1); left: -20vmax; top: -25vmax; }
.sky i:nth-child(2) { background: var(--m2); right: -25vmax; top: 10vh; animation-duration: 34s; animation-delay: -8s; }
.sky i:nth-child(3) { background: var(--m1); left: 20vw; bottom: -35vmax; opacity: .25; animation-duration: 40s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
body.pulse .sky { animation: beat var(--beat, .83s) ease-out infinite; }
@keyframes beat { 0% { filter: brightness(1.6) saturate(1.3); } 30% { filter: brightness(1); } }

#app { position: fixed; top: var(--app-top, 0px); left: 0; right: 0; height: var(--app-h, 100%); z-index: 1; display: flex; justify-content: center; overflow: hidden; }
.shell { width: 100%; max-width: 1100px; display: grid; grid-template-columns: 1fr; height: 100%; }
@media (min-width: 960px) { .shell { grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; padding: 18px; } .shell > .side { display: flex !important; } }

/* ---------- login ---------- */
.login { margin: auto; text-align: center; padding: 24px 16px; width: 100%; max-width: 440px; }
.logo { font: 600 56px/1 var(--serif); letter-spacing: -.02em; }
.logo em { font-style: italic; font-weight: 400; background: var(--mine); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { color: var(--ink-2); margin: 10px 0 34px; }
.who { display: flex; gap: 22px; justify-content: center; margin-bottom: 26px; }
.who button { display: grid; gap: 10px; justify-items: center; opacity: .55; transition: .3s; }
.who button.on { opacity: 1; transform: translateY(-4px); }
.who .av { width: 88px; height: 88px; font-size: 40px; }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-2); border: 1px solid var(--line); font-size: 20px; flex: none; position: relative; }
.av.ring::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(var(--m1), var(--m2), var(--m1)); z-index: -1; animation: spin 6s linear infinite; }
.av.ring { background: var(--m3); }
@keyframes spin { to { transform: rotate(1turn); } }
.field { width: 100%; padding: 15px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); outline: none; text-align: center; letter-spacing: .3em; font-size: 18px; }
.field:focus { border-color: var(--m1); }
.cta { margin-top: 14px; width: 100%; padding: 15px; border-radius: 16px; background: var(--mine); font-weight: 600; box-shadow: 0 10px 30px -10px var(--m1); }
.err { color: #ffb3c1; min-height: 22px; margin-top: 10px; }

/* ---------- onboarding ---------- */
.onb { margin: auto; padding: 24px 16px; width: 100%; max-width: 520px; }
.onb h1 { font: 600 34px/1.15 var(--serif); margin: 0 0 8px; }
.onb p.lead { color: var(--ink-2); margin: 0 0 22px; }
.qcard { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; backdrop-filter: blur(20px); animation: rise .5s ease; }
.qcard .q { font: 400 22px/1.3 var(--serif); margin-bottom: 14px; }
.qcard textarea { width: 100%; min-height: 96px; resize: none; border: 0; outline: 0; background: rgba(0,0,0,.18); border-radius: 14px; padding: 14px; }
.dots { display: flex; gap: 6px; justify-content: center; margin: 18px 0; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--ink-3); transition: .3s; }
.dots i.on { width: 22px; background: var(--m1); }
.row { display: flex; gap: 10px; align-items: center; }
.ghost { padding: 12px 16px; border-radius: 14px; color: var(--ink-2); }
.privacy { color: var(--ink-3); font-size: 12.5px; margin-top: 18px; text-align: center; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- main ---------- */
.main { display: flex; flex-direction: column; min-height: 0; height: 100%; min-width: 0; overflow: hidden; }
#view > *, .qbar > *, .board > * { min-width: 0; }
@media (min-width: 960px) { .main, .side { background: rgba(10, 6, 25, .35); border: 1px solid var(--line); border-radius: 28px; backdrop-filter: blur(24px); overflow: hidden; } }
header.top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: rgba(10, 6, 25, .25); backdrop-filter: blur(20px); }
header.top .name { font: 600 18px/1.1 var(--serif); }
header.top .sub { font-size: 12.5px; color: var(--ink-2); }
.sub .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #7ae582; margin-right: 5px; box-shadow: 0 0 8px #7ae582; }
.moodchip { margin-left: auto; padding: 6px 12px; border-radius: 999px; background: var(--glass-2); font-size: 12.5px; border: 1px solid var(--line); display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.moodchip.think::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--m1); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line); font-size: 18px; flex: none; }

/* next stop board */
.board { margin: 10px 14px 0; border-radius: 14px; background: #0b0b0b; border: 1px solid #222; padding: 9px 14px; font-family: var(--mono); display: flex; align-items: center; gap: 12px; color: #ffcf33; box-shadow: inset 0 0 18px rgba(255, 190, 0, .08); }
.board .lbl { font-size: 10px; letter-spacing: .18em; color: #a98b2a; }
.board .dest { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .cd { margin-left: auto; font-weight: 700; font-size: 15px; letter-spacing: .08em; white-space: nowrap; }
.flap { display: inline-block; animation: flap .35s steps(3); }
@keyframes flap { 0% { transform: scaleY(.1); } 100% { transform: scaleY(1); } }

.thread { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.day { align-self: center; font-size: 11.5px; color: var(--ink-3); margin: 14px 0 6px; letter-spacing: .06em; text-transform: uppercase; }
.msg { max-width: min(78%, 520px); display: flex; flex-direction: column; position: relative; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 10px 14px; border-radius: 20px; background: var(--glass-2); backdrop-filter: blur(14px); word-wrap: break-word; white-space: pre-wrap; border: 1px solid var(--line); }
.msg.me .bubble { background: var(--mine); border: 0; border-bottom-right-radius: 6px; }
.msg:not(.me) .bubble { border-bottom-left-radius: 6px; }
.bubble.media { padding: 4px; overflow: hidden; }
.bubble.media img { border-radius: 16px; max-height: 340px; object-fit: cover; }
.bubble.media .cap { padding: 6px 8px 4px; }
.quote { font-size: 12.5px; opacity: .75; border-left: 2px solid currentColor; padding-left: 8px; margin-bottom: 6px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { font-size: 10.5px; color: var(--ink-3); margin: 2px 8px 6px; display: flex; gap: 6px; align-items: center; }
.reacts { position: absolute; bottom: 14px; right: -6px; background: var(--m3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; font-size: 13px; }
.msg.me .reacts { right: auto; left: -6px; }
.intent { font-size: 11px; color: var(--ink-2); background: rgba(0,0,0,.2); border: 1px dashed var(--line); border-radius: 999px; padding: 2px 9px; margin: 2px 6px 4px; display: inline-flex; gap: 6px; align-items: center; }
.intent button { color: var(--m1); font-weight: 600; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.snapcard, .capsule { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--glass); min-width: 200px; }
.snapcard .sq { width: 18px; height: 18px; border-radius: 5px; background: var(--m1); box-shadow: 0 0 12px var(--m1); }
.snapcard.opened .sq { background: transparent; border: 2px solid var(--ink-3); box-shadow: none; }
.capsule { background: linear-gradient(135deg, rgba(255, 215, 120, .18), rgba(255, 255, 255, .05)); }
.capsule .seal { font-size: 26px; }
.capsule.opening { animation: unseal 1.4s ease; }
@keyframes unseal { 30% { transform: scale(1.06) rotate(-2deg); filter: brightness(1.8); } }
.typing { align-self: flex-start; padding: 12px 16px; border-radius: 20px; background: var(--glass-2); display: flex; gap: 4px; margin: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 30% { transform: translateY(-5px); opacity: 1; } 0%, 60%, 100% { opacity: .4; } }

/* suggestions + composer */
.sugg { display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px 2px; scrollbar-width: none; }
.sugg::-webkit-scrollbar { display: none; }
.sugg button { flex: none; max-width: 280px; text-align: left; padding: 8px 13px; border-radius: 16px; background: rgba(255,255,255,.1); border: 1px solid var(--line); font-size: 13.5px; animation: rise .4s ease backwards; }
.sugg button small { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.sugg .spark { color: var(--m1); font-size: 12px; align-self: center; flex: none; padding: 0 2px; }
.replying { margin: 6px 14px 0; padding: 6px 12px; border-left: 3px solid var(--m1); background: var(--glass); border-radius: 10px; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.composer textarea { flex: 1; resize: none; max-height: 140px; min-height: 44px; padding: 11px 16px; border-radius: 22px; border: 1px solid var(--line); background: rgba(10, 6, 25, .35); outline: 0; backdrop-filter: blur(16px); }
.composer textarea:focus { border-color: rgba(255,255,255,.3); }
.send { width: 44px; height: 44px; border-radius: 50%; background: var(--mine); display: grid; place-items: center; font-size: 18px; flex: none; }
.heart { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; flex: none; background: var(--glass); border: 1px solid var(--line); user-select: none; touch-action: none; }
.heart.holding { animation: hb var(--beat, .83s) infinite; background: rgba(255, 80, 120, .35); }
@keyframes hb { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.15); } }

.plus { position: absolute; bottom: 74px; left: 12px; background: rgba(20, 12, 40, .92); border: 1px solid var(--line); border-radius: 20px; padding: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; z-index: 5; backdrop-filter: blur(20px); animation: rise .2s ease; width: min(340px, calc(100% - 24px)); }
.plus button { padding: 12px 6px; border-radius: 14px; display: grid; gap: 4px; justify-items: center; font-size: 12px; color: var(--ink-2); }
.plus button b { font-size: 24px; }
.plus button:hover { background: var(--glass); }

.tabbar { display: flex; justify-content: space-around; border-top: 1px solid var(--line); padding: 6px 0 max(6px, env(safe-area-inset-bottom)); background: rgba(10, 6, 25, .3); backdrop-filter: blur(20px); }
.tabbar button { padding: 6px 14px; display: grid; justify-items: center; font-size: 11px; color: var(--ink-3); gap: 2px; }
.tabbar button b { font-size: 20px; filter: grayscale(1); opacity: .7; }
.tabbar button.on { color: var(--ink); } .tabbar button.on b { filter: none; opacity: 1; }

/* ---------- side / spine ---------- */
.side { display: none; flex-direction: column; overflow-y: auto; padding: 18px; gap: 14px; }
.panel { overflow-y: auto; flex: 1; padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card h3 { margin: 0 0 10px; font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; justify-content: space-between; }
.moodbig { font: 400 28px/1.1 var(--serif); text-transform: capitalize; }
.moodnote { color: var(--ink-2); margin-top: 6px; font-size: 14px; }
.meter { height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; background: var(--mine); border-radius: 3px; transition: width 1.5s; }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; font-size: 11.5px; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: 13px; border: 1px solid var(--line); }
.mem { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mem:first-of-type { border-top: 0; }
.mem .src { font-size: 11px; color: var(--ink-3); }
.mem button { margin-left: auto; color: var(--ink-3); font-size: 15px; padding: 0 4px; }
.qtonight { font: italic 400 19px/1.35 var(--serif); }
.small { font-size: 12.5px; color: var(--ink-3); }
.switch { width: 42px; height: 24px; border-radius: 12px; background: rgba(255,255,255,.18); position: relative; transition: .3s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .3s; }
.switch.on { background: var(--m1); } .switch.on::after { left: 21px; }
.addrow { display: flex; gap: 6px; margin-top: 10px; }
.addrow input { flex: 1; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.2); outline: 0; min-width: 0; }
.addrow select { border-radius: 12px; background: rgba(0,0,0,.3); color: var(--ink); border: 1px solid var(--line); padding: 0 6px; }
.pill { padding: 8px 14px; border-radius: 12px; background: var(--mine); font-weight: 600; font-size: 13px; }

/* ---------- note on screen ---------- */
.note { margin: 10px 14px 0; padding: 12px 16px 12px 14px; background: #fff6d5; color: #3b2a12; border-radius: 4px 4px 16px 4px; font: italic 400 16px/1.35 var(--serif); transform: rotate(-1deg); box-shadow: 0 10px 24px -12px rgba(0,0,0,.6); position: relative; animation: rise .5s ease; cursor: pointer; }
.note::before { content: ""; position: absolute; top: -8px; left: 50%; width: 60px; height: 16px; transform: translateX(-50%) rotate(2deg); background: rgba(255, 143, 171, .55); border-radius: 2px; }
.note small { display: block; font: 500 11px var(--sans); color: #8a6d3b; margin-top: 4px; font-style: normal; }

/* ---------- tonight's question bar ---------- */
.qbar { overflow: hidden; margin: 10px 14px 0; padding: 10px 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; text-align: left; width: calc(100% - 28px); }
.qbar .qt { font: italic 400 14.5px/1.3 var(--serif); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qbar .qs { font-size: 11px; color: var(--m1); font-weight: 600; white-space: nowrap; }
.answers { display: grid; gap: 10px; margin-top: 14px; }
.answers .a { padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid var(--line); }
.answers .a b { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; letter-spacing: .06em; text-transform: uppercase; }
.answers .a.locked { color: var(--ink-3); font-style: italic; filter: blur(.3px); }

/* ---------- letters ---------- */
.letters-hero { font: 600 30px/1.1 var(--serif); }
.envs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.env { aspect-ratio: 1.45; border-radius: 10px; position: relative; background: linear-gradient(160deg, #fbe9e1, #f2cfc4); color: #5a2a36; padding: 12px; display: flex; flex-direction: column; justify-content: flex-end; text-align: left; box-shadow: 0 14px 30px -16px rgba(0,0,0,.7); overflow: hidden; transition: transform .25s; }
.env:hover { transform: translateY(-3px) rotate(-1deg); }
.env::before { content: ""; position: absolute; inset: 0 0 45% 0; background: linear-gradient(160deg, #f6d9cf, #ecbcb0); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.env::after { content: "♥"; position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: #c2304f; color: #fff; display: grid; place-items: center; font-size: 13px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.env.opened::after { content: "✓"; background: #b9a29c; }
.env span { position: relative; font: italic 400 13.5px/1.2 var(--serif); }
.env small { position: relative; font-size: 10.5px; opacity: .7; }
.paper { width: 100%; max-width: 460px; background: #fffaf3; color: #3b2a2a; border-radius: 6px; padding: 30px 26px; font: 400 18px/1.6 var(--serif); white-space: pre-wrap; box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); animation: unfold .7s cubic-bezier(.2,.8,.2,1); max-height: 80dvh; overflow: auto; }
.paper h4 { font: italic 400 15px var(--serif); color: #a0526a; margin: 0 0 14px; }
.paper .sig { text-align: right; margin-top: 18px; font-style: italic; }
@keyframes unfold { from { transform: perspective(800px) rotateX(70deg) scale(.8); opacity: 0; } }

/* ---------- profile ---------- */
.prof { text-align: center; padding: 8px 0 4px; }
.bigav { width: 112px; height: 112px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 52px; background: var(--glass-2); border: 3px solid rgba(255,255,255,.25); overflow: hidden; position: relative; box-shadow: 0 0 0 6px rgba(255,255,255,.05), 0 20px 40px -20px var(--m1); }
.bigav img, .av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av { overflow: hidden; }
.bigav .edit { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.5); font-size: 11px; padding: 4px 0; }
.prof h2 { font: 600 28px/1.1 var(--serif); margin: 14px 0 4px; }
.prof .status { color: var(--ink-2); font-style: italic; font-family: var(--serif); font-size: 16px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 14px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.stat b { display: block; font: 600 26px/1 var(--serif); margin-bottom: 4px; }
.stat span { font-size: 12px; color: var(--ink-3); }
.firstmsg { font: italic 400 18px/1.4 var(--serif); }
.seg { display: flex; background: rgba(0,0,0,.2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; padding: 9px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2); }
.seg button.on { background: var(--glass-2); color: var(--ink); }

/* ---------- voice ---------- */
.voice { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.voice .play { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; flex: none; }
.voice .wave { flex: 1; height: 26px; display: flex; align-items: center; gap: 2px; }
.voice .wave i { flex: 1; background: currentColor; opacity: .55; border-radius: 2px; }
.voice .wave i.p { opacity: 1; }
.voice .dur { font-size: 11.5px; opacity: .8; font-variant-numeric: tabular-nums; }
.mic.rec { background: #e63950; animation: hb 1s infinite; }
.recbar { flex: 1; min-height: 44px; border-radius: 22px; background: rgba(230, 57, 80, .18); border: 1px solid rgba(230,57,80,.5); display: flex; align-items: center; padding: 0 16px; gap: 10px; font-variant-numeric: tabular-nums; }
.recbar i { width: 10px; height: 10px; border-radius: 50%; background: #e63950; animation: blink 1s infinite; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(5, 3, 14, .9); backdrop-filter: blur(16px); display: flex; flex-direction: column; align-items: center; justify-content: center; animation: fade .25s; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
.overlay .x { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; }
.overlay img.full { max-height: 80dvh; border-radius: 18px; }
.snapbar { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 16px; right: 70px; height: 3px; background: rgba(255,255,255,.2); border-radius: 2px; overflow: hidden; }
.snapbar i { display: block; height: 100%; background: #fff; animation: fill linear forwards; }
@keyframes fill { from { width: 0; } to { width: 100%; } }
.hbwrap { text-align: center; }
.hbheart { font-size: 140px; animation: hb var(--beat, .83s) infinite; filter: drop-shadow(0 0 40px #ff3d7f); }
.hbtext { font: italic 400 22px/1.3 var(--serif); margin-top: 18px; }
canvas.doodle { background: rgba(255,255,255,.04); border-radius: 18px; border: 1px solid var(--line); touch-action: none; width: min(92vw, 520px); height: min(62dvh, 520px); }
.colors { display: flex; gap: 10px; margin: 14px 0; }
.colors button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; }
.colors button.on { border-color: #fff; }
.sheet { width: 100%; max-width: 440px; background: rgba(20, 12, 40, .9); border: 1px solid var(--line); border-radius: 26px; padding: 22px; }
.sheet h2 { font: 600 24px/1.2 var(--serif); margin: 0 0 6px; }
.sheet textarea, .sheet input { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.25); outline: 0; margin-top: 10px; }
.sheet textarea { min-height: 110px; resize: none; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.presets button { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; }
.presets button.on { background: var(--glass-2); border-color: var(--m1); }

#toasts { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 30; display: grid; gap: 8px; width: min(92vw, 400px); pointer-events: none; }
.toast { padding: 11px 16px; border-radius: 16px; background: rgba(20, 12, 40, .92); border: 1px solid var(--line); backdrop-filter: blur(20px); text-align: center; animation: rise .3s ease; font-size: 14px; }
.floaty { position: fixed; z-index: 25; pointer-events: none; font-size: 30px; animation: floatup 3s ease-out forwards; }
@keyframes floatup { to { transform: translateY(-70vh) rotate(var(--rot, 20deg)); opacity: 0; } }

.storyrow { display: flex; gap: 14px; padding: 4px 2px; }
.storyrow button { display: grid; justify-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.storyrow .av { width: 56px; height: 56px; font-size: 26px; }
.empty { margin: auto; text-align: center; color: var(--ink-2); padding: 30px; }
.empty .big { font-size: 46px; margin-bottom: 10px; }
.empty h2 { font: 400 24px/1.25 var(--serif); color: var(--ink); margin: 0 0 6px; }
@media (prefers-reduced-motion: reduce) { *, .sky i { animation: none !important; transition: none !important; } }

/* ---------- v3: tones, magic, whisper, effects, touch, game, photos ---------- */
.sugg { flex-wrap: nowrap; align-items: stretch; }
.sugg .sg small { text-transform: capitalize; }
.tones { display: flex; gap: 6px; flex: none; align-items: center; padding-left: 4px; }
.tones button { padding: 7px 11px; border-radius: 999px; font-size: 12.5px; background: rgba(0,0,0,.25); border: 1px dashed var(--line); white-space: nowrap; }
.shimmer { flex: none; width: 170px; height: 52px; border-radius: 16px; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.16), rgba(255,255,255,.06)); background-size: 200% 100%; animation: shim 1.2s linear infinite; display: block; }
@keyframes shim { to { background-position: -200% 0; } }
textarea.whispering { border-color: rgba(214, 120, 255, .55) !important; background: rgba(70, 20, 90, .5) !important; box-shadow: 0 0 0 4px rgba(181, 23, 158, .15), 0 0 24px -6px rgba(214, 120, 255, .6) !important; }
.wtag { display: block; font-size: 10.5px; opacity: .7; margin-bottom: 3px; letter-spacing: .04em; }
.bubble.whisper { cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.bubble.whisper .wt { filter: blur(7px); transition: filter .25s; display: inline-block; }
.bubble.whisper.open .wt { filter: none; }
.confetti { position: fixed; top: -12px; width: 8px; height: 13px; z-index: 40; pointer-events: none; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 108vh) rotate(720deg); } }
.night { position: fixed; inset: 0; z-index: 35; background: radial-gradient(circle at 50% 30%, #1b1f4a, #05060f 70%); display: grid; place-items: center; animation: fade 1s; transition: opacity 1.2s; }
.night.sun { background: radial-gradient(circle at 50% 70%, #ffd166, #f3722c 45%, #3c1053 100%); }
.night.out { opacity: 0; }
.night i { position: absolute; background: #fff; border-radius: 50%; animation: twinkle 2s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .2; } }
.night .moon { font-size: 90px; animation: rise 1.4s ease; filter: drop-shadow(0 0 30px rgba(255,255,220,.6)); }
.night .nt { position: absolute; top: 62%; font: italic 400 28px var(--serif); text-align: center; padding: 0 16px; animation: rise 1.8s ease; }
.touchO { padding: 0; }
.touchpad { position: absolute; inset: 0; touch-action: none; overflow: hidden; transition: background 1s; }
.touchpad.together { background: radial-gradient(circle at 50% 50%, rgba(255, 95, 143, .45), rgba(123, 92, 255, .2) 60%, transparent); animation: beat 1.1s ease-out infinite; }
.tdot { position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; transform: scale(.6); }
.tdot.on { opacity: 1; transform: scale(1); }
.tdot.me { background: radial-gradient(circle, rgba(255,255,255,.9), rgba(255, 143, 171, .5) 40%, transparent 70%); }
.tdot.them { background: radial-gradient(circle, rgba(255,255,255,.9), rgba(123, 92, 255, .6) 40%, transparent 70%); animation: hb 1.1s infinite; }
.thint { position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; font: italic 400 22px/1.35 var(--serif); pointer-events: none; padding: 0 16px; }
.game h2 { font-size: 30px; }
.tot { display: grid; gap: 12px; margin-top: 14px; text-align: center; }
.tot button { padding: 26px 16px; border-radius: 20px; background: var(--glass-2); border: 1px solid var(--line); font: 600 22px var(--serif); transition: .2s; }
.tot button:hover { border-color: var(--m1); }
.tot button.picked { background: var(--mine); transform: scale(1.03); }
.tot span { color: var(--ink-3); font-style: italic; }
.results { display: grid; gap: 6px; margin-top: 14px; max-height: 46dvh; overflow: auto; }
.results div { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.05); font-size: 13.5px; }
.results div span:last-child { text-align: right; }
.results div.same { background: rgba(255, 95, 143, .16); }
.results i { font-style: normal; font-size: 11px; color: var(--ink-3); }
.pwall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pwall img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: pointer; width: 100%; }
.plus { grid-template-columns: repeat(3, 1fr); }
.touchO .x { z-index: 3; }

.send.idle { opacity: .45; }

/* notifications */
.pushbar { margin: 10px 14px 0; display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(255, 143, 171, .25), rgba(123, 92, 255, .25)); border: 1px solid var(--line); }
.pushbar .pb-main { flex: 1; text-align: left; font-size: 13.5px; padding: 8px 0; font-weight: 500; }
.pushbar .pb-x { width: 32px; height: 32px; border-radius: 50%; color: var(--ink-3); flex: none; }
.steps { margin: 16px 0 6px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--mine); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.steps li span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.steps li .ico { display: inline; margin-left: 4px; }

/* install + notification steps */
.gate { text-align: center; }
.gate .steps { text-align: left; }
.gate-ico { width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 22px; overflow: hidden; box-shadow: 0 18px 40px -16px var(--m1); display: grid; place-items: center; }
.gate-ico img { width: 100%; height: 100%; }
.gate-ico.big { font-size: 54px; background: var(--glass-2); border-radius: 50%; }
.pointer { position: fixed; bottom: max(14px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); font-size: 40px; display: grid; justify-items: center; animation: nudge 1.1s ease-in-out infinite; z-index: 5; pointer-events: none; }
.pointer small { font-size: 12px; color: var(--ink-2); order: -1; margin-bottom: 2px; }
@keyframes nudge { 50% { transform: translate(-50%, 10px); } }


/* =================== motion system =================== */
:root { --spring: cubic-bezier(.2, .9, .25, 1.25); --ease-out: cubic-bezier(.16, 1, .3, 1); --t-fast: .18s; --t: .32s; --t-slow: .55s; }

/* screen edges: content sits inside the notch / home bar, colours run to the very edge */
.main { padding-bottom: 0; }
.tabbar { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.login, .onb { padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: max(24px, env(safe-area-inset-bottom)); overflow-y: auto; max-height: 100%; }

/* everything you can press gives back */
button { transition: transform var(--t-fast) var(--spring), opacity var(--t-fast), background-color var(--t), box-shadow var(--t); -webkit-user-select: none; user-select: none; }
button:active:not(:disabled) { transform: scale(.94); }
.cta:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .75; }
.cta { position: relative; overflow: hidden; }
.cta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.35) 50%, transparent 80%); transform: translateX(-120%); animation: sheen 3.6s var(--ease-out) infinite 1.2s; }
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.busy::after { display: none; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }

/* entrances: children rise one after another */
.stagger > *, .onb > *, .gate > *, #view.entering .panel > * { animation: rise var(--t-slow) var(--ease-out) backwards; }
.stagger > *:nth-child(2), .onb > *:nth-child(2), .gate > *:nth-child(2), #view.entering .panel > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3), .onb > *:nth-child(3), .gate > *:nth-child(3), #view.entering .panel > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4), .onb > *:nth-child(4), .gate > *:nth-child(4), #view.entering .panel > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5), .onb > *:nth-child(5), .gate > *:nth-child(5), #view.entering .panel > *:nth-child(5) { animation-delay: .24s; }
.stagger > *:nth-child(n+6), .onb > *:nth-child(n+6), .gate > *:nth-child(n+6), #view.entering .panel > *:nth-child(n+6) { animation-delay: .3s; }
.steps li { animation: rise var(--t-slow) var(--ease-out) backwards; }
.steps li:nth-child(2) { animation-delay: .1s; } .steps li:nth-child(3) { animation-delay: .2s; } .steps li:nth-child(4) { animation-delay: .3s; } .steps li:nth-child(5) { animation-delay: .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } }

/* login: the logo breathes, avatars float, wrong answers shake */
.logo { animation: logoIn 1s var(--ease-out) both; }
.logo em { background-size: 200% 100%; animation: shimmerText 6s ease-in-out infinite; }
@keyframes logoIn { from { opacity: 0; letter-spacing: .2em; filter: blur(8px); } }
@keyframes shimmerText { 50% { background-position: 100% 0; } }
.who button .av { animation: float 4.5s ease-in-out infinite; transition: transform var(--t) var(--spring), box-shadow var(--t); }
.who button:nth-child(2) .av { animation-delay: -2.2s; }
.who button.on .av { box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 14px 34px -10px var(--m1); }
@keyframes float { 50% { transform: translateY(-6px); } }
.shake { animation: shake .42s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
#dogStep:not([style*="none"]) { animation: rise var(--t) var(--spring); }
.gate-ico { animation: float 4s ease-in-out infinite, rise .7s var(--spring) backwards; }

/* tabs glide in the direction you move */
#view.enter-fwd > * { animation: inR var(--t) var(--ease-out); }
#view.enter-back > * { animation: inL var(--t) var(--ease-out); }
@keyframes inR { from { opacity: 0; transform: translateX(22px); } }
@keyframes inL { from { opacity: 0; transform: translateX(-22px); } }
.tabbar button b { transition: transform var(--t) var(--spring), filter var(--t), opacity var(--t); }
.tabbar button.on b { transform: translateY(-3px) scale(1.12); }
.tabbar button { position: relative; }
.tabbar button.on::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 18px; height: 3px; border-radius: 2px; background: var(--mine); transform: translateX(-50%); animation: grow var(--t) var(--spring); }
@keyframes grow { from { width: 0; } }

/* messages: new ones arrive with a spring from their side */
.thread.first-paint .msg { animation: fadeIn .4s ease backwards; }
.msg.fresh { animation: inTheirs .5s var(--spring) backwards; transform-origin: bottom left; }
.msg.me.fresh { animation-name: inMine; transform-origin: bottom right; }
@keyframes inTheirs { from { opacity: 0; transform: translate(-14px, 14px) scale(.85); } }
@keyframes inMine { from { opacity: 0; transform: translate(14px, 18px) scale(.85); } }
@keyframes fadeIn { from { opacity: 0; } }
.reacts { transition: transform var(--t) var(--spring); }
.reacts.popped { animation: reactPop .5s var(--spring); }
@keyframes reactPop { 0% { transform: scale(0); } 60% { transform: scale(1.35); } }
.bubble { transition: transform var(--t-fast) var(--spring); }
.msg:active .bubble { transform: scale(.98); }
.typing { animation: rise var(--t) var(--spring); }

/* composer */
.send.launch { animation: launch .45s var(--spring); }
@keyframes launch { 30% { transform: translate(6px, -6px) rotate(-18deg) scale(.88); } 60% { transform: translate(-2px, 2px) scale(1.08); } }
.heart:not(.holding) { animation: idleBeat 5s ease-in-out infinite 2s; }
@keyframes idleBeat { 0%, 86%, 100% { transform: scale(1); } 90% { transform: scale(1.14); } 94% { transform: scale(.98); } 97% { transform: scale(1.08); } }
.composer textarea { transition: border-color var(--t), box-shadow var(--t), background var(--t); }
.composer textarea:focus { box-shadow: 0 0 0 4px rgba(255,255,255,.06), 0 10px 30px -18px var(--m1); }
.plus { animation: popUp .32s var(--spring); transform-origin: bottom left; }
.plus button { animation: rise .4s var(--ease-out) backwards; }
.plus button:nth-child(2) { animation-delay: .03s; } .plus button:nth-child(3) { animation-delay: .06s; } .plus button:nth-child(4) { animation-delay: .09s; } .plus button:nth-child(5) { animation-delay: .12s; } .plus button:nth-child(6) { animation-delay: .15s; } .plus button:nth-child(7) { animation-delay: .18s; } .plus button:nth-child(8) { animation-delay: .21s; } .plus button:nth-child(9) { animation-delay: .24s; }
.plus button b { transition: transform var(--t) var(--spring); }
.plus button:hover b, .plus button:active b { transform: scale(1.18) rotate(-6deg); }
@keyframes popUp { from { opacity: 0; transform: scale(.85) translateY(10px); } }
.sugg button { transition: transform var(--t-fast) var(--spring), background var(--t); }

/* header: their avatar glows while they're here */
#themAv { transition: box-shadow var(--t-slow); }
#themAv.online { box-shadow: 0 0 0 2px rgba(122, 229, 130, .9), 0 0 18px rgba(122, 229, 130, .45); animation: onlinePulse 2.6s ease-in-out infinite; }
@keyframes onlinePulse { 50% { box-shadow: 0 0 0 2px rgba(122, 229, 130, .6), 0 0 28px rgba(122, 229, 130, .25); } }
.moodchip { transition: background var(--t-slow), transform var(--t) var(--spring); animation: rise .5s var(--spring) backwards; }
body.mood-shift .moodchip { animation: moodPop .8s var(--spring); }
body.mood-shift .sky { animation: wash 1.6s ease-out; }
@keyframes moodPop { 40% { transform: scale(1.12); } }
@keyframes wash { 0% { filter: brightness(1); } 30% { filter: brightness(1.45) saturate(1.3); } 100% { filter: brightness(1); } }
#view.entering .board, #view.entering .qbar, .pushbar, .note { animation: rise .5s var(--spring) backwards; }
.qbar { transition: transform var(--t-fast) var(--spring); }

/* overlays slide up like real sheets, and slide away */
.overlay { animation: fade .28s ease both; }
.overlay > .sheet, .overlay > .paper, .overlay > img.full, .overlay > .hbwrap { animation: sheetUp .5s var(--spring) both; }
.overlay.out { animation: fadeOut .24s ease forwards; }
.overlay.out > * { animation: sheetDown .24s ease forwards; }
@keyframes sheetUp { from { opacity: 0; transform: translateY(40px) scale(.96); } }
@keyframes sheetDown { to { opacity: 0; transform: translateY(30px) scale(.97); } }
@keyframes fadeOut { to { opacity: 0; } }
.toast { animation: toastIn .45s var(--spring) both; }
.toast.out { animation: toastOut .26s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.92); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(.96); } }

/* cards and envelopes respond */
.card { transition: transform var(--t) var(--spring), border-color var(--t); }
#view.entering .env { animation: rise .5s var(--spring) backwards; }
.envs .env:nth-child(2) { animation-delay: .05s; } .envs .env:nth-child(3) { animation-delay: .1s; } .envs .env:nth-child(4) { animation-delay: .15s; } .envs .env:nth-child(n+5) { animation-delay: .2s; }
.env:active { transform: scale(.96) rotate(-1deg); }
#view.entering .stat, .side .stat { animation: rise .5s var(--spring) backwards; }
.stats .stat:nth-child(2) { animation-delay: .05s; } .stats .stat:nth-child(3) { animation-delay: .1s; } .stats .stat:nth-child(4) { animation-delay: .15s; } .stats .stat:nth-child(5) { animation-delay: .2s; } .stats .stat:nth-child(6) { animation-delay: .25s; }
#view.entering .bigav { animation: rise .6s var(--spring) backwards; }
.bigav { transition: transform var(--t) var(--spring); }
.bigav:active { transform: scale(.95); }
.seg button { transition: background var(--t) var(--ease-out), color var(--t); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Home Screen app: everything sized to the physical screen */
html, body { height: var(--app-h, 100%); }
.sky, .overlay, .night { bottom: auto; height: var(--app-h, 100%); }

/* whisper mode */
.whisperbar { margin: 6px 12px 0; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 16px;
  background: linear-gradient(120deg, rgba(181, 23, 158, .28), rgba(123, 92, 255, .22)); border: 1px solid rgba(214, 120, 255, .35);
  animation: rise .35s var(--spring); backdrop-filter: blur(14px); }
.whisperbar.out { animation: sheetDown .2s ease forwards; }
.wb-ico { font-size: 22px; animation: hush 2.4s ease-in-out infinite; }
@keyframes hush { 50% { transform: scale(1.1) rotate(-6deg); } }
.wb-txt { flex: 1; min-width: 0; line-height: 1.25; }
.wb-txt b { display: block; font-size: 13.5px; }
.wb-txt span { font-size: 12px; color: var(--ink-2); }
.wb-x { width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.25); flex: none; font-size: 13px; }
.composer.whisper-on .send { background: linear-gradient(135deg, #d678ff, #7b5cff); box-shadow: 0 0 18px -4px #d678ff; }
/* the whisper she receives: a glowing, shimmering secret */
.bubble.whisper { background: linear-gradient(120deg, rgba(181, 23, 158, .35), rgba(123, 92, 255, .3)); border-color: rgba(214, 120, 255, .45); box-shadow: 0 0 22px -8px rgba(214, 120, 255, .8); position: relative; overflow: hidden; }
.bubble.whisper::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%); transform: translateX(-100%); animation: secretSheen 2.8s ease-in-out infinite; pointer-events: none; }
.bubble.whisper.open::after { display: none; }
.bubble.whisper.open { box-shadow: 0 0 30px -6px rgba(214, 120, 255, 1); transform: scale(1.02); }
.bubble.whisper .wt { transition: filter .3s var(--ease-out); }
@keyframes secretSheen { 60%, 100% { transform: translateX(100%); } }

/* wrong-guess messages */
.err { min-height: 44px; }
.err-line { display: inline-block; animation: errIn .45s var(--spring); font-weight: 500; }
.err-line.hint-close, .err-line.hint-warm { color: #ffd166; }
.err-line.hint-locked { color: #a0c4ff; }
.err small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 12px; animation: fadeIn .4s ease .15s backwards; }
@keyframes errIn { from { opacity: 0; transform: translateY(8px) scale(.9); filter: blur(4px); } }
.wobble { animation: wobble .5s var(--spring); }
@keyframes wobble { 25% { transform: rotate(-1.5deg) scale(1.01); } 50% { transform: rotate(1.2deg); } 75% { transform: rotate(-.6deg); } }

/* auto-written profile bits */
.aboutline { margin-top: 10px; font: italic 400 16px/1.4 var(--serif); color: var(--ink-2); animation: fadeIn .6s ease; padding: 0 6px; }
.aboutline.faint { font: 400 12.5px var(--sans); color: var(--ink-3); }
#view.entering .mem { animation: rise .45s var(--spring) backwards; }
.autonote { margin-top: 10px; font-size: 11.5px; }

/* iPhone zooms into any field under 16px and never zooms back: keep every field at 16px */
input, textarea, select, .composer textarea, .sheet textarea, .sheet input, .addrow input, .bp-form input { font-size: 16px !important; }

/* suggestions: one tidy line, expandable */
#sugg.sugg { display: block; overflow: visible; padding: 6px 12px 0; }
.sg-row { display: flex; gap: 8px; align-items: center; animation: rise .35s var(--spring); }
.sg-one { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; padding: 9px 14px; border-radius: 16px; background: rgba(255,255,255,.1); border: 1px solid var(--line); font-size: 14px; }
.sg-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-more { flex: none; height: 38px; min-width: 44px; padding: 0 12px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px dashed var(--line); font-size: 13px; font-weight: 600; color: var(--m1); }
.shimmer.line { flex: 1; width: auto; height: 38px; }
.sg-panel { background: rgba(20, 12, 40, .88); border: 1px solid var(--line); border-radius: 20px; padding: 10px; backdrop-filter: blur(20px); display: grid; gap: 6px; animation: popUp .35s var(--spring); transform-origin: bottom center; box-shadow: 0 20px 40px -20px rgba(0,0,0,.7); }
.sg-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-3); padding: 0 4px 2px; letter-spacing: .04em; }
.sg-x { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 12px; }
.sg-item { text-align: left; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid transparent; font-size: 14px; animation: rise .35s var(--ease-out) backwards; }
.sg-item span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sg-item small { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; text-transform: capitalize; }
.sg-item:active { border-color: var(--m1); }
.sg-panel .tones { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 0; }
.sg-panel .tones button { flex: 1 1 auto; text-align: center; }

/* chemistry */
.chem { margin-left: auto; position: relative; width: 40px; height: 40px; display: grid; place-items: center; flex: none; }
.chem + .moodchip { margin-left: 6px; }
.chem .ring { position: absolute; inset: 1px; filter: drop-shadow(0 0 6px rgba(255, 95, 143, .55)); }
.chem-n { font: 700 11px var(--sans); position: relative; }
.chem.bump { animation: chemBump .9s var(--spring); }
@keyframes chemBump { 30% { transform: scale(1.35) rotate(-8deg); } 60% { transform: scale(.95); } }
.ring .arc { animation: drawArc 1.2s var(--ease-out) both; }
@keyframes drawArc { from { stroke-dasharray: 0 100; } }
.chem-cap { font: italic 400 18px/1.35 var(--serif); text-align: center; margin: 8px 0 14px; animation: fadeIn .6s ease; }
.rings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
.rg { display: grid; justify-items: center; gap: 6px; animation: rise .55s var(--spring) backwards; }
.rg-c { position: relative; display: grid; place-items: center; }
.rg-n { position: absolute; font: 600 17px var(--serif); }
.rings.big .rg-n { font-size: 22px; }
.rg span { font-size: 12.5px; color: var(--ink-2); }
.fm { margin-top: 18px; }
.fm h4 { margin: 0 0 8px; font: 600 12px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.fq { padding: 10px 12px; border-radius: 14px; background: linear-gradient(120deg, rgba(255, 209, 102, .12), rgba(255,255,255,.05)); border: 1px solid var(--line); margin-bottom: 6px; font-size: 14.5px; animation: rise .5s var(--spring) backwards; }
.fq small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 11.5px; }
.chem-sheet { max-height: 86dvh; overflow-y: auto; }

.sg-panel .tones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sg-panel .tones button { padding: 8px 4px; font-size: 12px; white-space: nowrap; }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* keyboard up: give every pixel to the chat, like WhatsApp */
body.kb .tabbar { display: none; }
body.kb .board, body.kb .qbar, body.kb .pushbar, body.kb .note { display: none; }
body.kb .composer { padding-bottom: 8px; }

/* WhatsApp-style mic + send */
.micbtn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); flex: none; border-radius: 50%; touch-action: none; -webkit-touch-callout: none; }
.micbtn:active { background: rgba(255,255,255,.1); }
.send { color: #fff; }
.send svg { margin-left: 2px; }
.send.swap-in { animation: swapIn .3s var(--spring); }
@keyframes swapIn { from { transform: scale(.4) rotate(-30deg); opacity: 0; } }
.composer { position: relative; }
.composer.recording { gap: 6px; }
.rec-bar { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 22px; background: rgba(10, 6, 25, .55); border: 1px solid var(--line); overflow: hidden; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 10px #ff3b5c; animation: blink 1s infinite; flex: none; }
.rec-t { font-variant-numeric: tabular-nums; font-size: 15px; flex: none; }
.rec-wave { flex: 1; height: 26px; display: none; align-items: center; gap: 2px; }
.locked .rec-wave { display: flex; }
.rec-wave i { flex: 1; height: 12%; background: var(--m1); border-radius: 2px; transition: height .08s; }
.rec-cancel { flex: 1; text-align: center; color: var(--ink-2); font-size: 14px; white-space: nowrap; background: linear-gradient(90deg, var(--ink-3), #fff, var(--ink-3)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmerText 2s linear infinite; }
.rec-mic { width: 64px; height: 64px; margin: -10px -6px -10px 0; border-radius: 50%; background: var(--mine); display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 0 0 0 rgba(255, 95, 143, .5); animation: recPulse 1.2s ease-out infinite; transition: transform .05s; z-index: 2; }
@keyframes recPulse { 70% { box-shadow: 0 0 0 16px rgba(255, 95, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 95, 143, 0); } }
.rec-lock { position: absolute; right: 18px; bottom: 76px; width: 40px; padding: 10px 0 8px; border-radius: 20px; background: rgba(20, 12, 40, .92); border: 1px solid var(--line); display: grid; justify-items: center; gap: 2px; animation: popUp .3s var(--spring); transition: transform .2s var(--spring), background .2s; }
.rec-lock i { font-style: normal; font-size: 12px; color: var(--ink-3); animation: nudgeUp 1.1s ease-in-out infinite; }
.rec-lock.near { transform: translateY(-8px) scale(1.12); background: var(--m2); }
@keyframes nudgeUp { 50% { transform: translateY(-4px); } }
.rec-del { width: 44px; height: 44px; display: grid; place-items: center; color: #ff8fa3; flex: none; order: -1; }
.voice .play svg { display: block; }

/* keyboard up on login / onboarding: compact, anchored right above the keyboard */
body.kb .login, body.kb .onb { margin: auto auto 0; padding-top: 10px; padding-bottom: 10px; max-height: 100%; }
body.kb .login .logo { font-size: 34px; animation: none; }
body.kb .login .tag { display: none; }
body.kb .login .who { margin: 8px 0 12px; gap: 16px; }
body.kb .login .who .av { width: 52px; height: 52px; font-size: 24px; animation: none; }
body.kb .login .who button { gap: 4px; font-size: 13px; }
body.kb .login .small { margin-bottom: 6px !important; }
body.kb .login .field { padding: 12px 16px; }
body.kb .login .cta { margin-top: 10px; padding: 13px; }
body.kb .login .err { min-height: 0; margin-top: 6px; }
body.kb .login #dogStep { margin-top: 10px !important; }
body.kb .onb h1 { font-size: 24px; }
body.kb .onb .dots { margin: 6px 0; }
body.kb .onb .qcard { padding: 16px; }
body.kb .onb .qcard textarea { min-height: 70px; }
body.kb .onb .qcard [style*="font-size:40px"] { font-size: 26px !important; margin-bottom: 4px !important; }
body.kb .login > *, body.kb .onb > * { animation: none !important; }
.login, .onb { transition: padding .2s ease; }

/* viewers: always a visible way out */
.overlay.viewer .x { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 3; background: rgba(0,0,0,.45); }
.viewer-bar { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; padding: 0 16px; }
.ghost.danger { color: #ff8fa3; background: rgba(255, 60, 90, .12); border-radius: 14px; }
.danger-cta { background: linear-gradient(135deg, #ff5f7a, #c2304f) !important; box-shadow: 0 10px 30px -10px #ff5f7a !important; }
.overlay.viewer img.full { max-height: 74dvh; }
/* long-press never selects text or opens iOS menus */
.msg .bubble, .msg .snapcard, .msg .capsule { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.bubble.media img { min-height: 120px; background: rgba(255,255,255,.06); }
#older[hidden], #typingRow[hidden] { display: none; }
#typingRow { margin: 4px 0; }

/* the message list is the flex column now (yours on the right, theirs on the left) */
#msglist { display: flex; flex-direction: column; gap: 4px; }
#msglist > .day { align-self: center; }
.toast.bump { animation: toastBump .35s var(--spring); }
@keyframes toastBump { 40% { transform: scale(1.05); } }
#plusBtn { transition: transform .3s var(--spring), background .2s; }
#plusBtn.on { transform: rotate(45deg); background: var(--glass-2); }

/* invitation cards */
#invites { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(94vw, 420px); z-index: 32; display: grid; gap: 8px; pointer-events: none; }
.invite { pointer-events: auto; position: relative; overflow: hidden; padding: 14px 14px 12px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(40, 20, 70, .96), rgba(25, 12, 45, .96)); border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 18px 50px -12px rgba(0,0,0,.8), 0 0 0 1px rgba(255, 143, 171, .12), 0 0 40px -10px var(--m1);
  backdrop-filter: blur(24px); animation: invIn .55s var(--spring); touch-action: none; transition: transform .2s, opacity .2s; }
.invite.out { animation: invOut .32s ease forwards; } .invite.out-fast { opacity: 0; transition: opacity .1s; }
@keyframes invIn { from { opacity: 0; transform: translateY(-40px) scale(.92); } }
@keyframes invOut { to { opacity: 0; transform: translateY(-30px) scale(.95); } }
.inv-top { display: flex; gap: 12px; align-items: center; }
.inv-av { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--glass-2); flex: none; }
.inv-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.inv-ring { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--m1); animation: invRing 1.6s ease-out infinite; }
@keyframes invRing { from { transform: scale(.95); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.inv-ico { position: absolute; right: -6px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%; background: var(--m3); border: 2px solid rgba(255,255,255,.2); display: grid; place-items: center; font-size: 14px; animation: invWiggle 1.8s ease-in-out infinite; }
@keyframes invWiggle { 0%, 70%, 100% { transform: rotate(0); } 80% { transform: rotate(-14deg) scale(1.1); } 90% { transform: rotate(10deg); } }
.inv-txt { min-width: 0; line-height: 1.3; }
.inv-txt b { display: block; font: 600 17px/1.25 var(--serif); }
.inv-txt span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.inv-acts { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; margin-top: 12px; }
.inv-acts button { padding: 11px; border-radius: 14px; font-weight: 600; font-size: 14.5px; }
.inv-no { background: rgba(255,255,255,.08); color: var(--ink-2); }
.inv-yes { background: var(--mine); color: #fff; box-shadow: 0 8px 22px -8px var(--m1); position: relative; overflow: hidden; }
.inv-yes::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.4) 50%, transparent 75%); transform: translateX(-120%); animation: sheen 2.2s ease-in-out infinite .4s; }
.inv-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--mine); transform-origin: left; animation: invBar linear forwards; opacity: .7; }
@keyframes invBar { to { transform: scaleX(0); } }
