/* Humraaz — app styles. Colours come from the selected theme (see js/core/prefs.js). */
:root {
  --accent: #91465e; --deep: #713449; --gold: #b88942; --bg: #faf2f4; --card: #fffdfd; --ink: #30232a; --muted: #7c6870;
  --line: #e8dbe0; --soft: #f1e4e9; --chat: #f4ebee; --mine: #f3d9e1; --minek: #30232a; --on-accent: #fff;
  --danger: #c0392b; --ok: #2f855a; --read: #2b7bd6;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Nirmala UI", "Mangal", sans-serif;
  --font-ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", "Segoe UI", sans-serif;
  --fs: 15px; --r: 14px; --rail: 72px; --list: 380px; --info: 360px;
  --shadow: 0 10px 34px rgba(30, 18, 26, .14); --shadow-s: 0 2px 10px rgba(30, 18, 26, .08);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
:root[data-mode=dark] { --danger: #ff7b6e; --ok: #68d391; --read: #63b3ff; --shadow: 0 10px 34px rgba(0, 0, 0, .5); --shadow-s: 0 2px 10px rgba(0, 0, 0, .35); }
:root[data-text=s] { --fs: 14px } :root[data-text=l] { --fs: 16.5px } :root[data-text=xl] { --fs: 18px }
:root[lang=ur] body { font-family: var(--font-ur); line-height: 1.9 }
* { box-sizing: border-box }
html, body { height: 100%; margin: 0 }
body { font: var(--fs)/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; -webkit-tap-highlight-color: transparent }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer; background: none; border: 0; padding: 0 }
a { color: var(--accent) }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px }
.hidden { display: none !important }
.flip-rtl { } [dir=rtl] .flip-rtl { transform: scaleX(-1) }
.hint { color: var(--muted); font-size: .86em; margin: 4px 0 }
.hint.center { text-align: center } .pad { padding: 12px 18px }
.enc { display: flex; gap: 6px; align-items: center }
h1, h2, h3 { margin: 0; line-height: 1.25 }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); min-height: 42px; outline: none }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent) }
textarea { resize: vertical }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent) }
input[type=range] { padding: 0; border: 0; background: none; min-height: 0; accent-color: var(--accent); box-shadow: none }

/* ---------- brand ---------- */
.brand-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(150deg, var(--accent), var(--deep)); color: var(--on-accent); font: italic 700 26px/1 Georgia, "Times New Roman", serif; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent) }
.brand-mark.small { width: 38px; height: 38px; font-size: 22px; border-radius: 12px }
.brand-mark.huge { width: 84px; height: 84px; font-size: 50px; border-radius: 26px }
.brand-name { font: italic 700 30px/1 Georgia, "Times New Roman", serif; color: var(--accent); letter-spacing: -.5px }
#splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50 }
#splash .brand-mark { animation: pulse 1.4s ease-in-out infinite }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7 } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 650; min-height: 42px; text-decoration: none; transition: filter .15s, transform .15s }
.btn:hover { filter: brightness(1.06) } .btn:active { transform: scale(.98) }
.btn:disabled { opacity: .5; cursor: default }
.btn.big { width: 100%; min-height: 48px; margin-top: 14px; font-size: 1.02em }
.btn.small { min-height: 32px; padding: 5px 12px; font-size: .88em; border-radius: 10px }
.btn.ghost { background: var(--soft); color: var(--ink) }
.btn.danger { background: var(--danger); color: #fff }
.btn.ghost-danger { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger) }
.link { color: var(--accent); font-weight: 600; padding: 8px 6px; border-radius: 8px }
.link:hover { background: var(--soft) }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); flex: none; text-decoration: none }
.icon-btn:hover { background: var(--soft); color: var(--ink) }
.icon-btn.small { width: 30px; height: 30px }
.icon-btn.danger { color: var(--danger) }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px; background: var(--soft); color: var(--muted); font-size: .88em; font-weight: 600; white-space: nowrap }
.chip.on { background: color-mix(in srgb, var(--accent) 16%, var(--card)); color: var(--accent) }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 }
.chips.center { justify-content: center; padding: 10px }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 700; font-style: normal; line-height: 1 }
.badge.muted { background: var(--muted) } .badge.mention { background: var(--gold) } .badge.dot-only { min-width: 12px; width: 12px; height: 12px; padding: 0 }
.spinner { display: inline-block; width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite }
.loading { display: grid; place-items: center; padding: 40px }

/* ---------- auth ---------- */
#auth { position: fixed; inset: 0; overflow: auto; background: radial-gradient(ellipse at 15% 10%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 50%), radial-gradient(ellipse at 90% 90%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 45%), var(--bg) }
.auth-wrap { min-height: 100%; display: grid; place-items: center; align-content: center; gap: 14px; padding: 24px 16px calc(24px + var(--safe-b)) }
.auth-card { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: clamp(22px, 5vw, 34px); box-shadow: var(--shadow) }
.auth-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px }
.brand-row { display: flex; align-items: center; gap: 12px }
.lang-pick { width: auto; min-height: 36px; padding: 4px 10px; font-size: .9em }
.auth-form h1 { font-size: 1.5em; letter-spacing: -.3px }
.lead { color: var(--muted); margin: 8px 0 18px; line-height: 1.55 }
.field { display: block; margin: 12px 0 }
.field > span { display: block; font-size: .86em; font-weight: 650; color: var(--muted); margin-bottom: 5px }
.form-error { color: var(--danger); min-height: 1em; margin: 10px 0 0; font-size: .92em }
.form-ok { color: var(--ok); margin: 10px 0 0; font-size: .92em }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-top: 12px }
.auth-foot { max-width: 440px; width: 100%; text-align: center; color: var(--muted); font-size: .8em; line-height: 1.5 }
.get-app { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; padding: 12px 16px; border-radius: 16px; text-align: start; text-decoration: none; color: var(--ink); background: color-mix(in srgb, var(--card) 85%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow-s); font-size: 1.15em }
.get-app:hover { border-color: var(--accent) } .get-app strong { display: block; color: var(--accent) } .get-app small { color: var(--muted); font-size: .82em }
.get-app-icon { font-size: 1.6em } .get-app-go { margin-inline-start: auto; font-size: 1.6em; color: var(--accent) }

/* ---------- app frame ---------- */
#app { height: 100dvh; display: grid; grid-template-columns: var(--rail) var(--list) 1fr; background: var(--card) }
#app.with-info { grid-template-columns: var(--rail) var(--list) 1fr var(--info) }
#rail { grid-row: 1; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: calc(14px + var(--safe-t)) 0 14px; background: var(--soft); border-inline-end: 1px solid var(--line) }
.rail-top, .rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 6px }
.rail-top .brand-mark { margin-bottom: 14px }
.nav-btn { position: relative; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; color: var(--muted); text-decoration: none }
.nav-btn:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--ink) }
.nav-btn.on { background: color-mix(in srgb, var(--accent) 15%, var(--card)); color: var(--accent) }
.nav-icon { position: relative; display: grid; place-items: center }
.nav-icon .badge { position: absolute; top: -8px; inset-inline-end: -12px; font-size: 10.5px; min-width: 18px; height: 18px }
.nav-icon .dot { position: absolute; top: -3px; inset-inline-end: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--soft) }
#rail .nav-label { display: none }
.nav-me { margin-top: 8px; border-radius: 50% }
#tabbar { display: none }
#list-pane { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--card); border-inline-end: 1px solid var(--line) }
#chat-pane { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--chat) }
#info-pane { display: flex; flex-direction: column; min-height: 0; background: var(--card); border-inline-start: 1px solid var(--line); overflow: auto }

