/* ============ Kalam design system ============ */
:root {
  --font: "Tajawal", "Inter", system-ui, sans-serif;
  --radius: 18px;
  --tr: 0.22s cubic-bezier(0.2, 0.8, 0.25, 1);
}
/* accent themes */
[data-theme="emerald"] { --accent: #00d68f; --accent2: #00b8d9; --ring: conic-gradient(#00d68f, #00b8d9, #7c5cff, #00d68f); }
[data-theme="ocean"]   { --accent: #38b6ff; --accent2: #0066ff; --ring: conic-gradient(#38b6ff, #0066ff, #7c5cff, #38b6ff); }
[data-theme="sunset"]  { --accent: #ff9f43; --accent2: #ff5e62; --ring: conic-gradient(#ff9f43, #ff5e62, #c44dff, #ff9f43); }
[data-theme="violet"]  { --accent: #a06bff; --accent2: #5e6bff; --ring: conic-gradient(#a06bff, #5e6bff, #ff6bd6, #a06bff); }
[data-theme="rose"]    { --accent: #ff6b9d; --accent2: #ff8a5c; --ring: conic-gradient(#ff6b9d, #ff8a5c, #ffd166, #ff6b9d); }
/* dark / light */
[data-mode="dark"] {
  --bg: #0b0f14; --bg2: #10161d; --panel: #141c26; --panel2: #1a2431;
  --text: #eef3f8; --muted: #8593a3; --line: rgba(255,255,255,0.07);
  --bubble-in: #1a2431; --glass: rgba(16,22,29,0.82); --shadow: 0 10px 40px rgba(0,0,0,0.5);
}
[data-mode="light"] {
  --bg: #eef2f6; --bg2: #ffffff; --panel: #ffffff; --panel2: #f2f5f9;
  --text: #12202e; --muted: #61707f; --line: rgba(0,0,0,0.08);
  --bubble-in: #ffffff; --glass: rgba(255,255,255,0.85); --shadow: 0 10px 30px rgba(20,40,60,0.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  transition: background var(--tr), color var(--tr);
}
#root { height: 100dvh; }
.hidden { display: none !important; }
.view { height: 100dvh; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font-family: inherit; color: var(--text); }
::placeholder { color: var(--muted); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--panel2); border-radius: 3px; }

/* icons */
.ic, [data-icon] { display: inline-flex; align-items: center; justify-content: center; }
.ic svg, [data-icon] svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* buttons */
.btn { padding: 10px 18px; border-radius: 12px; font-weight: 700; font-size: 15px; transition: var(--tr); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.primary:active { transform: scale(0.96); }
.btn.ghost { background: var(--panel2); color: var(--text); }
.btn.big { width: 100%; padding: 14px; font-size: 16px; }
.btn.danger { background: #e5484d; color: #fff; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: var(--tr); position: relative; }
.icon-btn:hover { background: var(--panel2); color: var(--text); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn.accent { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.glass { background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }

/* ============ Auth ============ */
#auth-view {
  display: flex; padding: 20px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(60vw 60vw at 80% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(50vw 50vw at 0% 110%, color-mix(in srgb, var(--accent2) 20%, transparent), transparent 60%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 400px; margin: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 32px 26px; box-shadow: var(--shadow); flex-shrink: 0; }
.pop-in { animation: popin 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes popin { from { transform: translateY(24px) scale(0.96); opacity: 0; } }
.brand { text-align: center; margin-bottom: 22px; }
.brand-logo {
  width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 800; color: #fff;
  box-shadow: 0 8px 30px color-mix(in srgb, var(--accent) 45%, transparent);
}
.brand-logo.small { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; margin: 0; }
.brand-name { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: 0.5px; }
.brand-tag { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.auth-tabs { display: flex; background: var(--panel2); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tab { flex: 1; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); transition: var(--tr); }
.auth-tab.active { background: var(--panel); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--bg2); font-size: 16px; outline: none; transition: var(--tr);
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.auth-error { color: #ff6b6b; font-size: 14px; margin: 0 0 12px; animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(5px); } 75% { transform: translateX(-5px); } }
.auth-lang { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 18px; color: var(--muted); }
.auth-lang select { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 14px; }
.auth-sec { text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0 0; line-height: 1.6; }

/* ============ App layout ============ */
#panes { display: flex; height: 100dvh; }
#list-pane { width: 400px; min-width: 320px; display: flex; flex-direction: column; border-inline-end: 1px solid var(--line); background: var(--bg2); }
#conv-pane { flex: 1; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.topbar-actions { display: flex; gap: 4px; }
.tabpage { flex: 1; overflow-y: auto; padding-bottom: 8px; }

.search-wrap { margin: 10px 12px; display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 12px; padding: 10px 12px; color: var(--muted); }
.search-wrap input { flex: 1; background: none; border: none; outline: none; font-size: 15px; }
#search-results { margin: 0 12px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.search-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; transition: var(--tr); }
.search-row:hover { background: var(--panel2); }

/* chat list */
.chat-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; transition: background var(--tr); position: relative; animation: rowin 0.3s both; }
@keyframes rowin { from { opacity: 0; transform: translateY(8px); } }
.chat-row:hover { background: var(--panel2); }
.chat-row.active { background: var(--panel2); }
.chat-info { flex: 1; min-width: 0; }
.chat-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chat-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.chat-preview { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.chat-last { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-badge { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-size: 12px; font-weight: 700; min-width: 21px; height: 21px; border-radius: 11px; display: flex; align-items: center; justify-content: center; padding: 0 6px; flex-shrink: 0; }

/* avatar */
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--panel2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; color: #fff; overflow: hidden; position: relative; background-size: cover; background-position: center; }
.avatar.small { width: 34px; height: 34px; font-size: 14px; }
.avatar.big { width: 90px; height: 90px; font-size: 40px; }
.online-dot { position: absolute; bottom: 1px; inset-inline-end: 1px; width: 12px; height: 12px; background: #2ee59d; border: 2.5px solid var(--bg2); border-radius: 50%; }

/* bottom nav */
.bottomnav { display: flex; border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.navbtn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px; border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 600; transition: var(--tr); }
.navbtn.active { color: var(--accent); }
.navbtn svg { width: 24px; height: 24px; }

/* empty states */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-art { font-size: 52px; margin-bottom: 12px; }

/* ============ conversation ============ */
.conv-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); z-index: 5; }
.conv-head .avatar { width: 42px; height: 42px; cursor: pointer; }
.conv-meta { flex: 1; min-width: 0; cursor: pointer; }
#conv-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-status { font-size: 12.5px; color: var(--muted); }
.conv-status.online { color: var(--accent); }

#msg-area { flex: 1; overflow-y: auto; padding: 16px 10px 8px; display: flex; flex-direction: column; gap: 3px; scroll-behavior: smooth; }
.day-sep { align-self: center; background: var(--panel2); color: var(--muted); font-size: 12px; font-weight: 600; padding: 5px 14px; border-radius: 20px; margin: 10px 0; }
.msg-row { display: flex; margin-bottom: 2px; animation: msgin 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
@keyframes msgin { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.msg-row.mine { justify-content: flex-end; }
.bubble {
  max-width: min(72%, 560px); padding: 8px 12px 6px; border-radius: var(--radius);
  background: var(--bubble-in); position: relative; box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  word-wrap: break-word; overflow-wrap: anywhere; cursor: default;
}
.msg-row.mine .bubble { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.msg-row:not(.mine) .bubble { border-start-start-radius: 6px; }
.msg-row.mine .bubble { border-start-end-radius: 6px; }
.bubble-sender { font-size: 12.5px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.msg-row.mine .bubble-sender { color: rgba(255,255,255,0.85); }
.bubble-text { font-size: 15.5px; line-height: 1.5; white-space: pre-wrap; }
.bubble-media { margin: 2px -6px 4px; border-radius: 12px; overflow: hidden; }
.bubble-media img { max-width: 280px; max-height: 320px; width: 100%; display: block; cursor: pointer; }
.bubble-file { display: flex; align-items: center; gap: 10px; padding: 6px 4px; text-decoration: none; color: inherit; }
.bubble-file .fic { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.msg-row:not(.mine) .bubble-file .fic { background: var(--panel2); }
.bubble-file .fname { font-size: 14px; font-weight: 600; }
.bubble-file .fsize { font-size: 12px; opacity: 0.75; }
.bubble-audio { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.bubble-audio audio { width: 220px; height: 38px; }
.bubble-foot { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 2px; }
.bubble-time { font-size: 11px; opacity: 0.7; }
.ticks { display: inline-flex; }
.ticks svg { width: 17px; height: 17px; }
.ticks.read { color: #4dd0ff; }
.msg-row.mine .ticks.read { color: #d4f4ff; }
.reactions { position: absolute; bottom: -13px; inset-inline-start: 8px; display: flex; gap: 2px; z-index: 2; }
.reaction-chip { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1px 7px; font-size: 13px; display: flex; gap: 3px; align-items: center; box-shadow: 0 2px 6px rgba(0,0,0,0.3); cursor: pointer; animation: reactpop 0.25s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.reaction-chip.mine { border-color: var(--accent); }
@keyframes reactpop { from { transform: scale(0); } }
.msg-row.has-reactions { margin-bottom: 16px; }

/* reaction bar */
#react-bar { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line); border-radius: 30px; padding: 6px 10px; display: flex; gap: 4px; box-shadow: var(--shadow); animation: reactpop 0.2s both; }
#react-bar button { font-size: 24px; padding: 4px; border-radius: 50%; transition: transform 0.15s; }
#react-bar button:hover { transform: scale(1.3); }

/* typing */
#typing-row { padding: 4px 16px 8px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.tdots { display: inline-flex; gap: 3px; }
.tdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: tblink 1.2s infinite; }
.tdots i:nth-child(2) { animation-delay: 0.2s; }
.tdots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes tblink { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* composer */
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.input-wrap { flex: 1; background: var(--panel2); border-radius: 22px; padding: 11px 16px; max-height: 130px; overflow-y: auto; }
#composer-input { width: 100%; background: none; border: none; outline: none; resize: none; font-size: 15.5px; line-height: 1.4; max-height: 110px; }

/* emoji panel */
#emoji-panel { position: absolute; bottom: 74px; inset-inline-start: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; box-shadow: var(--shadow); z-index: 20; max-height: 260px; overflow-y: auto; animation: popin 0.2s both; }
#emoji-panel button { font-size: 23px; padding: 5px; border-radius: 8px; }
#emoji-panel button:hover { background: var(--panel2); }

/* recording */
#rec-panel { position: absolute; bottom: 74px; inset-inline: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); z-index: 20; animation: popin 0.2s both; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #e5484d; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
#rec-time { font-weight: 700; font-variant-numeric: tabular-nums; flex: 1; }

/* ============ stories ============ */
#my-story-row { padding: 14px 12px 6px; }
.story-ring { width: 62px; height: 62px; border-radius: 50%; padding: 3px; background: var(--panel2); position: relative; cursor: pointer; flex-shrink: 0; }
.story-ring.unseen { background: var(--ring); animation: spin 4s linear infinite; }
@keyframes spin { to { filter: hue-rotate(360deg); } }
.story-ring .avatar { width: 100%; height: 100%; border: 3px solid var(--bg2); }
.story-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; }
.story-row:hover { background: var(--panel2); }
.story-add { position: absolute; bottom: 0; inset-inline-end: 0; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; border: 2px solid var(--bg2); }
.story-name { font-weight: 700; font-size: 15px; }
.story-time { font-size: 12.5px; color: var(--muted); }

/* story viewer */
#story-viewer { background: #000; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.story-progress { position: absolute; top: 12px; inset-inline: 12px; display: flex; gap: 4px; z-index: 5; }
.story-progress .seg { flex: 1; height: 3px; background: rgba(255,255,255,0.3); border-radius: 2px; overflow: hidden; }
.story-progress .seg i { display: block; height: 100%; background: #fff; width: 0; }
.story-head { position: absolute; top: 24px; inset-inline: 14px; display: flex; align-items: center; gap: 10px; color: #fff; z-index: 5; }
.story-body { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.story-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.story-text-slide { font-size: 26px; font-weight: 700; color: #fff; text-align: center; padding: 40px; max-width: 560px; line-height: 1.7; }
.story-close { position: absolute; top: 20px; inset-inline-end: 14px; z-index: 6; color: #fff; font-size: 26px; }
.story-nav { position: absolute; inset: 0; display: flex; z-index: 4; }
.story-nav > div { flex: 1; }

/* story composer */
#story-composer { background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.story-edit { width: 100%; max-width: 420px; height: 78dvh; border-radius: 22px; overflow: hidden; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.story-edit textarea { background: none; border: none; outline: none; resize: none; color: #fff; font-size: 24px; font-weight: 700; text-align: center; width: 88%; font-family: inherit; }
.story-edit .bg-picker { position: absolute; top: 14px; inset-inline-end: 12px; display: flex; flex-direction: column; gap: 8px; }
.story-edit .bg-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.7); cursor: pointer; }
.story-edit .sc-actions { position: absolute; bottom: 16px; inset-inline: 16px; display: flex; gap: 10px; }
.story-edit .sc-actions .btn { flex: 1; }
.story-edit img.preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }

/* ============ settings ============ */
#settings-body { padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.set-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.set-card h3 { margin: 0 0 12px; font-size: 15px; color: var(--muted); font-weight: 700; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .avatar { cursor: pointer; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row label { font-weight: 600; font-size: 15px; }
.set-row select, .set-row input[type="text"] { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; max-width: 55%; }
.theme-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 14px; cursor: pointer; border: 3px solid transparent; transition: var(--tr); }
.swatch.active { border-color: var(--text); transform: scale(1.08); }
.mode-toggle { display: flex; background: var(--panel2); border-radius: 10px; padding: 3px; }
.mode-toggle button { padding: 7px 16px; border-radius: 8px; font-weight: 700; color: var(--muted); }
.mode-toggle button.active { background: var(--panel); color: var(--text); }

/* ============ overlays / modal / call ============ */
.overlay { position: fixed; inset: 0; z-index: 50; animation: fadein 0.25s both; }
@keyframes fadein { from { opacity: 0; } }
#modal { background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; width: 100%; max-width: 380px; max-height: 80dvh; overflow-y: auto; box-shadow: var(--shadow); animation: popin 0.3s both; }
.modal-card h2 { margin: 0 0 14px; font-size: 19px; }
.modal-card .btn-row { display: flex; gap: 10px; margin-top: 16px; }
.modal-card .btn-row .btn { flex: 1; }
.modal-list-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }

/* call UI */
#call-overlay { background: linear-gradient(160deg, #0d1420, #101d2b); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; z-index: 70; }
.call-avatar { width: 110px; height: 110px; border-radius: 50%; font-size: 48px; font-weight: 800; display: flex; align-items: center; justify-content: center; background: var(--panel2); background-size: cover; margin-bottom: 18px; animation: callpulse 2s infinite; }
@keyframes callpulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.15); } 70% { box-shadow: 0 0 0 26px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.call-name { font-size: 26px; font-weight: 800; }
.call-state { color: rgba(255,255,255,0.65); margin-top: 6px; font-size: 15px; font-variant-numeric: tabular-nums; }
.call-actions { position: absolute; bottom: 60px; display: flex; gap: 26px; align-items: center; }
.call-btn { width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform 0.15s; }
.call-btn:active { transform: scale(0.92); }
.call-btn.end { background: #e5484d; }
.call-btn.accept { background: #2fbf71; animation: acceptbounce 1.4s infinite; }
@keyframes acceptbounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.call-btn.ctrl { background: rgba(255,255,255,0.14); width: 56px; height: 56px; }
.call-btn.ctrl.on { background: #fff; color: #111; }
.call-btn svg { width: 28px; height: 28px; }

/* toast */
#toast { position: fixed; bottom: 90px; inset-inline: 0; margin-inline: auto; width: fit-content; max-width: 86%; background: var(--panel); color: var(--text); border: 1px solid var(--line); padding: 12px 20px; border-radius: 14px; box-shadow: var(--shadow); z-index: 90; font-weight: 600; animation: toastin 0.3s both; text-align: center; }
@keyframes toastin { from { opacity: 0; transform: translateY(16px); } }

/* image lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 80; display: flex; align-items: center; justify-content: center; animation: fadein 0.2s both; }
.lightbox img { max-width: 96%; max-height: 92%; border-radius: 8px; }

/* empty conversation placeholder */
#conv-empty { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 16px; font-weight: 600; }
@media (min-width: 821px) {
  #conv-pane.hidden { display: flex !important; }
  #conv-pane.hidden > *:not(#conv-empty) { display: none !important; }
  #conv-pane.hidden > #conv-empty { display: flex; }
}

/* responsive */
.mobile-only { display: none !important; }
@media (max-width: 820px) {
  #list-pane { width: 100%; min-width: 0; border: none; }
  #conv-pane { position: fixed; inset: 0; z-index: 40; }
  .mobile-only { display: inline-flex !important; }
  .bubble { max-width: 84%; }
}

/* Short screens (phones with keyboard open): compact auth card */
@media (max-height: 720px) {
  .brand { margin-bottom: 12px; }
  .brand-logo { width: 52px; height: 52px; font-size: 28px; border-radius: 16px; margin-bottom: 6px; }
  .brand-name { font-size: 24px; }
  .auth-card { padding: 20px 20px; }
  .field { margin-bottom: 10px; }
  .auth-sec { display: none; }
}
