/* ============ Tiya — app styles (dark, WhatsApp-inspired) ============ */
:root {
  --bg: #0b141a;
  --panel: #111b21;
  --panel2: #202c33;
  --panel3: #2a3942;
  --line: #222d34;
  --txt: #e9edef;
  --dim: #8696a0;
  --acc: #00a884;
  --acc-d: #008f72;
  --acc-soft: rgba(0, 168, 132, .14);
  --bubble-out: #005c4b;
  --bubble-in: #202c33;
  --err: #f15c6d;
  --read: #53bdeb;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --meta: rgba(233, 237, 239, .55);
  --reply-bg: rgba(0, 0, 0, .18);
  --dot: rgba(255, 255, 255, .028);
  --rad: 12px;
}

:root[data-theme="light"] {
  --bg: #eef2f5;
  --panel: #ffffff;
  --panel2: #f0f2f5;
  --panel3: #e2e8ec;
  --line: #dde4e9;
  --txt: #111b21;
  --dim: #64747e;
  --acc: #00a884;
  --acc-d: #008f72;
  --acc-soft: rgba(0, 168, 132, .12);
  --bubble-out: #d9fdd3;
  --bubble-in: #ffffff;
  --err: #ea3e54;
  --read: #2f9fd8;
  --shadow: 0 10px 32px rgba(20, 40, 50, .16);
  --meta: rgba(17, 27, 33, .45);
  --reply-bg: rgba(0, 0, 0, .06);
  --dot: rgba(0, 0, 0, .035);
}

:root[data-theme="neon"] {
  --bg: #06050c;
  --panel: #0d0c18;
  --panel2: #141225;
  --panel3: #1d1a33;
  --line: #2c2750;
  --txt: #eef0ff;
  --dim: #8f8ac2;
  --acc: #00f0ff;
  --acc-d: #00c2d1;
  --acc-soft: rgba(0, 240, 255, .14);
  --bubble-out: #241040;
  --bubble-in: #141225;
  --err: #ff3b7d;
  --read: #00f0ff;
  --shadow: 0 10px 40px rgba(255, 0, 220, .22);
  --meta: rgba(238, 240, 255, .55);
  --reply-bg: rgba(255, 255, 255, .06);
  --dot: rgba(0, 240, 255, .05);
  --grad: linear-gradient(135deg, #ff2fd0, #00f0ff);
}
:root[data-theme="neon"] .btn,
:root[data-theme="neon"] .send-btn { box-shadow: 0 0 18px rgba(0, 240, 255, .45); }
:root[data-theme="neon"] .call-ctl.hang,
:root[data-theme="neon"] .call-btn.accept { box-shadow: 0 0 20px currentColor; }
:root[data-theme="neon"] .avatar img,
:root[data-theme="neon"] .chat-item.active { box-shadow: 0 0 12px rgba(0, 240, 255, .35); }
:root[data-theme="neon"] .side-title { filter: drop-shadow(0 0 6px rgba(255, 47, 208, .5)); }

:root[data-theme="retro"] {
  --bg: #1a1410;
  --panel: #241c15;
  --panel2: #2e2318;
  --panel3: #3a2c1d;
  --line: #4a3826;
  --txt: #f4e4c8;
  --dim: #b09070;
  --acc: #ff9d3f;
  --acc-d: #e8822a;
  --acc-soft: rgba(255, 157, 63, .16);
  --bubble-out: #4a3220;
  --bubble-in: #2e2318;
  --err: #e85d4a;
  --read: #ffcc66;
  --shadow: 0 10px 40px rgba(0, 0, 0, .6);
  --meta: rgba(244, 228, 200, .55);
  --reply-bg: rgba(0, 0, 0, .22);
  --dot: rgba(255, 157, 63, .05);
  --grad: linear-gradient(135deg, #ff9d3f, #e0562e);
}
:root[data-theme="retro"] body { font-family: Georgia, 'Times New Roman', serif; }
:root[data-theme="retro"] .composer-input,
:root[data-theme="retro"] .text-input { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overscroll-behavior-y: none; }
body {
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--txt);
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--acc); }
img, video { max-width: 100%; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: rgba(134, 150, 160, .35); border-radius: 4px; }

