/* ============================================================
   Panel design system v3 — light canvas, gradient sidebar,
   pills, double-bezel containers, Geist + Geist Mono.
   ============================================================ */
/* ---------------- Enterprise Admin Palette & Glass Tokens ---------------- */
:root {
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --grad: linear-gradient(135deg, #2563eb, #1d4ed8 60%, #0f172a);
  --canvas: #f8fafc;
  --sunken: #f1f5f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink2: #64748b;
  --ink3: #94a3b8;
  --hair: rgba(15, 23, 42, 0.06);
  --hair2: rgba(15, 23, 42, 0.10);
  --hair3: rgba(15, 23, 42, 0.16);
  --violet: #7c3aed;
  --teal: #0d9488;
  --orange: #ea580c;
  --pink: #db2777;
  --amber: #d97706;
  --blue: #2563eb;
  --violet-soft: #f5f3ff;
  --teal-soft: #f0fdfa;
  --orange-soft: #fff7ed;
  --pink-soft: #fdf2f8;
  --amber-soft: #fffbeb;
  --ok: #16a34a;
  --live: #10b981;
  --warn: #d97706;
  --bad: #ef4444;
  --hot: #f97316;
  --side: #090d16;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease2: cubic-bezier(.32, .72, 0, 1);
  --bg: var(--canvas);
  --panel: var(--surface);
  --bar: var(--sunken);
  --elev: #ffffff;
  --line: var(--hair2);
  --text: var(--ink);
  --dim: var(--ink2);
  --danger: var(--bad);
  --warn-c: var(--warn);
  --out: #2563eb;
  --in: #ffffff;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--canvas); color: var(--ink); font: 14px/1.5 "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; letter-spacing: -0.01em; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 32px; font-weight: 600; letter-spacing: -.035em; margin: 0 0 4px; line-height: 1.1; } h2 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin: 0; } h3 { font-size: 16px; font-weight: 600; margin: 22px 0 10px; color: var(--ink); letter-spacing: -.01em; }
.card > h3:first-child, .modal-body > h3:first-child { margin-top: 0; }
.muted { color: var(--ink2); } .small { font-size: 13px; } .grow { flex: 1; }
code, .mono, .stat b, .chat-item-time, .conv-status, .kv b, .usage b, .plan-box b, td.num, .msg-time, .rec-time { font-family: var(--mono); font-feature-settings: "tnum"; }
label { display: block; margin: 0 0 12px; font-size: 13px; color: var(--ink2); }
label > input, label > textarea, label > select, .row > input, .row > select, .search-row input, .filter-row input, .filter-row select, .conv-foot textarea, .sel-sm, .nav-mode select, .tenant-switch select { display: block; width: 100%; margin-top: 6px; background: #fff; border: 1px solid var(--hair2); color: var(--ink); border-radius: 14px; padding: 10px 13px; outline: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
label > input:focus, label > textarea:focus, label > select:focus, .row > input:focus, .search-row input:focus, .conv-foot textarea:focus, .filter-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
label > textarea { resize: vertical; min-height: 64px; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
input[type="range"] { accent-color: var(--accent); padding: 0; border: 0; box-shadow: none; }
input[type="file"] { padding: 8px; font-size: 12.5px; }
input[type="color"] { padding: 2px; height: 42px; }
.row { display: flex; gap: 10px; align-items: flex-end; } .row > label { flex: 1; } .row > label > .row { margin-top: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #fff; border: 1px solid var(--hair2); color: var(--ink); padding: 10px 18px; border-radius: 999px; cursor: pointer; text-decoration: none; margin: 4px 6px 4px 0; font-weight: 500; font-size: 14px; transition: transform .16s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease); white-space: nowrap; }
.btn:hover { background: var(--sunken); } .btn:active { transform: scale(.97); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 12px 30px -18px rgb(40 87 224 / .9); } .btn.primary:hover { filter: brightness(1.06); }
.btn.success { background: var(--live); border-color: transparent; color: #fff; }
.btn.danger { background: #fff; border-color: rgb(208 53 63 / .35); color: var(--bad); } .btn.warn { border-color: rgb(184 106 18 / .4); color: var(--warn); background: #fff; } .btn.ghost { background: transparent; border-color: transparent; }
.btn.save { display: block; margin-top: 14px; } .btn.sm { padding: 6px 12px; font-size: 12.5px; margin: 0; }
.icon-btn { background: none; border: none; cursor: pointer; width: 38px; height: 38px; border-radius: 999px; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink2); transition: background .2s var(--ease), transform .16s var(--ease); }
.icon-btn:hover { background: var(--sunken); } .icon-btn:active { transform: scale(.97); }
.err { background: #fdecec; color: var(--bad); padding: 9px 12px; border-radius: 14px; margin: 8px 0; font-size: 13px; border: 1px solid rgb(208 53 63 / .2); }
.badge { background: #fff; color: var(--accent); font-size: 11.5px; border-radius: 999px; padding: 1px 8px; margin-left: auto; font-weight: 600; font-family: var(--mono); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--sunken); color: var(--ink2); font-weight: 500; } .pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.on, .pill.active, .pill.paid { background: #e4f5ea; color: var(--ok); } .pill.off, .pill.expired, .pill.rejected, .pill.suspended { background: #fdecec; color: var(--bad); } .pill.trial { background: var(--violet-soft); color: var(--violet); } .pill.pending, .pill.review { background: var(--amber-soft); color: var(--warn); }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--canvas); }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--hair2); border-radius: 24px; padding: 30px; text-align: center; box-shadow: 0 30px 70px -40px rgb(17 18 20 / .3); }
.login-card label { text-align: left; } .login-card .btn { width: 100%; margin: 8px 0 0; padding: 14px; }
.login-logo { font-size: 40px; } .login h1 { margin: 6px 0 2px; font-size: 26px; } .login p { margin: 0 0 18px; }

/* shell */
.admin { display: flex; height: 100vh; overflow: hidden; }
.nav {
  width: 272px;
  flex: none;
  background: #090d16;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  overflow-y: auto;
  position: relative;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 220px at 0% 0%, rgba(37, 99, 235, 0.12), transparent 70%),
              radial-gradient(300px 300px at 100% 100%, rgba(124, 58, 237, 0.08), transparent 70%);
  pointer-events: none;
}
.nav > * { position: relative; }
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
}
.nav-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.nav-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.nav-status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  flex: none;
  transition: all .2s ease;
}
.nav-status.on {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}
.admin-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0 12px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  cursor: pointer;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  transition: all .16s ease;
  text-decoration: none;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}
.nav-item:active { transform: scale(.98); }
.nav-item.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.nav-item .ic {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: none;
  box-shadow: none;
}
.nav-item .ic svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
}
.nav-item.active .ic svg { stroke: #fff; }
.nav-foot {
  margin-top: auto;
  padding: 16px 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nav-mode {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.nav-mode select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-top: 4px;
}
.nav-mode select option { color: var(--ink); background: #fff; }
.plan-box {
  font-size: 12px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.plan-box b { color: #f8fafc; font-size: 13px; font-weight: 700; }
.tenant-switch { padding: 0 2px 8px; }
.tenant-switch select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}
.tenant-switch select option { color: var(--ink); background: #fff; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  text-align: left;
  padding: 6px 8px;
  color: #94a3b8;
  cursor: pointer;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 8px;
  transition: all .15s ease;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-link svg { width: 17px; height: 17px; flex: none; stroke: currentColor; }
.nav-close-btn { display: none; background: none; border: none; color: #94a3b8; font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; margin-left: auto; line-height: 1; }
.nav-close-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.65); backdrop-filter: blur(4px); z-index: 45; }
.nav-toggle { display: none; position: fixed; top: 14px; left: 14px; z-index: 40; width: 40px; height: 40px; border-radius: 10px; background: #0f172a; border: 1px solid rgba(255,255,255,0.18); color: #fff; font-size: 18px; box-shadow: 0 4px 16px rgba(0,0,0,0.3); cursor: pointer; }
.slug-input-wrap { display: flex; align-items: center; background: var(--sunken); border: 1px solid var(--hair2); border-radius: 12px; overflow: hidden; margin-top: 6px; max-width: 100%; width: 100%; box-sizing: border-box; }
.slug-prefix { padding: 10px 12px; color: var(--ink2); font-family: var(--mono); font-size: 13px; white-space: nowrap; background: rgba(0,0,0,0.04); border-right: 1px solid var(--hair2); flex: none; }
.slug-input-wrap input { flex: 1; min-width: 0; border: none !important; background: transparent !important; padding: 10px 12px; font-family: var(--mono); font-weight: 600; font-size: 14px; box-shadow: none !important; }
.slug-suffix { padding: 10px 12px; color: var(--ink2); font-family: var(--mono); font-size: 13px; flex: none; }
.plan-tiers-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.plan-tier-card { background: #fff; border: 1px solid var(--hair2); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: all .2s ease; }
.plan-tier-card.is-current { border-color: var(--accent); background: linear-gradient(180deg, rgba(37,99,235,0.04) 0%, #fff 100%); box-shadow: 0 4px 20px -8px rgba(37,99,235,0.25); }
.plan-tier-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.plan-tier-info { flex: 1; min-width: 200px; }
.plan-tier-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.plan-tier-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.plan-tier-meta { font-size: 13px; color: var(--ink2); line-height: 1.45; }
.plan-tier-price { text-align: right; flex: none; }
.plan-tier-price .price-main { font-size: 21px; font-weight: 800; color: var(--ink); }
.plan-tier-price .price-sub { font-size: 12px; color: var(--ink3); }
.plan-act-btn { margin-top: 4px; font-weight: 600; width: 100%; }
.view { flex: 1; min-width: 0; height: 100vh; overflow: hidden; }
.page { overflow-y: auto; padding: 28px 32px 70px; }
.page-head { margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; } .page-head h1 { flex-basis: 100%; } .page-head p { margin: 0; max-width: 760px; color: var(--ink2); flex: 1 1 400px; } .page-head .btn { margin: 0; }
.card { background: rgb(17 18 20 / .035); border: 1px solid var(--hair); border-radius: 24px; padding: 6px; margin-bottom: 18px; }
.card > * { position: relative; }
.card::before { content: ""; position: absolute; } .card { position: relative; }
.card > :first-child { margin-top: 0; }
.card { display: flow-root; }
.card::after { content: none; }
.card-inner, .card { }
.card { background-clip: padding-box; }
.card > h3, .card > label, .card > .btn, .card > p, .card > .row, .card > table, .card > div, .card > iframe, .card > a { margin-left: 14px; margin-right: 14px; } .card > table { width: calc(100% - 28px); } .card > .table-wrap { overflow-x: auto; }
.card > h3:first-child { margin-top: 16px; } .card > :last-child { margin-bottom: 16px; }
.card > .table-wrap, .card > .qa-list, .card > .theme-grid, .card > .filter-row, .card > .bulk-row, .card > .kv-list, .card > .bars, .card > .log-list, .card > .multi, .card > .usage, .card > .test-out, .card > .check-list, .card > .stat-row, .card > iframe { margin-left: 14px; margin-right: 14px; }
.card { box-shadow: none; }
.card::before { content: ""; position: absolute; inset: 6px; border-radius: 18px; background: #fff; box-shadow: inset 0 1px 0 #fff; z-index: 0; pointer-events: none; }
.card > * { z-index: 1; }
.card > h3:first-child, .card > label:first-child, .card > p:first-child, .card > div:first-child { padding-top: 14px; }
.card > h3:first-child { padding-top: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; } .grid2.wide-left { grid-template-columns: 1.4fr 1fr; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; } .table th { text-align: left; color: var(--ink3); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--hair2); font-size: 12.5px; } .table td { padding: 12px 10px; border-bottom: 1px solid var(--hair); vertical-align: middle; } .table tr:hover td { background: rgb(17 18 20 / .02); }
.table code { background: var(--sunken); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; }
.avatar-preview { width: 72px; height: 72px; border-radius: 999px; overflow: hidden; background: var(--sunken); flex: none; } .avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.qa-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.qa-item { background: #fff; border: 1px solid var(--hair2); border-radius: 18px; padding: 14px; }
.qa-item .row { margin-bottom: 8px; } .qa-item label { margin-bottom: 6px; } .qa-item .row > label { margin: 0; }
.qa-item .qa-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; } .qa-item .qa-head b { flex: 1; }
.qa-item .emoji-in { width: 64px !important; flex: none; text-align: center; font-size: 18px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-card { border: 2px solid var(--hair2); border-radius: 18px; overflow: hidden; cursor: pointer; background: #fff; text-align: left; padding: 0; transition: transform .2s var(--ease), border-color .2s; } .theme-card:hover { transform: translateY(-2px); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.theme-prev { height: 92px; position: relative; padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.theme-prev .th { height: 14px; border-radius: 3px; margin: -6px -6px 2px; } .theme-prev .bi, .theme-prev .bo { height: 16px; width: 60%; border-radius: 6px; } .theme-prev .bo { align-self: flex-end; } .theme-prev .cp { margin-top: auto; height: 12px; border-radius: 8px; }
.theme-name { padding: 8px 10px; font-size: 12.5px; font-weight: 500; display: flex; justify-content: space-between; } .theme-name span { color: var(--ink3); font-weight: 400; }
.preview-card { position: sticky; top: 0; } .preview-card iframe { width: 100%; height: 640px; border: 1px solid var(--hair2); border-radius: 24px; background: #000; max-width: 380px; display: block; margin: 0 auto; }

/* inbox */
.inbox { display: flex; }
.chat-list-pane { width: 340px; flex: none; background: #fff; border-right: 1px solid var(--hair2); display: flex; flex-direction: column; }
.pane-head { display: flex; align-items: center; gap: 8px; padding: 16px 14px 8px; } .pane-title { font-weight: 600; font-size: 20px; letter-spacing: -.02em; flex: 1; }
.sel-sm { background: #fff; border: 1px solid var(--hair2); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; max-width: 150px; margin: 0; width: auto; }
.search-row { padding: 4px 12px 10px; } .search-row input { border-radius: 999px; margin: 0; padding: 10px 16px; background: var(--sunken); border-color: transparent; }
.chip-row { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; } .chip-row::-webkit-scrollbar { display: none; }
.chip { flex: none; background: #fff; border: 1px dashed var(--hair3); color: var(--ink2); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; transition: all .2s var(--ease); } .chip.active { background: var(--grad); border-style: solid; border-color: transparent; color: #fff; }
.chat-list { flex: 1; overflow-y: auto; }
.chat-item { display: flex; gap: 12px; padding: 10px 14px; cursor: pointer; align-items: center; border-radius: 18px; margin: 2px 8px; transition: background .2s var(--ease); }
.chat-item:hover { background: var(--sunken); } .chat-item.active { background: var(--accent-soft); }
.av { width: 46px; height: 46px; border-radius: 999px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; position: relative; font-size: 17px; }
.av .dot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--ink3); border: 2px solid #fff; } .av .dot.on { background: var(--live); }
.chat-item-body { flex: 1; min-width: 0; } .chat-item-top { display: flex; justify-content: space-between; gap: 8px; } .chat-item-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .chat-item-time { font-size: 12px; color: var(--ink3); flex: none; }
.chat-item-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; } .chat-item-last { font-size: 13px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-link { font-size: 10.5px; color: var(--ink2); background: var(--sunken); padding: 1px 7px; border-radius: 999px; flex: none; }
.chat-item-flags { display: flex; gap: 4px; align-items: center; flex: none; } .flag { font-size: 11px; }
.unread { background: var(--accent); color: #fff; font-size: 11px; min-width: 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; font-weight: 600; flex: none; font-family: var(--mono); }
.chat-item.unread-item .chat-item-name, .chat-item.unread-item .chat-item-last { color: var(--ink); font-weight: 600; }
.conv-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--canvas); position: relative; }
.conv-empty { margin: auto; text-align: center; color: var(--ink2); } .conv-empty-icon { font-size: 56px; } .conv-empty h2 { color: var(--ink); margin: 8px 0 4px; }
.conv { display: flex; flex-direction: column; height: 100%; }
/* ---------------- Enterprise Conversation Header & Footer ---------------- */
.conv-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--hair2);
  flex-wrap: wrap;
  row-gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.conv-head .av {
  width: 42px;
  height: 42px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.conv-head-text { flex: 1 1 180px; min-width: 0; }
.conv-name { font-weight: 700; font-size: 15px; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-sub { font-size: 12.5px; color: #64748b; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.conv-head .sel-sm {
  background: #f8fafc;
  border: 1px solid var(--hair2);
  color: #0f172a;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all .15s;
}
.conv-head .sel-sm:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.conv-head .btn, .conv-head .icon-btn {
  border-radius: 10px;
  transition: all .15s ease;
}
.conv-head .icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--hair2);
  background: #f8fafc;
  color: #475569;
}
.conv-head .icon-btn:hover { background: #e2e8f0; color: #0f172a; }
.conv-head .icon-btn svg { width: 18px; height: 18px; stroke: currentColor; }

#convAiToggle {
  background: #f5f3ff;
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: #7c3aed;
  font-weight: 600;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#convAiToggle.warn {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.3);
  color: #d97706;
}

/* Composer / Conversation Footer */
.conv-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #ffffff;
  border-top: 1px solid var(--hair2);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}
.conv-foot textarea {
  flex: 1;
  resize: none;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 16px;
  outline: none;
  max-height: 140px;
  min-height: 46px;
  margin: 0;
  font-size: 14.5px;
  color: #0f172a;
  transition: all .15s ease;
}
.conv-foot textarea:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.conv-foot textarea::placeholder { color: #94a3b8; }

.conv-foot .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--hair2);
  background: #f8fafc;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
}
.conv-foot .icon-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.conv-foot .icon-btn svg { width: 19px; height: 19px; stroke: currentColor; }

.conv-foot .send {
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all .15s ease;
  cursor: pointer;
}
.conv-foot .send:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.conv-foot .send:active { transform: translateY(1px); }
/* ---------------- Ultra Clean Enterprise Chat Canvas (No Doodles) ---------------- */
.conv-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 8%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: #f8fafc;
  background-image: radial-gradient(circle at 12% 16%, rgba(37,99,235, 0.03), transparent 40%),
                    radial-gradient(circle at 88% 84%, rgba(124,58,237, 0.03), transparent 45%);
  position: relative;
}
.conv-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}
.conv-body > * { position: relative; z-index: 1; }
.day {
  align-self: center;
  background: #ffffff;
  color: var(--ink2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 999px;
  margin: 10px 0;
  border: 1px solid var(--hair2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.bub {
  max-width: 68%;
  padding: 9px 13px 10px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.07);
}
.bub.in {
  align-self: flex-start;
  background: #ffffff;
  color: #0f172a;
}
.bub.out {
  align-self: flex-end;
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.22);
}
.bub.out .txt { color: #ffffff; }
.bub.out .txt a { color: #bfdbfe; text-decoration: underline; }
.bub.out .meta { color: rgba(255, 255, 255, 0.75); }
.bub.out .meta .ticks { color: #93c5fd; }
.bub.tail.in { border-top-left-radius: 4px; margin-top: 8px; }
.bub.tail.out { border-top-right-radius: 4px; margin-top: 8px; }
.bub.tail::before { display: none; }
.bub .txt a { color: var(--accent); }
.bub .txt::after { content: ""; display: inline-block; width: 70px; }
.bub .meta { position: absolute; right: 10px; bottom: 5px; font-size: 11px; color: var(--ink3); display: flex; gap: 4px; align-items: center; font-family: var(--mono); }
.bub.no-text .meta { position: static; justify-content: flex-end; margin-top: 4px; }
.bub .ticks { width: 16px; height: 11px; }
.bub .ticks.read { color: var(--accent); }
.bub .agent-name { font-size: 11.5px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.bub.out .agent-name { color: #dbeafe; }
.bub.ai { border-left: 3px solid var(--violet); }
.bub .agent-name.ai { color: var(--violet); }
.bub.out .agent-name.ai { color: #f5f3ff; }
.bub img.att { max-width: 320px; width: 100%; border-radius: 10px; display: block; cursor: zoom-in; } .bub video { max-width: 320px; width: 100%; border-radius: 10px; } .bub audio { display: block; width: 260px; max-width: 100%; }
.bub .file { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--sunken); border-radius: 10px; color: var(--ink); text-decoration: none; }
.bub .cta { display: block; text-align: center; margin: 6px -10px -8px; padding: 9px; border-top: 1px solid var(--hair2); color: var(--accent); text-decoration: none; font-weight: 500; }
.bub.has-cta .meta { position: static; justify-content: flex-end; margin: 2px 0 4px; }
.bub.sys { align-self: center; background: #fff; color: var(--ink2); font-size: 12.5px; }
.typing-line { padding: 4px 8%; font-size: 12.5px; color: var(--live); }
.conv-foot { display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--hair2); }
.conv-foot textarea { flex: 1; resize: none; background: var(--sunken); border: 1px solid transparent; border-radius: 22px; padding: 11px 16px; outline: none; max-height: 140px; min-height: 44px; margin: 0; }
.conv-foot .send { margin: 0; padding: 11px 18px; } .conv-foot .send .txt { display: inline; } .conv-foot .send .ico { display: none; }
.composer-more { display: none; }
.rec-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border-top: 1px solid var(--hair2); } .rec-bar .btn { margin: 0; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; } @keyframes blink { 50% { opacity: .2; } }
.ai-bar { display: flex; align-items: center; gap: 10px; margin: 0 12px 6px; background: var(--violet-soft); border: 1px solid rgb(109 79 214 / .3); border-radius: 18px; padding: 10px 14px; }
.ai-bar-text { flex: 1; min-width: 0; font-size: 13.5px; } .ai-bar-text b { display: block; font-size: 12px; color: var(--violet); margin-bottom: 2px; } .ai-bar-text span { white-space: pre-wrap; }
.canned-pop { position: absolute; left: 16px; right: 16px; bottom: 70px; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--hair2); border-radius: 18px; box-shadow: 0 12px 40px -18px rgb(17 18 20 / .3); z-index: 5; }
.canned-pop button { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--hair); padding: 10px 14px; cursor: pointer; color: var(--ink); }
.canned-pop button:hover { background: var(--sunken); } .canned-pop button b { display: block; font-size: 13px; color: var(--accent); } .canned-pop button span { font-size: 12.5px; color: var(--ink2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-pane { width: 300px; flex: none; background: #fff; border-left: 1px solid var(--hair2); display: flex; flex-direction: column; overflow-y: auto; }
.info-body { padding: 8px 16px 24px; } .info-av { width: 80px; height: 80px; border-radius: 999px; background: var(--grad); color: #fff; margin: 8px auto 16px; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 13px; } .kv span { color: var(--ink2); } .kv b { font-weight: 500; text-align: right; overflow-wrap: anywhere; } .kv b.small { font-size: 11.5px; }
.info-body .btn { width: 100%; margin: 6px 0 0; }
.notes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; } .note { background: var(--amber-soft); border: 1px solid rgb(209 154 18 / .3); border-radius: 14px; padding: 8px 10px; font-size: 13px; } .note small { display: block; color: var(--ink2); margin-top: 3px; font-size: 11px; }

/* mobile action sheet */
.sheet-scrim { position: fixed; inset: 0; background: rgb(17 18 20 / .35); z-index: 70; }
.action-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto; background: #fff; border-radius: 24px 24px 0 0; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); z-index: 71; box-shadow: 0 -12px 40px -18px rgb(17 18 20 / .3); animation: up .32s var(--ease2); }
@keyframes up { from { transform: translateY(100%); } }
.action-sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--hair3); margin: 0 auto 14px; }
.action-sheet label { margin-bottom: 10px; } .action-sheet .btn { width: 100%; margin: 6px 0 0; justify-content: flex-start; }
.composer-pop { position: absolute; left: 12px; bottom: 74px; background: #fff; border: 1px solid var(--hair2); border-radius: 18px; box-shadow: 0 12px 40px -18px rgb(17 18 20 / .3); z-index: 6; padding: 6px; display: flex; flex-direction: column; }
.composer-pop button { background: none; border: none; text-align: left; padding: 10px 14px; border-radius: 12px; cursor: pointer; font-size: 14px; } .composer-pop button:hover { background: var(--sunken); }

/* modal & misc */
.modal { position: fixed; inset: 0; background: rgb(17 18 20 / .4); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { background: #fff; border-radius: 24px; width: 100%; max-width: 660px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 30px 70px -30px rgb(17 18 20 / .4); }
.modal-card header, .modal-card footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--hair2); } .modal-card footer { border-bottom: 0; border-top: 1px solid var(--hair2); justify-content: flex-end; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.call-banner { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--hair2); border-radius: 999px; padding: 10px 14px 10px 18px; display: flex; align-items: center; gap: 10px; z-index: 90; box-shadow: 0 12px 40px -18px rgb(17 18 20 / .4); animation: ring 1.4s infinite; max-width: calc(100% - 20px); }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgb(18 166 111 / .4); } 100% { box-shadow: 0 0 0 16px rgb(18 166 111 / 0); } }
.call-banner.live { animation: none; } .call-banner .btn { margin: 0; } .call-banner-text { display: flex; flex-direction: column; margin-right: 8px; } .call-banner-text span { font-size: 12.5px; color: var(--ink2); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 100; box-shadow: 0 12px 40px -18px rgb(17 18 20 / .5); max-width: calc(100% - 32px); font-size: 13.5px; }
.lightbox { position: fixed; inset: 0; background: rgb(17 18 20 / .92); z-index: 95; display: flex; align-items: center; justify-content: center; cursor: zoom-out; } .lightbox img { max-width: 96%; max-height: 96%; border-radius: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--hair2); border-radius: 18px; padding: 14px 16px; } .stat b { display: block; font-size: 28px; font-weight: 500; letter-spacing: -.03em; } .stat span { color: var(--ink2); font-size: 12.5px; }
.stat:nth-child(1) { background: var(--accent-soft); } .stat:nth-child(2) { background: var(--violet-soft); } .stat:nth-child(3) { background: var(--orange-soft); } .stat:nth-child(4) { background: var(--teal-soft); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; } .bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; height: 100%; font-size: 10px; color: var(--ink3); font-family: var(--mono); }
.bar-col .b { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; } .b.chats { background: var(--accent); } .b.ai { background: var(--violet); } .b.human { background: var(--teal); } .b.vis { background: #c7cbd6; } .b.rev { background: var(--grad); }
.kv-list .kv b { font-weight: 600; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; } .filter-row input, .filter-row select { width: auto; margin: 0; border-radius: 999px; padding: 8px 14px; } .filter-row .btn { margin: 0; } .filter-row label.check { margin: 0; }
.bulk-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; } .table tr.sel td { background: var(--accent-soft); } .table td .tag { margin: 1px 2px 1px 0; }
.multi { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .multi label.check { margin: 0; font-size: 13px; background: #fff; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--hair2); }
.usage { margin-top: 10px; font-size: 13px; color: var(--ink2); } .usage .meter { height: 8px; border-radius: 999px; background: var(--sunken); margin-top: 6px; overflow: hidden; } .usage .meter i { display: block; height: 100%; background: var(--grad); }
.log-list { max-height: 360px; overflow-y: auto; font-size: 12.5px; } .log-list div { padding: 8px 0; border-bottom: 1px solid var(--hair); } .log-list .ok { color: var(--ok); } .log-list .fail { color: var(--bad); }
.provider-key { font-family: var(--mono); }
.test-out { margin-top: 10px; border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; border: 1px solid var(--hair2); background: #fff; white-space: pre-wrap; }
.test-out.ok { border-color: rgb(31 157 85 / .4); background: #e4f5ea; } .test-out.fail { border-color: rgb(208 53 63 / .35); background: #fdecec; }
.test-out b { display: block; margin-bottom: 4px; } .test-out .sol { display: block; margin-top: 6px; color: var(--warn); font-weight: 500; } .test-out .note { display: block; margin-top: 6px; color: var(--ink2); }
.plan-banner { position: fixed; top: 0; left: 272px; right: 0; z-index: 40; background: var(--amber-soft); border-bottom: 1px solid rgb(209 154 18 / .35); padding: 8px 16px; font-size: 13.5px; display: flex; align-items: center; gap: 10px; }
.plan-banner:not([hidden]) ~ .view.page { padding-top: 64px; } .plan-banner:not([hidden]) ~ .view.inbox .chat-list-pane, .plan-banner:not([hidden]) ~ .view.inbox .conv-pane { padding-top: 40px; }
.toggle-sm { display: inline-flex; gap: 6px; }
.enter { animation: rise .7s var(--ease) both; } @keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1100px) { .info-pane { position: absolute; right: 0; top: 0; bottom: 0; z-index: 10; box-shadow: -12px 0 40px -18px rgb(17 18 20 / .3); } .grid2, .grid2.wide-left { grid-template-columns: 1fr; } .preview-card { position: static; } }
@media (max-width: 800px) {
  h1 { font-size: 24px; }
  .nav { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .32s var(--ease2); width: 280px; }
  .nav.open { transform: none; box-shadow: 20px 0 60px -20px rgb(17 18 20 / .5); }
  .nav-close-btn { display: inline-flex; }
  .nav.open ~ .nav-backdrop, body.nav-open .nav-backdrop { display: block; }
  .nav.open ~ .nav-toggle, body.nav-open .nav-toggle { display: none !important; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  body.in-conv .nav-toggle, body.modal-open .nav-toggle { display: none !important; }
  .page { padding: 68px 14px 60px; }
  .page-head { position: relative; padding-left: 48px; min-height: 44px; }
  .page-head h1 { font-size: 22px; line-height: 1.25; margin-bottom: 4px; }
  .inbox { position: relative; } .chat-list-pane { width: 100%; padding-top: 56px; border: 0; } .pane-head { padding-top: 6px; }
  .conv-pane { position: absolute; inset: 0; z-index: 20; transform: translateX(100%); transition: transform .32s var(--ease2); } .inbox.show-conv .conv-pane { transform: none; }
  .conv-head { flex-wrap: nowrap; padding: 10px 8px; } .conv-head .back, .conv-head .more { display: inline-flex; } .conv-head .sel-sm, #convAiToggle, #convCall, #convInfoBtn { display: none; } .conv-head-text { flex: 1 1 auto; }
  .conv-body { padding: 12px 10px; } .bub { max-width: 84%; }
  .conv-foot { gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); } #cannedBtn, #aiDraftBtn, #attachAdmin { display: none; } .composer-more { display: inline-flex; }
  .conv-foot .send { width: 44px; height: 44px; padding: 0; border-radius: 999px; } .conv-foot .send .txt { display: none; } .conv-foot .send .ico { display: inline; font-size: 18px; }
  .info-pane { width: 100%; z-index: 30; }
  .preview-card iframe { height: 560px; }
  .row { flex-wrap: wrap; } .row > label, .row > input { flex: 1 1 100%; }
  .plan-banner { left: 0; top: 0; padding-left: 60px; min-height: 52px; } .plan-banner:not([hidden]) ~ .view.inbox .chat-list-pane { padding-top: 100px; }
  .stat-row { grid-template-columns: 1fr 1fr; } .stat b { font-size: 22px; }
  .page-head .btn { width: 100%; }
  .call-banner { top: auto; bottom: 80px; border-radius: 24px; flex-wrap: wrap; justify-content: center; }
  .modal-card { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; padding: 18px 14px; margin: 16px auto; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { padding: 9px 8px; font-size: 12px; }
  .table code { word-break: break-all; }
  .plan-tier-price { text-align: left; width: 100%; padding-top: 8px; border-top: 1px dashed var(--hair); }
  .slug-input-wrap { flex-direction: column; align-items: stretch; }
  .slug-prefix { border-right: none; border-bottom: 1px solid var(--hair2); width: 100%; box-sizing: border-box; }
  .slug-suffix { display: none; }
}

/* ---------- media editor & stickers ---------- */
.media-box { border: 1px dashed var(--hair3); border-radius: 18px; padding: 10px; background: #fff; }
.media-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.media-list:empty { display: none; }
.media-chip { display: flex; align-items: center; gap: 8px; background: var(--sunken); border-radius: 999px; padding: 5px 10px 5px 5px; font-size: 12.5px; max-width: 100%; }
.media-chip img { width: 30px; height: 30px; border-radius: 999px; object-fit: cover; flex: none; background: #fff; }
.media-chip span.ic { width: 30px; height: 30px; border-radius: 999px; background: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.media-chip b { font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-chip button { background: none; border: none; cursor: pointer; color: var(--ink2); font-size: 14px; padding: 0 2px; }
.media-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.media-bar .btn { margin: 0; }
.media-empty { color: var(--ink3); font-size: 12.5px; margin-bottom: 8px; }
.pack-card .sticker-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 10px 14px; }
.sticker-admin-cell { position: relative; aspect-ratio: 1; border: 1px solid var(--hair2); border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 8px; }
.sticker-admin-cell img { width: 100%; height: 100%; object-fit: contain; }
.sticker-admin-cell button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 999px; background: var(--bad); color: #fff; border: 2px solid #fff; font-size: 12px; line-height: 1; cursor: pointer; display: none; }
.sticker-admin-cell:hover button, .sticker-admin-cell:focus-within button { display: block; }
.pack-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 14px 0; } .pack-actions .btn { margin: 0; }
.pack-actions label.btn { cursor: pointer; }
.sticker-pop { position: absolute; left: 12px; right: 12px; bottom: 74px; max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--hair2); border-radius: 18px; box-shadow: 0 12px 40px -18px rgb(17 18 20 / .3); z-index: 6; padding: 10px; }
.sticker-pop .packs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; } .sticker-pop .packs button { flex: none; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--hair2); background: #fff; cursor: pointer; font-size: 12.5px; } .sticker-pop .packs button.on { background: var(--grad); color: #fff; border-color: transparent; }
.sticker-pop .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.sticker-pop .grid button { aspect-ratio: 1; border: none; background: none; cursor: pointer; border-radius: 12px; padding: 6px; } .sticker-pop .grid button:hover { background: var(--sunken); } .sticker-pop .grid img { width: 100%; height: 100%; object-fit: contain; }
.bub .sticker-att { width: 132px; height: 132px; object-fit: contain; display: block; }
.bub.sticker-msg { background: none !important; box-shadow: none !important; padding: 0 !important; }
.install-link { font-weight: 600; color: #fff !important; }
@media (max-width: 800px) { .media-chip b { max-width: 90px; } .pack-actions .btn { flex: 1 1 100%; } }

/* reply / quote, call log, related chats, paging */
.bub.sys { align-self: center; background: #fff; color: var(--ink2); font-size: 12.5px; }
.bub .quote { border-left: 3px solid var(--accent, #2857e0); background: rgb(0 0 0 / .05); border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; font-size: 13px; cursor: pointer; white-space: normal; }
.bub .quote b { display: block; font-size: 12px; color: var(--accent, #2857e0); }
.bub .quote span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Modern message hover action pill */
.bub .bub-actions {
  position: absolute;
  top: -14px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 20px;
  padding: 3px 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 10;
}
.bub.in .bub-actions { right: 10px; }
.bub.out .bub-actions { left: 10px; }

.bub:hover .bub-actions,
.bub:focus-within .bub-actions,
.bub.show-actions .bub-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.bub-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #475569 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all .15s ease;
}
.bub-action-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}
.bub-action-btn:hover {
  background: #f1f5f9;
  color: #0f172a !important;
}
.bub-action-btn.del-btn:hover {
  background: #fee2e2;
  color: #ef4444 !important;
}

@media (hover: none) {
  .bub .bub-actions {
    display: none;
  }
  .bub.show-actions .bub-actions {
    display: inline-flex;
    opacity: 1;
    pointer-events: auto;
  }
}

.fwd-search { width: 100%; margin-bottom: 10px; }
.fwd-list { max-height: 50vh; overflow: auto; }
.fwd-item { display: flex; gap: 10px; align-items: center; margin: 0; padding: 9px 4px; border-bottom: 1px solid rgb(0 0 0 / .06); color: inherit; font-size: 14px; cursor: pointer; }
.fwd-item input { width: auto; margin: 0; }
.fwd-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.bub.flash { animation: bubflash 1.2s ease; }
@keyframes bubflash { 0%, 60% { filter: brightness(.85); } 100% { filter: none; } }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--hair2); background: #fff; }
.reply-bar-text { flex: 1; min-width: 0; border-left: 3px solid var(--accent, #2857e0); padding-left: 8px; font-size: 13px; }
.reply-bar-text b { display: block; font-size: 12px; }
.reply-bar-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-chats { align-self: center; background: #fff8e1; border: 1px solid #f3dc9a; border-radius: 12px; padding: 8px 12px; font-size: 13px; margin: 6px 0; max-width: 92%; white-space: normal; }
.related-chats button { margin: 4px 4px 0 0; }
.load-older { display: block; margin: 10px auto; }
.bub.deleted .txt { font-style: italic; opacity: .65; }