.pane-head { display: flex; align-items: center; gap: 6px; padding: calc(12px + var(--safe-t)) 12px 10px 18px; min-height: 64px }
[dir=rtl] .pane-head { padding: calc(12px + var(--safe-t)) 18px 10px 12px }
.pane-head .back { margin-inline-start: -8px }
.pane-title { flex: 1; min-width: 0 }
.pane-title h1 { font-size: 1.35em; letter-spacing: -.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.pane-title small { color: var(--muted) }
.pane-actions { display: flex; gap: 2px }
.list-tools { padding: 0 14px 8px; display: grid; gap: 10px }
.search-wrap { position: relative; display: flex; align-items: center }
.search-wrap > .ic { position: absolute; inset-inline-start: 12px; color: var(--muted); pointer-events: none }
.search-wrap input.search { padding-inline-start: 40px; border-radius: 12px; background: var(--soft); border-color: transparent; min-height: 40px }
.search-wrap .icon-btn { position: absolute; inset-inline-end: 2px }
.list { flex: 1; overflow-y: auto; padding: 2px 6px 90px; scrollbar-width: thin }
.list-section { font-size: .78em; font-weight: 700; color: var(--accent); padding: 14px 12px 6px; letter-spacing: .02em }

/* chat rows */
.chat-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 14px; text-align: start; color: inherit; text-decoration: none; position: relative }
.chat-row:not(.static):hover { background: var(--soft) }
.chat-row.on { background: color-mix(in srgb, var(--accent) 11%, var(--card)) }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: start }
.row-top, .row-bottom { display: flex; align-items: center; gap: 8px; min-width: 0 }
.row-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650 }
.row-main > strong, .row-main > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.row-top time { font-size: .76em; color: var(--muted); flex: none }
.chat-row.unread .row-top time { color: var(--accent); font-weight: 700 }
.row-main small, .preview { color: var(--muted); font-size: .9em }
.preview { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; overflow: hidden; white-space: nowrap }
.preview .ic { flex: none; opacity: .8 }
.preview .sender { flex: none; font-weight: 600; color: var(--ink); opacity: .75 }
.row-flags { display: flex; gap: 4px; align-items: center; color: var(--muted); flex: none }
.typing-text { color: var(--ok) !important; font-weight: 600 }
.icon-avatar { display: grid !important; place-items: center; background: var(--soft) !important; color: var(--accent) !important }
.icon-avatar.accent { background: var(--accent) !important; color: var(--on-accent) !important }
.archived-row strong { color: var(--accent) }
.fab { position: absolute; inset-inline-end: 20px; bottom: calc(22px + var(--safe-b)); width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); z-index: 3 }
.fab.small { position: static; width: 44px; height: 44px; border-radius: 14px; background: var(--soft); color: var(--accent) }
.fab-stack { position: absolute; inset-inline-end: 20px; bottom: calc(22px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 12px }
.fab-stack .fab:not(.small) { position: static }
.row-avatar { border-radius: 50%; flex: none }
.call-row.missed strong { color: var(--danger) }
.call-dir { vertical-align: -3px; margin-inline-end: 3px; color: var(--ok) } .call-dir.missed, .call-dir.declined, .call-dir.unanswered { color: var(--danger) }

/* avatars */
.avatar { --s: 44px; position: relative; flex: none; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; overflow: visible; color: #fff; font-weight: 700; font-size: calc(var(--s) * .38); background: var(--c, var(--accent)); letter-spacing: .02em; user-select: none }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block }
.avatar.group { border-radius: 32% }
.avatar.group img { border-radius: 32% }
.presence-dot { position: absolute; bottom: 1px; inset-inline-end: 1px; width: 26%; height: 26%; min-width: 10px; min-height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--card) }
.avatar.ring-new { box-shadow: 0 0 0 2px var(--card), 0 0 0 4.5px var(--accent) }
.avatar.ring-seen { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--line) }
.status-av { position: relative; flex: none }
.add-badge { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); border: 2px solid var(--card) }
.empty-state { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 50px 26px; color: var(--muted) }
.empty-state h3 { color: var(--ink); font-size: 1.05em }
.empty-state p { margin: 0; max-width: 34ch; line-height: 1.5 }
.empty-state .btn { margin-top: 10px }