/* ============ boot splash ============ */
.boot { height: 100vh; display: flex; align-items: center; justify-content: center; }
.boot-logo {
  width: 76px; height: 76px; border-radius: 20px;
  background: linear-gradient(135deg, #00a884, #0b7f8f);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 38px; font-weight: 800;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.08); opacity: .85; } }

/* ============ auth ============ */
.auth-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 168, 132, .10), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(11, 127, 143, .10), transparent 45%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 36px 32px;
  text-align: center; box-shadow: var(--shadow);
}
.auth-logo {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px;
  background: linear-gradient(135deg, #00a884, #0b7f8f);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 30px; font-weight: 800;
}
.auth-logo-img {
  width: 72px; height: 72px; margin: 0 auto 14px; display: block;
  border-radius: 18px; object-fit: contain;
}
.side-logo { width: 26px; height: 26px; border-radius: 7px; object-fit: contain; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-sub { margin-bottom: 22px; }
.auth-err {
  background: rgba(241, 92, 109, .12); border: 1px solid rgba(241, 92, 109, .4);
  color: #ffb3bc; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px;
}
.auth-switch { margin-top: 18px; font-size: 13.5px; color: var(--dim); }

/* ============ inputs & buttons ============ */
.text-input {
  width: 100%; padding: 11px 14px; margin-bottom: 10px;
  background: var(--panel2); color: var(--txt);
  border: 1px solid var(--line); border-radius: 9px; font-size: 14.5px; outline: none;
}
.text-input:focus { border-color: var(--acc); }
.btn {
  padding: 11px 22px; color: #fff;
  background: linear-gradient(135deg, #00a884, #029d90);
  border-radius: 9px; font-weight: 600; font-size: 14.5px;
  transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--txt); }
.btn.ghost:hover { background: var(--panel2); }
.btn.danger { background: var(--err); }
.btn.full { width: 100%; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--dim); transition: background .15s; flex-shrink: 0;
}
.icon-btn:hover { background: var(--panel3); color: var(--txt); }

/* ============ shell layout ============ */
.shell { display: flex; height: 100vh; height: 100dvh; }
.sidebar {
  width: 400px; min-width: 320px; background: var(--panel);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.main-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.side-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--panel2);
}
.side-me { cursor: pointer; }
.side-title { font-weight: 700; font-size: 17px; flex: 1; display: flex; align-items: center; gap: 8px; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); display: inline-block; }
.conn-dot.off { background: var(--err); animation: pulse 1s infinite; }
.side-actions { display: flex; gap: 2px; }

.side-tabs { display: flex; border-bottom: 1px solid var(--line); }
.side-tab {
  flex: 1; padding: 11px 0; font-size: 13.5px; color: var(--dim);
  border-bottom: 2.5px solid transparent; font-weight: 600;
}
.side-tab.on { color: var(--acc); border-bottom-color: var(--acc); }
.side-list { flex: 1; overflow-y: auto; padding-bottom: 20px; }

.empty-side { text-align: center; padding: 60px 24px; color: var(--dim); }
.empty-emoji { font-size: 44px; margin-bottom: 10px; }
.empty-emoji.big { font-size: 64px; }
.empty-side p { margin-bottom: 16px; }

/* ============ chat list item ============ */
.chat-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 16px; cursor: pointer; transition: background .12s;
}
.chat-item:hover { background: var(--panel2); }
.chat-item.active { background: var(--panel3); box-shadow: inset 3px 0 0 var(--acc); }
.chat-item-av { position: relative; flex-shrink: 0; }
.online-dot {
  position: absolute; bottom: 1px; right: 1px; width: 12px; height: 12px;
  background: var(--acc); border: 2.5px solid var(--panel); border-radius: 50%;
}
.chat-item-mid { flex: 1; min-width: 0; }
.chat-item-name { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-name.missed { color: var(--err); }
.chat-item-preview {
  color: var(--dim); font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.chat-item-preview.typing { color: var(--acc); }
.missed { color: var(--err); }
.chat-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.chat-item-time { font-size: 11.5px; color: var(--dim); }
.chat-item-time.unread { color: var(--acc); font-weight: 700; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--acc); color: #fff; font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ============ avatar ============ */
.avatar {
  border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel3); color: #fff; font-weight: 700; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-group { background: linear-gradient(135deg, #00a884, #0b7f8f); }

/* ============ chat panel ============ */
.panel-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--dim); gap: 8px;
  border-bottom: 5px solid var(--acc); text-align: center; padding: 24px;
}
.panel-loading { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 26px; }

