:root {
  --pink: #ff4d8d; --pink2: #ff7a45; --bg: #f6f6f8; --card: #fff; --text: #17171c; --muted: #6b6b78; --line: #e6e6ec; --chip: #f0f0f4; --danger: #d6264f;
  --bubble-me: #ff4d8d; --bubble-me-text: #fff; --bubble: #ececf1;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e0e12; --card: #18181f; --text: #f1f1f5; --muted: #9a9aa8; --line: #2a2a33; --chip: #24242d; --bubble: #26262f; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
#app { max-width: 680px; margin: 0 auto; min-height: 100dvh; padding-bottom: 76px; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; }
.lg { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--pink), var(--pink2)); }
main { padding: 12px 12px 24px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.nav .navitem { flex: 1; max-width: 136px; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 7px 0; font-size: 11px; color: var(--muted); }
.nav .navitem.on { color: var(--pink); font-weight: 700; }
.ni { font-size: 20px; line-height: 1.2; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 14px; overflow: hidden; }
.form { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.center { display: grid; place-items: start center; padding-top: 24px; }
.auth { width: min(420px, 100%); }
.input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); outline: none; }
.input:focus { border-color: var(--pink); }
textarea.input { resize: vertical; }
.btn { border: 0; cursor: pointer; padding: 10px 18px; border-radius: 999px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--pink), var(--pink2)); display: inline-block; text-align: center; }
.btn.ghost { background: var(--chip); color: var(--text); }
.btn.sm { padding: 6px 14px; font-size: 14px; }
.btn.big { padding: 13px 18px; font-size: 17px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--pink); cursor: pointer; font-weight: 600; }
.err { color: var(--danger); min-height: 1.2em; font-size: 14px; }
.row { display: flex; align-items: center; } .row.gap { gap: 10px; } .row.between { justify-content: space-between; } .row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.sub { color: var(--muted); font-size: 13px; } .faint { color: var(--muted); }
.h { margin: 4px 2px 10px; } .big { margin: 0; font-size: 22px; } .back { display: inline-block; margin: 0 0 8px; color: var(--pink); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.notice { background: var(--chip); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--muted); margin-top: 12px; }
.tick { color: #1d9bf0; font-size: .8em; }
.avatar { border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--pink2)); color: #fff; display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.tabs { display: flex; gap: 8px; margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; cursor: pointer; padding: 8px 18px; border-radius: 999px; background: var(--chip); font-weight: 600; white-space: nowrap; }
.tab.on { background: var(--pink); color: #fff; } .tabs.small .tab { padding: 6px 14px; font-size: 14px; }
/* posts */
.post .phead { padding: 12px 14px 8px; } .who { display: flex; align-items: center; gap: 10px; }
.post .media { display: block; width: 100%; max-height: 78vh; object-fit: contain; background: #000; }
.vidwrap { position: relative; background: #000; } .overlay { position: absolute; left: 0; right: 0; text-align: center; color: #fff; font-weight: 800; text-shadow: 0 2px 8px #000a; padding: 0 12px; pointer-events: none; }
.overlay.pos0 { top: 10%; } .overlay.pos1 { top: 45%; } .overlay.pos2 { bottom: 14%; }
.textpost { min-height: 240px; display: grid; place-content: center; text-align: center; padding: 28px; color: #fff; font-size: 24px; font-weight: 800; gap: 12px; }
.textpost p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; } .textpost a { font-size: 15px; text-decoration: underline; font-weight: 600; word-break: break-all; }
.cap { margin: 8px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.acts { display: flex; align-items: center; gap: 4px; padding: 6px 8px 10px; flex-wrap: wrap; }
.act { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 8px 10px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }
.act:hover { background: var(--chip); } .act.on { color: var(--pink); } .act.shop { color: var(--pink); margin-left: auto; }
.ico svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.act:disabled { opacity: .45; }
.comments { margin-bottom: 12px; } .comment { display: flex; gap: 10px; padding: 8px 2px; align-items: flex-start; } .comment .ct { overflow-wrap: anywhere; } .nm { font-weight: 700; }
.composer { display: flex; gap: 8px; align-items: center; padding: 8px 0; } .ibtn { border: 0; background: var(--chip); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 18px; flex: none; }
/* profile */
.phead2 { display: flex; gap: 16px; padding: 16px; align-items: flex-start; } .stats { display: flex; gap: 18px; margin: 8px 0 12px; color: var(--muted); } .stats b { color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; } .tile { position: relative; aspect-ratio: 9/12; background: var(--chip); overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; } .tile .tt { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 8px; color: #fff; font-weight: 700; font-size: 13px; }
.tile .play { position: absolute; right: 6px; top: 6px; color: #fff; font-size: 12px; text-shadow: 0 1px 4px #000; }
/* chats */
.rowitem { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; } .rowitem:hover { background: var(--chip); }
.rowitem .pv { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .rowitem.unread b, .rowitem.unread .pv { font-weight: 800; color: var(--text); } .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pink); flex: none; }
.chat { display: flex; flex-direction: column; height: calc(100dvh - 160px); min-height: 360px; }
.chead { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); } .chead .back { margin: 0; font-size: 22px; }
.sub.live { color: var(--pink); font-weight: 700; }
.msgs { flex: 1; overflow-y: auto; padding: 10px 2px; display: flex; flex-direction: column; gap: 4px; }
.row-msg { display: flex; } .row-msg.mine { justify-content: flex-end; }
.bub { position: relative; max-width: 78%; padding: 8px 12px; border-radius: 18px; background: var(--bubble); overflow-wrap: anywhere; white-space: pre-wrap; }
.mine .bub { background: var(--bubble-me); color: var(--bubble-me-text); } .mine .bub a { color: inherit; text-decoration: underline; }
.bub .time { display: block; font-size: 10px; opacity: .65; text-align: right; margin-top: 2px; }
.bub .x { position: absolute; left: -22px; top: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; opacity: 0; } .bub:hover .x { opacity: 1; }
.att { max-width: min(280px, 100%); border-radius: 12px; display: block; } .sticker { width: 132px; height: 132px; object-fit: contain; }
.sysmsg { text-align: center; margin: 8px 0; } .sysmsg span { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: 12px; }
.seen { align-self: flex-end; font-size: 11px; color: var(--muted); padding-right: 6px; }
.typingdots { color: var(--muted); letter-spacing: 2px; animation: pulse 1.2s infinite; } @keyframes pulse { 50% { opacity: .45; } }
.closed { text-align: center; padding: 14px; background: var(--chip); border-radius: 14px; color: var(--muted); }
.stickers { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 8px; max-height: 260px; overflow-y: auto; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; } .sbtn { border: 0; background: none; cursor: pointer; padding: 4px; border-radius: 12px; } .sbtn:hover { background: var(--chip); } .sbtn img { width: 100%; aspect-ratio: 1; object-fit: contain; }
[hidden] { display: none !important; }
/* market */
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; } .prod { margin: 0; } .prod img, .prod .tt { width: 100%; aspect-ratio: 1; object-fit: cover; display: grid; place-items: center; font-size: 36px; background: var(--chip); }
.pi { padding: 10px 12px 12px; } .pt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .price { font-weight: 800; color: var(--pink); } .price.big { font-size: 24px; } .old { color: var(--muted); font-weight: 400; font-size: 13px; }
.prodpage .media { width: 100%; max-height: 60vh; object-fit: contain; background: #000; display: block; } .chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; } .chip { background: var(--chip); border-radius: 999px; padding: 3px 12px; font-size: 13px; }
.seller { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
/* swatches, banner, locked, toast */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; } .sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; } .sw.on { border-color: var(--text); }
#banner { background: #ffe4e8; color: #8a1230; padding: 8px 14px; font-size: 13px; } @media (prefers-color-scheme: dark) { #banner { background: #3a1620; color: #ffc2cf; } }
.locked { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 28px; } .locked .big-ico { font-size: 64px; } .locked h1 { margin: 0; }
#toast { position: fixed; left: 50%; bottom: 88px; transform: translate(-50%, 20px); background: #222; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; max-width: 90vw; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); } #toast.warn { background: var(--danger); }
progress { width: 100%; accent-color: var(--pink); }
@media (min-width: 900px) {
  #app { max-width: 760px; }
}