/* ---------- chat pane ---------- */
.chat-welcome { margin: auto; text-align: center; display: grid; justify-items: center; gap: 10px; padding: 30px; color: var(--muted); max-width: 440px }
.chat-welcome h2 { color: var(--ink); font-size: 1.6em }
.chat-welcome .hint { display: flex; gap: 6px; align-items: center }
.chat-head { display: flex; align-items: center; gap: 4px; padding: calc(8px + var(--safe-t)) 8px 8px; background: var(--card); border-bottom: 1px solid var(--line); min-height: 64px; z-index: 2 }
.chat-head .back { display: none }
.head-id { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 4px 8px; border-radius: 12px; text-align: start }
.head-id:hover { background: var(--soft) }
.head-text { min-width: 0; display: flex; flex-direction: column }
.head-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.04em }
.head-sub { color: var(--muted); font-size: .82em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.head-actions { display: flex; gap: 2px }
.pin-bar, .call-bar { display: flex; align-items: center; gap: 10px; padding: 6px 14px; background: var(--card); border-bottom: 1px solid var(--line); font-size: .9em }
.call-bar { color: var(--ok); font-weight: 600 } .call-bar span { flex: 1 }
.pin-main { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; text-align: start; color: var(--muted) }
.pin-text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; gap: 4px; align-items: center }
.pin-dots { display: flex; flex-direction: column; gap: 2px } .pin-dots i { width: 3px; height: 8px; border-radius: 2px; background: var(--line) } .pin-dots i.on { background: var(--accent) }
.messages-wrap { position: relative; flex: 1; min-height: 0 }
.messages { position: absolute; inset: 0; overflow-y: auto; padding: 14px clamp(10px, 4vw, 56px) 18px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; overscroll-behavior: contain }
:root[data-wallpaper=jaali] #chat-pane { background-image: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 7%, transparent) 1.2px, transparent 1.6px), linear-gradient(45deg, transparent 47%, color-mix(in srgb, var(--accent) 4%, transparent) 48%, color-mix(in srgb, var(--accent) 4%, transparent) 52%, transparent 53%), linear-gradient(-45deg, transparent 47%, color-mix(in srgb, var(--accent) 4%, transparent) 48%, color-mix(in srgb, var(--accent) 4%, transparent) 52%, transparent 53%); background-size: 26px 26px }
:root[data-wallpaper=dots] #chat-pane { background-image: radial-gradient(color-mix(in srgb, var(--ink) 6%, transparent) .8px, transparent .8px); background-size: 16px 16px }
.day-sep, .sys-row, .unread-sep { display: flex; justify-content: center; margin: 10px 0 6px }
.day-sep span, .sys { background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--muted); padding: 5px 12px; border-radius: 10px; font-size: .78em; box-shadow: var(--shadow-s); text-align: center; max-width: 86%; backdrop-filter: blur(6px) }
.unread-sep span { background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: var(--accent); padding: 4px 14px; border-radius: 10px; font-size: .8em; font-weight: 700 }
.call-pill { display: inline-flex; align-items: center; gap: 8px }
.call-pill.missed { color: var(--danger) }
.call-pill time { opacity: .7 }
.chat-intro { align-self: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; align-items: center; max-width: 440px; text-align: center; margin: 6px auto 12px; padding: 8px 14px; border-radius: 12px; font-size: .78em; color: color-mix(in srgb, var(--gold) 70%, var(--ink)); background: color-mix(in srgb, var(--gold) 14%, var(--card)) }
.older-sentinel { display: flex; justify-content: center; padding: 6px }
.msg-row { display: flex; align-items: flex-end; gap: 6px; max-width: min(78%, 620px); align-self: flex-start; transition: transform .15s }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse }
.msg-row.run-start { margin-top: 6px }
.msg-avatar { flex: none; width: 30px; border-radius: 50% } .msg-avatar.spacer { height: 1px }
.msg-col { position: relative; display: flex; flex-direction: column; min-width: 0; max-width: 100% }
.msg-row.mine .msg-col { align-items: flex-end }
.bubble { position: relative; padding: 6px 9px 6px 10px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow-s); overflow-wrap: anywhere; min-width: 76px; max-width: 100% }
.msg-row.mine .bubble { background: var(--mine); color: var(--minek) }
.msg-row.theirs.run-start .bubble { border-start-start-radius: 5px }
.msg-row.mine.run-start .bubble { border-start-end-radius: 5px }
.bubble .sender { display: block; font-size: .82em; font-weight: 700; margin-bottom: 1px; text-align: start }
.bubble .text { margin: 0; white-space: pre-wrap; padding-inline-end: 6px }
.bubble .text::after { content: ''; display: inline-block; width: 64px }
.big-emoji { font-size: 2.4em; line-height: 1.2 }
.msg-row.emoji-only .bubble { background: none !important; box-shadow: none; padding: 0 }
.mention { color: var(--accent); font-weight: 650 }
.bubble a { color: var(--accent); word-break: break-all }
.meta { float: inline-end; display: inline-flex; align-items: center; gap: 3px; margin: 5px 0 -3px 8px; font-size: .7em; color: var(--muted); white-space: nowrap; position: relative; top: 2px }
.bubble:has(> .media:last-of-type) .meta, .bubble:has(> .view-once) .meta { float: none; justify-content: flex-end; display: flex }
.meta .starred { color: var(--gold) }
.tick { display: inline-flex; color: var(--muted) } .tick.read { color: var(--read) } .tick.pending { opacity: .7 }
.forwarded { display: flex; gap: 4px; align-items: center; color: var(--muted); font-style: italic; font-size: .78em; margin-bottom: 2px }
.quote { display: block; width: 100%; text-align: start; border-inline-start: 3px solid var(--accent); background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 8px; padding: 5px 9px; margin: 2px 0 5px; font-size: .86em; overflow: hidden }
.quote b { display: block; color: var(--accent); font-size: .95em }
.quote span { display: flex; gap: 4px; align-items: center; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.status-quote { border-color: var(--gold) }
.deleted-text { margin: 0; display: flex; gap: 6px; align-items: center; color: var(--muted); font-style: italic; padding-inline-end: 60px }
.media { display: block; margin: 0 -5px 3px; border-radius: 12px; overflow: hidden; position: relative; background: var(--soft); max-width: 330px }
.media img, .media video { display: block; width: 100%; max-height: 360px; object-fit: cover; min-width: 160px; min-height: 90px }
.play-badge { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: #fff }
.play-badge.small { width: 30px; height: 30px }
.view-once { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 6px; color: var(--accent); font-weight: 650 }
.view-once.done { color: var(--muted); font-weight: 500 }
.doc, .location-card { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -3px 3px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 6%, transparent); color: inherit !important; text-decoration: none; min-width: 220px; max-width: 330px; word-break: normal !important }
.doc.wide { max-width: none; margin: 4px 0 }
.doc-icon { flex: none; width: 40px; height: 46px; display: grid; place-items: center; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 800 }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column }
.doc-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .92em }
.doc-main small { color: var(--muted); font-size: .78em }
.loc-art { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: repeating-linear-gradient(45deg, var(--soft) 0 6px, var(--card) 6px 12px) }
.contact-card { display: flex; align-items: center; gap: 10px; padding: 6px 2px; min-width: 230px }
.voice { display: flex; align-items: center; gap: 8px; min-width: 230px; padding: 4px 2px }
.vp-play { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex: none }
.vp-bar { flex: 1 }
.vp-time { color: var(--muted); font-size: .76em; min-width: 32px }
.vp-speed { font-size: .75em; font-weight: 700; padding: 3px 7px; border-radius: 8px; background: var(--soft) }
.vp-mic { color: var(--accent) }
.poll { min-width: 240px; padding: 2px }
.poll-q { display: block; margin: 2px 0 } .poll .hint { margin: 2px 0 8px }
.poll-opt { position: relative; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; width: 100%; text-align: start; padding: 7px 4px 12px }
.poll-check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center }
.poll-opt.on .poll-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent) }
.poll-bar { position: absolute; inset-inline: 32px 4px; bottom: 4px; height: 5px; border-radius: 4px; background: var(--line) }
.poll-bar span { display: block; height: 100%; border-radius: 4px; background: var(--accent) }
.translation { border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent); margin-top: 6px; padding-top: 5px }
.translation small { color: var(--muted); font-size: .72em } .translation p { margin: 2px 0 0; white-space: pre-wrap }
.reactions { display: flex; gap: 4px; margin: -6px 8px 2px; z-index: 1; flex-wrap: wrap }
.reaction { display: inline-flex; gap: 3px; align-items: center; padding: 1px 7px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: .9em; box-shadow: var(--shadow-s) }
.reaction.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)) }
.reaction small { font-size: .78em; color: var(--muted) }
.msg-menu-btn { position: absolute; top: 2px; inset-inline-end: 2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: color-mix(in srgb, var(--card) 85%, transparent); opacity: 0; transition: opacity .12s }
.msg-col:hover .msg-menu-btn, .msg-menu-btn:focus-visible { opacity: 1 }
@media (pointer: coarse) { .msg-menu-btn { display: none } }
.msg-row.flash .bubble { animation: flash 1.6s ease }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--gold) } }
.upload-progress { display: flex; gap: 8px; align-items: center; margin-top: 3px; width: 100%; font-size: .8em }
.upload-progress .bar { flex: 1; height: 4px; border-radius: 3px; background: var(--line); overflow: hidden } .upload-progress .bar i { display: block; height: 100%; background: var(--accent); transition: width .2s }
.jump-bottom { position: absolute; bottom: 14px; inset-inline-end: 18px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--muted); box-shadow: var(--shadow) }
.jump-bottom .badge { position: absolute; top: -6px; inset-inline-start: -4px }
.chat-search { background: var(--card); border-bottom: 1px solid var(--line); padding: 8px 12px; max-height: 45%; display: flex; flex-direction: column; gap: 6px }
.search-results { overflow: auto }
.search-hit { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; width: 100%; text-align: start; padding: 8px; border-radius: 10px }
.search-hit:hover { background: var(--soft) } .search-hit time { color: var(--muted); font-size: .76em } .search-hit span { grid-column: 1/-1; color: var(--muted); font-size: .9em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.drop-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 10px; background: color-mix(in srgb, var(--card) 85%, transparent); border: 3px dashed var(--accent); border-radius: 18px; margin: 10px; color: var(--accent); font-weight: 700 }

/* composer */
.composer-host { position: relative; background: transparent; padding: 6px clamp(8px, 2vw, 20px) calc(10px + var(--safe-b)) }
.composer { display: flex; align-items: flex-end; gap: 8px }
.compose-box { flex: 1; display: flex; align-items: flex-end; gap: 2px; background: var(--card); border-radius: 24px; padding: 3px 4px; box-shadow: var(--shadow-s); min-width: 0 }
.compose-box textarea { flex: 1; border: 0; background: transparent; resize: none; min-height: 42px; max-height: 160px; padding: 10px 6px; box-shadow: none !important; line-height: 1.4 }
.send-btn { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-s) }
.reply-preview { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 8px 8px 8px 12px; margin-bottom: 6px; border-inline-start: 4px solid var(--accent); box-shadow: var(--shadow-s); color: var(--accent) }
.reply-preview div { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink) }
.reply-preview b { color: var(--accent); font-size: .88em } .reply-preview span { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: .88em; white-space: nowrap; overflow: hidden }
.reply-preview.editing { border-color: var(--gold) }
.composer-note { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 12px; background: var(--card); border-radius: 14px; color: var(--muted); text-align: center; font-size: .92em; flex-wrap: wrap }
.composer-note.warn { color: var(--danger) }
.recording-bar { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 24px; padding: 4px 4px 4px 16px; box-shadow: var(--shadow-s) }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 650 } .rec-hint { flex: 1; color: var(--muted); font-size: .86em }
.mention-box { position: absolute; bottom: 100%; inset-inline: 16px; max-width: 360px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; margin-bottom: 4px; z-index: 6 }
.mention-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 10px; text-align: start }
.mention-opt.on, .mention-opt:hover { background: var(--soft) } .mention-opt small { color: var(--muted) }

