:root {
  --header: #f0f2f5;       /* panel/header gray */
  --search-bg: #f0f2f5;
  --hover: #f5f6f6;
  --active: #f0f2f5;
  --chat-bg: #efeae2;       /* chat wallpaper base */
  --bubble-out: #d9fdd3;    /* outgoing */
  --bubble-in: #ffffff;     /* incoming */
  --text: #111b21;
  --muted: #667781;
  --icon: #54656f;          /* flat icon color */
  --accent: #00a884;        /* WhatsApp Web green */
  --accent-dark: #008069;
  --online: #25d366;
  --tick: #53bdeb;
  --border: #e9edef;
  --avatar-bg: #dfe5e7;
  --avatar-fg: #fff;
  --shadow: 0 1px 0.5px rgba(11,20,26,0.13);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: #d1d7db; color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.screen { height: 100vh; height: 100dvh; }
.screen.center { display: flex; align-items: center; justify-content: center; }
[hidden] { display: none !important; }

/* icons */
svg.ic { width: 24px; height: 24px; display: block; }

/* thin WhatsApp scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Auth ---------- */
#auth { background: var(--accent-dark); }
#change { background: #d1d7db; }
#auth .card { border-top: 6px solid var(--accent-dark); }
.card { background: #fff; padding: 30px; border-radius: 8px; width: 360px; max-width: 92vw; box-shadow: 0 4px 18px rgba(0,0,0,0.25); text-align: center; }
.brand-logo, .empty-logo, .brand-emoji { display: flex; align-items: center; justify-content: center; }
.brand-logo svg, .empty-logo svg { width: 60px; height: 60px; color: var(--accent); }
.brand-emoji { font-size: 44px; }
.card h1 { margin: 8px 0 4px; font-size: 24px; color: var(--accent-dark); }
.subtitle { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
form { display: flex; flex-direction: column; gap: 12px; }
.card input { padding: 12px; border-radius: 8px; border: 1px solid #d6dce0; font-size: 15px; outline: none; }
.card input:focus { border-color: var(--accent); }
#auth-submit, .primary { padding: 12px; border: none; border-radius: 24px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 500; cursor: pointer; }
#auth-submit:hover, .primary:hover { background: var(--accent-dark); }
.error { color: #e2503b; font-size: 13px; margin: 0; }

/* ---------- Layout ---------- */
.layout { display: flex; height: 100vh; height: 100dvh; }
.sidebar { width: 30%; min-width: 300px; max-width: 420px; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--border); }
.conversation { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }

/* avatars */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--avatar-bg); color: var(--avatar-fg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.avatar svg { width: 100%; height: 100%; }
.avatar.lg { width: 49px; height: 49px; }

/* flat icon buttons */
.icon-btn { background: transparent; border: none; cursor: pointer; color: var(--icon); padding: 8px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.icon-btn:hover { background: rgba(0,0,0,0.05); }
.icon-btn.accent { color: var(--accent); }
.icon-btn.danger { color: #ea0038; }

/* ---------- Sidebar ---------- */
.side-header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--header); height: 59px; position: relative; }
.me-name { flex: 1; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-actions { display: flex; gap: 4px; }
.search-wrap { padding: 7px 12px; background: #fff; border-bottom: 1px solid var(--border); }
.search-box { display: flex; align-items: center; background: var(--search-bg); border-radius: 8px; padding: 0 12px; height: 35px; }
.search-icon { color: var(--icon); display: flex; }
.search-icon svg { width: 18px; height: 18px; }
.search-box input { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; padding: 0 8px; }

.conv-list { flex: 1; overflow-y: auto; }
.conv-row { display: flex; align-items: center; gap: 13px; padding: 0 16px; height: 72px; cursor: pointer; }
.conv-row:hover { background: var(--hover); }
.conv-row.active { background: var(--active); }
.conv-avatar-wrap { position: relative; flex-shrink: 0; }
.conv-avatar-wrap .avatar { width: 49px; height: 49px; }
.dot { position: absolute; bottom: 1px; right: 1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: #c4ccd1; }
.dot.on { background: var(--online); }
.conv-main { flex: 1; min-width: 0; border-top: 1px solid var(--border); height: 100%; display: flex; flex-direction: column; justify-content: center; }
.conv-row:first-child .conv-main { border-top: none; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv-name { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.conv-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.conv-preview { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.badge { background: var(--online); color: #fff; font-size: 12px; font-weight: 500; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- Conversation pane ---------- */
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 20px; background: #f0f2f5; border-bottom: 6px solid var(--accent); }
.empty-logo svg { width: 240px; height: 240px; color: #d9dee0; }
.empty-state h2 { font-size: 32px; font-weight: 300; color: #41525d; margin: 14px 0 8px; }
.active-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-header { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--header); height: 59px; position: relative; }
.header-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.header-text strong { font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status.typing { color: var(--accent); }
.back { display: none; }

.messages {
  flex: 1; overflow-y: auto; padding: 12px 6% 8px; display: flex; flex-direction: column; gap: 2px;
  background-color: var(--chat-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cg fill='%23000' fill-opacity='0.035'%3E%3Ccircle cx='20' cy='20' r='2.5'/%3E%3Cpath d='M58 14h14v3H58zM58 21h10v3H58z'/%3E%3Cpath d='M14 60c4 0 7-3 7-7s-3-7-7-7-7 3-7 7 3 7 7 7zm0-3a4 4 0 1 1 0-8 4 4 0 0 1 0 8z'/%3E%3Cpath d='M64 64l6-6-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2z'/%3E%3C/g%3E%3C/svg%3E");
}
.msg { max-width: 65%; display: flex; flex-direction: column; margin-bottom: 2px; }
.msg .bubble { background: var(--bubble-in); padding: 6px 9px 8px; border-radius: 8px; border-top-left-radius: 0; box-shadow: var(--shadow); position: relative; line-height: 1.35; font-size: 14.2px; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
/* tails */
.msg:not(.me) .bubble::before { content: ""; position: absolute; top: 0; left: -8px; width: 8px; height: 13px; background: var(--bubble-in); clip-path: polygon(100% 0, 100% 100%, 0 0); }
.msg.me { align-self: flex-end; }
.msg.me .bubble { background: var(--bubble-out); border-top-left-radius: 8px; border-top-right-radius: 0; }
.msg.me .bubble::before { content: ""; position: absolute; top: 0; right: -8px; width: 8px; height: 13px; background: var(--bubble-out); clip-path: polygon(0 0, 0 100%, 100% 0); }
.msg .sender { font-size: 12.8px; font-weight: 500; color: #1f8a70; margin-bottom: 2px; }
.msg.me .sender { display: none; }
.msg .meta { font-size: 11px; color: var(--muted); float: right; margin: 6px 0 -3px 10px; user-select: none; display: inline-flex; align-items: center; gap: 2px; }
.msg .meta .tick { color: var(--tick); font-size: 13px; }
.bubble img.photo { display: block; max-width: 330px; width: 100%; border-radius: 6px; cursor: pointer; }
.bubble .caption-text { margin-top: 4px; }
.bubble audio { display: block; width: 260px; max-width: 60vw; margin: 2px 0; }
.file-att { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; background: rgba(0,0,0,0.04); padding: 10px 12px; border-radius: 8px; min-width: 200px; }
.file-att .file-icon { color: var(--icon); display: flex; }
.file-att .file-name { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.file-att .file-size { font-size: 12px; color: var(--muted); }

/* ---------- Composer ---------- */
.composer { display: flex; flex-direction: row; align-items: center; gap: 6px; padding: 8px 14px; background: var(--header); }
.input-wrap { flex: 1; background: #fff; border-radius: 8px; padding: 0 12px; display: flex; align-items: center; min-height: 42px; }
.input-wrap input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; padding: 9px 0; }
.attach-wrap { position: relative; }
.attach-btn-rot svg { transform: rotate(0deg); }
.attach-menu { position: absolute; bottom: 54px; left: -4px; background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.25); padding: 8px; display: flex; flex-direction: column; min-width: 190px; z-index: 5; }
.attach-menu button { display: flex; align-items: center; gap: 14px; background: transparent; border: none; text-align: left; padding: 9px 12px; font-size: 14.5px; cursor: pointer; border-radius: 8px; color: var(--text); }
.attach-menu button:hover { background: var(--header); }
.attach-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.attach-icon svg { width: 20px; height: 20px; }
.attach-icon.doc { background: #7f66ff; }
.attach-icon.cam { background: #ff5e57; }
.attach-icon.photo { background: #007bfc; }

/* send circle (preview + recorder) */
.send-circle { width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.send-circle:hover { background: var(--accent-dark); }
.send-circle svg { width: 24px; height: 24px; }

/* ---------- Recording bar ---------- */
.recorder { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--header); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #ea0038; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.2; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 500; }
.rec-hint { color: var(--muted); font-size: 13px; flex: 1; }

/* ---------- Photo / file preview overlay ---------- */
.preview-overlay { position: absolute; inset: 0; z-index: 20; background: #f0f2f5; display: flex; flex-direction: column; }
.preview-top { height: 59px; display: flex; align-items: center; padding: 0 16px; background: var(--header); }
.preview-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; min-height: 0; }
.preview-body img { max-width: 70%; max-height: 100%; border-radius: 4px; object-fit: contain; }
.preview-body .file-chip { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.preview-body .file-chip .big-doc { width: 84px; height: 84px; color: var(--icon); }
.preview-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--header); }
.caption { flex: 1; padding: 11px 14px; border-radius: 8px; border: none; background: #fff; outline: none; font-size: 15px; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 40; }
.modal-card { background: #fff; border-radius: 12px; width: 400px; max-width: 92vw; max-height: 80vh; display: flex; flex-direction: column; padding: 18px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.modal-header strong { font-size: 18px; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 6px 0; }
.group-name { padding: 11px 14px; border-radius: 8px; border: 1px solid #d6dce0; font-size: 15px; outline: none; margin-bottom: 6px; }
.group-name:focus { border-color: var(--accent); }
.people-list { overflow-y: auto; flex: 1; margin-bottom: 8px; }
.person { display: flex; align-items: center; gap: 14px; padding: 9px 6px; border-radius: 8px; cursor: pointer; }
.person:hover { background: var(--header); }
.person .name { flex: 1; }
.person .presence { font-size: 12px; color: var(--muted); }
.person .presence.on { color: var(--online); }
.people-list.checks .person input { width: 18px; height: 18px; accent-color: var(--accent); }
#create-group { margin-top: 4px; }

/* ---------- ticks (sent / delivered / read) ---------- */
.tick { display: inline-flex; align-items: center; }
.tick-ic { width: 16px; height: 11px; display: block; }
.tick.sent, .tick.delivered { color: #8696a0; }
.tick.read { color: var(--tick); }

/* ---------- system message ---------- */
.system { align-self: center; background: #ffffff; color: #54656f; font-size: 12.5px; padding: 5px 12px; border-radius: 8px; margin: 8px 0; box-shadow: var(--shadow); text-align: center; max-width: 80%; }

/* ---------- dropdown menus ---------- */
.dropdown { position: absolute; top: 52px; right: 12px; background: #fff; border-radius: 8px; box-shadow: 0 2px 14px rgba(0,0,0,0.25); padding: 6px 0; min-width: 200px; z-index: 30; }
.menu-label { font-size: 12px; color: var(--muted); padding: 8px 16px 4px; }
.menu-item { display: flex; align-items: center; justify-content: space-between; width: 100%; background: transparent; border: none; text-align: left; padding: 10px 16px; font-size: 14.5px; cursor: pointer; color: var(--text); }
.menu-item:hover { background: var(--header); }
.menu-item .chk { color: var(--accent); font-weight: 700; }
.menu-item.danger-item { color: #ea0038; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; font-size: 14.5px; cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Admin console ---------- */
#admin { display: flex; flex-direction: column; background: #f0f2f5; }
.admin-top { display: flex; align-items: center; gap: 18px; padding: 12px 20px; background: var(--accent-dark); color: #fff; }
.admin-top strong { font-size: 17px; }
.admin-tabs { display: flex; gap: 8px; }
.atab { background: rgba(255,255,255,0.15); color: #fff; border: none; padding: 7px 16px; border-radius: 18px; cursor: pointer; font-size: 14px; }
.atab.active { background: #fff; color: var(--accent-dark); font-weight: 600; }
.admin-me { margin-left: auto; font-size: 13px; opacity: 0.9; }
.admin-top .icon-btn { color: #fff; }
.admin-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.admin-bar { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.admin-bar .primary { border-radius: 8px; padding: 9px 16px; }
.admin-hint { color: var(--muted); font-size: 13px; }
.admin-list { flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.admin-user-row { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
.admin-user-row .avatar { width: 40px; height: 40px; }
.admin-user-row .u-main { flex: 1; min-width: 0; }
.admin-user-row .u-name { font-weight: 500; }
.admin-user-row .u-sub { font-size: 12px; color: var(--muted); }
.admin-user-row button { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.admin-user-row button:hover { background: var(--header); }
.admin-user-row button.danger { color: #ea0038; border-color: #f3c2c8; }

.admin-split { flex: 1; display: flex; min-height: 0; }
.admin-conv-list { width: 34%; min-width: 280px; max-width: 420px; overflow-y: auto; background: #fff; border-right: 1px solid var(--border); }
.admin-conv-row { padding: 12px 18px; border-bottom: 1px solid var(--border); cursor: pointer; }
.admin-conv-row:hover, .admin-conv-row.active { background: var(--header); }
.admin-conv-row .c-title { font-weight: 500; }
.admin-conv-row .c-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-msgs { flex: 1; overflow-y: auto; padding: 18px 8%; background-color: var(--chat-bg); }
.admin-empty { color: var(--muted); text-align: center; margin-top: 40px; }
.admin-msg { margin-bottom: 8px; max-width: 70%; }
.admin-msg .a-bubble { background: #fff; border-radius: 8px; padding: 6px 10px 8px; box-shadow: var(--shadow); display: inline-block; }
.admin-msg .a-sender { font-size: 12.5px; font-weight: 600; color: #1f8a70; }
.admin-msg .a-time { font-size: 11px; color: var(--muted); margin-left: 8px; }
.admin-msg.sys { text-align: center; max-width: none; }
.admin-msg.sys .a-bubble { background: #fff; color: #54656f; font-size: 12.5px; }

/* ---------- Calls ---------- */
.call-btn { width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center; }
.call-btn svg { width: 28px; height: 28px; }
.call-btn.accept { background: var(--online); }
.call-btn.decline { background: #ea0038; }
.call-btn.neutral { background: rgba(255,255,255,0.18); }
.call-btn.neutral.off { background: #fff; color: #111b21; }

.incoming { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 60; display: flex; align-items: center; justify-content: center; }
.incoming-card { background: #233138; color: #fff; border-radius: 16px; padding: 28px 34px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.incoming-card .avatar.lg { width: 84px; height: 84px; margin: 0 auto 14px; }
.incoming-title { font-size: 20px; font-weight: 600; }
.incoming-sub { color: #aebac1; font-size: 14px; margin-top: 4px; }
.incoming-actions { display: flex; gap: 60px; justify-content: center; margin-top: 26px; }
.call-btn.accept { animation: shake 1s infinite; }
@keyframes shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

.call-overlay { position: fixed; inset: 0; background: #0b141a; z-index: 60; display: flex; flex-direction: column; }
.call-top { padding: 16px; text-align: center; color: #fff; }
.call-top strong { display: block; font-size: 18px; }
.call-status { color: #aebac1; font-size: 13px; }
.call-grid { flex: 1; display: grid; gap: 6px; padding: 6px; grid-template-columns: 1fr; min-height: 0; }
.call-grid.two { grid-template-columns: 1fr 1fr; }
.call-grid.many { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; }
.call-tile { position: relative; background: #233138; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 0; }
.call-tile video { width: 100%; height: 100%; object-fit: cover; }
.call-tile .tile-avatar { width: 96px; height: 96px; }
.call-tile .tile-name { position: absolute; bottom: 8px; left: 10px; color: #fff; font-size: 13px; background: rgba(0,0,0,0.4); padding: 2px 8px; border-radius: 8px; }
.local-video { position: absolute; right: 16px; bottom: 96px; width: 130px; height: 180px; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255,255,255,0.25); background: #233138; z-index: 2; }
.call-controls { display: flex; gap: 26px; justify-content: center; padding: 20px; }

@media (max-width: 768px) {
  .local-video { width: 96px; height: 132px; bottom: 92px; right: 12px; }
}

/* ---------- Login splash ("Stay Safe") ---------- */
.splash {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #00c98f 0%, #00a884 38%, #075e54 100%);
  perspective: 800px; transition: opacity 0.5s ease;
}
.splash.hide { opacity: 0; }
.splash-inner { text-align: center; color: #fff; transform-style: preserve-3d; animation: splashPop 0.7s cubic-bezier(.2,.9,.3,1.3) both; }
.splash-badge { width: 130px; height: 130px; margin: 0 auto 18px; filter: drop-shadow(0 12px 24px rgba(0,0,0,0.35)); animation: badgeFloat 2s ease-in-out infinite; }
.splash-badge svg { width: 100%; height: 100%; }
.splash-badge .shield { transform-origin: center; animation: shieldIn 0.6s ease-out both; }
.splash-badge .tick { stroke-dasharray: 90; stroke-dashoffset: 90; animation: drawTick 0.5s 0.45s ease-out forwards; }
.splash-name { font-size: 34px; font-weight: 700; letter-spacing: 0.5px; text-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.splash-sub { font-size: 15px; opacity: 0.9; margin-top: 4px; }
@keyframes splashPop { 0% { opacity: 0; transform: translateZ(-120px) scale(0.8); } 100% { opacity: 1; transform: translateZ(0) scale(1); } }
@keyframes badgeFloat { 0%,100% { transform: rotateX(8deg) translateY(0); } 50% { transform: rotateX(8deg) translateY(-8px); } }
@keyframes shieldIn { 0% { transform: scale(0.3) rotate(-12deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes drawTick { to { stroke-dashoffset: 0; } }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 50; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 4px; }

/* ---------- Mobile ---------- */
/* Floating "new chat" button — mobile only */
.fab { display: none; }

@media (max-width: 768px) {
  .sidebar { width: 100%; max-width: none; }
  .conversation { display: none; }
  .layout.viewing .sidebar { display: none; }
  .layout.viewing .conversation { display: flex; }
  .back { display: inline-flex; }
  .msg { max-width: 82%; }
  .messages { padding: 12px 14px 8px; }
  .preview-body img { max-width: 100%; }

  /* --- WhatsApp-mobile green look + depth --- */
  .side-header,
  .chat-header {
    background: linear-gradient(180deg, #027a63 0%, var(--accent-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    height: 62px;
    position: relative; z-index: 5;
  }
  .side-header .me-name,
  .chat-header .header-text strong { color: #fff; font-weight: 600; }
  .side-header .icon-btn,
  .chat-header .icon-btn,
  .chat-header .back { color: #fff; }
  .side-header .icon-btn:hover,
  .chat-header .icon-btn:hover { background: rgba(255, 255, 255, 0.18); }
  .side-header .avatar { background: rgba(255, 255, 255, 0.25); }
  .chat-header .avatar { background: rgba(255, 255, 255, 0.25); box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
  .chat-header .status { color: rgba(255, 255, 255, 0.85); }
  .chat-header .status.typing { color: #d7f5e9; }

  /* search bar with a touch of elevation */
  .search-wrap { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
  .search-box { box-shadow: inset 0 1px 2px rgba(0,0,0,0.06); }

  /* deeper, rounder chat bubbles (3D feel) */
  .msg .bubble { box-shadow: 0 1px 2px rgba(0,0,0,0.18); border-radius: 12px; }
  .msg:not(.me) .bubble { border-top-left-radius: 2px; }
  .msg.me .bubble { border-top-right-radius: 2px; }

  /* conversation rows get a subtle lift */
  .conv-row.active { background: #e7f7f1; }

  /* floating action button (new chat) */
  .fab {
    display: flex; position: fixed; right: 16px; bottom: 20px;
    width: 58px; height: 58px; border-radius: 18px; border: none;
    background: linear-gradient(145deg, #25d366 0%, var(--accent) 100%);
    color: #fff; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 122, 99, 0.45); z-index: 20;
  }
  .fab:active { transform: scale(0.94); }
  .fab svg { width: 26px; height: 26px; }
  .layout.viewing .fab { display: none; }

  /* round call buttons get more depth */
  .send-circle, .round-btn { box-shadow: 0 3px 8px rgba(0,0,0,0.25); }
}
