:root {
  --bg: #0b0e11;
  --card: #141a21;
  --card2: #1b232c;
  --line: #222b35;
  --text: #eef2f6;
  --muted: #8794a3;
  --acc: #10b981;
  --grad: linear-gradient(135deg, #10b981, #0891b2);
  --danger: #e5484d;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; overflow: hidden; }
body { position: fixed; top: 0; left: 0; right: 0; height: var(--vh, 100dvh); font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.tap { cursor: pointer; }
.muted { color: var(--muted); }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.bigemoji { font-size: 46px; margin-bottom: 6px; }

input, textarea, button { font-family: inherit; font-size: 16px; border: none; border-radius: 14px; padding: 12px 14px; }
input, textarea { background: var(--card2); color: var(--text); width: 100%; outline: none; border: 1px solid transparent; }
input:focus, textarea:focus { border-color: var(--acc); }
input::placeholder, textarea::placeholder { color: #5f6b7a; }
textarea { resize: none; }
input[type=checkbox] { width: 22px; height: 22px; padding: 0; margin: 0; accent-color: var(--acc); }
button { background: var(--grad); color: #fff; cursor: pointer; font-weight: 600; }
button:active { opacity: .85; }
button:disabled { opacity: .5; }
button.grey { background: var(--card2); color: var(--text); }
button.red { background: var(--danger); }
button.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
button.ic { width: 42px; height: 42px; padding: 0; border-radius: 50%; font-size: 18px; flex: none; }

.screen { height: 100%; display: flex; flex-direction: column; }
.topbar { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar b { font-size: 17px; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.row input { flex: 1; width: auto; }
.headbox { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.tcol { display: flex; flex-direction: column; min-width: 0; }
.tcol b, .tcol span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcol small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 26px 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-top: 14px; text-align: left; font-size: 14px; }
.sec { margin: 16px 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }

/* login */
#login { height: 100%; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: 22px; background: radial-gradient(circle at 50% -10%, #0f3d33 0%, transparent 60%), var(--bg); }
.lbox { width: 100%; max-width: 360px; text-align: center; }
.lbox img { width: 84px; height: 84px; border-radius: 22px; margin-bottom: 8px; }
.lbox h1 { margin: 0; font-size: 28px; }
.lbox .tag { color: var(--muted); margin: 4px 0 18px; font-size: 14px; }
.lbox input { margin-bottom: 10px; }
.lbox button { width: 100%; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--card); border-radius: 16px; margin-bottom: 14px; }
.lbox .seg button { background: transparent; color: var(--muted); padding: 10px; }
.lbox .seg button.on { background: var(--card2); color: var(--text); }
#loginMsg { color: #ff8a8f; font-size: 14px; margin-top: 12px; min-height: 18px; }

/* main */
.hero { flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 14px 8px; }
.hero b { font-size: 19px; display: block; }
.hero small { color: var(--muted); font-size: 12px; }
.quick { flex: none; display: flex; gap: 10px; padding: 6px 12px; }
.qbtn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; border-radius: 18px; font-size: 14px; }
.qbtn.alt { background: var(--card2); color: var(--text); }
.qi { font-size: 22px; }
.strip { flex: none; display: flex; align-items: center; gap: 10px; justify-content: space-between; margin: 6px 12px; padding: 10px 12px; border-radius: 14px; background: #12261f; border: 1px solid #1d4a3c; font-size: 14px; }
.tabs { flex: none; display: flex; gap: 4px; padding: 4px; margin: 8px 12px 0; background: var(--card); border-radius: 16px; }
.tabs button { flex: 1; background: transparent; color: var(--muted); padding: 10px 6px; border-radius: 12px; position: relative; font-size: 15px; }
.tabs button.on { background: var(--card2); color: var(--text); }
.tb { font-style: normal; background: var(--grad); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; margin-left: 6px; }

.item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--line); padding: 10px 12px; border-radius: 16px; margin-bottom: 8px; }
.item .who2 { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item .btns { display: flex; gap: 6px; align-items: center; flex: none; }
.item span { font-size: 16px; }
.friend { cursor: pointer; }
.friend:active { background: var(--card2); }
.av { border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f766e, #1d4ed8); color: #fff; font-weight: bold; overflow: hidden; }
.badge { background: var(--grad); color: #fff; border-radius: 10px; padding: 2px 8px; font-size: 12px; font-weight: bold; }

/* chat area */
#msgs, #rMsgs { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; overscroll-behavior: contain; background: radial-gradient(circle at 15% 0%, #10201d 0%, transparent 55%), var(--bg); }
.more { text-align: center; margin-bottom: 10px; }
.sys { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0; }

.m { background: var(--card2); padding: 9px 13px; border-radius: 18px 18px 18px 5px; margin-bottom: 8px; max-width: 84%; width: fit-content; word-wrap: break-word; line-height: 1.35; white-space: pre-wrap; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.m.me { background: var(--grad); margin-left: auto; border-radius: 18px 18px 5px 18px; color: #fff; }
#rMsgs .m { user-select: text; -webkit-user-select: text; }
.m.flash { outline: 2px solid #67e8f9; }
.m .who { display: block; font-size: 12px; color: #67e8f9; margin-bottom: 2px; font-weight: 600; }
.m img { max-width: 100%; max-height: 260px; border-radius: 12px; display: block; margin-bottom: 4px; }
.m small { display: block; font-size: 10px; color: rgba(255,255,255,.6); margin-top: 3px; text-align: right; }

.mrow { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 6px; }
.mrow.mine { justify-content: flex-end; }
.mrow .m { margin: 0; max-width: 80%; }
.mav { cursor: pointer; margin-bottom: 2px; }

.quote { border-left: 3px solid #67e8f9; background: rgba(255,255,255,.1); padding: 4px 8px; border-radius: 8px; margin-bottom: 4px; font-size: 12px; cursor: pointer; white-space: normal; }
.quote b { display: block; color: #67e8f9; font-size: 12px; }
.tick { margin-left: 4px; }
.tick.seen { color: #cffafe; font-weight: bold; }

.mention { color: #67e8f9; font-weight: 700; }
.m.me .mention { color: #fff; text-decoration: underline; }
.m.mentioned { background: #2a2412; border: 1.5px solid #fbbf24; box-shadow: 0 0 0 3px rgba(251,191,36,.18); }
.mtag { font-size: 11px; color: #fbbf24; font-weight: 700; margin-bottom: 3px; }

.m.stk { background: transparent !important; padding: 2px 4px; box-shadow: none; border: none; }
.stkemo { font-size: 68px; line-height: 1.1; display: block; }
.m img.stkimg { width: 150px; height: 150px; max-height: none; object-fit: contain; border-radius: 0; }
.m.stk small { color: var(--muted); }

.reacts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.rchip { background: rgba(0,0,0,.35); border-radius: 12px; padding: 1px 8px; font-size: 13px; cursor: pointer; }
.rchip.mine { outline: 1px solid #67e8f9; }

.vn { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.vbtn { width: 36px; height: 36px; border-radius: 50%; padding: 0; background: rgba(255,255,255,.2); font-size: 14px; }
.vbar { flex: 1; height: 5px; background: rgba(255,255,255,.2); border-radius: 3px; overflow: hidden; }
.vbar i { display: block; height: 100%; width: 0; background: #fff; }
.vdur { font-size: 12px; opacity: .85; }

#msgMenu { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 25; display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--card); border-radius: 22px 22px 0 0; padding: 14px; max-height: 80%; overflow-y: auto; }
.sheet h4 { margin: 0 0 8px; font-size: 17px; }
.sheet p { margin: 4px 0; font-size: 14px; color: #b6c0cc; }
.rrow { display: flex; justify-content: space-around; margin-bottom: 8px; }
.rq { background: var(--card2); width: 44px; height: 44px; border-radius: 50%; padding: 0; font-size: 22px; }
.rq.on { outline: 2px solid var(--acc); }
.mitem { display: block; width: 100%; text-align: left; background: transparent; color: var(--text); font-weight: 500; padding: 13px 6px; border-radius: 10px; border-bottom: 1px solid var(--line); }
.mitem.danger { color: #ff8a8f; }

#replyBar { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--card); border-left: 3px solid var(--acc); }
#replyTxt { flex: 1; min-width: 0; font-size: 13px; color: #b6c0cc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rStatus { flex: none; padding: 8px 14px; font-size: 13px; color: #67e8f9; background: var(--card); }
#bar, #rBar { flex: none; display: flex; gap: 8px; padding: 8px 10px; background: var(--card); align-items: center; }
#bar input, #rBar input { flex: 1; width: auto; border-radius: 22px; }
#rBar button { padding: 11px 16px; border-radius: 22px; }
#recBar { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--card); }
.recmid { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 16px; }
.recmid small { color: var(--muted); }
.recdot { width: 12px; height: 12px; border-radius: 50%; background: #ef4444; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

#mentionBar { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 6px 10px; background: var(--card); border-top: 1px solid var(--line); }
.mchip { display: flex; align-items: center; gap: 6px; background: var(--card2); border-radius: 18px; padding: 4px 12px 4px 4px; white-space: nowrap; cursor: pointer; font-size: 14px; }

#stickerTray { flex: none; height: 230px; background: var(--card); border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.stabs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; flex: none; }
.stab { background: var(--card2); color: var(--text); padding: 6px 14px; border-radius: 14px; font-size: 13px; white-space: nowrap; }
.stab.on { background: var(--grad); }
.sgrid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px; align-content: start; }
.sg { font-size: 34px; background: transparent; padding: 4px; border-radius: 12px; }
.sg.grey { background: var(--card2); color: var(--text); }
.simg { position: relative; cursor: pointer; }
.simg img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 10px; background: var(--card2); display: block; }
.simg .sx { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0; border-radius: 50%; font-size: 11px; background: rgba(0,0,0,.65); }

#viewer { position: fixed; inset: 0; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; z-index: 10; }
#viewer img { max-width: 100%; max-height: 100%; }
#banner { position: fixed; top: 8px; left: 8px; right: 8px; background: var(--grad); color: #fff; padding: 11px 14px; border-radius: 14px; z-index: 30; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
#toastBar { position: fixed; left: 14px; right: 14px; bottom: 84px; background: #12261f; border: 1px solid #1d4a3c; color: #fff; padding: 11px 14px; border-radius: 14px; z-index: 40; font-size: 14px; }

/* popups */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 20; display: flex; align-items: center; justify-content: center; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; width: 92%; max-width: 390px; max-height: 88%; overflow-y: auto; }
.panel h3 { margin: 0 0 10px; font-size: 19px; display: block; color: var(--text); }
.panel ul { padding-left: 20px; line-height: 1.6; font-size: 15px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 16px; }

/* profile */
#pBody { text-align: center; }
#pAv { display: flex; justify-content: center; margin: 10px 0; }
#pUser { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
#pName { font-size: 23px; font-weight: bold; }
#pBio { color: #b6c0cc; margin: 10px 0; white-space: pre-wrap; }
#pFriend { color: #67e8f9; font-size: 14px; }
#pNotifOther { margin-top: 12px; font-size: 14px; }
#pEdit { text-align: left; margin-top: 12px; }
#pEdit label { display: block; font-size: 13px; color: #67e8f9; margin: 10px 0 4px; }
.pbtns { display: flex; gap: 8px; justify-content: center; margin: 10px 0 0; }

/* END style.css */