/* ---------- tokens ---------- */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --bg: #f2f2f7;
  --glass: rgba(255, 255, 255, 0.64);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-hover: rgba(255, 255, 255, 0.9);
  --stroke: rgba(60, 60, 67, 0.14);
  --text: #0b0b0f;
  --text2: rgba(60, 60, 67, 0.66);
  --text3: rgba(60, 60, 67, 0.4);
  --accent: #00a884;
  --accent-text: #ffffff;
  --accent-soft: rgba(0, 168, 132, 0.14);
  --danger: #ff3b30;
  --warn: #ff9f0a;
  --blue: #34b7f1;
  --in: #ffffff;
  --out: #d9fdd3;
  --bubble-text: #111b21;
  --wall: rgba(239, 234, 226, 0.78);
  --shadow: 0 10px 30px rgba(20, 20, 40, 0.1), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  --blur: saturate(190%) blur(26px);
  --blob1: #9be7c8;
  --blob2: #a9c7ff;
  --blob3: #ffd6a5;
  --radius: 18px;
  --tab-h: 58px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

:root[data-mode="dark"] { color-scheme: dark; }
:root[data-mode="light"] { color-scheme: light; }

:root[data-mode="dark"] {
  --bg: #000000;
  --glass: rgba(34, 34, 38, 0.6);
  --glass-strong: rgba(28, 28, 32, 0.84);
  --glass-hover: rgba(58, 58, 64, 0.8);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: #f5f5f7;
  --text2: rgba(235, 235, 245, 0.62);
  --text3: rgba(235, 235, 245, 0.34);
  --accent: #25d09a;
  --accent-text: #00130d;
  --accent-soft: rgba(37, 208, 154, 0.18);
  --in: #202c33;
  --out: #005c4b;
  --bubble-text: #e9edef;
  --wall: rgba(11, 20, 26, 0.74);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  --blob1: #0d6b52;
  --blob2: #1d3a8a;
  --blob3: #5a2d74;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font: 16px/1.4 var(--font);
  color: var(--text);
  background: var(--bg);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.backdrop { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.backdrop i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: 0.55; }
.backdrop i:nth-child(1) { background: var(--blob1); top: -25vmax; left: -15vmax; }
.backdrop i:nth-child(2) { background: var(--blob2); bottom: -30vmax; right: -20vmax; }
.backdrop i:nth-child(3) { background: var(--blob3); top: 30%; left: 45%; width: 40vmax; height: 40vmax; opacity: 0.35; }

#app { position: relative; z-index: 1; height: 100dvh; }
#layer { position: relative; z-index: 50; }

svg.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.ic.sm { width: 16px; height: 16px; }
svg.ic.lg { width: 28px; height: 28px; }

/* ---------- glass surfaces ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 0.5px solid var(--stroke);
}

/* ---------- shell ---------- */
.shell { display: grid; height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
.shell .main { min-height: 0; min-width: 0; overflow: hidden; position: relative; }
.tabbar {
  display: flex; justify-content: space-around; padding: 6px 8px calc(6px + var(--sab));
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-top: 0.5px solid var(--stroke);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px;
  background: none; border: 0; color: var(--text2); font-size: 10.5px; font-weight: 500; text-decoration: none; position: relative;
}
.tab.on { color: var(--accent); }
.tab .pip { position: absolute; top: 0; left: calc(50% + 6px); }
.shell.no-tabs { grid-template-rows: 1fr; }
.shell.no-tabs .tabbar { display: none; }

@media (min-width: 900px) {
  .shell, .shell.no-tabs { grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .tabbar { order: -1; }
  .shell.no-tabs .tabbar { display: flex; }
  .tabbar {
    flex-direction: column; justify-content: flex-start; gap: 4px; padding: 22px 12px; border-top: 0; border-right: 0.5px solid var(--stroke);
  }
  .tabbar .brand { display: flex; }
  .tab { flex: none; flex-direction: row; gap: 12px; font-size: 15px; padding: 10px 12px; border-radius: 12px; }
  .tab:hover { background: var(--glass-hover); }
  .tab.on { background: var(--accent-soft); }
  .tab .pip { position: static; margin-left: auto; }
}
.brand { display: none; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; padding: 0 8px 18px; letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }

/* ---------- pages ---------- */
.page { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 24px; }
.page-inner { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.navbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(var(--sat) + 8px) 12px 8px; min-height: 52px;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 0.5px solid var(--stroke);
}
.navbar h1 { margin: 0; font-size: 17px; font-weight: 600; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar .side { min-width: 40px; display: flex; gap: 6px; align-items: center; }
.navbar .side.end { justify-content: flex-end; }
.large-title { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; margin: 14px 0 10px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text2); margin: 22px 14px 7px; }
.footnote { font-size: 13px; color: var(--text2); margin: 7px 14px 0; }

.group { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 0.5px solid var(--stroke); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 52px; position: relative; width: 100%; text-align: left; background: none; border: 0; color: inherit; text-decoration: none; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 0.5px; background: var(--stroke); }
button.row:active, a.row:active { background: var(--glass-hover); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { font-size: 13.5px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .v { color: var(--text2); font-size: 15px; }
.row .chev { color: var(--text3); }
.row .tile { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--accent); flex: none; }
.row .tile.blue { background: #0a84ff; } .row .tile.orange { background: #ff9f0a; } .row .tile.purple { background: #af52de; }
.row .tile.red { background: #ff453a; } .row .tile.gray { background: #8e8e93; } .row .tile.teal { background: #30b0c7; }
.row.danger .t { color: var(--danger); }
.row-form { display: block; padding: 12px 14px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 13px; border: 0;
  background: var(--accent); color: var(--accent-text); font-weight: 600; transition: transform 0.1s, opacity 0.15s; min-height: 44px;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.secondary { background: var(--glass-strong); color: var(--text); border: 0.5px solid var(--stroke); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: none; color: var(--accent); }
.btn.small { padding: 7px 13px; min-height: 34px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; background: none; color: var(--accent); flex: none;
}
.icon-btn:active { background: var(--accent-soft); }
.icon-btn.solid { background: var(--accent); color: var(--accent-text); }
.icon-btn[disabled] { opacity: 0.4; pointer-events: none; }

label.f { display: block; margin: 12px 0; }
label.f > span { display: block; font-size: 13px; color: var(--text2); margin: 0 4px 5px; }
.in, textarea.in, select.in {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 0.5px solid var(--stroke); outline: none;
  background: var(--glass-strong); color: var(--text); min-height: 44px; appearance: none; -webkit-appearance: none;
}
.in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.in { resize: vertical; min-height: 88px; }
select.in { background-image: linear-gradient(45deg, transparent 50%, var(--text2) 50%), linear-gradient(135deg, var(--text2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.hint { font-size: 12.5px; color: var(--text2); margin: 4px 4px 0; }
.seg { display: flex; padding: 3px; border-radius: 11px; background: var(--glass-strong); border: 0.5px solid var(--stroke); }
.seg button { flex: 1; border: 0; background: none; padding: 7px 8px; border-radius: 9px; font-weight: 500; font-size: 14px; color: var(--text2); }
.seg button.on { background: var(--accent); color: var(--accent-text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
.switch { position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--text3); border: 0; flex: none; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.3); transition: transform 0.2s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.warn { background: rgba(255, 159, 10, 0.16); color: var(--warn); }
.pill.danger { background: rgba(255, 59, 48, 0.14); color: var(--danger); }
.pill.gray { background: var(--glass-strong); color: var(--text2); border: 0.5px solid var(--stroke); }
.badge { min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--accent-text); font-size: 12.5px; font-weight: 700; display: inline-grid; place-items: center; }

.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 17px; flex: none; }
.avatar.sm { width: 38px; height: 38px; font-size: 14px; }
.av0 { background: linear-gradient(135deg, #34d399, #059669); } .av1 { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.av2 { background: linear-gradient(135deg, #f472b6, #db2777); } .av3 { background: linear-gradient(135deg, #fbbf24, #d97706); }
.av4 { background: linear-gradient(135deg, #a78bfa, #7c3aed); } .av5 { background: linear-gradient(135deg, #fb7185, #e11d48); }
.av6 { background: linear-gradient(135deg, #22d3ee, #0891b2); } .av7 { background: linear-gradient(135deg, #a3e635, #65a30d); }

.empty { display: grid; place-items: center; text-align: center; color: var(--text2); padding: 48px 24px; gap: 8px; }
.empty .ic { width: 46px; height: 46px; opacity: 0.5; }
.empty b { color: var(--text); font-size: 18px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--stroke); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-text { color: var(--danger); font-size: 14px; margin: 8px 4px 0; min-height: 1px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.copy { display: flex; gap: 8px; align-items: center; }
.copy .mono { flex: 1; padding: 10px 12px; border-radius: 10px; background: var(--glass-strong); border: 0.5px solid var(--stroke); min-width: 0; }

/* ---------- login ---------- */
.login { height: 100dvh; display: grid; place-items: center; padding: 20px; position: relative; z-index: 1; }
.login-card { width: min(400px, 100%); padding: 30px 24px 24px; border-radius: 28px; box-shadow: var(--shadow); }
.login-card .logo { width: 68px; height: 68px; border-radius: 18px; display: block; margin: 0 auto 14px; box-shadow: 0 8px 22px rgba(0, 168, 132, 0.35); }
.login-card h1 { text-align: center; margin: 0 0 4px; font-size: 26px; letter-spacing: -0.03em; }
.login-card p { text-align: center; margin: 0 0 18px; color: var(--text2); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.34); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 0.18s; z-index: 60; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet { width: min(560px, 100%); max-height: 90dvh; display: flex; flex-direction: column; border-radius: 26px 26px 0 0; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 0.5px solid var(--stroke); animation: rise 0.24s cubic-bezier(.2,.9,.3,1); padding-bottom: var(--sab); box-shadow: var(--shadow); }
.sheet header { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px; }
.sheet header h2 { margin: 0; flex: 1; font-size: 18px; }
.sheet .body { padding: 4px 16px 16px; overflow-y: auto; }
.sheet footer { padding: 6px 16px 16px; display: flex; gap: 10px; }
.sheet footer .btn { flex: 1; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 26px; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 24px + var(--sab)); transform: translateX(-50%); padding: 11px 18px; border-radius: 99px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 0.5px solid var(--stroke); box-shadow: var(--shadow); z-index: 90; font-weight: 500; max-width: 90vw; animation: rise 0.2s; }
.toast.err { color: var(--danger); }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.88); display: grid; place-items: center; animation: fade 0.15s; }
.lightbox img, .lightbox video { max-width: 96vw; max-height: 88dvh; border-radius: 10px; }
.lightbox .icon-btn { position: absolute; top: calc(var(--sat) + 12px); right: 12px; color: #fff; background: rgba(255,255,255,.18); }

/* ---------- chats ---------- */
.chats { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); position: relative; }
.pane-list, .pane-thread { height: 100%; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.chats[data-view="thread"] .pane-list { display: none; }
.chats[data-view="list"] .pane-thread { display: none; }
@media (min-width: 900px) {
  .chats { grid-template-columns: 370px minmax(0, 1fr); }
  .chats[data-view] .pane-list, .chats[data-view] .pane-thread { display: flex; }
  .pane-list { border-right: 0.5px solid var(--stroke); }
}
.list-head { padding: calc(var(--sat) + 10px) 14px 8px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 0.5px solid var(--stroke); }
.list-head .title-row { display: flex; align-items: center; gap: 8px; }
.list-head h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; flex: 1; }
.search { position: relative; margin-top: 8px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text2); }
.search .in { padding-left: 36px; min-height: 38px; border-radius: 11px; background: var(--glass); }
.chat-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.chat-row { text-decoration: none; display: flex; gap: 12px; padding: 10px 14px; align-items: center; width: 100%; background: none; border: 0; text-align: left; color: inherit; position: relative; }
.chat-row + .chat-row::before { content: ""; position: absolute; top: 0; left: 74px; right: 0; height: 0.5px; background: var(--stroke); }
.chat-row:active, .chat-row:hover { background: var(--glass-hover); }
.chat-row.on { background: var(--accent-soft); }
.chat-row .mid { flex: 1; min-width: 0; }
.chat-row .top { display: flex; gap: 8px; align-items: baseline; }
.chat-row .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .time { font-size: 12.5px; color: var(--text2); }
.chat-row.unread .time { color: var(--accent); font-weight: 600; }
.chat-row .bot { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.chat-row .prev { flex: 1; color: var(--text2); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.chat-row .prev.cleared { font-style: italic; }
.tick { color: var(--text3); display: inline-flex; }
.tick.read { color: var(--blue); }
.tick.fail { color: var(--danger); }

.thread-head { display: flex; align-items: center; gap: 10px; padding: calc(var(--sat) + 8px) 10px 8px 6px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 0.5px solid var(--stroke); z-index: 3; }
.thread-head .who { flex: 1; min-width: 0; }
.thread-head .pill { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; }
.thread-head .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-head .sub { font-size: 12.5px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-head .back { display: grid; }
@media (min-width: 900px) { .thread-head .back { display: none; } .thread-head { padding-left: 14px; } }
.messages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 10px 8px; background: var(--wall); display: flex; flex-direction: column; gap: 3px; background-image: radial-gradient(var(--stroke) 1px, transparent 1.4px); background-size: 22px 22px; }
.day { align-self: center; margin: 10px 0 6px; padding: 4px 12px; border-radius: 10px; font-size: 12.5px; color: var(--text2); background: var(--glass-strong); border: 0.5px solid var(--stroke); }
.bubble { max-width: min(78%, 520px); padding: 6px 9px 5px; border-radius: 12px; background: var(--in); color: var(--bubble-text); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12); position: relative; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble.in { align-self: flex-start; border-top-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--out); border-top-right-radius: 4px; }
.bubble.gap { margin-top: 8px; }
.bubble .txt { white-space: pre-wrap; line-height: 1.34; }
.bubble .meta { float: right; margin: 6px 0 -2px 10px; font-size: 11px; color: var(--text2); display: inline-flex; gap: 3px; align-items: center; }
.bubble .by { font-size: 11.5px; font-weight: 600; color: var(--accent); margin-bottom: 1px; }
.bubble .tpl { font-size: 11.5px; font-weight: 600; color: var(--text2); display: flex; gap: 5px; align-items: center; margin-bottom: 2px; }
.bubble .err { color: var(--danger); font-size: 12px; margin-top: 3px; }
.media-img, .media-vid { display: block; max-width: 100%; width: 300px; max-height: 340px; object-fit: cover; border-radius: 9px; margin: 1px 0 4px; cursor: zoom-in; background: rgba(0,0,0,.1); }
.media-img.sticker { width: 150px; object-fit: contain; background: none; }
.media-aud { width: 250px; max-width: 100%; height: 40px; margin: 2px 0 4px; }
.media-doc { display: flex; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 9px; background: rgba(0, 0, 0, 0.06); color: inherit; text-decoration: none; margin-bottom: 4px; min-width: 210px; }
.media-doc .dn { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.media-doc .ds { font-size: 12px; color: var(--text2); }
.media-wait { display: flex; gap: 8px; align-items: center; color: var(--text2); font-size: 13.5px; padding: 6px 2px; }
.cleared-note { margin: auto; text-align: center; color: var(--text2); display: grid; gap: 6px; justify-items: center; padding: 20px; }
.cleared-note b { font-size: 18px; color: var(--text); }
.more-btn { align-self: center; margin: 6px 0; }

.composer-wrap { position: relative; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 0.5px solid var(--stroke); padding: 8px 8px calc(8px + var(--sab)); }
.composer { display: flex; align-items: flex-end; gap: 6px; }
.composer textarea { flex: 1; resize: none; max-height: 140px; min-height: 40px; padding: 9px 14px; border-radius: 20px; border: 0.5px solid var(--stroke); background: var(--glass); outline: none; line-height: 1.3; }
.composer textarea:focus { border-color: var(--accent); }
.attach-chip { display: flex; gap: 8px; align-items: center; padding: 6px 10px; margin: 0 4px 8px; border-radius: 12px; background: var(--glass); border: 0.5px solid var(--stroke); font-size: 14px; }
.attach-chip .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); border-radius: 16px; overflow: hidden; max-height: 40dvh; overflow-y: auto; box-shadow: var(--shadow); }
.suggest button { display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: 0; }
.suggest button + button { border-top: 0.5px solid var(--stroke); }
.suggest button:hover, .suggest button.on { background: var(--accent-soft); }
.suggest .k { font-weight: 600; color: var(--accent); }
.suggest .b { color: var(--text2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255, 159, 10, 0.14); color: var(--text); font-size: 14px; }
.banner.info { background: var(--accent-soft); }
.banner .grow { flex: 1; }

.tpl-preview { padding: 12px; border-radius: 14px; background: var(--wall); border: 0.5px solid var(--stroke); margin: 10px 0; white-space: pre-wrap; }
.list-plain { display: grid; gap: 8px; }
.log { display: flex; gap: 10px; padding: 10px 14px; font-size: 14px; align-items: flex-start; }
.log + .log { border-top: 0.5px solid var(--stroke); }
.log time { color: var(--text2); font-size: 12px; white-space: nowrap; min-width: 84px; }
.log .m { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.log .k { font-size: 12px; color: var(--text2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; }
.dot.warn { background: var(--warn); } .dot.error { background: var(--danger); }
.stat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.stat > div { padding: 14px; border-radius: 16px; background: var(--glass); border: 0.5px solid var(--stroke); }
.stat b { display: block; font-size: 24px; letter-spacing: -0.02em; }
.stat span { color: var(--text2); font-size: 13px; }
.media-wait .spinner { margin: 0; width: 16px; height: 16px; border-width: 2px; }

input[type="range"] { width: 100%; accent-color: var(--accent); margin: 8px 0 12px; }
.row-form .row { padding-left: 0; padding-right: 0; }
.row-form .row + .row::before { display: none; }
.row-form .copy + .hint { margin-top: 12px; }
input[type="search"]::-webkit-search-cancel-button { display: none; }

/* deleted messages, message menu, presence */
.bubble.deleted { background: transparent; box-shadow: none; border: 0.5px dashed var(--stroke); color: var(--text2); }
.bubble.deleted .txt { font-style: italic; display: inline-flex; gap: 6px; align-items: center; }
.bubble .opts { position: absolute; top: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; color: var(--text2); background: var(--glass-strong); border: 0.5px solid var(--stroke); opacity: 0; transition: opacity 0.12s; padding: 0; }
.bubble.in .opts { right: -32px; }
.bubble.out .opts { left: -32px; }
.bubble:hover .opts, .bubble .opts:focus-visible { opacity: 1; }
@media (hover: none) { .bubble .opts { opacity: 0.55; } }
.presence { display: flex; gap: 6px; align-items: center; padding: 6px 14px; font-size: 13px; color: var(--accent); background: var(--accent-soft); border-bottom: 0.5px solid var(--stroke); }
.presence svg { flex: none; }