/* ---------- info pane ---------- */
.info-body { flex: 1; overflow: auto; padding-bottom: 30px }
.info-hero { display: grid; justify-items: center; gap: 4px; padding: 18px 20px 14px; text-align: center }
.info-hero h2 { display: flex; align-items: center; gap: 4px; font-size: 1.35em; margin-top: 8px }
.hero-avatar { position: relative; border-radius: 50% }
.hero-edit { position: absolute; bottom: 4px; inset-inline-end: 4px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); border: 3px solid var(--card) }
.hero-actions { display: flex; justify-content: center; gap: 10px; padding: 4px 16px 12px }
.hero-btn { display: grid; justify-items: center; gap: 4px; padding: 10px 14px; min-width: 80px; border-radius: 14px; border: 1px solid var(--line); color: var(--accent); font-size: .82em }
.hero-btn:hover { background: var(--soft) }
.info-sec { border-top: 8px solid var(--bg); padding: 10px 14px }
.sec-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 4px 4px 8px; color: var(--muted); font-size: .86em; font-weight: 650 }
.link-row { text-align: start } .link-row span:first-child { flex: 1 }
.row-value { color: var(--muted); font-size: .88em; margin-inline-start: auto }
.desc { margin: 0 4px 6px; white-space: pre-wrap }
.role-tag { flex: none; font-size: .72em; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); padding: 1px 8px; border-radius: 6px; font-weight: 700 }
.detail { display: flex; align-items: center; gap: 14px; padding: 8px 6px; color: inherit; text-decoration: none; border-radius: 10px }
.detail .ic { color: var(--muted); flex: none } .detail span { display: flex; flex-direction: column; min-width: 0 } .detail small { color: var(--muted); font-size: .78em } .detail strong { font-weight: 500; overflow-wrap: anywhere }
a.detail:hover { background: var(--soft) }
.media-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 4px }
.thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--soft); display: block }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block }
.link-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line) }
.link-item span { display: flex; flex-direction: column; min-width: 0 } .link-item strong { color: var(--accent); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap } .link-item small { color: var(--muted) }
.info-quote { margin: 16px; padding: 12px; border-radius: 12px; background: var(--mine); display: flex; gap: 6px; align-items: center }
.danger-zone .row-btn.danger { color: var(--danger) }

/* toggles & rows */
.toggle { display: flex; align-items: center; gap: 12px; padding: 10px 4px; cursor: pointer; position: relative }
.toggle-text { flex: 1; display: flex; flex-direction: column } .toggle-text small { color: var(--muted); font-size: .82em }
.toggle input { position: absolute; opacity: 0; pointer-events: none }
.switch { flex: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s }
.toggle input:checked + .switch { background: var(--accent) }
.toggle input:checked + .switch::after { transform: translateX(18px) } [dir=rtl] .toggle input:checked + .switch::after { transform: translateX(-18px) }
.toggle input:focus-visible + .switch { outline: 2px solid var(--gold); outline-offset: 2px }
.row-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 6px; border-radius: 10px; text-align: start; color: inherit; text-decoration: none }
.row-btn:hover { background: var(--soft) } .row-btn > .ic:first-child { color: var(--muted) }
.row-btn.danger { color: var(--danger) } .row-btn.danger .ic { color: var(--danger) }
.row-label { flex: 1 }
.settings-body { flex: 1; overflow: auto; padding: 4px 10px 90px }
.me-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 10px; border-radius: 14px; text-align: start; margin-bottom: 8px }
.me-card:hover { background: var(--soft) } .me-card span { display: flex; flex-direction: column } .me-card small { color: var(--muted) }
.settings-list { border-top: 1px solid var(--line); padding-top: 4px }
.seg { display: flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 12px; margin: 4px 0 10px }
.seg button { flex: 1; display: flex; gap: 6px; justify-content: center; align-items: center; padding: 8px; border-radius: 9px; color: var(--muted); font-size: .9em; font-weight: 600 }
.seg button.on { background: var(--card); color: var(--accent); box-shadow: var(--shadow-s) }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 6px 0 14px }
.theme { display: grid; gap: 6px; justify-items: center; padding: 10px 6px; border-radius: 12px; border: 2px solid transparent; background: var(--soft) }
.theme.on { border-color: var(--accent) } .theme small { font-size: .74em; text-align: center; color: var(--muted) }
.swatches { display: flex } .swatches i { width: 16px; height: 16px; border-radius: 50%; margin-inline-start: -4px; border: 2px solid var(--card) }
.pane-form { flex: 1; overflow: auto; padding: 4px 18px 60px }
.form-section { font-size: .92em; margin: 20px 0 0; color: var(--accent) }
.group-photo-row { display: flex; align-items: flex-end; gap: 14px }
.grow { flex: 1 }
.photo-pick { width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--muted); overflow: hidden; margin-bottom: 12px }
.photo-pick img { width: 100%; height: 100%; object-fit: cover }
.picked { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 6px }
.pick-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 99px; background: var(--soft); font-size: .86em }
.pick-row { cursor: pointer } .pick-row input { flex: none }

