/* BITIK — Telegram uslubidagi interfeys */
:root {
  --accent: #0ea5e9; --accent2: #0284c7; --danger: #ef4444; --ok: #22c55e;
  --bg: #ffffff; --bg2: #f1f5f9; --panel: #ffffff; --line: #e2e8f0; --text: #0f172a; --muted: #64748b;
  --chatbg: #dfe9f2; --in: #ffffff; --out: #dcf3ff; --hover: #f1f5f9; --sel: #0ea5e9; --selText: #fff;
  --shadow: 0 6px 24px rgba(15,23,42,.18);
}
body.dark {
  --bg: #0f1720; --bg2: #17212b; --panel: #17212b; --line: #0b1219; --text: #e6edf3; --muted: #7f91a4;
  --chatbg: #0e1621; --in: #182533; --out: #1f4d6f; --hover: #202b36; --sel: #2b5278; --selText: #fff;
  --shadow: 0 6px 24px rgba(0,0,0,.5);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.4 "Segoe UI", Roboto, -apple-system, Arial, sans-serif; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
input:focus, textarea:focus { border-color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--danger); min-height: 20px; margin-top: 8px; text-align: center; }
.icon { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 19px; color: var(--muted); flex: 0 0 auto; }
.icon:hover { background: var(--hover); }
.icon.small { width: 26px; height: 26px; font-size: 13px; }
button.primary { background: var(--accent); color: #fff; border-radius: 10px; padding: 9px 16px; font-weight: 600; }
button.primary:hover { background: var(--accent2); }
button.primary.big { width: 100%; padding: 12px; font-size: 16px; margin-top: 6px; }
button.ghost { color: var(--accent); padding: 8px 12px; border-radius: 8px; font-weight: 600; }
button.ghost:hover { background: var(--hover); }
button.danger, .danger { color: var(--danger) !important; }

/* ---------- Avatar ---------- */
.avatar { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 16px; background: #64748b center/cover no-repeat; overflow: hidden; position: relative; user-select: none; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.avatar.lg { width: 54px; height: 54px; font-size: 20px; }
.avatar.xl { width: 120px; height: 120px; font-size: 44px; }
.avatar .online { position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); }

/* ---------- Kirish ---------- */
#auth { height: 100%; display: grid; place-items: center; background: var(--bg); overflow-y: auto; padding: 20px; }
.auth-box { width: 100%; max-width: 380px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.auth-logo { width: 110px; height: 110px; margin: 0 auto; }
.auth-box h1 { margin: 4px 0 0; font-size: 30px; letter-spacing: 3px; }
.auth-box form { display: flex; flex-direction: column; gap: 10px; }
#serverRow { text-align: left; display: flex; flex-direction: column; gap: 4px; }
#serverRow label { font-size: 13px; color: var(--muted); }
.tabs2 { display: flex; background: var(--bg2); border-radius: 10px; padding: 3px; margin: 8px 0 4px; }
.tabs2 button { flex: 1; padding: 8px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.tabs2 button.active { background: var(--accent); color: #fff; }

/* ---------- Asosiy ---------- */
#main { display: flex; height: 100%; }
#sidebar { width: 360px; min-width: 280px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: relative; }
.sb-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.search-wrap { flex: 1; position: relative; }
.search-wrap input { width: 100%; border-radius: 22px; padding: 9px 34px 9px 14px; background: var(--bg2); border-color: transparent; }
.search-wrap button { position: absolute; right: 6px; top: 7px; }
#connBar { background: #f59e0b; color: #111; text-align: center; font-size: 13px; padding: 3px; }
#chatList, #searchResults { flex: 1; overflow-y: auto; }
.citem { display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin: 0 6px; border-radius: 10px; cursor: pointer; }
.citem:hover { background: var(--hover); }
.citem.active { background: var(--sel); color: var(--selText); }
.citem.active .muted, .citem.active .ctime { color: rgba(255,255,255,.75); }
.cbody { flex: 1; min-width: 0; }
.crow { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ctitle { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctime { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.cprev { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); flex: 1; }
.cprev .who { color: var(--accent); }
.citem.active .cprev .who { color: #fff; }
.badge { background: var(--accent); color: #fff; border-radius: 12px; min-width: 22px; height: 22px; padding: 0 7px; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.badge.muted-b { background: #8194a7; }
.ticon { margin-right: 3px; }
.sr-head { padding: 10px 16px 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
#fab { position: absolute; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 22px; box-shadow: var(--shadow); }
.dropdown { position: absolute; z-index: 40; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 220px; border: 1px solid var(--line); }
.dropdown button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; }
.dropdown button:hover { background: var(--hover); }
#menu { top: 54px; left: 10px; }
.menu-me { display: flex; gap: 10px; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- Chat ---------- */
#chatPane { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--chatbg); position: relative;
  background-image: radial-gradient(circle at 20% 20%, rgba(14,165,233,.07) 0, transparent 40%), radial-gradient(circle at 80% 70%, rgba(37,99,235,.07) 0, transparent 40%); }
#emptyPane { flex: 1; display: grid; place-items: center; }
.pill { background: rgba(0,0,0,.25); color: #fff; padding: 5px 14px; border-radius: 14px; font-size: 14px; }
#chat { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
#chatHead { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 56px; }
#backBtn { display: none; }
.ch-titles { flex: 1; min-width: 0; cursor: pointer; }
#chTitle { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chSub { font-size: 13px; }
#chSub.typing { color: var(--accent); }
.ch-actions { display: flex; }
#msgs { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 0; }
#msgsInner { max-width: 760px; margin: 0 auto; padding: 0 12px; display: flex; flex-direction: column; }
.day { align-self: center; margin: 10px 0; }
.sys { align-self: center; margin: 6px 0; background: rgba(0,0,0,.22); color: #fff; padding: 4px 12px; border-radius: 12px; font-size: 13px; max-width: 80%; text-align: center; }
.mrow { display: flex; align-items: flex-end; gap: 6px; margin: 1px 0; }
.mrow.out { flex-direction: row-reverse; }
.mrow .avatar { visibility: hidden; }
.mrow.last .avatar { visibility: visible; }
.mrow.grouped-gap { margin-top: 8px; }
.bubble { max-width: min(78%, 520px); background: var(--in); border-radius: 14px; padding: 6px 10px 6px; position: relative; box-shadow: 0 1px 1px rgba(0,0,0,.12); word-wrap: break-word; overflow-wrap: anywhere; }
.mrow.out .bubble { background: var(--out); }
.mrow.last.in .bubble { border-bottom-left-radius: 4px; }
.mrow.last.out .bubble { border-bottom-right-radius: 4px; }
.bubble.media { padding: 3px; }
.bubble.media .mtext { padding: 4px 7px 0; }
.bubble.highlight { animation: hl 1.4s; }
@keyframes hl { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } }
.sender { font-weight: 600; font-size: 13.5px; margin-bottom: 1px; cursor: pointer; }
.fwd { font-size: 13px; color: var(--accent); margin-bottom: 2px; }
.mtext { white-space: pre-wrap; }
.mtext a { color: var(--accent); }
.mrow.out .mtext a { color: #7dd3fc; }
body:not(.dark) .mrow.out .mtext a { color: #0369a1; }
.meta { float: right; font-size: 11.5px; color: var(--muted); margin: 6px 0 -4px 10px; display: inline-flex; gap: 4px; align-items: center; user-select: none; }
.mrow.out .meta { color: #7aa6c2; }
body:not(.dark) .mrow.out .meta { color: #4a8bb0; }
.meta .ticks.read { color: var(--accent); }
.bubble.media > .meta { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.45); color: #fff; padding: 1px 6px; border-radius: 10px; margin: 0; }
.bubble.media.withtext > .meta { position: static; background: none; color: var(--muted); padding: 0; margin: 6px 7px 2px 10px; }
.reply-q { border-left: 3px solid var(--accent); padding: 2px 8px; margin: 2px 0 4px; border-radius: 4px; background: rgba(14,165,233,.1); cursor: pointer; font-size: 13.5px; }
.reply-q b { color: var(--accent); display: block; font-size: 13px; }
.reply-q span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.photo { display: block; max-width: 100%; max-height: 420px; min-width: 120px; border-radius: 11px; cursor: zoom-in; background: rgba(0,0,0,.1); }
video.vid { display: block; max-width: 100%; max-height: 420px; border-radius: 11px; background: #000; }
.fileb { display: flex; gap: 10px; align-items: center; min-width: 220px; cursor: pointer; text-decoration: none; color: inherit; padding: 4px 2px; }
.fileb .fi { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 20px; flex: 0 0 auto; }
.fileb .fn { font-weight: 600; word-break: break-all; }
.fileb .fs { font-size: 13px; color: var(--muted); }
.voice { display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 2px 0; }
.voice .play { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 16px; display: grid; place-items: center; flex: 0 0 auto; }
.voice .vw { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.voice canvas { width: 100%; height: 28px; cursor: pointer; }
.voice .vd { font-size: 12.5px; color: var(--muted); }
.callmsg { display: flex; gap: 10px; align-items: center; padding: 2px 0; min-width: 180px; }
.callmsg .ci { font-size: 22px; }
.callmsg .missed { color: var(--danger); }
.views { margin-right: 2px; }
.upload-prog { height: 4px; background: rgba(0,0,0,.2); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.upload-prog div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
#toBottom { position: absolute; right: 18px; bottom: 76px; width: 46px; height: 46px; border-radius: 50%; background: var(--panel); color: var(--muted); font-size: 20px; box-shadow: var(--shadow); z-index: 5; }
#toBottomCount { position: absolute; top: -6px; right: -4px; background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 6px; }
#toBottomCount:empty { display: none; }

#replyBar { display: flex; align-items: center; gap: 10px; background: var(--panel); padding: 6px 10px 0; }
.rb-line { width: 3px; align-self: stretch; background: var(--accent); border-radius: 2px; }
.rb-text { flex: 1; min-width: 0; font-size: 14px; }
.rb-text b { color: var(--accent); }
#rbBody { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
#composer, #recBar, #joinBar { display: flex; align-items: flex-end; gap: 4px; padding: 8px 10px; background: var(--panel); }
#input { flex: 1; resize: none; max-height: 180px; border: none; background: transparent; padding: 9px 6px; line-height: 1.35; }
.icon.send { color: var(--accent); }
#recBar { align-items: center; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; margin-left: 8px; }
@keyframes blink { 50% { opacity: .2; } }
#recTime { font-variant-numeric: tabular-nums; min-width: 44px; }
#recWave { flex: 1 1 0; min-width: 0; width: 0; height: 32px; }
#recBar > button, #recBar > span { flex: 0 0 auto; }
#roundRec { z-index: 45; }
.rr-bar > * { flex: 0 0 auto; }
#joinBar { justify-content: center; }
#joinBtn { color: var(--accent); font-weight: 700; padding: 8px 30px; border-radius: 10px; text-transform: uppercase; letter-spacing: .5px; }
#joinBtn:hover { background: var(--hover); }
#dropZone { position: absolute; inset: 10px; border: 3px dashed var(--accent); border-radius: 16px; display: grid; place-items: center; font-size: 20px; font-weight: 600; background: rgba(14,165,233,.12); z-index: 20; pointer-events: none; }

/* ---------- Maʼlumot paneli ---------- */
#infoPane { width: 340px; background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; }
.ip-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
.ip-top { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px 12px; text-align: center; }
.ip-top .t { font-size: 20px; font-weight: 700; }
.ip-row { padding: 10px 18px; display: flex; gap: 14px; align-items: flex-start; }
.ip-row .ic { color: var(--muted); width: 22px; text-align: center; }
.ip-row .l { font-size: 12.5px; color: var(--muted); }
.ip-sec { padding: 8px 18px 4px; font-size: 13px; color: var(--accent); font-weight: 600; }
.mem { display: flex; gap: 10px; align-items: center; padding: 6px 14px; cursor: pointer; border-radius: 10px; margin: 0 6px; }
.mem:hover { background: var(--hover); }
.mem .role { margin-left: auto; font-size: 12px; color: var(--accent); }
.ip-actions { display: flex; flex-direction: column; padding: 6px; }
.ip-actions button { text-align: left; padding: 10px 12px; border-radius: 8px; }
.ip-actions button:hover { background: var(--hover); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; z-index: 60; padding: 14px; }
.modal-box { background: var(--panel); border-radius: 14px; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.modal-box h2 { margin: 0 0 4px; font-size: 19px; }
.modal-box .row-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.modal-box label.lbl { font-size: 13px; color: var(--muted); margin-bottom: -6px; }
.av-pick { display: flex; align-items: center; gap: 14px; }
.pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.pick { display: flex; gap: 10px; align-items: center; padding: 7px 10px; cursor: pointer; }
.pick:hover { background: var(--hover); }
.pick .chk { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; font-size: 13px; color: #fff; }
.pick.on .chk { background: var(--accent); border-color: var(--accent); }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.seg { display: flex; background: var(--bg2); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; padding: 7px; border-radius: 8px; color: var(--muted); }
.seg button.on { background: var(--accent); color: #fff; }

/* ---------- Rasm koʻruvchi ---------- */
#viewer { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 70; display: grid; place-items: center; }
#viewer img { max-width: 96vw; max-height: 92vh; }
#viewer .close { position: absolute; top: 12px; right: 12px; color: #fff; font-size: 22px; }
#ctxMenu { position: fixed; z-index: 80; min-width: 190px; }

/* ---------- Qoʻngʻiroq ---------- */
#call { position: fixed; inset: 0; z-index: 90; background: radial-gradient(circle at 50% 30%, #1e3a5f, #0b1220 70%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#remoteVideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: none; }
#call.video-on #remoteVideo { display: block; }
#call.video-on #callInfo { position: absolute; top: 20px; left: 0; right: 0; }
#call.video-on #callAvatar { display: none; }
#callInfo { display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 2; text-shadow: 0 1px 4px #000; }
#callName { font-size: 26px; font-weight: 700; }
#callStatus { font-size: 15px; opacity: .85; font-variant-numeric: tabular-nums; }
#localVideo { position: absolute; right: 16px; top: 16px; width: 26vw; max-width: 260px; border-radius: 12px; background: #000; z-index: 3; display: none; transform: scaleX(-1); box-shadow: 0 4px 16px #000; }
#call.cam-on #localVideo { display: block; }
#callBtns { position: absolute; bottom: 36px; display: flex; gap: 26px; z-index: 4; }
.cbtn { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 26px; display: grid; place-items: center; backdrop-filter: blur(6px); }
.cbtn.off { background: #fff; color: #111; }
.cbtn.end { background: var(--danger); transform: rotate(135deg); }
.cbtn.ok { background: var(--ok); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(34,197,94,.25); } }
#incoming { position: fixed; z-index: 95; right: 20px; bottom: 20px; width: 300px; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px solid var(--line); }
#incoming .avatar.xl { width: 88px; height: 88px; font-size: 32px; }
#inName { font-size: 19px; font-weight: 700; }
.in-btns { display: flex; gap: 50px; margin-top: 8px; }

#toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: rgba(20,28,38,.95); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 100; box-shadow: var(--shadow); max-width: 90vw; text-align: center; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(127,145,164,.35); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
  #sidebar { width: 100%; min-width: 0; border-right: none; }
  #main.in-chat #sidebar { display: none; }
  #main:not(.in-chat) #chatPane { display: none; }
  #backBtn { display: inline-grid; }
  #infoPane { position: fixed; inset: 0; width: 100%; z-index: 30; }
  .bubble { max-width: 86%; }
  #incoming { left: 12px; right: 12px; width: auto; bottom: 12px; }
  #localVideo { width: 30vw; }
}
@media (min-width: 761px) and (max-width: 1100px) { #infoPane { position: absolute; right: 0; top: 0; bottom: 0; z-index: 30; box-shadow: var(--shadow); } }

/* Dumaloq video xabar */
#roundRec { position: absolute; inset: 0; z-index: 30; background: rgba(5,10,16,.82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.rr-box { position: relative; width: min(300px, 70vw); aspect-ratio: 1; }
.rr-box video { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); border-radius: 50%; object-fit: cover; background: #000; transform: scaleX(-1); }
.rr-box video.back { transform: none; }
.rr-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.rr-ring circle { fill: none; stroke-width: 3; stroke: rgba(255,255,255,.15); }
.rr-ring #rrProg { stroke: var(--accent); stroke-dasharray: 301.6; stroke-dashoffset: 301.6; stroke-linecap: round; }
.rr-bar { display: flex; align-items: center; gap: 10px; background: var(--panel); padding: 8px 14px; border-radius: 28px; }
#rrTime { font-variant-numeric: tabular-nums; min-width: 44px; }
.round { position: relative; width: 240px; height: 240px; border-radius: 50%; overflow: hidden; cursor: pointer; background: #000; }
.round video { width: 100%; height: 100%; object-fit: cover; display: block; }
.round .rdur { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.round .rsnd { position: absolute; right: 50%; top: 10px; margin-right: -13px; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.bubble:has(.round) { background: transparent !important; box-shadow: none !important; padding: 0 !important; }
@media (max-width: 760px) { .round { width: 200px; height: 200px; } }

/* ===== Pastki boʻlimlar: Chatlar / Kontaktlar / Yangiliklar / Lenta ===== */
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.modal-box h3 { margin: 0 0 4px; font-size: 18px; } .modal-box h4 { margin: 8px 0 0; font-size: 15px; }
.tab-title { display: none; flex: 1; font-size: 18px; font-weight: 700; padding-left: 4px; }
body:not([data-tab="chats"]) .sb-head .search-wrap { display: none; }
body:not([data-tab="chats"]) .tab-title { display: block; }
.tabview { flex: 1; overflow-y: auto; padding: 6px 0 90px; background: var(--bg2); }
#chatList { padding-bottom: 80px; }
#bottomNav { display: flex; border-top: 1px solid var(--line); background: var(--panel); flex: 0 0 auto; padding-bottom: env(safe-area-inset-bottom); }
#bottomNav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
#bottomNav button span { font-size: 21px; line-height: 1; filter: grayscale(1); opacity: .75; }
#bottomNav button.active { color: var(--accent); }
#bottomNav button.active span { filter: none; opacity: 1; }
#fab { bottom: 74px; }
@media (min-width: 761px) { body[data-tab="news"] #sidebar, body[data-tab="feed"] #sidebar, body[data-tab="contacts"] #sidebar { width: 520px; } }
.card { display: block; background: var(--panel); margin: 8px 10px; border-radius: 14px; overflow: hidden; color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.card-media { display: block; width: 100%; max-height: 520px; object-fit: cover; background: #000; }
.card-body { padding: 10px 14px 12px; }
.card-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.card-title { font-weight: 700; font-size: 16px; line-height: 1.3; }
.card-text { font-size: 14.5px; line-height: 1.4; margin-top: 4px; color: var(--text); white-space: pre-wrap; }
.card.news .card-text { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.card.ad { border: 1px solid var(--accent); }
.ad-badge { background: #f59e0b; color: #111; border-radius: 6px; padding: 1px 7px; font-weight: 700; font-size: 11px; }
.ad-btn { display: inline-block; margin-top: 8px; background: var(--accent); color: #fff; border-radius: 9px; padding: 7px 14px; font-weight: 600; text-decoration: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 10px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 6px 12px; border-radius: 16px; background: var(--panel); color: var(--text); font-size: 13.5px; font-weight: 600; border: 1px solid var(--line); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.ghost { color: var(--accent); }
.empty-note { text-align: center; color: var(--muted); padding: 28px 24px; font-size: 14px; }
.new-post { display: flex; align-items: center; gap: 10px; width: calc(100% - 20px); padding: 10px 14px; text-align: left; }
.new-post .muted { flex: 1; } .np-ic { font-size: 22px; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.post-who { flex: 1; display: flex; flex-direction: column; line-height: 1.25; } .post-who .muted { font-size: 12.5px; }
.post-text { padding: 8px 14px 2px; }
.post-actions { display: flex; gap: 4px; padding: 6px 8px 8px; }
.post-actions button { padding: 6px 10px; border-radius: 18px; font-size: 14.5px; color: var(--text); }
.post-actions button:hover { background: var(--hover); }
.np-preview img, .np-preview video { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 10px; background: #000; }
.cm-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.cm-head { font-size: 13.5px; } .cm-head .muted { font-size: 12px; }
.cm-input { display: flex; gap: 6px; } .cm-input input { flex: 1; }
.link-btn { color: var(--danger); font-size: 12px; }
.sec-title { padding: 12px 16px 4px; font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.small-note { font-size: 12.5px; padding: 0 18px 6px; }
.sync-btn { width: calc(100% - 20px); padding: 13px; text-align: center; font-weight: 600; color: var(--accent); }
#contactsView .citem { background: var(--panel); margin: 0 10px 2px; }
.check-list { display: flex; flex-direction: column; gap: 4px; }
.check-row { display: flex; gap: 12px; align-items: center; padding: 6px 2px; font-size: 15px; flex-wrap: wrap; }
.check-row input, .adm-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.adm-list { display: flex; flex-direction: column; gap: 8px; max-height: 40vh; overflow-y: auto; }
.adm-row { display: flex; gap: 8px; align-items: center; background: var(--bg2); border-radius: 10px; padding: 8px; }
.adm-main { flex: 1; min-width: 0; }
.adm-row select { max-width: 120px; }
select { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.err { color: var(--danger); }

/* ===== Ism belgisi, stiker, GIF ===== */
.nbadge { margin-left: 4px; font-size: .95em; display: inline-block; vertical-align: -1px; }
.badge-preview { display: flex; align-items: center; gap: 10px; background: var(--bg2); border-radius: 12px; padding: 10px; }
.free-note { background: rgba(34,197,94,.12); color: var(--ok); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; font-weight: 600; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 46vh; overflow-y: auto; }
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; background: var(--bg2); border: 2px solid transparent; }
.badge-item.sel { border-color: var(--accent); }
.badge-item .be { font-size: 30px; } .badge-item .bn { font-size: 13px; font-weight: 600; } .badge-item .bp { font-size: 11.5px; color: var(--ok); } .badge-item .bp s { color: var(--muted); }
#picker { position: relative; background: var(--panel); border-top: 1px solid var(--line); height: min(340px, 45vh); display: flex; flex-direction: column; }
.pk-tabs { display: flex; gap: 4px; padding: 6px 8px 0; }
.pk-tabs button { flex: 1; padding: 7px; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 600; font-size: 14px; }
.pk-tabs button.active { color: var(--accent); background: var(--bg2); }
.pk-body { flex: 1; overflow-y: auto; padding: 6px 8px 10px; background: var(--bg2); }
.pk-sec { font-size: 12px; color: var(--muted); font-weight: 700; margin: 8px 4px 4px; text-transform: uppercase; }
.pk-grid { display: grid; gap: 2px; }
.pk-grid.emoji { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
.pk-grid.emoji button { font-size: 26px; height: 42px; border-radius: 8px; }
.pk-grid.emoji button:hover, .pk-grid.stk button:hover { background: var(--hover); }
.pk-grid.stk { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.pk-grid.stk button { height: 76px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; }
.pk-grid.stk img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pk-grid.stk .big-emoji { font-size: 50px; }
.pk-add { border: 2px dashed var(--muted) !important; color: var(--muted); font-size: 30px; }
#gifQ { width: 100%; margin-bottom: 6px; }
.pk-gifs { columns: 3 110px; column-gap: 4px; }
.pk-gifs button { display: block; width: 100%; margin-bottom: 4px; break-inside: avoid; border-radius: 8px; overflow: hidden; }
.pk-gifs img { width: 100%; display: block; }
.pk-note { color: var(--muted); font-size: 13.5px; padding: 12px 4px; column-span: all; }
.pk-upload { margin-top: 6px; }
.sticker { display: block; width: 180px; max-height: 200px; object-fit: contain; }
.sticker-emoji { font-size: 110px; line-height: 1.1; padding: 4px 8px; animation: stk-pop .5s ease-out; }
@keyframes stk-pop { 0% { transform: scale(.3); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.bubble:has(.sticker), .bubble:has(.sticker-emoji) { background: transparent !important; box-shadow: none !important; }
.bubble:has(.sticker) > .meta, .bubble:has(.sticker-emoji) > .meta { background: rgba(0,0,0,.45) !important; color: #fff !important; }
.gifimg { display: block; max-width: 320px; width: 100%; border-radius: 11px; background: rgba(0,0,0,.1); }
.gif-badge { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }

/* ===== BITIK Premium ===== */
.pstar { background: linear-gradient(135deg, #a855f7, #0ea5e9); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.avatar.prem { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px #a855f7; }
.prem-item { font-weight: 700; background: linear-gradient(90deg, rgba(168,85,247,.15), rgba(14,165,233,.15)) !important; }
.prem-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.prem-logo { font-size: 46px; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #a855f7, #0ea5e9); }
.prem-price { font-size: 15px; } .prem-price s { color: var(--muted); } .prem-price b { color: var(--ok); }
.prem-active { color: var(--ok); font-weight: 700; }
.perks { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.perk { display: flex; gap: 12px; align-items: flex-start; } .perk .pe { font-size: 24px; width: 32px; text-align: center; } .perk .muted { font-size: 13px; }
.prem-btn { background: linear-gradient(90deg, #a855f7, #0ea5e9) !important; }