.chat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; background: var(--panel2); z-index: 2;
}
.back-btn { display: none; }
.chat-head-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.chat-title { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { font-size: 12.5px; color: var(--dim); }
.chat-head-actions { display: flex; gap: 2px; }

.msg-list {
  flex: 1; overflow-y: auto; padding: 18px 7% 12px;
  background:
    radial-gradient(var(--dot) 1.2px, transparent 1.2px),
    radial-gradient(circle at 20% 30%, rgba(0, 168, 132, .04), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(11, 127, 143, .04), transparent 40%),
    var(--bg);
  background-size: 24px 24px, auto, auto, auto;
  display: flex; flex-direction: column;
}
.msg-row, .day-sep, .sys-msg { margin-top: 10px; }
.msg-row.grouped { margin-top: 2px; }
.day-sep { text-align: center; margin: 14px 0 8px; }
.day-sep span {
  background: var(--panel2); color: var(--dim); font-size: 12px;
  padding: 5px 13px; border-radius: 8px;
}
.sys-msg { text-align: center; margin: 6px 0; }
.sys-msg span {
  background: var(--panel2); color: var(--dim); font-size: 12.5px;
  padding: 5px 13px; border-radius: 8px;
}

.msg-row { display: flex; align-items: center; gap: 6px; max-width: 72%; }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-row.theirs { align-self: flex-start; }
.msg-actions { opacity: 0; display: flex; transition: opacity .15s; }
.msg-row:hover .msg-actions { opacity: 1; }
.msg-act {
  width: 28px; height: 28px; border-radius: 50%; color: var(--dim); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.msg-act:hover { background: var(--panel2); }

.bubble {
  background: var(--bubble-in); border-radius: 12px; padding: 7px 10px 5px;
  min-width: 90px; max-width: 100%; box-shadow: 0 1px 1.5px rgba(0, 0, 0, .18);
  position: relative; overflow-wrap: break-word;
}
.mine .bubble { background: var(--bubble-out); border-bottom-right-radius: 4px; }
.theirs .bubble { border-bottom-left-radius: 4px; }
.grouped.mine .bubble { border-radius: 12px; }
.grouped.theirs .bubble { border-radius: 12px; }
.msg-sender { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; }
.msg-text { font-size: 14.5px; white-space: pre-wrap; }
.msg-text a { color: #7fd4c1; }
.msg-meta {
  display: flex; justify-content: flex-end; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--meta); margin-top: 3px;
}
.ticks { letter-spacing: -2px; font-size: 12px; }
.ticks.read, .mine .ticks.read { color: var(--read); }
.msg-deleted { font-size: 13.5px; color: var(--dim); font-style: italic; }

.msg-reply {
  border-left: 3.5px solid var(--acc); background: var(--reply-bg);
  border-radius: 6px; padding: 5px 9px; margin-bottom: 5px;
  display: flex; flex-direction: column; font-size: 12.5px;
}
.reply-who { color: var(--acc); font-weight: 700; }
.reply-txt { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }

.msg-img { border-radius: 8px; max-height: 320px; display: block; }
.msg-video { border-radius: 8px; max-height: 320px; display: block; }
.msg-audio { width: 260px; max-width: 100%; height: 38px; }
.msg-file {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  color: var(--txt); background: var(--reply-bg); padding: 9px 12px; border-radius: 8px;
}
.file-ico { font-size: 26px; }
.file-meta { display: flex; flex-direction: column; min-width: 0; }
.file-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.file-size { font-size: 11.5px; color: var(--dim); }

/* ============ composer ============ */
.composer-wrap { background: var(--panel2); }
.reply-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px 0;
}
.reply-bar .reply-preview {
  flex: 1; border-left: 3.5px solid var(--acc); background: var(--panel3);
  border-radius: 6px; padding: 6px 10px; display: flex; flex-direction: column; font-size: 12.5px;
  min-width: 0;
}
.composer { display: flex; align-items: flex-end; gap: 4px; padding: 9px 12px; }
.composer-input {
  flex: 1; resize: none; border: none; outline: none;
  background: var(--panel3); color: var(--txt);
  border-radius: 10px; padding: 10px 14px; font: inherit; font-size: 14.5px;
  max-height: 140px;
}
.send-btn {
  width: 42px; height: 42px; border-radius: 50%; background: var(--acc);
  color: #fff; font-size: 17px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.send-btn:hover { background: var(--acc-d); }
.mic-btn.rec { background: var(--err); color: #fff; border-radius: 20px; width: auto; padding: 0 12px; font-size: 13px; }

/* ============ modals & toasts ============ */
.overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  opacity: 0; transition: opacity .18s;
}
.overlay.show { opacity: 1; }
.modal {
  width: 100%; max-width: 440px; max-height: 86vh; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transform: translateY(12px); transition: transform .18s;
}
.overlay.show .modal { transform: none; }
.modal.wide { max-width: 620px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 10px;
}
.modal-title { font-weight: 700; font-size: 17px; }
.modal-body { padding: 8px 20px 22px; overflow-y: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.confirm-text { text-align: center; color: var(--dim); }
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin: 12px 0 6px; }
.sec-line { border-top: 1px solid var(--line); margin: 16px 0 8px; }
.muted { color: var(--dim); }
.tag {
  font-size: 10.5px; background: var(--acc-soft); color: var(--acc);
  padding: 3px 8px; border-radius: 6px; font-weight: 700;
}
.chk-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; padding: 6px 0; }
.chk-row input { width: 17px; height: 17px; accent-color: var(--acc); }

.user-list { max-height: 320px; overflow-y: auto; }
.user-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 8px;
  border-radius: 10px; cursor: pointer;
}
.user-row:hover { background: var(--panel2); }
.user-row.static { cursor: default; }
.user-row.sel { background: var(--acc-soft); }
.user-row-mid { flex: 1; min-width: 0; }
.user-row-name { font-weight: 600; font-size: 14.5px; }
.user-row-sub { font-size: 12.5px; color: var(--dim); }
.check { color: var(--acc); font-weight: 800; width: 22px; text-align: center; }

