:root {
  --bg: #f4f5fb;
  --panel: #ffffff;
  --panel-2: #f7f7fc;
  --line: #e4e6f0;
  --text: #1b1d2a;
  --muted: #6b7088;
  --accent: #6c4dff;
  --accent-2: #3fb6ff;
  --accent-text: #ffffff;
  --mine: #6c4dff;
  --mine-text: #ffffff;
  --theirs: #ffffff;
  --theirs-text: #1b1d2a;
  --danger: #d93f5c;
  --ok: #1fae6c;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(30, 20, 90, .10);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1018;
    --panel: #171925;
    --panel-2: #1d2030;
    --line: #2a2d40;
    --text: #e8e9f3;
    --muted: #9095ad;
    --accent: #8b72ff;
    --mine: #6c4dff;
    --theirs: #232638;
    --theirs-text: #e8e9f3;
    --shadow: 0 8px 30px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- shared ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 22px; letter-spacing: .2px; }
.brand.small { font-size: 18px; gap: 8px; }
.hint { color: var(--muted); margin: 0 0 14px; line-height: 1.45; }
.error { color: var(--danger); min-height: 1.2em; margin: 4px 0 10px; font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 24px 16px; line-height: 1.5; }
.empty.center { margin: auto; }
.sub { color: var(--muted); font-size: 13px; }
.name { font-weight: 600; }

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-text); border: 0; border-radius: 10px;
  padding: 11px 16px; font-weight: 600; width: 100%;
}
.primary:disabled { opacity: .6; cursor: default; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 0;
  background: transparent; display: grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn svg, .send svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 15px;
  background: var(--accent);
}

input:not([type=checkbox]), textarea {
  width: 100%; border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 10px; padding: 10px 12px; outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); }

/* ---------- auth ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.card {
  width: 100%; max-width: 380px; background: var(--panel); border-radius: 20px;
  padding: 28px 24px; box-shadow: var(--shadow);
}
.card h1 { font-size: 20px; margin: 22px 0 6px; }
.card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.card label input { margin-top: 5px; font-size: 15px; color: var(--text); }

/* ---------- layout ---------- */
.app { height: 100%; display: flex; }
.sidebar {
  width: 340px; flex: none; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 16px; }
.actions { display: flex; gap: 2px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 16px 12px; border-bottom: 1px solid var(--line); }
.me .avatar { width: 34px; height: 34px; font-size: 13px; }
#conn.online { color: var(--ok); }

.chat-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.chat-list:empty { display: none; }
.chat-item {
  display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; cursor: pointer;
}
.chat-item:hover { background: var(--panel-2); }
.chat-item.active { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chat-item .meta { flex: 1; min-width: 0; }
.chat-item .row { display: flex; justify-content: space-between; gap: 8px; }
.chat-item .time { color: var(--muted); font-size: 12px; flex: none; }
.chat-item .preview { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  background: var(--accent); color: #fff; border-radius: 10px; font-size: 12px;
  padding: 1px 7px; font-weight: 600; flex: none;
}

.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.chat-head .back { display: none; }

.messages { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; }
.day { align-self: center; color: var(--muted); font-size: 12px; background: var(--panel); border-radius: 10px; padding: 3px 10px; margin: 10px 0 6px; }
.msg {
  max-width: min(560px, 78%); padding: 8px 12px 6px; border-radius: 16px;
  background: var(--theirs); color: var(--theirs-text); align-self: flex-start;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .05); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4;
}
.msg.mine { background: var(--mine); color: var(--mine-text); align-self: flex-end; }
.msg .t { font-size: 11px; opacity: .65; margin-left: 10px; float: right; margin-top: 6px; }
.msg.pending { opacity: .6; }

