/* Чаты. Оформление по макету design-v2/chats.html: тёплая палитра, Manrope, карточки, тёмные исходящие пузыри. */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');
:root {
  --bg: #f6f3f0; --surface: #ffffff; --surface-2: #f1ece8; --ink: #1d1715; --muted: #7b706b; --line: rgba(29, 23, 21, .08);
  --accent: #d94f70; --accent-ink: #ffffff; --accent-soft: #fbe7ec;
  --danger: #e5484d; --danger-soft: #fdeceb; --ok: #22a06b;
  --brand-bg: #1d1715; --brand-ink: #f3eeeb; --brand-muted: #a39d99;
  --tg: #2aabee; --wa: #25d366; --max: #8a5cf0;
  --shadow: 0 1px 2px rgba(29, 23, 21, .04), 0 8px 24px rgba(29, 23, 21, .06);
  --radius: 16px;
  --font: Manrope, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121011; --surface: #1c1a1b; --surface-2: #262324; --ink: #f3eeeb; --muted: #9c938f; --line: rgba(255, 255, 255, .08);
    --accent: #ff6f8f; --accent-ink: #ffffff; --accent-soft: rgba(255, 111, 143, .14);
    --danger: #ff8b82; --danger-soft: #3a1f1d; --ok: #5fd39a;
    --brand-bg: #0c0a0b; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121011; --surface: #1c1a1b; --surface-2: #262324; --ink: #f3eeeb; --muted: #9c938f; --line: rgba(255, 255, 255, .08);
  --accent: #ff6f8f; --accent-ink: #ffffff; --accent-soft: rgba(255, 111, 143, .14);
  --danger: #ff8b82; --danger-soft: #3a1f1d; --ok: #5fd39a;
  --brand-bg: #0c0a0b; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }

/* ---------- вход ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, 5fr) minmax(360px, 6fr); }
.brand { background: var(--brand-bg); color: var(--brand-ink); padding: clamp(24px, 5vw, 56px); display: flex; flex-direction: column; gap: 28px; justify-content: space-between; min-width: 0; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.logo svg { width: 30px; height: 30px; flex: none; }
.headline { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.1; font-weight: 700; letter-spacing: -.025em; text-wrap: balance; max-width: 16ch; }
.lead { color: var(--brand-muted); max-width: 38ch; margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.07); font-size: 14px; font-weight: 600; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.demo { display: grid; gap: 10px; max-width: 380px; }
.demo-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.06); }
.demo-row .av { width: 36px; height: 36px; border-radius: 50%; background: var(--c); display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.demo-row b { display: block; font-size: 14px; }
.demo-row span { display: block; font-size: 13px; color: var(--brand-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-row em { font-style: normal; font-size: 12px; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.demo-note { font-size: 12px; color: var(--brand-muted); }

.panel { position: relative; display: grid; place-items: center; padding: 56px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left)); min-width: 0; }
.theme { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.theme svg { width: 20px; height: 20px; }
.card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 4vw, 36px); display: grid; gap: 18px; box-shadow: var(--shadow); }
.card h1 { font-size: 28px; letter-spacing: -.02em; line-height: 1.15; }
.sub { color: var(--muted); margin-top: 4px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 99px; }
.seg button { border: 0; background: transparent; padding: 9px 8px; border-radius: 99px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(16, 34, 43, .15); }
form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.row { display: flex; gap: 8px; align-items: stretch; }
.input { flex: 1; min-width: 0; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 17px; }
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input[data-state="error"] { border-color: var(--danger); }
.input[data-state="ok"] { border-color: var(--ok); }
.hint { font-size: 13px; color: var(--muted); min-height: 0; }
.hint[data-state="error"] { color: var(--danger); }
.toggle { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 0 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.rules li::before { content: "○ "; }
.rules li[data-ok="true"] { color: var(--ok); }
.rules li[data-ok="true"]::before { content: "● "; }
.err { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.err:empty { display: none; }
.btn { border: 0; border-radius: 99px; background: var(--accent); color: var(--accent-ink); padding: 13px 16px; font-weight: 700; font-size: 16px; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: var(--surface-2); color: var(--ink); border: 1.5px solid transparent; }
.alt { text-align: center; color: var(--muted); font-size: 15px; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.qr { display: grid; justify-items: center; gap: 12px; text-align: center; }
.qr-box { width: 240px; height: 240px; border-radius: 16px; background: #fff; display: grid; place-items: center; border: 1px solid var(--line); overflow: hidden; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-box.dead svg { opacity: .15; }
.qr p { color: var(--muted); font-size: 14px; max-width: 32ch; }
.qr .timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

/* ---------- приложение ---------- */
.shell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); background: var(--surface); border-bottom: 1px solid var(--line); }
.top .logo { font-size: 20px; }
.top .grow { flex: 1; }
.me { font-size: 14px; color: var(--muted); max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .theme { position: static; }
.embedded { height: 100vh; height: 100dvh; min-height: 0; grid-template-rows: 1fr; }
.embedded .list { overflow-y: auto; }
.embedded .top { display: none; }
.work { display: grid; grid-template-columns: 380px 1fr; min-height: 0; gap: 12px; padding: 12px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 18px 12px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.list h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.empty { color: var(--muted); font-size: 15px; padding: 18px; border: 1.5px dashed var(--line); border-radius: var(--radius); }
.main { padding: clamp(16px, 3vw, 32px); display: grid; gap: 18px; align-content: start; min-width: 0; }
.main h2 { font-size: 22px; letter-spacing: -.01em; }
.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ch { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 10px; align-content: start; }
.ch .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); display: inline-block; margin-right: 8px; }
.ch h3 { font-size: 17px; }
.ch p { color: var(--muted); font-size: 14px; }
.badge { justify-self: start; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.approve { max-width: 460px; margin: 10vh auto; }
.ok { background: var(--accent-soft); color: var(--accent); padding: 10px 12px; border-radius: 10px; font-weight: 600; }

/* ---------- переписки ---------- */
.work { height: 100%; overflow: hidden; }
.list { overflow-y: auto; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn.sm { padding: 7px 14px; font-size: 14px; border-radius: 99px; }
.search { width: 100%; font-size: 15px; padding: 10px 14px; height: 42px; border-radius: 14px; border-color: transparent; background: var(--surface-2); }
.strip { display: flex; flex-wrap: wrap; gap: 6px; }
.strip:empty { display: none; }
.chan { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.chan i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chan button { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 4px 6px; border-radius: 50%; display: grid; place-items: center; }
.chan button svg { width: 16px; height: 16px; display: block; }
.chan button[data-act="eye"]:hover { color: var(--ink); }
.chan button[data-act="disc"]:hover { color: var(--danger); }
.chan.off { opacity: .6; text-decoration: line-through; text-decoration-thickness: 1px; }
.chan.off button { text-decoration: none; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters:empty { display: none; }
.ftab { display: inline-flex; align-items: center; gap: 6px; height: 32px; border: 0; background: var(--surface-2); border-radius: 99px; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ftab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.ftab em { font-style: normal; font-size: 12px; opacity: .6; }
.ftab[aria-selected="true"] em { color: inherit; }
.av { position: relative; }
.av[data-t]:not([data-t=""])::after { content: attr(data-t); position: absolute; right: -4px; bottom: -4px; font-size: 9px; font-weight: 800; letter-spacing: -.02em; line-height: 1; padding: 3px 4px; border-radius: 999px; background: var(--surface); color: var(--c); border: 1.5px solid var(--c); }
.chat-list { display: grid; gap: 2px; align-content: start; }
.empty .btn { margin-top: 12px; width: 100%; }
.chat { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; border: 0; background: transparent; padding: 10px; border-radius: 16px; width: 100%; }
.chat:hover { background: var(--surface-2); }
.chat[aria-current="true"] { background: var(--accent-soft); }
.av { width: 48px; height: 48px; border-radius: 50%; background: var(--c, var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.chat-main { min-width: 0; display: grid; }
.chat-main b { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-main span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-meta { display: grid; justify-items: end; gap: 4px; font-size: 12px; color: var(--muted); }
.chat-meta em { font-style: normal; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 1px 7px; border-radius: 999px; min-width: 20px; text-align: center; }
.convo { display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); min-width: 0; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.convo-empty { display: grid; place-items: center; color: var(--muted); height: 100%; padding: 24px; text-align: center; }
.convo:has(> .convo-empty) { grid-template-rows: 1fr; }
.convo-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.convo-head small { display: block; color: var(--muted); font-size: 12px; }
.back { display: none; border: 0; background: var(--surface-2); font-size: 20px; width: 40px; height: 40px; border-radius: 50%; padding: 0; flex: none; }
.msgs { overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.day { text-align: center; margin: 8px 0; }
.day span { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 4px 12px; border-radius: 99px; }
.msg { display: flex; }
.msg.out { justify-content: flex-end; }
.bubble { max-width: min(460px, 75%); padding: 10px 14px 8px; border-radius: 20px; background: var(--surface-2); border: 0; font-size: 15px; overflow-wrap: anywhere; display: grid; gap: 4px; }
.msg.pending .bubble { opacity: .6; }
.msg.out .bubble { background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; }
.msg.out .bubble time { color: inherit; opacity: .55; }
.msg.out .vp-time { color: inherit; opacity: .7; }
.msg.out .vp-text { color: inherit; opacity: .75; }
.msg.out .vp-bars i { background: color-mix(in srgb, var(--bg) 40%, transparent); }
.msg.out .vp-fill i { background: var(--accent); }
.msg.in .bubble { border-bottom-left-radius: 6px; }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble time { justify-self: end; font-size: 11px; color: var(--muted); }
.voice { width: min(260px, 100%); height: 40px; display: block; }
.clip { max-width: 100%; max-height: 320px; border-radius: 10px; display: block; background: #000; }
.photo { max-width: 100%; max-height: 320px; border-radius: 10px; cursor: zoom-in; display: block; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); }
.composer { align-items: flex-end; gap: 6px; }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 1.5px solid transparent; border-radius: 24px; padding: 12px 18px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 16px; line-height: 20px; height: 48px; max-height: 130px; overflow-y: auto; }
.composer textarea:focus { outline: none; border-color: var(--accent); }
.composer .send { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; padding: 0; transition: opacity .15s, transform .15s; }
.composer .send svg { width: 22px; height: 22px; margin-left: 2px; }
.composer .send:disabled { background: var(--line); color: var(--muted); }
.composer .send:not(:disabled):active { transform: scale(.92); }
.composer .icon-btn { width: 48px; height: 48px; background: var(--surface-2); }
.icon-btn { border: 0; background: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 22px; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 99px; font-size: 14px; font-weight: 700; z-index: 50; max-width: 90vw; }
.modal-bg { position: fixed; inset: 0; background: rgba(10, 22, 28, .55); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal-bg.zoom img { max-width: 94vw; max-height: 90vh; border-radius: 10px; }
.modal { width: min(440px, 100%); max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 16px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { font-size: 20px; }
.pick { display: grid; gap: 10px; }
.pick-item { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; text-align: left; padding: 14px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); }
.pick-item i { grid-row: 1 / 3; width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.pick-item:not(.off):hover { border-color: var(--accent); }
.pick-item span { color: var(--muted); font-size: 14px; }
.pick-item:not([style]) { grid-template-columns: 1fr; }
.pick-item.off { opacity: .6; }
/* заказ из чата */
.grow { flex: 1; min-width: 0; }
.convo-head .grow b, .convo-head .grow small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-btn { white-space: nowrap; }
.convo-foot { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.composer, .pickbar { min-width: 0; }
.pickbar { flex-wrap: wrap; }
.pickbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.pickbar span { flex: 1; }
.pickbar .btn { width: auto; }
.msg.pickable { cursor: pointer; align-items: center; gap: 8px; }
.msg.pickable .bubble { pointer-events: none; }
.msg.pickable .photo { pointer-events: none; }
.chk { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); flex: none; }
.msg.out .chk { order: 2; }
.msg.picked .chk { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
.msg.picked .bubble { outline: 2px solid var(--accent); }
.quote-box { display: grid; gap: 4px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-size: 14px; color: var(--muted); }
.quote-box i { font-style: normal; text-align: center; letter-spacing: .2em; }
#modalBody { display: grid; gap: 16px; }
#modalBody .link { justify-self: start; }
#modalBody .btn { width: 100%; }
.modal .qr { margin-top: 4px; }
.notes { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); font-size: 15px; }
.modal .hint[data-state="error"] { color: var(--danger); }

@media (max-width: 860px) {
  .work[data-view="chat"] .list { display: none; }
  .work[data-view="list"] .convo { display: none; }
  .work { grid-template-columns: 1fr; gap: 0; padding: 0; }
  .list, .convo { border-radius: 0; border: 0; box-shadow: none; }
  .back { display: grid; place-items: center; }
  .bubble { max-width: 85%; }
  .auth { grid-template-columns: 1fr; }
  .brand { padding: 20px max(16px, env(safe-area-inset-left)); gap: 16px; }
  .brand .demo, .brand .lead, .brand .chips { display: none; }
  .headline { font-size: 22px; max-width: none; }
  .auth { position: relative; }
  .panel { position: static; padding-top: 24px; place-items: start center; }
  .panel .theme { top: 14px; right: max(16px, env(safe-area-inset-right)); background: rgba(255,255,255,.1); border-color: transparent; color: var(--brand-ink); }
  .headline { padding-right: 52px; }
  .work { grid-template-columns: minmax(0, 1fr); }
  .list { padding: 14px 8px; }
  .me { display: none; }
  /* телефон: шапка диалога не шире экрана, кнопки удобно нажимать */
  .convo-head { gap: 8px; padding: 8px 10px; }
  .convo-head .av { width: 40px; height: 40px; }
  .order-btn { padding: 8px 10px; font-size: 13px; }
  .back { min-width: 40px; min-height: 40px; }
  .msgs { padding: 12px 10px; }
  .composer { padding-left: 8px; padding-right: 8px; }
  .chan button { padding: 9px; min-width: 36px; min-height: 36px; }
  .chan { padding: 2px 2px 2px 10px; }
  .chat { padding: 12px 8px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) {
  .card, .ch { animation: rise .35s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* архив, папки, шаблоны */
.head-btns{display:flex;gap:6px;align-items:center}
.btn.ghost.sm{padding:7px 10px}
.convo-head .btn.ghost{white-space:nowrap}
.tpl{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center}
.tpl .pick-item{text-align:left}
.tpl .pick-item b{font-weight:600;font-size:15px}
#folderHint,#folderInput+.hint{min-height:0}

/* иконки мессенджеров */
.chi { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -4px; margin-right: 6px; }
.ftab .chi, .chan .chi { margin-right: 0; }
.chan .chi { width: 16px; height: 16px; }
.pick-item .chi { grid-row: 1 / 3; width: 32px; height: 32px; margin: 0; }
.convo-head small .chi { width: 14px; height: 14px; vertical-align: -3px; margin-right: 4px; }
.av-ic { position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.av-ic .chi { width: 16px; height: 16px; margin: 0; vertical-align: 0; }
/* голосовые как в Telegram */
.vp { --p: 0%; display: grid; grid-template-columns: 42px minmax(120px, 1fr) auto; gap: 10px; align-items: center; min-width: min(240px, 70vw); }
.vp audio { display: none; }
.vp-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; padding: 0; }
.vp-btn svg { width: 20px; height: 20px; fill: currentColor; }
.vp .i-pause, .vp.playing .i-play { display: none; }
.vp.playing .i-pause { display: inline; }
.vp-wave { position: relative; height: 28px; cursor: pointer; }
.vp-bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; pointer-events: none; }
.vp-bars i { flex: 1; min-width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 45%, transparent); }
.vp-fill { clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.vp-fill i { background: var(--accent); }
.vp-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
.vp-text { font-size: 14px; color: var(--muted); font-style: italic; }
.btn.ghost.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
#folders [data-act=folder-edit] { padding: 5px 10px; }

/* аватарки, закреп, галочки, «в сети» */
.av-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.av-ic { z-index: 1; }
.pin { font-size: 12px; line-height: 1; filter: grayscale(.3); }
.chat-meta { grid-auto-flow: row; }
.tick { display: inline-flex; vertical-align: -3px; margin-left: 4px; width: 16px; height: 16px; }
.tick svg { width: 16px; height: 16px; }
.tick[data-tick="pending"] { opacity: .7; }
.tick[data-tick="read"] { color: var(--tick-read); }
.msg.out .bubble .tick[data-tick="read"] { color: var(--tick-read); opacity: 1; }
:root { --tick-read: #4fb6ff; }
.seen:not(:empty)::before { content: " · "; }
/* меню переписки (правая кнопка мыши / долгое нажатие) */
.ctx { position: fixed; z-index: 60; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 36px rgba(29, 23, 21, .18); display: grid; gap: 2px; }
.ctx[hidden] { display: none; }
.ctx button { border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.ctx button:hover, .ctx button:focus-visible { background: var(--surface-2); outline: none; }
/* «Распознать» у голосового */
.vtext { justify-self: start; border: 0; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 99px; }
.vtext:disabled { opacity: .6; cursor: progress; }
.msg.out .vtext { background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; }