.profile-view { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.profile-view .text-input { margin-bottom: 0; margin-top: 8px; }
.profile-view .about { font-size: 14px; }
.profile-av { position: relative; cursor: pointer; }
.profile-av-edit {
  position: absolute; bottom: 0; right: 0; width: 30px; height: 30px;
  background: var(--acc); border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 14px; border: 2.5px solid var(--panel);
}

.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-btn { font-size: 24px; padding: 6px; border-radius: 8px; }
.emoji-btn:hover { background: var(--panel2); }

#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--panel3); color: var(--txt); padding: 10px 20px;
  border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); transition: all .25s;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: #5b2730; color: #ffc4cb; }

/* ============ calls ============ */
.call-incoming {
  position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .72);
  display: flex; align-items: center; justify-content: center;
}
.ci-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 36px 44px; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 10px; box-shadow: var(--shadow);
  animation: slideup .25s ease;
}
@keyframes slideup { from { transform: translateY(20px); opacity: 0; } }
.ci-actions { display: flex; gap: 34px; margin-top: 16px; }
.call-btn {
  width: 62px; height: 62px; border-radius: 50%; font-size: 24px; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.call-btn.accept { background: var(--acc); animation: pulse 1.2s infinite; }
.call-btn.decline { background: var(--err); }

.call-ui {
  position: fixed; inset: 0; z-index: 200;
  background: radial-gradient(circle at 50% 28%, #14242e, #0a0f13 75%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #e9edef;
}
.audio-stage .avatar { box-shadow: 0 0 0 10px rgba(0, 168, 132, .12), 0 0 0 22px rgba(0, 168, 132, .05); }
.audio-stage { display: flex; flex-direction: column; align-items: center; }
.video-stage { position: absolute; inset: 0; }
.video-stage video#remoteMedia { width: 100%; height: 100%; object-fit: contain; background: #000; }
.local-pip {
  position: absolute; right: 18px; bottom: 110px; width: 200px; max-width: 32vw;
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); z-index: 2;
  background: #000;
}
.local-pip video { width: 100%; display: block; transform: scaleX(-1); }
.call-info { text-align: center; margin-top: 18px; z-index: 2; }
.call-ui.video .call-info {
  position: absolute; top: 22px; left: 0; right: 0; margin: 0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}
.call-timer { font-size: 14px; color: var(--acc); margin-top: 4px; font-variant-numeric: tabular-nums; }
.call-controls {
  position: absolute; bottom: 30px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 18px; z-index: 3;
}
.call-ctl {
  width: 54px; height: 54px; border-radius: 50%; background: var(--panel3);
  font-size: 21px; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.call-ctl:hover { background: #3b4a54; }
.call-ctl.off { background: var(--err); }
.call-ctl.on { background: var(--acc); }
.call-ctl.hang { background: var(--err); transform: rotate(135deg); }

/* ============ meetings ============ */
.meet-ui {
  position: fixed; inset: 0; z-index: 200; background: #0a0f13;
  display: flex; flex-direction: column;
}
.meet-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: rgba(17, 27, 33, .9);
}
.meet-grid {
  flex: 1; display: grid; gap: 10px; padding: 12px;
  align-content: center; overflow: auto;
}
.meet-tile {
  position: relative; background: var(--panel2); border-radius: 12px; overflow: hidden;
  aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center;
  min-height: 120px;
}
.meet-tile video { width: 100%; height: 100%; object-fit: cover; }
.meet-tile.me video { transform: scaleX(-1); }
.meet-tile .tile-avatar { display: none; position: absolute; }
.meet-tile.cam-off video { visibility: hidden; }
.meet-tile.cam-off .tile-avatar { display: block; }
.meet-tile.connecting::after {
  content: 'connecting…'; position: absolute; top: 8px; right: 10px;
  font-size: 11px; color: var(--dim);
}
.tile-name {
  position: absolute; left: 10px; bottom: 8px; font-size: 12.5px; font-weight: 600;
  background: rgba(0, 0, 0, .45); padding: 3px 9px; border-radius: 6px;
}
.meet-controls { position: static; padding: 16px 0 26px; }
.meet-actions { display: flex; flex-direction: column; gap: 9px; padding: 16px; }
.meet-code {
  font-family: Consolas, monospace; font-size: 22px; letter-spacing: 1px;
  background: var(--panel2); border: 1px dashed var(--acc); border-radius: 10px;
  padding: 10px 22px; color: var(--acc); margin: 8px 0;
}
.lobby { display: flex; flex-direction: column; align-items: center; text-align: center; }
.lobby-preview {
  width: 100%; max-height: 240px; border-radius: 12px; background: #000;
  transform: scaleX(-1); object-fit: cover;
}
.lobby-novideo {
  width: 100%; height: 180px; border-radius: 12px; background: var(--panel2);
  display: flex; align-items: center; justify-content: center;
}

/* ============ PWA install banner ============ */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 150;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow); animation: slideup .3s ease;
}
.install-banner img { width: 42px; height: 42px; border-radius: 10px; }
.ib-txt { flex: 1; min-width: 0; }
.ib-title { font-weight: 700; font-size: 14.5px; }
.ib-sub { font-size: 12px; color: var(--dim); }
.ios-steps p { margin: 10px 0; font-size: 14.5px; }
@media (min-width: 900px) {
  .install-banner { left: auto; right: 20px; max-width: 380px; }
}

