/* ByPassMe Support — Telegram Mini App */

:root {
  --brand-1: #38bdf8;
  --brand-2: #2563eb;
  --brand-3: #1e3a8a;
  --brand-grad: linear-gradient(135deg, #38bdf8 0%, #2563eb 58%, #1e40af 100%);
  --hero-grad: linear-gradient(135deg, #0a1733 0%, #0f2c6e 52%, #1d6fe0 100%);
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;

  --bg: #eef3fa;
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --surface-3: #e8eef7;
  --text: #0b1324;
  --muted: #64748b;
  --border: #e2e8f0;
  --bubble-theirs: #ffffff;
  --bubble-theirs-text: #0b1324;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #070b14;
  --surface: #0e1524;
  --surface-2: #141d30;
  --surface-3: #1b263d;
  --text: #e7eef9;
  --muted: #8b98ae;
  --border: #1d2940;
  --bubble-theirs: #16203a;
  --bubble-theirs-text: #e7eef9;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--brand-2); }
html[data-theme="dark"] a { color: var(--brand-1); }
[hidden] { display: none !important; }

.app {
  height: var(--tg-viewport-height, 100dvh);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ── boot / states ─────────────────────────────────────────── */
.boot, .fatal {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center; color: var(--muted);
}
.fatal img { width: 72px; height: 72px; border-radius: 20px; box-shadow: var(--shadow); }
.fatal h2 { margin: 0; color: var(--text); font-size: 20px; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--brand-2);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── screens ───────────────────────────────────────────────── */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.screen.slide-in { animation: slideIn .22s ease-out; }
@keyframes slideIn { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }

.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 12px; }

/* ── top bar ───────────────────────────────────────────────── */
.topbar { flex: none; padding: 10px 0; }
.topbar .container { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}
.brand-meta { flex: 1; min-width: 0; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-status { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: var(--surface); box-shadow: var(--shadow); color: var(--text);
  font-weight: 700; font-size: 16px; transition: transform .12s;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.plain { background: transparent; box-shadow: none; }

/* ── chat area ─────────────────────────────────────────────── */
.chat-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding-bottom: 8px;
}

.hero {
  position: relative; overflow: hidden;
  margin: 4px 0 14px; padding: 22px 20px 20px;
  border-radius: 24px; color: #fff;
  background: var(--hero-grad);
  box-shadow: 0 16px 40px rgba(15, 44, 110, .28);
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.hero::before {
  width: 260px; height: 260px; right: -90px; top: -120px;
  background: radial-gradient(circle, rgba(56, 189, 248, .55), rgba(56, 189, 248, 0) 70%);
}
.hero::after {
  width: 220px; height: 220px; right: 40px; bottom: -150px;
  background: radial-gradient(circle, rgba(37, 99, 235, .7), rgba(37, 99, 235, 0) 70%);
}
.hero > * { position: relative; z-index: 1; }
.hero-kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; color: #7dd3fc; text-transform: uppercase; }
.hero-title { margin: 8px 0 6px; font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.hero-text { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .78); max-width: 440px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(6px); transition: background .15s, transform .12s;
}
.chip:active { transform: scale(.96); background: rgba(255, 255, 255, .22); }

.messages { display: flex; flex-direction: column; padding: 4px 0 6px; }
.msgs-real, .msgs-pending { display: flex; flex-direction: column; }
.sentinel { height: 1px; }
.older-loader { display: flex; justify-content: center; padding: 8px; }
.older-loader .spinner { width: 20px; height: 20px; border-width: 2px; }

.day, .empty-pill {
  align-self: center; margin: 12px 0 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2);
}
.empty-pill { margin-top: 28px; }

.msg { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.msg.cont { margin-top: 2px; }
.msg.mine { justify-content: flex-end; }
.msg.system { justify-content: center; margin: 10px 0; }
.msg.system .bubble {
  background: transparent; box-shadow: none; padding: 3px 10px; font-size: 12.5px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: 999px;
}
.bubble {
  position: relative; max-width: min(82%, 520px); min-width: 64px;
  padding: 8px 12px 6px; border-radius: 18px;
  background: var(--bubble-theirs); color: var(--bubble-theirs-text);
  box-shadow: var(--shadow); word-wrap: break-word; overflow-wrap: anywhere;
}
.msg.theirs .bubble { border-bottom-left-radius: 6px; }
.msg.theirs.cont .bubble { border-top-left-radius: 6px; }
.msg.mine .bubble {
  background: var(--brand-grad); color: #fff; border-bottom-right-radius: 6px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .22);
}
.msg.mine.cont .bubble { border-top-right-radius: 6px; }
.msg.mine .bubble a { color: #fff; text-decoration: underline; }
.who { font-size: 12.5px; font-weight: 700; color: var(--brand-2); margin-bottom: 2px; }
html[data-theme="dark"] .who { color: var(--brand-1); }
.text { white-space: pre-wrap; }
.meta {
  display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  margin-top: 2px; font-size: 11px; opacity: .7; user-select: none;
}
.msg.mine .meta { opacity: .85; }
.ticks { display: inline-flex; }
.ticks svg { width: 16px; height: 12px; }
.msg.pending .meta { opacity: .6; }
.msg.failed .bubble { background: linear-gradient(135deg, #f87171, #dc2626); cursor: pointer; }
.msg.failed .meta { opacity: 1; font-weight: 600; }

.bubble.has-media { padding: 4px; }
.bubble.has-media .text { padding: 4px 8px 0; }
.bubble.has-media .meta { padding: 0 8px 2px; }
.bubble.has-media .who { padding: 2px 8px 0; }
.bubble.media-only .meta {
  position: absolute; right: 10px; bottom: 9px; padding: 2px 7px; border-radius: 999px;
  background: rgba(0, 0, 0, .45); color: #fff; opacity: 1;
}
.media-box {
  position: relative; overflow: hidden; border-radius: 14px;
  background: var(--surface-3); max-width: 100%;
}
.media-box img, .media-box video { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-box img { cursor: zoom-in; }
.media-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(3, 7, 18, .38); color: #fff; font-size: 12.5px; font-weight: 600; text-align: center;
  pointer-events: none;
}
.media-overlay .ring { width: 46px; height: 46px; }
.media-overlay .ring circle { transition: stroke-dashoffset .2s; }
.unavailable {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 14px; min-width: 200px; text-align: center; font-size: 13px; color: var(--muted);
}
.msg.mine .unavailable { color: rgba(255, 255, 255, .85); }
.unavailable .ico { font-size: 26px; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text);
}
.msg.mine .mini-btn { background: rgba(255, 255, 255, .2); color: #fff; }

.jump {
  position: absolute; right: 16px; bottom: 96px; z-index: 5;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.jump svg { width: 20px; height: 20px; }
.jump .count {
  position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--brand-2); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

/* ── composer ──────────────────────────────────────────────── */
.composer {
  flex: none; padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(0, 0, 0, 0));
}
.composer-card {
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 8px;
}
.tray { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; }
.tray-item {
  position: relative; flex: none; width: 64px; height: 64px; border-radius: 12px; overflow: hidden;
  background: var(--surface-3);
}
.tray-item img, .tray-item video { width: 100%; height: 100%; object-fit: cover; }
.tray-item .kind { position: absolute; left: 4px; bottom: 3px; font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000; }
.tray-item button {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; font-size: 13px; line-height: 1;
}
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.attach-btn, .tpl-btn {
  width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); color: var(--brand-2);
}
html[data-theme="dark"] .attach-btn, html[data-theme="dark"] .tpl-btn { color: var(--brand-1); }
.attach-btn svg, .tpl-btn svg { width: 22px; height: 22px; }
.input {
  flex: 1; min-width: 0; min-height: 44px; max-height: 140px; resize: none;
  padding: 11px 14px; border: 0; outline: none; border-radius: 14px;
  background: var(--surface-2); line-height: 22px;
}
.input::placeholder { color: var(--muted); }
.send-btn {
  width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
  transition: transform .12s, opacity .15s;
}
.send-btn:disabled { opacity: .45; box-shadow: none; }
.send-btn:not(:disabled):active { transform: scale(.92); }
.send-btn svg { width: 22px; height: 22px; }
.composer-note { text-align: center; font-size: 11.5px; color: var(--muted); padding: 6px 4px 0; }
.composer-blocked { text-align: center; padding: 12px; color: var(--muted); font-size: 13.5px; }

/* ── sheets ────────────────────────────────────────────────── */
.sheet-backdrop {
  position: absolute; inset: 0; z-index: 20; background: rgba(3, 7, 18, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 760px; max-height: 88%; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg);
  padding-bottom: env(safe-area-inset-bottom);
  animation: up .24s cubic-bezier(.2, .8, .2, 1);
}
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px 6px; }
.sheet-title { flex: 1; font-size: 18px; font-weight: 700; }
.sheet-body { overflow-y: auto; padding: 6px 16px 18px; }

.faq details {
  border-radius: 16px; background: var(--surface-2); margin-bottom: 8px; overflow: hidden;
}
.faq summary {
  list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "›"; margin-left: auto; font-size: 20px; color: var(--muted); transition: transform .15s; }
.faq details[open] summary::after { transform: rotate(90deg); }
.faq .answer { padding: 0 16px 14px; color: var(--muted); font-size: 14px; }
.faq .answer ol { margin: 0; padding-left: 20px; }
.faq .answer .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px; border-radius: 13px; font-weight: 600; font-size: 14px;
  background: var(--surface-2); color: var(--text); transition: transform .12s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand-grad); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

/* ── диалог по центру окна ─────────────────────────────────── */
.dialog-backdrop {
  position: absolute; inset: 0; z-index: 35; padding: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(3, 7, 18, .45); animation: fade .15s ease-out;
}
.dialog {
  width: 100%; max-width: 340px; padding: 20px 16px 14px; border-radius: 22px;
  background: var(--surface); box-shadow: var(--shadow-lg); text-align: center;
  animation: pop .18s cubic-bezier(.2, .8, .2, 1);
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.dialog-title { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.dialog-text { margin-top: 6px; font-size: 14px; color: var(--muted); }
.dialog-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.dialog-actions.row { flex-direction: row; }
.dialog-actions.row .btn { flex: 1; }
.dialog .btn.danger { background: rgba(239, 68, 68, .12); }
.btn.ghost { background: transparent; color: var(--muted); }

/* ── lightbox / toast ──────────────────────────────────────── */
.lightbox {
  position: absolute; inset: 0; z-index: 30; background: rgba(0, 0, 0, .94);
  display: flex; align-items: center; justify-content: center; animation: fade .15s;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; touch-action: pinch-zoom; }
.lightbox .icon-btn { position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }

.toast {
  position: absolute; left: 50%; top: 14px; z-index: 40; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 14px;
  background: #0b1324; color: #fff; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: drop .2s ease-out;
}
html[data-theme="dark"] .toast { background: #e7eef9; color: #0b1324; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes drop { from { transform: translate(-50%, -12px); opacity: 0; } }

/* ── admin: list ───────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 2px 0 10px; }
.stat {
  padding: 12px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow);
  text-align: left;
}
.stat.accent { background: var(--hero-grad); color: #fff; }
.stat-num { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat.accent .stat-label { color: rgba(255, 255, 255, .72); }

.toolbar { padding-bottom: 8px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow); color: var(--muted);
}
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; height: 100%; }
.tabs { display: flex; gap: 6px; margin-top: 10px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.tab {
  flex: 1; height: 34px; border-radius: 11px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tab .n { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text); }
.tab.active .n { background: var(--brand-2); color: #fff; }

.conv-list { display: flex; flex-direction: column; gap: 6px; padding-bottom: 16px; }
.conv {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow);
  transition: transform .12s;
}
.conv:active { transform: scale(.985); }
.conv.closed { opacity: .72; box-shadow: none; background: var(--surface-2); }
.conv.waiting { box-shadow: inset 3px 0 0 var(--brand-2), var(--shadow); }
.avatar {
  --h: 210;
  width: 46px; height: 46px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 85% 62%), hsl(calc(var(--h) + 30) 75% 45%));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }
.avatar.sm { width: 38px; height: 38px; font-size: 14px; }
.conv-main { flex: 1; min-width: 0; }
.conv-top, .conv-bottom { display: flex; align-items: center; gap: 8px; }
.conv-top .name { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-top .time { font-size: 12px; color: var(--muted); flex: none; }
.conv.unread .conv-top .time { color: var(--brand-2); font-weight: 700; }
.conv-bottom { margin-top: 2px; }
.preview { flex: 1; min-width: 0; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview b { color: var(--text); font-weight: 600; }
.conv.unread .preview { color: var(--text); }
.badge {
  flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--brand-grad);
}
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
}
.conv.closed .tag { background: var(--surface-3); }
.tag.ok { color: var(--ok); background: rgba(16, 185, 129, .12); }
.tag.warn { color: var(--warn); background: rgba(245, 158, 11, .14); }
.tag.danger { color: var(--danger); background: rgba(239, 68, 68, .12); }
.tag.brand { color: #fff; background: var(--brand-2); }
.list-empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.list-empty .ico { font-size: 38px; margin-bottom: 8px; }

/* ── admin: chat head ──────────────────────────────────────── */
.chat-head .container { gap: 10px; }
.chat-title { flex: 1; min-width: 0; cursor: pointer; }
.chat-title .name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-btn {
  height: 36px; padding: 0 12px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  background: rgba(16, 185, 129, .12); color: var(--ok);
}
.status-btn.reopen { background: var(--surface-2); color: var(--text); }
.status-btn svg { width: 16px; height: 16px; }
.chat-banner {
  margin: 8px 0 0; padding: 8px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 600;
  background: rgba(245, 158, 11, .12); color: var(--warn); text-align: center;
}

/* ── admin: profile ────────────────────────────────────────── */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 4px 0 12px; }
.profile-head .name { font-size: 19px; font-weight: 800; }
.profile-head .sub { color: var(--muted); font-size: 13.5px; }
.profile-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.section-title {
  margin: 16px 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.kv { border-radius: 16px; background: var(--surface-2); overflow: hidden; }
.kv-row { display: flex; gap: 12px; padding: 10px 14px; font-size: 14px; }
.kv-row + .kv-row { border-top: 1px solid var(--border); }
.kv-key { color: var(--muted); flex: none; }
.kv-val { margin-left: auto; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.kv-val.ok { color: var(--ok); }
.kv-val.bad { color: var(--danger); }
.kv-val.copy { cursor: pointer; color: var(--brand-2); }
html[data-theme="dark"] .kv-val.copy { color: var(--brand-1); }
.device { font-size: 13px; }
.device .muted { color: var(--muted); font-weight: 500; }
.muted-note { color: var(--muted); font-size: 13.5px; padding: 10px 14px; }

/* ── admin: templates ──────────────────────────────────────── */
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl {
  display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface-2); text-align: left; font-size: 14px; width: 100%;
}
.tpl-text { flex: 1; white-space: pre-wrap; }
.tpl-del { color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; }
.tpl-add { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.tpl-add textarea {
  min-height: 70px; resize: vertical; padding: 10px 12px; border-radius: 14px; border: 0; outline: none;
  background: var(--surface-2);
}
.sheet-tools { display: flex; justify-content: flex-end; }

@media (max-width: 420px) {
  .chat-head .container { gap: 8px; }
  .status-btn { padding: 0 10px; font-size: 12.5px; }
}

@media (min-width: 700px) {
  .hero { padding: 28px 28px 24px; }
  .hero-title { font-size: 32px; }
  .container { padding: 0 20px; }
}
