:root { --acc1:#7B5CFF; --acc2:#4F7BFF; --bg:#0B0B14; --panel:rgba(11,11,20,.85); --panelsolid:#14141C; --panel2:#1C1C24; --panel2b:#1C1C2A; --panel3:#30303C; --panel4:#3A3A44; --panel5:#26262F; --panel6:#3A3A48; --panel7:#22222C; --recv:#2A2A33; --text:#FFFFFF; --muted:#8E8EA0; --glass:rgba(255,255,255,.07); --glass2:rgba(255,255,255,.05); --glass3:rgba(255,255,255,.18); --border:rgba(255,255,255,.14); --border2:rgba(255,255,255,.16); --bars:rgba(255,255,255,.8); --bubrad:20px; --icorad:50%; }
body.calm *{animation:none!important;transition:none!important}
#app{max-width:520px;margin:0 auto;position:relative;height:100dvh;box-shadow:0 0 60px rgba(0,0,0,.5)}
@media (min-width:560px){#app{border-left:1px solid var(--border);border-right:1px solid var(--border)}}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none;
}
#app { height: 100%; display: flex; flex-direction: column; }
.boot { margin: auto; font-size: 34px; font-weight: 700; }
button { font-family: inherit; }
.screen { height: 100%; display: flex; flex-direction: column; }
.center-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.glow { position: fixed; top: 0; left: 0; right: 0; height: 340px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(123,92,255,.30), transparent); animation: glowpulse 2.2s ease-in-out infinite alternate; }
@keyframes glowpulse { from { opacity: .55; } to { opacity: 1; } }
.logo-box { width: 88px; height: 88px; border-radius: 26px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--acc1), var(--acc2)); box-shadow: 0 0 60px rgba(123,92,255,.45); margin-bottom: 18px; }
.logo-box img { width: 56px; height: 56px; border-radius: 14px; }
.appname { font-size: 34px; font-weight: 700; }
.tagline { color: var(--muted); font-size: 14px; margin-top: 2px; }
.langrow { width: 100%; max-width: 420px; display: flex; justify-content: flex-end; margin-top: 14px; }
.langpill { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 999px;
  background: var(--glass2); border: 1px solid var(--border); color: var(--text); font-size: 12.5px; font-weight: 600;
  letter-spacing: .2px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.langpill:hover { background: var(--glass3); border-color: var(--acc2); }
.langpill:active { transform: scale(.96); }
.card { width: 100%; max-width: 420px; margin-top: 26px; background: var(--glass); border: 1px solid var(--border);
  border-radius: 28px; padding: 20px; display: flex; flex-direction: column; align-items: center; }
.card h2 { font-size: 20px; font-weight: 600; }
.helper { color: var(--muted); font-size: 12px; text-align: center; margin-top: 6px; line-height: 1.45; direction: ltr; }
.field { width: 100%; margin-top: 14px; }
.field input, .field textarea {
  width: 100%; background: var(--glass2); border: 1px solid var(--border2); border-radius: 18px;
  padding: 13px 16px; color: var(--text); font-size: 16px; outline: none; direction: ltr; text-align: left;
}
.field input:focus, .field textarea:focus { border-color: var(--acc2); background: var(--glass); }
.field label { display: block; font-size: 12px; color: var(--muted); margin: 0 4px 6px; }
.phone-row { display: flex; margin-top: 14px; width: 100%; }
.phone-row .cc { width: 96px; margin-right: 10px; }
.gbtn { width: 100%; height: 54px; border: none; border-radius: 27px; margin-top: 16px; color: #fff; font-size: 16px; font-weight: 600;
  background: linear-gradient(90deg, var(--acc1), var(--acc2)); cursor: pointer; }
.gbtn.tg { background: linear-gradient(90deg, #2AABEE, #1D8FD6); }
.gbtn.wa { background: linear-gradient(90deg, #25D366, #128C7E); }
.gbtn:disabled { background: var(--panel3); color: var(--muted); }
.linkbtn { background: none; border: none; color: var(--acc2); font-size: 14px; margin-top: 12px; cursor: pointer; }
.err { color: #FF6B6B; font-size: 13px; margin-top: 8px; text-align: center; }
.credit { color: var(--muted); font-size: 12px; margin: 22px 0 4px; direction: ltr; }
/* top bars */
.topbar { display: flex; align-items: center; padding: 10px 14px; background: var(--panel); }
.topbar .title { flex: 1; font-size: 26px; font-weight: 700; }
.topbar.chat { padding: 8px 6px; }
.topbar .peer { flex: 1; display: flex; align-items: center; min-width: 0; }
.topbar .peer .nm { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .peer .st { font-size: 12px; color: #30D158; }
.iconbtn { background: none; border: none; color: var(--text); font-size: 22px; width: 42px; height: 42px; cursor: pointer; }
.connecting { color: var(--muted); font-size: 12px; padding: 0 18px 4px; }
/* chat list */
.convlist { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.conv { display: flex; align-items: center; padding: 10px 18px; cursor: pointer; }
.conv:active { background: var(--glass2); }
.avatar { border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.conv .mid { flex: 1; min-width: 0; margin-left: 14px; }
.conv .row1 { display: flex; align-items: baseline; }
.conv .nm { flex: 1; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .tm { color: var(--muted); font-size: 12px; margin-left: 8px; }
.conv .pv { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .pv.typing { color: #30D158; }
.undot { width: 10px; height: 10px; border-radius: 50%; background: var(--acc2); margin-left: 8px; flex-shrink: 0; }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.empty .big { color: var(--text); font-size: 18px; margin-bottom: 6px; }
/* chat */
.chatwrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.msgs { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 10px; display: flex; flex-direction: column; }
.daysep { align-self: center; color: var(--muted); font-size: 11px; margin: 8px 0; }
.brow { display: flex; flex-direction: column; margin-top: 3px; }
.brow.mine { align-items: flex-end; }
.brow.theirs { align-items: flex-start; }
.bubble { max-width: 290px; padding: 8px 12px; border-radius: var(--bubrad); font-size: 16px; line-height: 1.35; word-break: break-word;
  -webkit-user-select: none; user-select: none; position: relative; }
.brow.mine .bubble { background: linear-gradient(135deg, var(--acc1), var(--acc2)); border-bottom-right-radius: 5px; color: #fff; }
.brow.theirs .bubble { background: var(--recv); border-bottom-left-radius: 5px; }
.bubble.media { padding: 3px; background: none; }
.brow.mine .bubble.media { background: linear-gradient(135deg, var(--acc1), var(--acc2)); }
.brow.theirs .bubble.media { background: var(--recv); }
.bubble img.photo { display: block; max-width: 260px; max-height: 340px; border-radius: calc(var(--bubrad) - 3px); }
.bubble img.sticker { display: block; width: 150px; height: 150px; object-fit: contain; }
.bubble .txt { unicode-bidi: plaintext; text-align: start; white-space: pre-wrap; }
.bubble .reply { border-left: 2px solid var(--acc2); padding-left: 6px; margin-bottom: 4px; font-size: 12px; color: inherit; opacity: .85;
  max-height: 34px; overflow: hidden; }
.bubble .deleted { color: inherit; opacity: .65; font-style: italic; font-size: 14px; }
.voice { display: flex; align-items: center; min-width: 150px; }
.voice .vbtn { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--glass3); color: var(--text); font-size: 14px; margin-right: 8px; flex-shrink: 0; }
.voice .bars { display: flex; align-items: center; }
.voice .bars i { width: 3px; background: var(--bars); border-radius: 2px; margin-right: 2px; }
.voice .dur { font-size: 13px; margin-left: 8px; }
.reacts { align-self: flex-end; margin-top: -4px; background: var(--panel6); border-radius: 12px; padding: 1px 7px; font-size: 13px; z-index: 2; }
.brow.theirs .reacts { align-self: flex-start; }
.mstatus { color: var(--muted); font-size: 11px; margin: 1px 4px 0 0; }
.typingbub { background: var(--recv); border-radius: 18px; padding: 10px 16px; color: var(--muted); letter-spacing: 2px; align-self: flex-start; margin-top: 3px; }
/* reply/edit bar */
.repbar { display: flex; align-items: center; background: var(--panel); padding: 6px 14px; }
.repbar .bar { width: 3px; height: 30px; background: var(--acc2); margin-right: 8px; }
.repbar .who { color: var(--acc2); font-size: 12px; font-weight: 600; }
.repbar .what { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repbar .x { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 18px; }
/* input */
.inputrow { display: flex; align-items: flex-end; padding: 8px; }
.roundbtn { width: 40px; height: 40px; border-radius: var(--icorad); border: none; background: var(--panel2b); color: var(--text); font-size: 20px; flex-shrink: 0; cursor: pointer; }
.inputmid { flex: 1; display: flex; align-items: center; background: var(--panel2); border-radius: 21px; min-height: 40px; margin: 0 8px; padding: 4px 4px 4px 14px; }
.inputmid textarea { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 16px; font-family: inherit;
  resize: none; max-height: 110px; unicode-bidi: plaintext; }
.inputmid textarea::placeholder { color: var(--muted); }
.sendbtn { width: 40px; height: 40px; border-radius: var(--icorad); border: none; font-size: 18px; color: #fff; flex-shrink: 0;
  background: var(--panel4); cursor: pointer; }
.sendbtn.on { background: #30D158; }
.mini { width: 36px; height: 36px; border-radius: var(--icorad); border: none; background: none; color: var(--muted); font-size: 20px; flex-shrink: 0; cursor: pointer; }
.mini.rec { color: #FF6B6B; background: rgba(255,107,107,.2); }
/* emoji / sticker panel */
.panel { height: 340px; background: var(--panelsolid); display: flex; flex-direction: column; }
.panel .tabs { display: flex; padding: 4px 12px; }
.panel .tabs .tab { padding: 6px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; margin-right: 8px; cursor: pointer; }
.panel .tabs .tab.on { background: var(--panel3); color: var(--text); }
.emojigrid { flex: 1; overflow-y: auto; display: flex; flex-wrap: wrap; padding: 6px; align-content: flex-start; }
.emojigrid span { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 26px; cursor: pointer; }
.stkgrid { flex: 1; overflow-y: auto; display: flex; flex-wrap: wrap; padding: 8px; align-content: flex-start; }
.stkgrid .stk { width: 76px; height: 76px; margin: 4px; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.stkgrid .stk img { max-width: 100%; max-height: 100%; }
.stkgrid .add { background: var(--panel7); color: var(--text); font-size: 30px; cursor: pointer; }
.stkcount { color: var(--muted); font-size: 12px; padding: 8px 12px 0; }
/* context menu */
.menu { position: fixed; z-index: 50; background: var(--panel5); color: var(--text); border-radius: 14px; padding: 6px; min-width: 200px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.menu .emojis { display: flex; padding: 4px; }
.menu .emojis span { font-size: 24px; padding: 4px; cursor: pointer; }
.menu .mi { padding: 10px 12px; font-size: 15px; border-radius: 9px; cursor: pointer; }
.menu .mi:active { background: var(--glass); }
.menu .mi.danger { color: #FF6B6B; }
.overlay { position: fixed; inset: 0; z-index: 40; }
/* settings */
.setlist { flex: 1; overflow-y: auto; padding: 16px; }
.setlist h3 { font-size: 16px; margin: 20px 0 8px; }
.setrow { display: flex; align-items: center; padding: 8px 0; }
.setrow .grow { flex: 1; }
.bgs { display: flex; }
.bgs .bg { width: 46px; height: 46px; border-radius: 50%; margin-right: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; }
.obtn { border: 1px solid var(--border); background: none; color: var(--text); border-radius: 20px; padding: 9px 16px; font-size: 14px; cursor: pointer; }
.obtn.danger { border-color: #FF6B6B; color: #FF6B6B; }
.panelcard { background: var(--panel2b); border-radius: 16px; margin-top: 30px; overflow: hidden; }
.panelcard .prow { display: flex; align-items: center; padding: 16px; cursor: pointer; }
.panelcard .prow .t { flex: 1; font-weight: 600; }
.panelcard .prow .s { font-size: 12px; color: var(--muted); font-weight: 400; }
.switch { position: relative; width: 46px; height: 28px; }
.switch input { display: none; }
.switch i { position: absolute; inset: 0; border-radius: 14px; background: var(--panel4); transition: .2s; }
.switch i:after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; }
.switch input:checked + i { background: #30D158; }
.switch input:checked + i:after { left: 21px; }
/* about */
.about-doodle { width: 260px; max-width: 80vw; border-radius: 36px; margin: 18px 0; }
.about-name { font-size: 28px; font-weight: 700; }
.about-ver { color: #8E8EA0; font-size: 13px; margin-top: 2px; }
.terms { color: var(--muted); font-size: 14px; line-height: 1.5; direction: ltr; }
.terms b { color: var(--text); }
.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); background: var(--panel5); color: var(--text); border-radius: 12px;
  padding: 10px 18px; font-size: 14px; z-index: 90; box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: 90vw; text-align: center; }
.spin { width: 22px; height: 22px; border: 2px solid var(--border); border-top-color: var(--text); border-radius: 50%; animation: sp 0.8s linear infinite; margin: 10px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.bubble .fwd{color:inherit;opacity:.7;font-size:11px;font-style:italic;margin-bottom:2px}
.brow.flash .bubble{outline:2px solid #6EA8FF;outline-offset:2px;transition:outline-color .3s}
.fwdmenu{max-height:60vh;overflow-y:auto;min-width:220px}
.conv .pindot{font-size:13px;margin-left:6px}
.tick { color:var(--muted); font-size:11px; }
.tick.rd { color:#4FA8FF; font-weight:700; }

/* view-once */
.voonce{display:flex;align-items:center;gap:10px;padding:14px 16px;min-width:200px;cursor:pointer}
.voonce.opened{opacity:.65;cursor:default}
.voflame{font-size:20px}
.votap{margin-left:auto;font-size:12px;opacity:.7}
.vooverlay{position:fixed;inset:0;background:rgba(4,4,10,.94);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:60;padding:20px;gap:14px}
.vofull{max-width:100%;max-height:70vh;border-radius:12px}
.vonote{font-size:13px;opacity:.75}
.voclose{background:linear-gradient(135deg,var(--acc1),var(--acc2));color:#fff;border:0;border-radius:12px;padding:12px 28px;font-size:15px;font-weight:600;cursor:pointer}
.vofire{background:linear-gradient(135deg,#E6533C,#F0852B)}
.vocancel{background:transparent;color:#9aa;border:1px solid #334;border-radius:12px;padding:12px 28px;font-size:15px;cursor:pointer}
.vomodal{background:var(--panelsolid);border:1px solid var(--border);border-radius:18px;padding:22px;max-width:340px;width:100%}
.muted{opacity:.65}

/* item 6: video, files, location, link previews */
.attachmenu{position:fixed;left:14px;bottom:84px;z-index:50}
.filecard{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--text);min-width:180px;padding:4px 2px}
.fico{font-size:22px}
.fname{font-size:14px;word-break:break-all}
.linkprev{display:block;margin-top:6px;background:var(--glass3);border-radius:12px;padding:10px;text-decoration:none;color:var(--text);max-width:280px}
.lpimg{width:100%;border-radius:8px;margin-bottom:6px;max-height:140px;object-fit:cover}
.lptitle{font-size:14px;font-weight:600;word-break:break-word}
.lpdesc{font-size:12px;opacity:.75;margin-top:3px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* item 7: voice waveform + speed */
.voice .bars i.on { background: var(--acc2); }
.brow.mine .voice .vbtn{background:rgba(255,255,255,.22);color:#fff}
.brow.mine .voice .bars i{background:rgba(255,255,255,.55)}
.brow.mine .voice .bars i.on{background:#fff}
.voice .vspd { border: none; background: var(--glass3); color: var(--text); font-size: 11px; font-weight: 600; border-radius: 10px; padding: 3px 6px; margin-left: 8px; cursor: pointer; flex-shrink: 0; }

/* item 8: appearance */
.accrow{display:flex;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.accsw{width:40px;height:40px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;font-size:16px;border:2px solid transparent}
.accsw.on{border-color:var(--text)}

/* item 8: themes */
.brow.mine .filecard{color:#fff}
.brow.mine .linkprev{background:rgba(0,0,0,.22);color:#fff}
.brow.mine .voice .vspd{background:rgba(255,255,255,.2);color:#fff}
.optrow{display:flex;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.opt{flex:1;min-width:80px;text-align:center;padding:10px 8px;border-radius:12px;background:var(--glass);border:1px solid var(--border);cursor:pointer;color:var(--text);font-size:14px}
.opt.on{border-color:var(--acc2);box-shadow:0 0 0 1px var(--acc2)}
.themeprev{display:flex;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.tprev{width:72px;height:52px;border-radius:12px;cursor:pointer;border:2px solid transparent;display:flex;align-items:flex-end;padding:5px;font-size:11px;color:#fff}
.tprev.on{border-color:var(--acc2)}

.bgs{flex-wrap:wrap}
.bgs .bg{flex-shrink:0;margin-bottom:8px}

.sysmsg { align-self: center; text-align: center; font-size: 12px; color: var(--muted); background: var(--glass, rgba(255,255,255,.08)); padding: 4px 12px; border-radius: 12px; margin: 8px auto; max-width: 80%; }

.poll{min-width:230px;max-width:290px;padding:2px}
.pq{font-weight:700;font-size:15px;margin-bottom:2px}.psub{font-size:12px;opacity:.7;margin-bottom:8px}
.popt{position:relative;display:flex;align-items:center;gap:8px;padding:9px 10px;border-radius:12px;background:rgba(255,255,255,.08);margin-bottom:6px;overflow:hidden;cursor:pointer}
.popt.on{outline:1.5px solid rgba(255,255,255,.7)}
.pfill{position:absolute;left:0;top:0;bottom:0;background:rgba(255,255,255,.16);transition:width .2s}
.popt>span{position:relative}.ptext{flex:1}.pcount{font-size:12px;opacity:.8}
.pfoot{font-size:12px;opacity:.7;margin-top:4px}.pclose{margin-top:8px;text-align:center;font-weight:600;font-size:13px;padding:8px;border-radius:10px;background:rgba(255,255,255,.12);cursor:pointer}
.pollwrap .overlay{z-index:60}
.pollsheet{position:fixed;left:0;right:0;bottom:0;z-index:61;background:var(--panelsolid);border-radius:22px 22px 0 0;padding:18px 16px 24px;border-top:1px solid var(--border);max-height:80%;overflow:auto}
.pshead{font-size:17px;font-weight:700;margin-bottom:12px}
.pinp{width:100%;box-sizing:border-box;background:var(--glass);border:1px solid var(--border);border-radius:12px;color:var(--text);padding:12px;font-size:15px;margin-bottom:8px;outline:none}
.prow{display:flex;align-items:center;gap:8px}.prow .pinp{flex:1}.prm{padding:8px;color:var(--muted);cursor:pointer}
.padd,.pmulti{padding:10px 4px;color:var(--acc2);font-weight:600;cursor:pointer}.pmulti{color:var(--text)}
.psend{width:100%;margin-top:8px;padding:14px;border:0;border-radius:14px;background:linear-gradient(135deg,var(--acc1),var(--acc2));color:#fff;font-size:16px;font-weight:700}

.stories{display:flex;gap:14px;padding:6px 14px 10px;overflow-x:auto;flex-shrink:0}
.sitem{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:62px;cursor:pointer}
.sring{position:relative;padding:3px;border-radius:50%;border:2.5px solid transparent;display:flex}
.sring.has{border-color:var(--acc2)}.sring.seen{border-color:var(--glass3)}.sring.none{border-color:var(--border);border-style:dashed}
.splus{position:absolute;right:-2px;bottom:-2px;width:20px;height:20px;border-radius:50%;background:linear-gradient(135deg,var(--acc1),var(--acc2));color:#fff;font-weight:700;font-size:15px;line-height:20px;text-align:center;border:2px solid var(--bg)}
.sname{font-size:12px;color:var(--muted);max-width:64px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.storyov{position:fixed;inset:0;z-index:90;background:#000;display:flex;flex-direction:column}
.sbody{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
.simg{max-width:100%;max-height:100%;object-fit:contain}
.stext{font-size:28px;font-weight:700;text-align:center;padding:40px 28px;color:#fff;word-break:break-word}
.scap{position:absolute;left:0;right:0;bottom:90px;text-align:center;padding:10px 18px;background:rgba(0,0,0,.45);color:#fff;font-size:16px}
.sbars{position:absolute;top:10px;left:10px;right:10px;display:flex;gap:4px;z-index:3}
.sbar{flex:1;height:3px;border-radius:2px;background:rgba(255,255,255,.3)}.sbar.on{background:#fff}
.shead{position:absolute;top:22px;left:12px;right:12px;display:flex;align-items:center;gap:10px;z-index:3;color:#fff}
.swho{font-weight:700;flex:1}.stime{font-size:12px;opacity:.8}.sclose{padding:6px 10px;font-size:20px;cursor:pointer}
.stap{position:absolute;top:70px;bottom:80px;width:40%;z-index:2}.stap.l{left:0}.stap.r{right:0}
.sfoot{position:absolute;left:0;right:0;bottom:0;padding:18px 20px 28px;display:flex;justify-content:space-between;align-items:center;z-index:3;color:#fff;background:linear-gradient(transparent,rgba(0,0,0,.6))}
.sdel{color:#ff6b7b;font-weight:600;padding:8px}
.stin{position:relative;z-index:2;width:86%;background:transparent;border:0;outline:none;color:#fff;font-size:26px;font-weight:700;text-align:center;resize:none;height:160px;font-family:inherit}
.composer .stin::placeholder{color:rgba(255,255,255,.6)}
.sbottom{position:absolute;left:0;right:0;bottom:0;padding:14px 16px 26px;z-index:3;background:linear-gradient(transparent,rgba(0,0,0,.65))}
.stools{display:flex;gap:10px;align-items:center;margin-bottom:12px}
.sw{width:30px;height:30px;border-radius:50%;border:2px solid rgba(255,255,255,.3)}.sw.on{border-color:#fff}
.sphoto{margin-left:auto;color:#fff;font-weight:600;padding:8px 12px;border-radius:12px;background:rgba(255,255,255,.18);cursor:pointer}

.sechead{padding:14px 16px 4px;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px}
.qrcard{margin:14px;padding:18px;border-radius:20px;background:var(--glass);border:1px solid var(--border);display:flex;flex-direction:column;align-items:center;gap:6px}
.qrcard svg{border-radius:12px}.qrname{font-weight:700;font-size:18px;margin-top:6px}.qrhint{font-size:13px;color:var(--muted)}
.obtn.danger{color:#ff6b7b;border-color:rgba(255,107,123,.5)}
.setrow.tap{cursor:pointer}
.pvtop{display:flex;flex-direction:column;align-items:center;padding:20px 0 8px;gap:6px}.pvname{font-weight:700;font-size:20px}.pvun{color:var(--muted)}
.pvbio{padding:8px 24px 14px;text-align:center}

.faqrow{margin:8px 14px 0;padding:14px 16px;border-radius:16px;background:var(--glass);border:1px solid var(--border);cursor:pointer;text-align:left}
.faqq{display:flex;justify-content:space-between;gap:10px;font-weight:600}.faqa{margin-top:8px;color:var(--muted);line-height:1.45;font-weight:400}
.tourcard{margin:14px;padding:30px 22px;border-radius:22px;background:var(--glass);border:1px solid var(--border);text-align:center}
.tournum{color:var(--muted);font-size:14px}.tourt{font-size:22px;font-weight:800;margin:10px 0 8px}.toursub{color:var(--muted);line-height:1.45}

.packcard { margin: 6px 8px; background: var(--panel7); border-radius: 14px; overflow: hidden; }
.packhead { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.packcover { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: rgba(255,255,255,.06); }
.packhead .grow { flex: 1; min-width: 0; }
.packname { font-weight: 600; font-size: 14px; }
.packsub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.packgrid { padding: 4px 8px 10px; }
.gbtn.small { padding: 7px 14px; font-size: 13px; width: auto; }
.gbtn.small.done { opacity: .55; }

.vbadge{display:inline-flex;align-items:center;justify-content:center;flex:none;line-height:1;margin-inline-start:5px;vertical-align:middle}

.pinbar{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--panel2b);border-bottom:1px solid var(--border);font-size:13px;cursor:pointer;flex-shrink:0}

/* iOS standalone safe areas (viewport-fit=cover) */
#app{padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
.topbar{padding-top:calc(10px + env(safe-area-inset-top,0px))}
.topbar.chat{padding-top:calc(8px + env(safe-area-inset-top,0px))}
.toast{top:calc(14px + env(safe-area-inset-top,0px))}
.inputrow{padding-bottom:calc(8px + env(safe-area-inset-bottom,0px))}
.convlist{padding-bottom:env(safe-area-inset-bottom,0px)}
.pollsheet{padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))}
.sbottom{padding-bottom:calc(26px + env(safe-area-inset-bottom,0px))}
.sfoot{padding-bottom:calc(28px + env(safe-area-inset-bottom,0px))}
.vooverlay{padding-bottom:calc(20px + env(safe-area-inset-bottom,0px))}

/* ---- auth screen v2 ---- */
.authglow{position:fixed;left:0;right:0;top:-90px;height:280px;pointer-events:none;
  background:radial-gradient(closest-side,rgba(123,92,255,.14),transparent)}
.langtop{display:flex;justify-content:flex-end;padding:14px 18px 0;position:relative;z-index:2}
.langsel{height:30px;padding:0 12px;border-radius:8px;background:var(--glass2);border:1px solid var(--border);
  color:var(--text);font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit}
.langsel:hover{background:var(--glass3)}
.logo-tile{width:64px;height:64px;border-radius:18px;background:#fff;display:flex;align-items:center;justify-content:center;
  box-shadow:0 8px 22px rgba(0,0,0,.28);border:1px solid var(--border)}
.logo-tile img{height:36px;width:auto;display:block}
.authtitle{font-size:22px;font-weight:700;margin-top:20px;letter-spacing:-.2px;color:var(--text)}
.authsub{max-width:280px;margin-top:7px;direction:inherit;color:var(--muted)}
.auth-body{width:100%;max-width:339px;display:flex;flex-direction:column;align-items:center;margin-top:26px}
.combo{display:flex;align-items:center;width:100%;height:50px;background:var(--glass2);
  border:1px solid var(--border);border-radius:12px;overflow:hidden}
.combo .cc{width:80px;height:100%;background:none;border:none;border-right:1px solid var(--border);
  color:var(--text);font-size:15px;font-weight:600;text-align:center;outline:none;direction:ltr;font-family:inherit}
.combo .ph{flex:1;height:100%;background:none;border:none;color:var(--text);font-size:14.5px;padding:0 14px;outline:none;direction:ltr;text-align:left;font-family:inherit}
.combo .ph::placeholder{color:var(--muted)}
.combo.single input{flex:1;height:100%;background:none;border:none;color:var(--text);font-size:14.5px;padding:0 14px;outline:none;direction:ltr;text-align:left;font-family:inherit}
.combo.single input::placeholder{color:var(--muted)}
.abtn{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;height:50px;border-radius:12px;
  font-size:14.5px;font-weight:700;cursor:pointer;margin-top:14px;border:none;font-family:inherit}
.abtn.wa{background:#00A884;color:#fff}
.abtn.tg{background:transparent;border:1px solid var(--border2);color:var(--text)}
.abtn.blue{background:#4F7BFF;color:#fff}
.abtn svg{width:17px;height:17px;flex:none}
.abtn:active{transform:scale(.99)}
.afoot{font-size:11px;line-height:1.5;text-align:center;margin-top:16px;padding:0 8px;direction:inherit;color:var(--muted)}
.authlink{background:none;border:none;color:#7FB6FF;font-size:13px;font-weight:600;margin-top:14px;cursor:pointer;font-family:inherit}

/* ---- market ---- */
.mksearch{ padding: 4px 14px 8px; }
.mkq{ width:100%; background:var(--glass2); border:1px solid var(--border); border-radius:12px;
  padding:11px 14px; color:var(--text); font-size:15px; outline:none; }
.mkq:focus{ border-color:var(--acc2); background:var(--glass); }
.mkfilters{ display:flex; gap:8px; padding:0 14px 10px; }
.mksel{ flex:1; min-width:0; background:var(--glass2); border:1px solid var(--border); border-radius:10px;
  color:var(--text); font-size:13.5px; padding:9px 10px; outline:none; -webkit-appearance:none; appearance:none; }
.mksel.wide{ flex:1 1 0; width:100%; font-size:15px; padding:12px; }
.mkfeed{ flex:1; overflow-y:auto; padding:0 14px 24px; }
.mkcard{ border:1px solid var(--border); border-radius:12px; overflow:hidden; background:var(--glass2); margin-bottom:12px; }
.mkphoto{ width:100%; height:190px; object-fit:cover; display:block; background:var(--panel7); }
.mkbody{ padding:11px 13px 12px; }
.mkrow{ display:flex; align-items:baseline; gap:10px; }
.mktitle{ flex:1; font-size:15px; font-weight:600; word-break:break-word; }
.mkprice{ font-size:15px; font-weight:700; color:#00A884; white-space:nowrap; }
.mksub{ color:var(--muted); font-size:11.5px; margin-top:4px; }
.mkacts{ display:flex; gap:8px; margin-top:11px; }
.mkbtn{ flex:1; background:#00A884; color:#04120e; border:0; border-radius:9px; padding:11px 12px;
  font-size:14px; font-weight:700; cursor:pointer; }
.mkbtn:active{ transform:scale(.99); }
.mkbtn.ghost{ background:transparent; color:var(--text); border:1px solid var(--border); font-weight:600; }
.mkprev{ width:72px; height:72px; border-radius:10px; border:1px solid var(--border);
  background:var(--glass2) center/cover no-repeat; flex:none; }
/* market option 2: list rows */
.mkfeed{ padding:0 14px 24px; }
.mkitem{ display:flex; gap:11px; align-items:flex-start; padding:12px 0; border-bottom:1px solid var(--border); }
.mkthumb{ width:92px; height:92px; border-radius:8px; object-fit:cover; background:var(--panel7); border:1px solid var(--border); flex:none; display:block; }
.mkmid{ flex:1; min-width:0; }
.mkmid .mktitle{ font-size:14.5px; font-weight:600; }
.mkmid .mkprice{ font-size:15px; font-weight:700; color:#00A884; margin-top:4px; }
.mkmid .mksub{ color:var(--muted); font-size:11px; margin-top:4px; }
.mkitem .mkbtn{ flex:none; align-self:center; padding:8px 12px; font-size:12.5px; border-radius:8px; white-space:nowrap; }
.mkcol{ display:flex; flex-direction:column; gap:6px; align-self:center; flex:none; }
.mkcol .mkbtn{ padding:6px 10px; font-size:11.5px; }