/* ============ v2 visual refresh ============ */
.side-head { padding: 13px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.side-title { font-size: 18px; font-weight: 800; letter-spacing: -.2px; display: flex; align-items: center; gap: 8px; }

.side-tabs { padding: 10px 10px 4px; gap: 6px; border-bottom: none; }
.side-tab {
  border-radius: 999px; border-bottom: none; padding: 8px 0;
  transition: background .15s, color .15s;
}
.side-tab.on { background: var(--acc-soft); color: var(--acc); }
.side-tab:hover:not(.on) { background: var(--panel2); }

.side-search { margin: 8px 12px 4px; position: relative; }
.side-search input {
  width: 100%; padding: 9px 14px 9px 36px; border-radius: 999px;
  background: var(--panel2); border: 1px solid transparent;
  color: var(--txt); outline: none; font-size: 13.5px;
}
.side-search input:focus { border-color: var(--acc); background: var(--bg); }
.side-search input::placeholder { color: var(--dim); }
.side-search .ico { position: absolute; left: 13px; top: 8px; font-size: 13px; opacity: .7; }

.side-list { padding: 4px 8px 20px; }
.chat-item { border-radius: 12px; padding: 10px 10px; margin-bottom: 1px; }
.chat-item.active { background: var(--acc-soft); box-shadow: none; }

.chat-head { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }

.composer-wrap { background: var(--panel); border-top: 1px solid var(--line); }
.composer { padding: 10px 14px 12px; }
.composer-input { border-radius: 22px; padding: 11px 18px; }
.send-btn {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #00a884, #029d90);
  box-shadow: 0 4px 14px rgba(0, 168, 132, .35);
  transition: transform .12s, filter .15s;
}
.send-btn:hover { transform: scale(1.06); filter: brightness(1.08); }

.bubble { border-radius: 14px; padding: 8px 12px 6px; }
.mine .bubble { border-bottom-right-radius: 5px; }
.theirs .bubble { border-bottom-left-radius: 5px; }
.badge { background: linear-gradient(135deg, #00a884, #02a695); }

.panel-empty { border-bottom: none; }
.panel-empty .empty-emoji.big {
  width: 116px; height: 116px; border-radius: 50%;
  background: var(--acc-soft); display: flex; align-items: center; justify-content: center;
  font-size: 54px; margin-bottom: 8px;
}

.chat-item-flags { display: flex; align-items: center; gap: 5px; }
.muted-ico { color: var(--dim); display: inline-flex; }

.ib-emoji {
  width: 42px; height: 42px; border-radius: 10px; background: var(--acc-soft);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.meet-tile { border-radius: 16px; }
.modal { border-radius: 18px; }

/* ============ SVG icons ============ */
.ic { display: inline-flex; align-items: center; justify-content: center; }
.ic svg { display: block; }
.ic-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.side-tab { display: flex; align-items: center; justify-content: center; gap: 6px; }
.msg-act .ic svg { width: 14px; height: 14px; }
.mic-btn.rec { font-variant-numeric: tabular-nums; }

/* ============ v3 — brand & delight ============ */
body {
  font-family: 'Plus Jakarta Sans', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: -.1px;
}

:root { --grad: linear-gradient(135deg, #00b894, #00a4bd); }

.btn, .send-btn, .badge, .call-btn.accept { background: var(--grad); }
.logo, .auth-logo, .boot-logo, .avatar-group { background: var(--grad); }

.side-title { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.side-title .conn-dot { -webkit-text-fill-color: initial; }

.tab-badge {
  min-width: 17px; height: 17px; padding: 0 5px; margin-left: 5px;
  border-radius: 9px; background: var(--err); color: #fff;
  font-size: 10.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

.people-search { padding: 12px 14px 4px; }
.people-search .text-input { border-radius: 12px; }
.people-row { margin: 2px 8px; border-radius: 12px; }
.people-row .btn.sm { padding: 7px 16px; border-radius: 999px; }
.btn.sm.ghost { background: var(--acc-soft); color: var(--acc); }

.chat-item-av .avatar { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.overlay { backdrop-filter: blur(4px); }
.modal { border: none; }

.msg-row { animation: msgIn .16s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }

.chat-item, .user-row, .side-tab, .icon-btn, .call-ctl { -webkit-tap-highlight-color: transparent; }

.auth-card { border: none; }
.auth-logo-img, .auth-logo { box-shadow: 0 10px 30px rgba(0, 168, 132, .35); }

.call-ctl { backdrop-filter: blur(6px); background: rgba(42, 57, 66, .8); }
.call-ctl.off { background: var(--err); }
.call-ctl.hang { background: var(--err); }
.ci-card { border: none; }

::-webkit-scrollbar { width: 5px; }

/* ============ Lite Mode badge ============ */
.lite-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255, 204, 0, .16); color: #ffcc00;
  border: 1px solid rgba(255, 204, 0, .35);
  font-size: 11px; font-weight: 700; padding: 3px 9px 3px 7px;
  border-radius: 999px; vertical-align: middle;
}
.lite-badge .ic svg { width: 12px; height: 12px; }
.chk-row .ic { display: inline-flex; vertical-align: -3px; margin-right: 2px; }

/* ============ theme picker ============ */
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.theme-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 10px; border-radius: 14px; border: 2px solid transparent;
  background: var(--panel2); font-size: 13px; font-weight: 600; color: var(--txt);
}
.theme-swatch.on { border-color: var(--acc); background: var(--acc-soft); }
.theme-swatch-color {
  width: 56px; height: 40px; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(255, 255, 255, .12);
}

/* ============ responsive ============ */
@media (max-width: 900px) {
  .sidebar { width: 100%; min-width: 0; border-right: none; }
  .main { display: none; }
  .shell.chat-open .sidebar { display: none; }
  .shell.chat-open .main { display: flex; }
  .back-btn { display: inline-flex; }
  .msg-list { padding: 14px 4% 10px; }
  .msg-row { max-width: 88%; }
  .local-pip { width: 110px; bottom: 120px; }
  .meet-grid { align-content: start; }
  .modal { max-height: 92vh; }
}