.composer {
  display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px;
  background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.composer textarea { resize: none; max-height: 160px; line-height: 1.4; }
.send {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  display: grid; place-items: center;
}

/* ---------- dialogs ---------- */
.dialog {
  border: 0; border-radius: 18px; padding: 22px; width: min(420px, calc(100vw - 32px));
  background: var(--panel); color: var(--text); box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(10, 10, 30, .45); }
.dialog h2 { margin: 0 0 12px; font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.user-list, .invite-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.user-list li { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; cursor: pointer; }
.user-list li:hover { background: var(--panel-2); }
.invite-list li {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.invite-list input { font-size: 13px; }
.invite-actions { display: flex; gap: 6px; align-items: center; }
.invite-actions .ghost { padding: 7px 12px; font-size: 14px; }
.invite-actions .grow { flex: 1; }
.invite-actions .revoke { margin-left: auto; color: var(--danger); }
.warn {
  background: color-mix(in srgb, #d99a1e 14%, transparent); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin: 0 0 14px;
}
.qr-dialog { text-align: center; }
.qr {
  display: block; margin: 4px auto 14px; width: min(280px, 70vw); height: auto;
  background: #fff; border-radius: 14px; padding: 6px;
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: 14px; z-index: 10; max-width: calc(100vw - 32px);
}

/* ---------- stage 2: groups, presence, receipts ---------- */
.avatar { position: relative; }
.avatar.group { border-radius: 30%; }
.avatar.big { width: 56px; height: 56px; font-size: 20px; }
.avatar svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.avatar.online::after {
  content: ''; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px;
  border-radius: 50%; background: var(--ok); border: 2px solid var(--panel);
}

.chat-info {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
  background: none; border: 0; padding: 0; text-align: left; cursor: default;
}
.chat-info.clickable { cursor: pointer; }
.chat-info-text { min-width: 0; }
.chat-info-text .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub.accent, .preview.typing { color: var(--accent); }

.msg .meta { font-size: 11px; opacity: .7; margin-left: 10px; float: right; margin-top: 6px; white-space: nowrap; }
.msg .tick { margin-left: 3px; letter-spacing: -3px; }
.msg .tick.read { color: #9fe6ff; opacity: 1; }
.author { font-size: 13px; font-weight: 600; margin: 8px 0 1px 12px; }
.system {
  align-self: center; text-align: center; color: var(--muted); font-size: 13px;
  background: var(--panel); border-radius: 10px; padding: 4px 12px; margin: 6px 0; max-width: 90%;
}

.new-group {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; margin-bottom: 10px;
  background: none; border: 0; border-radius: 10px; text-align: left; color: var(--accent);
}
.new-group:hover { background: var(--panel-2); }
#group-title { margin-bottom: 8px; }
.user-list.pick li { cursor: pointer; }
.user-list .check {
  margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; color: #fff; font-size: 13px; flex: none;
}
.user-list li.selected .check { background: var(--accent); border-color: var(--accent); }
.user-list li .grow { flex: 1; min-width: 0; }
.user-list .role { color: var(--accent); font-size: 12px; }
.user-list .remove { padding: 5px 10px; font-size: 13px; color: var(--danger); }
#dlg-info .user-list li { cursor: default; }

.primary.inline { width: auto; }
.dialog-actions { gap: 8px; }
.dialog-actions.spread { justify-content: space-between; }
.ghost.danger { color: var(--danger); }
.ghost.wide { width: 100%; margin-top: 10px; color: var(--accent); }
.info-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.info-head h2 { margin: 0 0 2px; overflow-wrap: anywhere; }
.rename { display: flex; gap: 6px; }
.rename .ghost { flex: none; }

/* ---------- stage 3: files, photos, avatars ---------- */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.online { overflow: visible; }
.avatar.online img { border-radius: inherit; }

button.me {
  width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line);
  text-align: left; cursor: pointer;
}
button.me:hover { background: var(--panel-2); }

.composer .attach { flex: none; height: 42px; width: 38px; }
.upload-bar {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  background: var(--panel); border-top: 1px solid var(--line);
}
.upload-info { flex: 1; min-width: 0; }
.upload-name { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; }
.progress { height: 5px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
#upload-progress { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .15s; }

.chat { position: relative; }
.drop-overlay {
  position: absolute; inset: 12px; z-index: 5; display: grid; place-items: center;
  border: 2px dashed var(--accent); border-radius: 18px; font-size: 18px; font-weight: 600; color: var(--accent);
  background: color-mix(in srgb, var(--panel) 88%, transparent); pointer-events: none;
}

.msg.has-file { padding: 4px 4px 6px; }
.msg.has-file .caption { padding: 6px 8px 0; }
.msg.has-file .meta { margin-right: 6px; }
.att-image {
  display: block; max-width: 100%; height: auto; border-radius: 12px; cursor: zoom-in;
  background: color-mix(in srgb, var(--muted) 15%, transparent);
}
.att-video { display: block; max-width: min(420px, 100%); max-height: 420px; border-radius: 12px; background: #000; }
.att-audio { display: block; width: min(300px, 70vw); margin: 4px; }
.att-file {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; color: inherit; text-decoration: none;
  min-width: 200px;
}
.att-icon {
  flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase; overflow: hidden;
  background: color-mix(in srgb, currentColor 16%, transparent);
}
.att-meta { display: flex; flex-direction: column; min-width: 0; }
.att-name { font-weight: 600; overflow-wrap: anywhere; }
.att-size { font-size: 12px; opacity: .7; }
.att-file:hover .att-name { text-decoration: underline; }

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; display: none; flex-direction: column; align-items: center; justify-content: center;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgba(5, 5, 15, .88); }
.lightbox img { max-width: 96vw; max-height: calc(100vh - 80px); object-fit: contain; border-radius: 6px; }
.lightbox-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; max-width: 96vw; }
.lightbox-bar .ghost { color: #fff; border-color: rgba(255, 255, 255, .3); text-decoration: none; font-size: 14px; }
.lightbox-name { color: #ddd; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }

.photo-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-actions .ghost { font-size: 14px; padding: 6px 10px; }
#group-photo-actions { margin-bottom: 10px; }
.field { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }
.field input { margin-top: 5px; font-size: 15px; color: var(--text); }

/* ---------- stage 5: notifications ---------- */
.push-banner {
  margin: 10px 10px 4px; padding: 12px; border-radius: 12px; font-size: 14px; line-height: 1.4;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.push-banner p { margin: 0 0 10px; }
.push-banner-actions { display: flex; gap: 8px; }
.push-banner-actions .ghost { padding: 6px 12px; font-size: 14px; }
.push-banner-actions .primary { padding: 7px 14px; font-size: 14px; }
.push-section {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px;
}
.push-section .sub { margin-top: 2px; }
.push-section .ghost { flex: none; font-size: 14px; padding: 7px 12px; }

/* ---------- round video messages ---------- */
.composer .attach { padding: 0; }
.msg.round-msg { background: transparent; box-shadow: none; padding: 0; color: var(--text); }
.msg.round-msg .meta { float: none; display: block; text-align: right; margin: 4px 8px 0; color: var(--muted); }
.msg.round-msg .tick.read { color: var(--accent); }
.round {
  position: relative; width: 240px; height: 240px; border-radius: 50%; overflow: hidden;
  cursor: pointer; background: #111; -webkit-tap-highlight-color: transparent;
}
.round video { width: 100%; height: 100%; object-fit: cover; display: block; }
.round svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.round .ring { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; opacity: .9; transition: stroke-dashoffset .2s linear; }
.round-time {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.round.paused::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: rgba(0, 0, 0, .45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='white'/%3E%3C/svg%3E") center / 26px no-repeat;
}

.round-recorder {
  position: fixed; inset: 0; z-index: 20; padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(5, 5, 15, .88); color: #fff;
}
.rr-stage { position: relative; width: min(78vw, 360px); aspect-ratio: 1; }
.rr-stage video {
  position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px);
  border-radius: 50%; object-fit: cover; background: #111;
}
.rr-stage video.mirror { transform: scaleX(-1); }
.rr-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.rr-track { fill: none; stroke: rgba(255, 255, 255, .15); stroke-width: 2; }
.rr-progress {
  fill: none; stroke: #ff4d6d; stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 301.6; stroke-dashoffset: 301.6;
}
.rr-timer { font-size: 18px; font-variant-numeric: tabular-nums; }
.round-recorder[data-mode="recording"] .rr-timer::before { content: '● '; color: #ff4d6d; }
.rr-hint { margin: 0; font-size: 14px; opacity: .75; text-align: center; }
.rr-controls { display: flex; align-items: center; gap: 28px; }
.rr-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .15); color: #fff; font-size: 20px;
}
.rr-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rr-main { width: 74px; height: 74px; background: #fff; }
.rr-main span { width: 58px; height: 58px; border-radius: 50%; background: #ff4d6d; transition: all .2s; }
.round-recorder[data-mode="recording"] .rr-main span { width: 28px; height: 28px; border-radius: 7px; }
.round-recorder[data-mode="recording"] #rr-flip { visibility: hidden; }

/* ---------- chat menu, swipe actions, archive, selection ---------- */
.chat-row { position: relative; border-radius: 12px; overflow: hidden; }
.chat-row .chat-item { position: relative; background: var(--panel); touch-action: pan-y; transition: transform .2s; }
.chat-row .chat-item.dragging { transition: none; }
.chat-row .chat-item:hover { background: var(--panel-2); }
.chat-row .chat-item.active { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.swipe-actions { position: absolute; inset: 0 auto 0 0; display: flex; }
.swipe-actions.right { inset: 0 0 0 auto; }
.swipe-actions .sw-erase { background: #4a5ad9; }
.swipe-actions .sw-block { background: #b0446a; }
.row-right { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.list-tick { font-size: 12px; color: var(--muted); letter-spacing: -3px; margin-right: 3px; }
.list-tick.read { color: var(--accent); }
.blocked-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px;
  background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.blocked-bar .ghost { color: var(--accent); }
.swipe-actions button {
  width: 76px; border: 0; color: #fff; font-size: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}
.swipe-actions svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.swipe-actions .sw-mute { background: #d98a1e; }
.swipe-actions .sw-delete { background: #d93f3f; }
.swipe-actions .sw-archive { background: #7a7d8c; }

.item-menu {
  flex: none; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); display: grid; place-items: center; opacity: 0; margin-left: -4px;
}
.chat-item:hover .item-menu, .item-menu:focus-visible, .chat-item.menu-open .item-menu { opacity: 1; }
.item-menu:hover { background: color-mix(in srgb, var(--muted) 18%, transparent); }
@media (pointer: coarse) { .item-menu { display: none; } }
.status-icons { display: inline-flex; gap: 3px; align-items: center; color: var(--muted); flex: none; }
.status-icons svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge.muted { background: var(--muted); }
.badge.dot { min-width: 10px; height: 10px; padding: 0; border-radius: 50%; }
.select-box {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; color: #fff; font-size: 13px;
}
.chat-item.selected .select-box { background: var(--accent); border-color: var(--accent); }
.archive-row .avatar { background: var(--muted) !important; }

.list-bar {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.list-bar .name { flex: 1; }
.select-actions { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; padding-bottom: 4px; }
.select-actions .ghost { font-size: 13px; padding: 5px 9px; }

.popup-menu {
  position: fixed; z-index: 30; min-width: 250px; padding: 6px; border-radius: 14px;
  background: var(--panel); box-shadow: 0 10px 40px rgba(10, 10, 40, .25); border: 1px solid var(--line);
}
.popup-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px;
  background: none; text-align: left; font-size: 15px;
}
.popup-menu button:hover, .popup-menu button:focus-visible { background: var(--panel-2); outline: none; }
.popup-menu button.danger { color: var(--danger); }
.popup-menu svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.check-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.primary.danger-bg { background: var(--danger); }

/* ---------- voice messages ---------- */
.record-btn .icon-voice { display: none; }
.record-btn[data-mode="voice"] .icon-voice { display: block; }
.record-btn[data-mode="voice"] .icon-round { display: none; }
.record-btn.recording { color: #ff4d6d; background: color-mix(in srgb, #ff4d6d 15%, transparent); }
.record-btn { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.composer { position: relative; }
.voice-bar {
  position: absolute; inset: 0 110px 0 0; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--panel); z-index: 2;
}
.voice-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff4d6d; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.voice-timer { font-variant-numeric: tabular-nums; font-weight: 600; }
.voice-hint { color: var(--muted); font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-bar .ghost { padding: 6px 10px; font-size: 13px; }

.voice { display: flex; align-items: center; gap: 10px; padding: 4px 6px 0 4px; min-width: 220px; }
.voice-play {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--accent); color: #fff;
}
.msg.mine .voice-play { background: #fff; color: var(--mine); }
.voice-play svg { width: 18px; height: 18px; fill: currentColor; }
.voice-body { flex: 1; min-width: 0; }
.wave { display: flex; align-items: center; gap: 2px; height: 28px; cursor: pointer; }
.wave span { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: currentColor; opacity: .35; }
.wave span.played { opacity: 1; }
.voice-time { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .sidebar { width: 100%; border-right: 0; }
  .chat { display: none; }
  .app.chat-open .sidebar { display: none; }
  .app.chat-open .chat { display: flex; }
  .chat-head .back { display: grid; }
  .messages { padding: 12px; }
  .msg { max-width: 85%; }
  .round { width: 200px; height: 200px; }
  .voice-bar { inset: 0 104px 0 0; padding: 0 10px; }
  .voice-hint { font-size: 12px; }
}
