:root{--bg:#f7f4fb;--ink:#241c35;--muted:#6f6783;--card:#fff;--line:#e4dcf0;--brand:#5b3df5;--on:#157f58;--onbg:#dff5ea;--off:#b3263e;--offbg:#fbe3e7}
@media(prefers-color-scheme:dark){:root{--bg:#171221;--ink:#f1ecfa;--muted:#a79fbb;--card:#221a31;--line:#352b4a;--brand:#8f7bff;--on:#6fe0a8;--onbg:#143528;--off:#ff8fa3;--offbg:#40202a}}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 system-ui,-apple-system,Segoe UI,sans-serif}
header{display:flex;flex-wrap:wrap;gap:.5rem 1rem;align-items:center;justify-content:space-between;padding:.8rem 1rem;background:var(--card);border-bottom:1px solid var(--line)}
.logo{font-weight:800;font-size:1.3rem;color:var(--brand);text-decoration:none}
nav{display:flex;flex-wrap:wrap;gap:.9rem;align-items:center}nav form{margin:0}
a{color:var(--brand)}main{max-width:760px;margin:0 auto;padding:1rem}
h1{font-size:1.5rem;margin:.2rem 0 .5rem}h2{font-size:1.1rem;margin:1.2rem 0 .5rem}
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:1rem;margin:0 0 1rem}.narrow{max-width:440px;margin:1.5rem auto}
label{display:block;font-weight:600;margin:.7rem 0}
input,textarea,select{display:block;width:100%;margin-top:.25rem;padding:.6rem .7rem;font:inherit;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:10px}
textarea{min-height:80px}
button,.btn{display:inline-block;padding:.6rem 1.1rem;font:inherit;font-weight:600;color:#fff;background:var(--brand);border:0;border-radius:10px;cursor:pointer;text-decoration:none;margin-top:.5rem}
button.ghost{background:transparent;color:var(--brand);border:1px solid var(--brand)}
button.link{background:none;color:var(--brand);padding:0;margin:0}
:focus-visible{outline:3px solid var(--brand);outline-offset:2px}
.row{display:flex;gap:.5rem;flex-wrap:wrap}.muted{color:var(--muted);margin:.2rem 0}
.err{color:var(--off)}.good{color:var(--on)}
.b{display:inline-block;padding:.1rem .6rem;border-radius:99px;font-size:.85rem;font-weight:700}
.b.on{color:var(--on);background:var(--onbg)}.b.off{color:var(--off);background:var(--offbg)}
.people{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.7rem}
.person{display:flex;flex-direction:column;align-items:flex-start;gap:.3rem;padding:.8rem;background:var(--card);border:1px solid var(--line);border-radius:14px;color:var(--ink);text-decoration:none}
.av{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:var(--brand);color:#fff;font-weight:800}.av.big{width:72px;height:72px;font-size:1.8rem}
.top{display:flex;gap:1rem;align-items:center}
.post{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:.8rem;margin:0 0 1rem}
.post img,.post video{width:100%;max-height:560px;object-fit:cover;border-radius:10px;margin:.5rem 0 0;background:#000}
.who{font-weight:700;text-decoration:none}
@media(prefers-reduced-motion:no-preference){button,.person{transition:transform .1s}button:active{transform:scale(.97)}}
.chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:0 0 .5rem}
.chip{padding:.15rem .7rem;border:1px solid var(--brand);color:var(--brand);border-radius:99px;font-size:.9rem;font-weight:600}
.ghost-btn{background:transparent;color:var(--brand);border:1px solid var(--brand)}
.vt{color:#fff;background:var(--brand);border-radius:50%;display:inline-grid;place-items:center;width:1.1em;height:1.1em;font-size:.75em;vertical-align:middle}
.dot{background:var(--off);color:#fff;border-radius:99px;padding:0 .45rem;font-size:.8rem}
details.card summary{cursor:pointer;font-weight:600}
.note.new{border-left:4px solid var(--brand)}.note p{margin:.2rem 0 0}
.selfie{display:block;max-width:100%;max-height:420px;margin:.6rem 0;border-radius:10px}
.msgs{display:flex;flex-direction:column;gap:.4rem;max-height:55vh;overflow:auto;margin:.8rem 0}
.msg{max-width:80%;padding:.5rem .8rem;border-radius:14px;white-space:pre-wrap;overflow-wrap:anywhere}
.msg.mine{align-self:flex-end;background:var(--brand);color:#fff}
.msg.theirs{align-self:flex-start;background:var(--bg);border:1px solid var(--line)}
.convo{display:flex;justify-content:space-between;gap:1rem;color:var(--ink);text-decoration:none}.convo p{margin:.1rem 0 0}
@media(prefers-color-scheme:dark){.msg.mine{color:#1a1030}}
[hidden]{display:none!important}
.tools{display:flex;flex-wrap:wrap;gap:.4rem;margin:.6rem 0}.tools button,.tools label{margin:0}
#recbar{margin:.5rem 0}#preview{width:min(240px,100%);border-radius:10px;background:#000}
.msg audio{max-width:100%}.msg.vid{padding:.3rem}.msg video{width:min(260px,100%);border-radius:10px;display:block}
#callov{position:fixed;inset:0;z-index:50;display:grid;place-items:center;background:rgba(14,8,26,.94);color:#fff}
.callbox{width:min(92vw,520px);text-align:center}.callbox .row{justify-content:center}
.vids{position:relative}#rv{width:100%;max-height:60vh;border-radius:14px;background:#000}
#lv{position:absolute;right:8px;bottom:8px;width:28%;border-radius:10px;background:#000}
.vids.audio video{position:absolute;width:1px;height:1px;opacity:0}
#callov .ghost{color:#fff;border-color:#fff}
.msg img{display:block;max-width:min(280px,100%);border-radius:10px}.msg.mine,.msg.theirs{width:fit-content}
.post form{margin:.3rem 0 0}
.banner{background:var(--offbg);color:var(--off);padding:.6rem .8rem;border-radius:10px;margin:0 0 1rem}.banner form{display:inline;margin:0}.banner .link{color:var(--off);text-decoration:underline}
.people{display:flex;overflow-x:auto;padding-bottom:.4rem}.person{flex:0 0 150px}
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:3px}.tile{position:relative;display:block;aspect-ratio:1;background:#000}
.tile img,.tile video{display:block;width:100%;height:100%;object-fit:cover;margin:0;border-radius:0;max-height:none}
.play{position:absolute;top:6px;right:8px;color:#fff;text-shadow:0 0 4px #000;font-size:.9rem}
.stats{display:flex;gap:1.1rem;margin:.3rem 0}.stats a,.stats span{color:var(--ink);text-decoration:none}
.phead{display:flex;align-items:center;gap:.5rem}.av.sm{width:32px;height:32px;font-size:.9rem}.ago{margin-left:auto}
.acts{display:flex;align-items:center;gap:.9rem;margin:.4rem 0}.acts form{margin:0}.acts .del{margin-left:auto}.acts .ghost{margin:0;padding:.3rem .7rem}
.heart{margin:0;padding:0;font-size:1.7rem;line-height:1;background:none;color:var(--ink)}.heart.on{color:#e0245e}
.act{margin:0;padding:0;background:none;color:var(--ink);font:inherit;font-weight:600;text-decoration:none;cursor:pointer;border:0}
.likes{margin:.1rem 0}.post p{margin:.25rem 0}
.cmt{padding:.5rem 0;border-bottom:1px solid var(--line)}.cmt form{display:inline;margin:0}.cmt .link{color:var(--muted);font-size:.85rem}
.rep{display:inline-block;margin-left:.5rem}.rep summary{cursor:pointer;color:var(--muted);font-size:.85rem}.rep form{display:block}
.rcontent .tile{width:120px}blockquote{margin:.3rem 0;padding-left:.7rem;border-left:3px solid var(--line)}
.stories{display:flex;gap:.9rem;overflow-x:auto;padding:.3rem .2rem .6rem}
.story{display:flex;flex-direction:column;align-items:center;gap:.35rem;min-width:64px;color:var(--ink);text-decoration:none;font-size:.8rem}
.story .av{width:54px;height:54px;box-shadow:0 0 0 3px var(--bg),0 0 0 5px var(--brand)}.story.seen .av{box-shadow:0 0 0 3px var(--bg),0 0 0 5px var(--line)}
#story{max-width:480px;margin:0 auto}.sbox img,.sbox video{display:block;width:100%;max-height:70vh;object-fit:contain;background:#000;border-radius:12px}
.bars{display:flex;gap:4px;margin:.3rem 0}.bars i{flex:1;height:3px;border-radius:2px;background:var(--line)}.bars i.done,.bars i.cur{background:var(--brand)}
.snav{display:flex;flex-wrap:wrap;gap:.5rem;margin:.6rem 0}.snav button,.snav .btn{margin:0}.snav form{margin:0}
.postmsg .tile{width:170px;margin-bottom:.3rem}.postmsg a:not(.tile){display:block;color:inherit;font-weight:600}
.check{display:block;font-weight:400}.check input{display:inline-block;width:auto;margin-right:.4rem}
.sreply{margin-top:.6rem}.sreply input{flex:1}
.ic{width:26px;height:26px;display:block;flex:none}.heart .ic{width:28px;height:28px}
.act{display:inline-flex;align-items:center;gap:.3rem}.cnt{font-size:.9rem;font-weight:600}
.heart.on .ic,.savebtn.on .ic{fill:currentColor}.acts{gap:1rem}.acts .saveform{margin-left:auto}.acts .del{margin-left:0}
.topicons{display:none;align-items:center;gap:.1rem}.topicons form{margin:0}
.ib{position:relative;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;padding:0;margin:0;border:0;border-radius:10px;background:none;color:var(--ink);cursor:pointer;text-decoration:none}
.ib .dot{position:absolute;top:1px;right:-2px;font-size:.65rem;padding:0 .3rem}
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:20;display:none;justify-content:space-around;align-items:center;padding:.5rem .5rem calc(.5rem + env(safe-area-inset-bottom));background:var(--card);border-top:1px solid var(--line)}
.tab{position:relative;display:flex;align-items:center;justify-content:center;flex:1;max-width:140px;height:46px;color:var(--ink);text-decoration:none;border-radius:12px}
.tab .ic{width:28px;height:28px}.tab.active .ic{stroke-width:2.8}.tab.active .ic.fillable{fill:currentColor}
.tabav{width:30px;height:30px;font-size:.9rem}.tab.active .tabav{box-shadow:0 0 0 2px var(--card),0 0 0 4px var(--ink)}
.badge{position:absolute;top:1px;right:calc(50% - 26px);min-width:18px;height:18px;padding:0 .3rem;border-radius:99px;background:#e5283f;color:#fff;font-size:.7rem;font-weight:700;display:grid;place-items:center}
.reddot{position:absolute;bottom:6px;right:calc(50% - 22px);width:12px;height:12px;border-radius:50%;background:#e5283f;border:2px solid var(--card)}
.toast{position:fixed;left:50%;bottom:calc(90px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:60;background:var(--ink);color:var(--bg);padding:.5rem 1rem;border-radius:99px;font-weight:600}
@media(max-width:1024px){.topnav{display:none}.topicons,.tabbar{display:flex}body{padding-bottom:calc(74px + env(safe-area-inset-bottom))}header{position:sticky;top:0;z-index:15}}
@media(min-width:1025px){.topnav{display:flex}}
.tab.plus{background:none;border:0;padding:0;margin:0;cursor:pointer}
.plusbtn{display:grid;place-items:center;width:50px;height:34px;border-radius:11px;background:var(--ink);color:var(--bg);box-shadow:-4px 0 0 #27d3f0,4px 0 0 #f0345c}
.plusbtn .ic{width:22px;height:22px;stroke-width:3.2}
.addstory{background:none;border:0;padding:0;margin:0;font:inherit;font-size:.8rem;color:var(--ink);cursor:pointer}
.story.addstory .av{background:var(--bg);color:var(--ink);box-shadow:0 0 0 3px var(--bg),0 0 0 5px var(--line)}.addstory .ic{width:22px;height:22px}
.sheet{position:fixed;inset:0;z-index:40;display:flex;align-items:flex-end;justify-content:center;background:rgba(0,0,0,.55)}
.sheetbox{width:100%;max-width:520px;max-height:92vh;overflow:auto;background:var(--card);border-radius:18px 18px 0 0;padding:1rem 1rem calc(1rem + env(safe-area-inset-bottom))}
.sheethead{display:flex;align-items:center;justify-content:space-between;margin-bottom:.6rem;font-size:1.1rem}
.choices{display:grid;grid-template-columns:1fr 1fr;gap:.8rem}
.choices button{display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:1.3rem .5rem;margin:0;font-weight:600;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:14px}
.choices .ic{width:34px;height:34px}
.preview img,.preview video{display:block;max-width:100%;max-height:260px;margin:.6rem 0;border-radius:12px;background:#000}
.sheet form .row{margin-top:.6rem;align-items:center}.sheet form .row button{margin:0}
body.noscroll{overflow:hidden}
@media(min-width:700px){.sheet{align-items:center}.sheetbox{border-radius:18px}}
.msgpop{position:fixed;top:calc(.7rem + env(safe-area-inset-top));right:.8rem;z-index:45;display:flex;align-items:center;gap:.45rem;padding:.7rem 1rem;border-radius:18px;background:#ec4560;color:#fff;font-weight:800;font-size:1.15rem;text-decoration:none;box-shadow:0 6px 18px rgba(0,0,0,.35)}
.msgpop .ic{width:26px;height:26px}.topnav .dot{margin-left:.25rem}
@media(prefers-reduced-motion:no-preference){.msgpop{animation:popin .25s ease-out}}
@keyframes popin{from{transform:translateY(-16px);opacity:0}to{transform:none;opacity:1}}