/* ---------- dialogs & menus ---------- */
dialog.modal { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(480px, calc(100vw - 24px)); width: 100%; max-height: calc(100dvh - 40px) }
dialog.modal.wide { max-width: min(680px, calc(100vw - 24px)) }
dialog.modal::backdrop { background: rgba(16, 10, 14, .5); backdrop-filter: blur(3px) }
.modal-inner { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; overflow: hidden }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 12px 4px 20px }
[dir=rtl] .modal-head { padding: 16px 20px 4px 12px }
.modal-head h2 { font-size: 1.12em }
.modal-inner > :not(.modal-head) { padding: 8px 20px 20px; overflow: auto }
.confirm p { margin: 4px 0 14px; line-height: 1.5 }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; align-items: center }
.actions.stack { flex-direction: column; align-items: stretch }
.actions.wrap { flex-wrap: wrap; justify-content: flex-start }
.actions .hint { flex: 1 }
.prompt label > span { display: block; font-size: .86em; color: var(--muted); font-weight: 650; margin-bottom: 6px }
.prompt label { display: block; margin-bottom: 12px }
label.inline { display: flex !important; gap: 10px; align-items: center }
.poll-opts { display: grid; gap: 6px }
.choices { display: grid; gap: 2px }
.choice { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 10px; text-align: start }
.choice:hover { background: var(--soft) } .choice > span:last-child { display: flex; flex-direction: column } .choice small { color: var(--muted); font-size: .82em }
.radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted) }
.choice.on .radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--card); background: var(--accent) }
.pick-list { display: grid; gap: 2px; max-height: 50vh; overflow: auto; margin-top: 8px }
.pick { display: flex; align-items: center; gap: 12px; padding: 7px 6px; border-radius: 10px; cursor: pointer; text-align: start; width: 100% }
.pick:hover { background: var(--soft) } .pick small { color: var(--muted); margin-inline-start: auto }
.menu-backdrop { position: fixed; inset: 0; z-index: 40 }
.menu { position: fixed; z-index: 41; min-width: 210px; max-width: 320px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; border: 1px solid var(--line); animation: pop .12s ease-out }
@keyframes pop { from { transform: scale(.96); opacity: 0 } }
.menu.as-sheet { inset: auto 0 0 0; max-width: none; border-radius: 22px 22px 0 0; padding: 10px 10px calc(12px + var(--safe-b)); animation: up .18s ease-out }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
.menu.as-sheet ~ .menu-backdrop, .menu-backdrop:has(+ .menu.as-sheet) { background: rgba(16, 10, 14, .4) }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 9px; text-align: start }
.menu-item:hover, .menu-item:focus-visible { background: var(--soft) } .menu-item .ic { color: var(--muted) }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger) }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0 }
.menu-title { padding: 6px 12px 10px; font-weight: 700 }
.react-bar { display: flex; gap: 2px; padding: 4px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; justify-content: space-between }
.react-bar button { font-size: 24px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center }
.react-bar button:hover { background: var(--soft); transform: scale(1.12) }
.more-react { background: var(--soft) !important; color: var(--muted) }
#toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; max-width: min(520px, 90vw); box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; transition: opacity .2s, transform .2s; font-size: .92em }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto }
#toast button { color: var(--gold); font-weight: 700 }
/* ---------- emoji & stickers (WhatsApp-style) ---------- */
.emoji-picker { display: flex; flex-direction: column; gap: 8px }
.emoji-body, .sticker-body { display: flex; flex-direction: column; gap: 6px; min-height: 0; height: 100% }
.emoji-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); padding-bottom: 4px; flex-shrink: 0 }
.emoji-tabs::-webkit-scrollbar { display: none }
.emoji-tabs button { flex: 1 0 auto; font-size: 20px; padding: 6px 8px; border-radius: 10px; opacity: .55; border: 0; background: none; cursor: pointer; transition: opacity .15s, background .15s; position: relative }
.emoji-tabs button.on { opacity: 1; background: var(--soft) }
.emoji-tabs button.on::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: -5px; height: 3px; border-radius: 3px; background: var(--accent) }
.emoji-tabs.dim button { opacity: .3 }
.emoji-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1; max-height: 340px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; padding-inline-end: 2px }
.emoji-sec h4 { position: sticky; top: 0; z-index: 1; margin: 0; padding: 6px 4px 4px; font-size: .74em; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); background: var(--card) }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 2px }
.emoji-grid button { font-size: 28px; line-height: 1; aspect-ratio: 1; border-radius: 12px; border: 0; background: none; cursor: pointer; transition: transform .1s ease, background .1s }
.emoji-grid button:hover, .emoji-grid button:focus-visible { background: var(--soft); transform: scale(1.12) }
.emoji-grid button:active { transform: scale(.92) }
.emoji-modal .emoji-scroll { max-height: min(46dvh, 380px) }
/* Docked panel in the chat (takes the keyboard's place on phones) */
.expr-panel { display: flex; flex-direction: column; height: min(42dvh, 360px); margin: 0 0 8px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-s, 0 2px 10px rgba(0,0,0,.08)); overflow: hidden; animation: exprIn .16s ease-out }
@keyframes exprIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.expr-body { flex: 1; min-height: 0; padding: 8px 8px 0; display: flex; flex-direction: column }
.expr-body .emoji-scroll, .expr-body .sticker-scroll { max-height: none; flex: 1; min-height: 0 }
.expr-foot { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-top: 1px solid var(--line); flex-shrink: 0 }
.expr-foot button { border: 0; background: none; color: var(--muted); border-radius: 10px; padding: 6px 10px; cursor: pointer; font-size: 20px; line-height: 1; display: inline-flex; align-items: center }
.expr-foot button.on { color: var(--accent); background: var(--soft) }
.expr-foot .grow { flex: 1 }
.expr-foot .backspace { font-size: 22px }
@media (max-width: 700px) {
  .composer-host.panel-open { display: flex; flex-direction: column }
  .composer-host.panel-open .expr-panel { order: 3; margin: 8px 0 0; border-radius: 16px 16px 0 0; border-bottom: 0; height: min(40dvh, 320px) }
  .emoji-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)) }
}
.send-files .file-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; max-height: 46vh; overflow: auto }
.file-previews figure { margin: 0; border-radius: 12px; overflow: hidden; background: var(--soft); display: grid }
.file-previews img, .file-previews video { width: 100%; height: 140px; object-fit: cover }
.file-previews figcaption { font-size: .76em; color: var(--muted); padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.doc-prev { place-items: center; padding: 18px 6px 0; color: var(--accent) }
.file-opts { display: flex; gap: 8px; margin: 12px 0 }
.caption { margin-top: 10px }
.invite { display: grid } .invite-result { display: grid; justify-items: center; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line) }
.qr { width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 6px }
.copy-field { text-align: center; font-size: .86em }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 45; background: rgba(8, 6, 8, .96); color: #fff; display: grid; grid-template-rows: auto 1fr auto; outline: none }
.viewer-head { display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 12px 10px }
.viewer .icon-btn { color: #ddd } .viewer .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff }
.viewer-who { flex: 1; display: flex; flex-direction: column } .viewer-who small { opacity: .7 }
.viewer-actions { display: flex; gap: 4px }
.viewer-stage { display: grid; place-items: center; overflow: hidden; min-height: 0 }
.viewer-stage img, .viewer-stage video { max-width: 100vw; max-height: calc(100dvh - 140px); object-fit: contain; transition: transform .2s; cursor: zoom-in }
.viewer-nav { position: absolute; top: 50%; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff }
.viewer-nav.prev { inset-inline-start: 14px } .viewer-nav.next { inset-inline-end: 14px }
.viewer-caption { text-align: center; padding: 10px 20px calc(16px + var(--safe-b)); margin: 0; white-space: pre-wrap }

/* ---------- status ---------- */
.status-viewer { position: fixed; inset: 0; z-index: 46; background: #000; color: #fff; display: grid; grid-template-rows: auto auto 1fr auto; outline: none }
.sv-bars { display: flex; gap: 4px; padding: calc(10px + var(--safe-t)) 12px 6px; z-index: 2 }
.sv-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden } .sv-bars i { display: block; height: 100%; background: #fff }
.sv-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px; z-index: 2 }
.sv-head .icon-btn { color: #fff }
.sv-who { display: flex; align-items: center; gap: 10px } .sv-who span { display: flex; flex-direction: column } .sv-who small { opacity: .75 }
.sv-stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden }
.sv-stage img, .sv-stage video { max-width: 100%; max-height: calc(100dvh - 160px); object-fit: contain }
.sv-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px }
.sv-text p { font-size: clamp(22px, 5vw, 38px); text-align: center; white-space: pre-wrap; max-width: 24ch; margin: 0; line-height: 1.3 }
.sv-caption { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; padding: 10px 20px; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); margin: 0 }
.sv-tap { position: absolute; top: 90px; bottom: 90px; width: 30%; z-index: 1 } .sv-tap.prev { inset-inline-start: 0 } .sv-tap.next { inset-inline-end: 0 }
.sv-foot { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 10px 12px calc(14px + var(--safe-b)); z-index: 2 }
.sv-foot .icon-btn { color: #fff }
.sv-views { display: flex; gap: 6px; align-items: center; color: #fff; padding: 8px 14px; border-radius: 99px; background: rgba(255, 255, 255, .14) }
.sv-reply-form { display: flex; gap: 6px; width: min(560px, 100%); align-items: center }
.sv-reply { background: rgba(255, 255, 255, .14); border: 0; color: #fff; border-radius: 99px }
.sv-reply::placeholder { color: rgba(255, 255, 255, .7) }
.status-compose { display: grid; gap: 12px }
.status-canvas { min-height: 300px; border-radius: 16px; display: grid; place-items: center; padding: 20px; transition: background .2s }
.status-text { background: transparent !important; border: 0 !important; color: #fff; text-align: center; font-size: 26px; resize: none; box-shadow: none !important }
.status-text::placeholder { color: rgba(255, 255, 255, .7) }
.status-tools { display: flex; align-items: center; gap: 4px } .status-tools .hint { flex: 1; text-align: end; margin-inline-end: 8px }
.status-preview { border-radius: 14px; overflow: hidden; background: #000; display: grid; place-items: center }
.status-preview img, .status-preview video { max-width: 100%; max-height: 55vh }
.font-serif { font-family: Georgia, "Times New Roman", serif } .font-hand { font-family: "Segoe Print", "Comic Sans MS", cursive } .font-mono { font-family: ui-monospace, Consolas, monospace } .font-bold { font-weight: 800 }
.viewers { display: grid; gap: 2px }

/* ---------- calls ---------- */
.call-ui { position: fixed; inset: 0; z-index: 44; background: radial-gradient(ellipse at top, #3a2530, #120c10 70%); color: #fff; display: grid; grid-template-rows: auto 1fr auto }
.call-top { display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-t)) 14px 8px }
.call-top .icon-btn { color: #fff }
.call-title { flex: 1; display: flex; flex-direction: column; text-align: center } .call-title small { opacity: .8; font-variant-numeric: tabular-nums }
.call-lock { display: flex; gap: 4px; align-items: center; font-size: .72em; opacity: .7 }
.call-tiles { display: grid; gap: 8px; padding: 8px; min-height: 0; grid-template-columns: 1fr }
.call-tiles[data-count="2"] { grid-template-columns: 1fr 1fr } .call-tiles[data-count="3"], .call-tiles[data-count="4"] { grid-template-columns: 1fr 1fr }
.call-tiles[data-count="5"], .call-tiles[data-count="6"], .call-tiles[data-count="7"], .call-tiles[data-count="8"] { grid-template-columns: repeat(3, 1fr) }
.tile { position: relative; border-radius: 18px; overflow: hidden; background: rgba(255, 255, 255, .05); display: grid; place-items: center; min-height: 0 }
.tile video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0 }
.tile.waiting { background: none; gap: 14px; align-content: center }
.tile-av { display: grid; place-items: center }
.tile-name { position: absolute; bottom: 10px; inset-inline-start: 12px; display: flex; gap: 4px; align-items: center; background: rgba(0, 0, 0, .45); padding: 3px 10px; border-radius: 99px; font-size: .82em }
.call-self { position: absolute; bottom: calc(110px + var(--safe-b)); inset-inline-end: 16px; width: 120px; aspect-ratio: 3/4; object-fit: cover; border-radius: 14px; box-shadow: var(--shadow); background: #222; transform: scaleX(-1) }
.call-controls { display: flex; justify-content: center; gap: 14px; padding: 16px 10px calc(22px + var(--safe-b)); flex-wrap: wrap }
.call-btn { display: grid; justify-items: center; gap: 6px; color: #fff; font-size: .72em; width: 64px }
.call-btn .ic { width: 56px; height: 56px; padding: 15px; border-radius: 50%; background: rgba(255, 255, 255, .14) }
.call-btn.on .ic { background: #fff; color: #222 }
.call-btn.end .ic { background: #e53e3e; color: #fff }
.call-btn.accept .ic { background: #38a169; color: #fff }
.call-ui.mini { inset: auto 16px calc(90px + var(--safe-b)) auto; width: 240px; height: 150px; border-radius: 18px; box-shadow: var(--shadow); grid-template-rows: 1fr auto; cursor: pointer; overflow: hidden }
.call-ui.mini .call-top { padding: 6px; position: absolute; z-index: 2; inset: 0 0 auto; font-size: .8em } .call-ui.mini .call-lock, .call-ui.mini .call-self { display: none }
.call-ui.mini .call-controls { padding: 4px; gap: 4px } .call-ui.mini .call-btn small { display: none } .call-ui.mini .call-btn .ic { width: 38px; height: 38px; padding: 9px } .call-ui.mini .call-btn { width: 40px }
.call-ui.mini .tile.waiting .avatar { --s: 48px !important } .call-ui.mini .tile.waiting p { display: none }
.incoming { position: fixed; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 47; width: min(440px, calc(100vw - 20px)); display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 22px; background: #1d1418; color: #fff; box-shadow: 0 16px 50px rgba(0, 0, 0, .45); animation: up .2s ease-out; flex-wrap: wrap }
.incoming-text { flex: 1; display: flex; flex-direction: column; min-width: 140px } .incoming-text small { opacity: .75 }
.incoming-actions { display: flex; gap: 6px }
.incoming .call-btn { width: 60px } .incoming .call-btn .ic { width: 50px; height: 50px; padding: 13px }

/* ---------- banners ---------- */
#banners { position: fixed; top: var(--safe-t); left: 50%; transform: translateX(-50%); z-index: 30; display: grid; gap: 6px; padding-top: 8px; pointer-events: none }
.banner { pointer-events: auto; max-width: calc(100vw - 24px); text-align: center; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 99px; font-size: .86em; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; justify-content: center }
.banner a { color: var(--gold); font-weight: 700 }
.banner.warn { background: var(--danger); color: #fff } .banner.warn a { color: #fff; text-decoration: underline }
.banner.offline { background: var(--gold); color: #1d1418 }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  #app.with-info { grid-template-columns: var(--rail) var(--list) 1fr }
  #info-pane { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(400px, 100vw); z-index: 20; box-shadow: var(--shadow) }
}
@media (max-width: 960px) { :root { --list: 320px } }
@media (max-width: 719px) {
  #app, #app.with-info { grid-template-columns: 1fr; grid-template-rows: 1fr auto }
  #rail { display: none }
  #tabbar { display: flex; grid-row: 2; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + var(--safe-b)) }
  #tabbar .nav-btn { width: auto; flex: 1; height: 56px; border-radius: 14px; display: grid; gap: 1px; align-content: center; justify-items: center; font-size: 11px }
  #tabbar .nav-btn.on { background: none } #tabbar .nav-btn.on .nav-icon { background: color-mix(in srgb, var(--accent) 16%, var(--card)); border-radius: 99px; padding: 2px 16px }
  #list-pane { grid-row: 1; border: 0 } #chat-pane { display: none }
  #app.in-chat #list-pane, #app.in-chat #tabbar { display: none }
  #app.in-chat #chat-pane { display: flex; grid-row: 1 / -1 }
  .chat-head .back { display: grid }
  .msg-row { max-width: 88% }
  .head-actions .icon-btn { width: 38px }
  .messages { padding: 10px 8px 14px }
  .media, .doc, .location-card { max-width: 260px }
  .fab, .fab-stack { bottom: 18px }
  #info-pane { width: 100vw }
  .call-self { width: 96px; bottom: calc(120px + var(--safe-b)) }
  .composer-host { padding: 4px 6px calc(8px + var(--safe-b)) }
  .compose-box .cam { display: none }
  dialog.modal.sheet, .menu.as-sheet { margin: auto 0 0 }
  #toast { bottom: calc(80px + var(--safe-b)) }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important } }
@media print { #rail, #tabbar, .composer-host, .chat-head { display: none } }
.compose-box textarea:focus-visible { outline: none }
.compose-box:focus-within { box-shadow: var(--shadow-s), 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent) }

/* ---------- stickers ---------- */
.msg-row.is-sticker .bubble { background: none !important; box-shadow: none !important; padding: 0; min-width: 0; border: 0 !important; backdrop-filter: none !important }
.msg-row.is-sticker .bubble .meta { position: static; justify-content: flex-end; background: color-mix(in srgb, var(--card) 80%, transparent); border-radius: 10px; padding: 1px 6px; width: max-content; margin-inline-start: auto }
.sticker-img { display: block; width: 168px; height: 168px; object-fit: contain; user-select: none; -webkit-user-drag: none }
.sticker-picker { display: flex; flex-direction: column; gap: 8px; min-height: 0 }
.sticker-tabs .make { margin-inline-start: auto }
.sticker-scroll { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; max-height: min(52dvh, 440px); min-height: 200px; -webkit-overflow-scrolling: touch }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px }
.sticker-cell { aspect-ratio: 1; border: 0; background: none; border-radius: 14px; padding: 4px; cursor: pointer; transition: transform .12s ease, background .12s }
.sticker-cell:hover, .sticker-cell:focus-visible { background: var(--soft); transform: scale(1.06) }
.sticker-cell img { width: 100%; height: 100%; object-fit: contain; pointer-events: none }
.sticker-src { font-size: .8em; color: var(--muted); margin: 12px 2px 6px; font-weight: 600 }
.sticker-more .btn { display: block; margin: 10px auto }
.sticker-preview { width: 220px; height: 220px; object-fit: contain; margin: 8px auto 4px; display: block }
.picker-switch { display: flex; gap: 4px; background: var(--soft); border-radius: 12px; padding: 3px; margin-bottom: 8px }
.picker-switch button { flex: 1; border: 0; background: none; padding: 7px 10px; border-radius: 9px; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer }
.picker-switch button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-s) }

/* ---------- frosted glass (iOS 26 "Liquid Glass" style), works with every colour theme ---------- */
:root[data-glass="1"] {
  --glass: color-mix(in srgb, var(--card) 38%, transparent);
  --glass-strong: color-mix(in srgb, var(--card) 58%, transparent);
  --glass-soft: color-mix(in srgb, var(--card) 22%, transparent);
  --glass-edge: rgba(255, 255, 255, .7);
  --glass-edge-2: rgba(255, 255, 255, .18);
  --glass-blur: blur(28px) saturate(185%) brightness(1.04);
  --glass-shine: inset 0 1px 0 var(--glass-edge), inset 0 -1px 0 var(--glass-edge-2), inset 0 0 0 1px rgba(255, 255, 255, .22);
}
:root[data-glass="1"][data-mode=dark] {
  --glass: color-mix(in srgb, var(--card) 34%, transparent);
  --glass-strong: color-mix(in srgb, var(--card) 54%, transparent);
  --glass-soft: color-mix(in srgb, var(--card) 18%, transparent);
  --glass-edge: rgba(255, 255, 255, .26); --glass-edge-2: rgba(255, 255, 255, .06);
  --glass-blur: blur(28px) saturate(170%) brightness(.92);
  --glass-shine: inset 0 1px 0 var(--glass-edge), inset 0 -1px 0 var(--glass-edge-2), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
/* a soft, colourful backdrop made from the theme's own colours — the glass needs something to blur */
:root[data-glass="1"] body {
  background:
    radial-gradient(55vmax 55vmax at 6% 0%, color-mix(in srgb, var(--accent) 85%, transparent), transparent 64%),
    radial-gradient(48vmax 48vmax at 100% 8%, color-mix(in srgb, var(--gold) 80%, transparent), transparent 62%),
    radial-gradient(52vmax 52vmax at 80% 100%, color-mix(in srgb, var(--deep) 75%, transparent), transparent 64%),
    radial-gradient(42vmax 42vmax at 14% 92%, color-mix(in srgb, var(--accent) 50%, var(--gold)), transparent 62%),
    radial-gradient(36vmax 36vmax at 52% 46%, color-mix(in srgb, var(--mine) 90%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
:root[data-glass="1"] #app { background: transparent }
:root[data-glass="1"] #rail, :root[data-glass="1"] #list-pane, :root[data-glass="1"] #info-pane,
:root[data-glass="1"] .chat-head, :root[data-glass="1"] #tabbar {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-color: var(--glass-edge-2); box-shadow: var(--glass-shine)
}
:root[data-glass="1"] #rail { background: var(--glass-soft) }
:root[data-glass="1"] #chat-pane { background-color: color-mix(in srgb, var(--chat) 12%, transparent) }
:root[data-glass="1"][data-mode=dark] body { background-blend-mode: normal; }
:root[data-glass="1"][data-mode=dark] #chat-pane { background-color: color-mix(in srgb, var(--chat) 38%, transparent) }
:root[data-glass="1"] .chat-head { position: relative; border-bottom-color: var(--glass-edge-2) }
:root[data-glass="1"] .bubble {
  background: var(--glass-strong); -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  box-shadow: var(--glass-shine), 0 4px 16px rgba(0, 0, 0, .08)
}
:root[data-glass="1"] .msg-row.mine .bubble { background: color-mix(in srgb, var(--mine) 72%, transparent) }
:root[data-glass="1"] .compose-box, :root[data-glass="1"] .send-btn, :root[data-glass="1"] .search-wrap input.search,
:root[data-glass="1"] .jump-bottom, :root[data-glass="1"] .fab-stack > * {
  background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shine), 0 8px 26px rgba(0, 0, 0, .12)
}
:root[data-glass="1"] .send-btn { background: color-mix(in srgb, var(--accent) 82%, transparent) }
:root[data-glass="1"] .modal-inner, :root[data-glass="1"] .menu, :root[data-glass="1"] #toast {
  background: var(--glass-strong); -webkit-backdrop-filter: blur(36px) saturate(190%); backdrop-filter: blur(36px) saturate(190%);
  border: 1px solid var(--glass-edge-2); box-shadow: var(--glass-shine), 0 20px 50px rgba(0, 0, 0, .22)
}
:root[data-glass="1"] dialog.modal::backdrop { background: rgba(10, 6, 12, .28); backdrop-filter: blur(6px) saturate(140%) }
:root[data-glass="1"] .chat-row.on { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: var(--glass-shine) }
:root[data-glass="1"] .chat-row:not(.static):hover { background: color-mix(in srgb, var(--card) 40%, transparent) }
:root[data-glass="1"] .nav-btn.on { background: var(--glass-strong); box-shadow: var(--glass-shine) }
:root[data-glass="1"] .picker-switch, :root[data-glass="1"] .seg { background: var(--glass-soft) }
@media (prefers-reduced-transparency: reduce) {
  :root[data-glass="1"] * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important }
  :root[data-glass="1"] { --glass: var(--card); --glass-strong: var(--card); --glass-soft: var(--soft) }
}
:root[data-glass="1"] #toast { color: var(--ink) }
.upload-progress[hidden] { display: none !important }

/* Settings → Account */
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line, rgba(127,127,127,.15)); flex-wrap: wrap; }
.account-row:last-child { border-bottom: 0; }
.account-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-main small { color: var(--muted, #888); }
.account-main strong { overflow-wrap: anywhere; }
.account-actions { display: flex; gap: 6px; align-items: center; }
.verify-badge { align-self: flex-start; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: rgba(220,140,0,.15); color: #b26b00; }
.verify-badge.ok { background: rgba(0,160,90,.15); color: #0a8a50; }
.reset-step[hidden] { display: none; }

/* Live captions in calls */
.call-captions { position: absolute; left: 50%; transform: translateX(-50%); bottom: 120px; width: min(92%, 720px); display: flex; flex-direction: column; gap: 6px; pointer-events: none; z-index: 3; }
.caption-line { margin: 0; padding: 6px 12px; border-radius: 12px; background: rgba(0,0,0,.62); color: #fff; font-size: 16px; line-height: 1.35; text-align: center; animation: capIn .2s ease-out; }
.caption-line.self { opacity: .7; font-size: 14px; }
.caption-line small { display: block; opacity: .7; font-size: 12px; }
@keyframes capIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Translation in chats */
.tr-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; opacity: .8; }
.tr-note .link.small, .translation .link.small { font-size: 12px; padding: 0; }
.translation.error small { color: var(--danger, #c0392b); }
.tr-actions { display: flex; gap: 10px; }
.transcript { margin: 6px 0 0; font-size: 14px; white-space: pre-wrap; }
.transcript.muted { opacity: .65; font-style: italic; }
.transcript.error { color: var(--danger, #c0392b); font-size: 12px; }
.transcribe-btn { display: block; margin-top: 4px; font-size: 12px; }
.notice-box { margin: 8px 16px; padding: 10px 12px; border-radius: 12px; background: rgba(220,140,0,.12); }
.notice-box p { margin: 0 0 8px; font-size: 14px; }

/* Maps & location */
.tile-map { position: relative; overflow: hidden; width: 100%; height: 100%; background: #e8e4dc; touch-action: none; user-select: none; }
.tile-map .map-tiles img { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.tile-map .map-tiles img.missing { visibility: hidden; }
.tile-map .map-pins { position: absolute; inset: 0; pointer-events: none; }
.map-pin { position: absolute; left: 0; top: 0; }
.map-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #d93025; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.map-pin.live .map-dot { background: #1a73e8; animation: livePulse 1.8s infinite; }
.map-acc { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(26,115,232,.15); border: 1px solid rgba(26,115,232,.35); }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(26,115,232,.55); } 70% { box-shadow: 0 0 0 14px rgba(26,115,232,0); } 100% { box-shadow: 0 0 0 0 rgba(26,115,232,0); } }
.map-credit { position: absolute; right: 4px; bottom: 2px; font-size: 9px; background: rgba(255,255,255,.75); color: #333; padding: 0 4px; border-radius: 4px; }
.map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.map-zoom button { width: 36px; height: 36px; border-radius: 8px; border: 0; background: #fff; color: #222; font-size: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; }
.location-card { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; width: min(280px, 70vw); border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.location-card .loc-map { display: block; width: 100%; height: 140px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.location-card .loc-map .loc-art { display: grid; place-items: center; height: 100%; }
.location-card .loc-info { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.location-card .loc-actions { display: flex; gap: 14px; margin-top: 4px; }
.location-card .loc-actions .link { color: var(--accent) !important; text-decoration: none; font-weight: 600 }
.location-card .live-dot::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1a73e8; margin-inline-end: 6px; animation: livePulse 1.8s infinite; }
.link.small.danger { color: var(--danger, #c0392b); }
.share-loc { display: flex; flex-direction: column; gap: 10px; }
.share-loc .tile-map.loc-pick { height: 220px; border-radius: 12px; }
.share-loc .live-box { border-top: 1px solid var(--line, rgba(127,127,127,.2)); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.map-viewer .tile-map.big { height: min(65vh, 560px); border-radius: 12px; }
.location-card .loc-map .loc-art { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, var(--soft), color-mix(in srgb, var(--accent) 14%, var(--soft))); color: var(--accent) }
.location-card.live-on .loc-map .loc-art { color: #1a73e8 }
button.link[hidden] { display: none }
.pw-wrap { position: relative; display: block }
.pw-wrap input { width: 100%; padding-inline-end: 44px }
.pw-eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 18px; opacity: .45; cursor: pointer; padding: 6px }
.pw-eye.on { opacity: 1 }

/* Video call: tap the small picture to swap it with the big one (like WhatsApp) */
.call-self { cursor: pointer; z-index: 2; transition: all .25s ease }
.call-top, .call-controls, .call-captions { position: relative; z-index: 3 }
.call-ui.swap .call-self { inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; bottom: auto; z-index: 0; box-shadow: none }
.call-ui.swap .call-tiles { position: absolute; z-index: 2; bottom: calc(110px + var(--safe-b)); inset-inline-end: 16px; width: 120px; height: 160px; padding: 0; cursor: pointer; transition: all .25s ease }
.call-ui.swap .call-tiles .tile { border-radius: 14px; box-shadow: var(--shadow) }
.call-ui.swap .call-tiles .tile-name, .call-ui.swap .call-tiles .tile-av .avatar { transform: scale(.5) }
@media (max-width: 700px) { .call-ui.swap .call-tiles { width: 96px; height: 128px; bottom: calc(120px + var(--safe-b)) } }

/* Settings → Contact us */
.support-card { margin: 12px; border-radius: 22px; overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-s, 0 2px 10px rgba(0,0,0,.06)) }
.support-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 20px 22px; background: linear-gradient(160deg, var(--accent), var(--deep)); color: #fff }
.support-hero h2 { margin: 6px 0 0; font-size: 1.35em } .support-hero p { margin: 0; opacity: .9; font-size: .95em }
.support-hero .brand-mark.big { width: 64px; height: 64px; font-size: 34px; border-radius: 20px; background: rgba(255,255,255,.18); color: #fff; display: grid; place-items: center }
.support-hours { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 12px; border-radius: 99px; background: rgba(255,255,255,.18); font-size: .85em }
.support-list { display: flex; flex-direction: column; padding: 6px 0 }
.support-action { display: flex; align-items: center; gap: 14px; padding: 12px 18px; color: inherit !important; text-decoration: none; border-bottom: 1px solid var(--line) }
.support-action:last-child { border-bottom: 0 } .support-action:hover { background: var(--soft) }
.support-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); flex: none }
.support-text { flex: 1; display: flex; flex-direction: column; min-width: 0 } .support-text small { color: var(--muted) } .support-text strong { overflow-wrap: anywhere }
.support-foot { text-align: center; color: var(--muted); font-size: .8em; padding: 10px; margin: 0; border-top: 1px solid var(--line) }

/* Status / connection banners are always solid and readable (see-through ones turned black on iPhone). */
.banner.offline { background: #f2b33d; color: #1d1418; border: 0 }
.banner.offline::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .9s linear infinite; flex: none }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- solid colour bars (WhatsApp style): strong top bar and tabs ---------- */
:root[data-solid="1"] #list-pane > .pane-head, :root[data-solid="1"] .chat-head, :root[data-solid="1"] #info-pane .pane-head {
  background: var(--bar); color: var(--onbar); border-bottom-color: transparent; box-shadow: 0 1px 3px rgba(0, 0, 0, .12)
}
:root[data-solid="1"] #list-pane > .pane-head .icon-btn, :root[data-solid="1"] .chat-head .icon-btn,
:root[data-solid="1"] #info-pane .pane-head .icon-btn, :root[data-solid="1"] .chat-head .head-text strong { color: var(--onbar) }
:root[data-solid="1"] #list-pane > .pane-head .icon-btn:hover, :root[data-solid="1"] .chat-head .icon-btn:hover { background: rgba(255, 255, 255, .14) }
:root[data-solid="1"] .pane-head .pane-title small, :root[data-solid="1"] .chat-head .head-sub { color: color-mix(in srgb, var(--onbar) 78%, transparent) }
:root[data-solid="1"] #rail { background: var(--bar); border-inline-end-color: transparent }
:root[data-solid="1"] #rail .nav-btn { color: color-mix(in srgb, var(--onbar) 72%, transparent) }
:root[data-solid="1"] #rail .nav-btn:hover { background: rgba(255, 255, 255, .12); color: var(--onbar) }
:root[data-solid="1"] #rail .nav-btn.on { background: rgba(255, 255, 255, .2); color: var(--onbar) }
@media (max-width: 719px) {
  :root[data-solid="1"] #tabbar { background: var(--bar); border-top-color: transparent }
  :root[data-solid="1"] #tabbar .nav-btn { color: color-mix(in srgb, var(--onbar) 70%, transparent) }
  :root[data-solid="1"] #tabbar .nav-btn.on { color: var(--onbar) }
  :root[data-solid="1"] #tabbar .nav-btn.on .nav-icon { background: rgba(255, 255, 255, .2) }
}
:root[data-solid="1"] .fab { background: var(--accent); color: #fff }
:root[data-solid="1"] #tabbar .badge, :root[data-solid="1"] #rail .badge { background: #fff; color: var(--bar) }
/* Licence / connection banners: fixed readable colours in every theme (glass, dark, solid). */
.banner { background: #2b2226 !important; color: #fff !important; border: 0 !important }
.banner a { color: #f3c06b !important }
.banner.warn { background: #c62f3c !important; color: #fff !important } .banner.warn a { color: #fff !important }
.banner.offline { background: #f2b33d !important; color: #1d1418 !important }
.banner .banner-x { color: inherit; opacity: .8; font-size: 1.15em; line-height: 1; padding: 0 2px; margin-inline-start: 2px }
/* Status page buttons: the camera button keeps its colour in glass themes (it looked all white / all black). */
:root[data-glass="1"] .fab-stack > .fab:not(.small) { background: color-mix(in srgb, var(--accent) 88%, transparent); color: var(--on-accent) }
:root[data-glass="1"] .fab-stack > .fab.small { color: var(--accent) }
/* ---------- photo & video tools (crop, draw, text, trim) ---------- */
.file-previews figure { position: relative }
.fig-tool { position: absolute; top: 6px; inset-inline-end: 6px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.6); color: #fff; z-index: 1 }
.fig-tool:hover { background: rgba(0,0,0,.78) }
.crop-avatar { display: grid; gap: 12px; justify-items: center }
.crop-canvas { border-radius: 12px; touch-action: none; cursor: grab; background: #000 }
.crop-zoom-row { display: flex; align-items: center; gap: 10px; width: min(320px, 80vw); color: var(--muted) }
.crop-zoom-row input { flex: 1 }
.editor-modal .modal-inner { max-width: min(900px, 96vw) }
.photo-editor, .video-trimmer { display: grid; gap: 10px }
.edit-tools { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap }
.edit-tools .icon-btn.on { background: var(--accent); color: var(--on-accent) }
.edit-stage { position: relative; display: grid; place-items: center; background: #111; border-radius: 12px; overflow: hidden; min-height: 200px }
.edit-canvas { display: block; max-width: 100%; max-height: 62vh; touch-action: none; cursor: crosshair }
.edit-text { position: absolute; transform: translate(-50%, -50%); font: 700 28px/1.15 system-ui, sans-serif; text-shadow: 0 1px 3px rgba(0,0,0,.6); cursor: move; touch-action: none; user-select: none; white-space: pre; padding: 4px 8px; border: 1px dashed rgba(255,255,255,.7); border-radius: 6px }
.edit-sub { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; min-height: 34px }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 0 0 1px rgba(0,0,0,.25) }
.swatch.on { outline: 3px solid var(--accent); outline-offset: 2px }
.edit-size { width: 120px }
.trim-video { width: 100%; max-height: 52vh; background: #000; border-radius: 12px }
.trim-row { display: flex; align-items: center; gap: 10px }
.trim-bar { position: relative; flex: 1; height: 46px; border-radius: 10px; background: var(--soft); touch-action: none }
.trim-sel { position: absolute; top: 0; bottom: 0; border: 3px solid var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 18%, transparent); pointer-events: none }
.trim-handle { position: absolute; top: -4px; bottom: -4px; width: 18px; margin-inline-start: -9px; border-radius: 6px; background: var(--accent); cursor: ew-resize; touch-action: none; box-shadow: 0 1px 4px rgba(0,0,0,.3) }
.trim-handle::after { content: ''; position: absolute; left: 50%; top: 30%; bottom: 30%; width: 2px; margin-left: -1px; background: var(--on-accent); border-radius: 2px }
.trim-head { position: absolute; top: 2px; bottom: 2px; width: 2px; background: var(--ink); pointer-events: none }
.trim-label { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums }
.trim-progress { text-align: center; font-weight: 600 }
.dl-placeholder { display: grid !important; place-items: center; gap: 4px; min-width: 200px; min-height: 160px; background: color-mix(in srgb, var(--ink) 12%, var(--card)); color: var(--ink); border-radius: 10px }
.dl-placeholder small { opacity: .8 }
