﻿:root {
  --navy: #111a4a;
  --navy-2: #1d2763;
  --blue: #2563eb;
  --cyan: #33d5e4;
  --pink: #ff7aac;
  --gold: #ffc857;
  --green: #e3ffd2;
  --bg: #f4f7fb;
  --panel: rgba(255, 255, 255, .88);
  --line: rgba(17, 26, 74, .10);
  --text: #151a2d;
  --muted: #737b91;
  --danger: #e34b61;
  --shadow: 0 22px 70px rgba(17, 26, 74, .13);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 122, 172, .18), transparent 34vw),
    radial-gradient(circle at 80% 10%, rgba(51, 213, 228, .18), transparent 35vw),
    linear-gradient(135deg, #f7f9ff 0%, #eef4ff 48%, #f6f8fb 100%);
}
button, input, textarea, select { font: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

.glass-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.primary-btn, .ghost-btn, .danger-btn, .danger-lite, .send-btn, .icon-btn {
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease, background .16s ease;
  user-select: none;
  white-space: nowrap;
}
.primary-btn, .send-btn {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8 48%, #152467);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .28);
  padding: 12px 20px;
  font-weight: 800;
}
.primary-btn:hover, .send-btn:hover, .ghost-btn:hover, .danger-btn:hover, .danger-lite:hover, .icon-btn:hover {
  transform: translateY(-1px);
}
.ghost-btn {
  background: #f4f7fc;
  color: #24304e;
  border: 1px solid var(--line);
  padding: 10px 16px;
  font-weight: 700;
}
.danger-btn {
  color: #fff;
  background: linear-gradient(135deg, #ff6275, #d82646);
  padding: 11px 16px;
  font-weight: 800;
}
.danger-lite {
  color: #b31f39;
  background: #fff0f2;
  border: 1px solid rgba(227, 75, 97, .18);
  padding: 10px 16px;
  font-weight: 800;
}

/* Portal */
.portal-page { min-height: 100vh; display: grid; place-items: center; padding: 42px; }
.portal-shell { width: min(1180px, 100%); display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: stretch; }
.portal-hero { border-radius: 34px; padding: 46px; overflow: hidden; position: relative; }
.portal-hero::before {
  content: ""; position: absolute; inset: -80px auto auto -80px; width: 240px; height: 240px;
  background: linear-gradient(135deg, rgba(255,122,172,.35), rgba(51,213,228,.24)); border-radius: 50%; filter: blur(2px);
}
.brand-lockup img { width: 230px; max-width: 100%; height: auto; display: block; }
.brand-lockup.xl img { width: 340px; margin-bottom: 34px; }
.eyebrow { display: inline-flex; padding: 8px 12px; border-radius: 999px; background: rgba(37,99,235,.09); color: #1d4ed8; font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.portal-hero h1 { font-size: clamp(34px, 5vw, 64px); line-height: 1.03; margin: 20px 0; color: var(--navy); }
.portal-hero p { color: #536078; font-size: 18px; line-height: 1.75; max-width: 720px; }
.portal-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 34px 0 16px; }
.portal-note { color: var(--muted); font-size: 14px; }
.portal-grid { display: grid; gap: 18px; }
.feature-card { border-radius: 28px; padding: 30px; background: rgba(255,255,255,.66); border: 1px solid rgba(255,255,255,.7); box-shadow: 0 16px 48px rgba(17,26,74,.08); }
.feature-card span { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 16px; background: linear-gradient(135deg, rgba(255,122,172,.26), rgba(51,213,228,.22)); color: var(--navy); font-weight: 900; }
.feature-card h2 { margin: 18px 0 8px; color: var(--navy); }
.feature-card p { color: #697388; line-height: 1.7; margin: 0; }

/* Customer */
.customer-page { min-height: 100vh; display: grid; place-items: center; padding: 18px; background: #e8edf7; }
.customer-phone {
  width: min(519px, calc(100vw - 24px));
  height: min(924px, calc(100vh - 36px));
  min-height: 680px;
  background: #fff;
  box-shadow: 0 26px 90px rgba(17,26,74,.22);
  border-radius: 26px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  min-width: 0;
  border: 1px solid rgba(17,26,74,.06);
}
.customer-header {
  min-height: 86px;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  color: #fff;
  background:
    radial-gradient(circle at 8% 20%, rgba(255,255,255,.34), transparent 18%),
    radial-gradient(circle at 88% 8%, rgba(255,255,255,.22), transparent 25%),
    linear-gradient(90deg, rgba(17,26,74,.26), rgba(17,26,74,0) 54%),
    linear-gradient(135deg, #ff7aac 0%, #f889c8 28%, #a7d8ff 62%, #33d5e4 100%);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.customer-header::after {
  content: ""; position: absolute; right: -46px; top: -58px; width: 170px; height: 170px;
  background: linear-gradient(135deg, rgba(255,255,255,.24), rgba(255,255,255,.08)); border-radius: 50%; z-index: -1;
}
.agent-avatar-wrap { position: relative; width: 58px; height: 58px; flex: 0 0 58px; }
.agent-avatar-wrap img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.52); background: rgba(255,255,255,.28); }
.agent-avatar-wrap i { position: absolute; right: 2px; bottom: 4px; width: 13px; height: 13px; border-radius: 50%; background: #28d37f; border: 2px solid #fff; }
.customer-title-block { flex: 1 1 auto; width: 0; min-width: 0; overflow: hidden; }
.title-row { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.vip-badge { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; padding: 3px 8px; border-radius: 5px; background: #fff; color: #df9a00; font-size: 12px; font-weight: 900; }
.customer-header h1 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 18px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-header p { width: 100%; max-width: 100%; margin: 7px 0 0; font-size: 13px; line-height: 1.35; opacity: .96; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-bar { height: 43px; display: grid; grid-template-columns: 38px 1fr 40px; align-items: center; background: #fff4fb; border-bottom: 1px solid rgba(255,122,172,.18); color: #a33a5e; }
.notice-icon { text-align: center; font-size: 20px; }
.notice-bar marquee { font-size: 16px; }
.notice-bar button { border: 0; background: transparent; font-size: 26px; color: #30364d; cursor: pointer; }
.ad-carousel {
  min-height: 74px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  border-bottom: 1px solid rgba(17,26,74,.08);
}
.ad-card {
  display: grid;
  gap: 4px;
  height: 54px;
  border-radius: 18px;
  padding: 9px 14px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 0%, rgba(255,255,255,.28), transparent 34%),
    linear-gradient(135deg, #111a4a 0%, #2563eb 48%, #33d5e4 100%);
  box-shadow: 0 12px 28px rgba(37,99,235,.18);
  overflow: hidden;
}
.ad-card:hover { text-decoration: none; }
.ad-card strong { font-size: 14px; line-height: 1.15; }
.ad-card span { font-size: 12px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-chat-area {
  background: #f0f4fc;
  padding: 18px 18px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  height: 100%;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.quick-strip { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 10px 14px 0; background: #fff; min-height: 0; scrollbar-width: none; }
.quick-strip::-webkit-scrollbar { display: none; }
.quick-chip { flex: 0 0 auto; max-width: 180px; border: 1px solid rgba(37,99,235,.12); background: #f6f8ff; color: #273355; border-radius: 999px; padding: 8px 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.customer-composer { background: #fff; padding: 12px 14px 16px; border-top: 1px solid rgba(17,26,74,.08); }
.composer-row { display: flex; gap: 8px; align-items: flex-end; width: 100%; min-width: 0; overflow: hidden; }
.icon-btn { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; background: #f5f7fb; border: 1px solid var(--line); color: #7b8395; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; }
.customer-composer textarea {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  min-height: 42px;
  max-height: 128px;
  resize: none;
  border: 0;
  outline: 0;
  background: #fff;
  padding: 11px 8px;
  line-height: 1.45;
  color: #273044;
}
.customer-composer textarea::placeholder { color: #b8bdc8; }
.customer-composer .send-btn { flex: 0 0 54px; min-width: 54px; height: 46px; padding: 0 13px; border-radius: 14px; }
.customer-footer-brand { width: 100%; overflow: hidden; text-align: right; font-size: 24px; line-height: 1.12; font-weight: 900; color: #101010; padding: 8px 14px 0 0; letter-spacing: .02em; }

.msg { display: flex; gap: 10px; width: 100%; min-width: 0; margin: 16px 0; align-items: flex-start; }
.msg.agent { justify-content: flex-start; }
.msg.customer { justify-content: flex-end; }
.msg-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; object-fit: cover; background: #fff; border: 1px solid rgba(17,26,74,.08); box-shadow: 0 4px 14px rgba(17,26,74,.07); }
.msg-stack { max-width: calc(100% - 52px); min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; }
.msg.customer .msg-stack { align-items: flex-end; }
.msg-meta { max-width: 100%; min-width: 0; color: #626b7d; font-size: 12px; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; align-self: flex-start; overflow: hidden; }
.msg.customer .msg-meta { justify-content: flex-end; align-self: flex-end; }
.msg-meta span { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.official-chip { background: #f5a623; color: #fff; border-radius: 4px; padding: 1px 5px; font-weight: 800; }
.bubble { display: inline-block; width: auto; max-width: 100%; padding: 12px 14px; border-radius: 5px 16px 16px 16px; line-height: 1.6; word-break: break-word; overflow-wrap: anywhere; box-shadow: 0 5px 18px rgba(17,26,74,.06); }
.bubble a { color: #1d4ed8; text-decoration: underline; font-weight: 800; }
.msg.agent .bubble { background: #fff; border: 1px solid rgba(17,26,74,.06); }
.msg.customer .bubble { background: #e2ffd3; border: 1px solid rgba(37, 160, 90, .12); border-radius: 16px 5px 16px 16px; }
.msg img.chat-image {
  max-width: 100%;
  max-height: 260px;
  border-radius: 12px;
  display: block;
  border: 1px solid rgba(17,26,74,.08);
  cursor: zoom-in;
  object-fit: contain;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.msg img.chat-image:hover,
.msg img.chat-image:focus {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(17,26,74,.16);
  filter: saturate(1.04);
}
.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 22px;
}
.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 38, .78);
  backdrop-filter: blur(14px);
  cursor: zoom-out;
}
.image-preview-card {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 38px);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.image-preview-card img {
  max-width: 100%;
  max-height: calc(100vh - 112px);
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  box-shadow: 0 24px 92px rgba(0,0,0,.38);
}
.image-preview-close {
  position: absolute;
  top: -16px;
  right: -10px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7aac, #33d5e4);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0,0,0,.28);
}
.image-preview-caption {
  color: rgba(255,255,255,.82);
  font-size: 13px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,.26);
}
.image-caption { margin-top: 8px; }
body.preview-open { overflow: hidden; }
.read-receipt { color: #767d8d; font-size: 12px; margin-top: 6px; }
.msg.customer .read-receipt { text-align: right; align-self: flex-end; }
.system-line { text-align: center; color: #97a1b4; font-size: 12px; margin: 14px 0; }

/* Admin */
.admin-page { min-height: 100vh; padding: 16px; overflow: hidden; }
.admin-shell { height: calc(100vh - 32px); min-height: 0; display: grid; grid-template-columns: 320px 1fr 340px; gap: 16px; }
.admin-sidebar, .chat-panel, .admin-inspector { border-radius: 26px; overflow: hidden; border: 1px solid rgba(255,255,255,.7); }
.admin-sidebar { display: grid; grid-template-rows: auto auto auto 1fr; min-width: 0; min-height: 0; }
.admin-brand { display: flex; align-items: center; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); }
.admin-brand img { width: 138px; max-height: 52px; object-fit: contain; }
.admin-brand span { font-weight: 900; color: var(--navy); }
.sidebar-search { padding: 12px 18px; }
.sidebar-search input, .inspector-card input, .inspector-card textarea, .inspector-card select, .settings-card input, .settings-card textarea {
  width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.82); border-radius: 13px; padding: 12px 13px; outline: none; color: #26304a;
}
.sidebar-search input:focus, .inspector-card input:focus, .inspector-card textarea:focus, .inspector-card select:focus, .settings-card input:focus, .settings-card textarea:focus {
  border-color: rgba(37,99,235,.46); box-shadow: 0 0 0 4px rgba(37,99,235,.09);
}
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 18px 12px; }
.metric-row div { background: linear-gradient(180deg, rgba(255,255,255,.84), rgba(245,248,255,.78)); border: 1px solid var(--line); border-radius: 16px; padding: 12px 8px; text-align: center; }
.metric-row strong { display: block; font-size: 22px; color: var(--navy); }
.metric-row span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.visitor-list { overflow-y: auto; overflow-x: hidden; min-height: 0; padding: 0 10px 14px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.visitor-card { width: 100%; border: 0; background: transparent; text-align: left; display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; padding: 12px 10px; border-radius: 18px; cursor: pointer; color: inherit; }
.visitor-card:hover { background: rgba(37,99,235,.06); }
.visitor-card.active { background: linear-gradient(135deg, rgba(255,241,222,.92), rgba(247,251,255,.96)); box-shadow: inset 0 0 0 1px rgba(255,200,87,.26); }
.visitor-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 4px 14px rgba(17,26,74,.08); }
.visitor-main { min-width: 0; }
.visitor-name { display: flex; align-items: center; gap: 6px; font-weight: 900; color: var(--navy); }
.visitor-preview { margin-top: 5px; color: #697489; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visitor-time { color: #9aa3b2; font-size: 12px; white-space: nowrap; }
.unread-dot { display: inline-flex; min-width: 18px; height: 18px; border-radius: 999px; background: #f04438; color: #fff; align-items: center; justify-content: center; font-size: 11px; padding: 0 5px; }
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.small-tag { display: inline-flex; padding: 2px 6px; border-radius: 999px; background: rgba(37,99,235,.08); color: #3151a6; font-size: 11px; }

.chat-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; min-width: 0; min-height: 0; height: 100%; }
.chat-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.5); }
.chat-toolbar h1 { margin: 0; font-size: 22px; color: var(--navy); }
.chat-toolbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.toolbar-actions { display: flex; gap: 10px; align-items: center; }
.admin-chat-area {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  height: 100%;
  padding: 18px 22px 22px;
  background: linear-gradient(180deg, rgba(240,244,252,.86), rgba(247,249,253,.82));
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.admin-chat-area.empty-state { display: grid; place-items: center; color: #9aa3b2; font-weight: 800; }
.admin-quick { border-top: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 8px; flex-wrap: wrap; background: rgba(255,255,255,.5); }
.admin-composer { border-top: 1px solid var(--line); background: rgba(255,255,255,.75); padding: 12px 14px; }
.admin-composer textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-height: 66px; background: #fff; }
.composer-actions { margin-top: 10px; display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.file-inline { display: inline-flex; align-items: center; }

.admin-inspector { overflow-y: auto; overflow-x: hidden; min-height: 0; padding: 14px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.inspector-card { background: rgba(255,255,255,.66); border: 1px solid rgba(17,26,74,.08); border-radius: 22px; padding: 16px; margin-bottom: 14px; }
.inspector-card h2 { font-size: 18px; color: var(--navy); margin: 0 0 14px; }
.inspector-card label, .settings-card label, .login-card label { display: block; color: #5d6678; font-size: 13px; font-weight: 800; margin-bottom: 12px; }
.inspector-card input, .inspector-card textarea, .inspector-card select, .settings-card input, .settings-card textarea, .login-card input { margin-top: 7px; }
.split-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.template-preview { display: flex; gap: 12px; align-items: center; }
.template-preview img { width: 54px; height: 54px; border-radius: 50%; background: #fff; object-fit: cover; }
.template-preview strong { display: block; color: var(--navy); }
.template-preview span { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; line-height: 1.4; }
.muted-line { color: var(--muted); line-height: 1.6; }
.visitor-profile-preview {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  margin: 8px 0 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(246,248,255,.78);
  border: 1px solid rgba(17,26,74,.07);
}
.visitor-profile-preview img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; background: #fff; }
.visitor-profile-preview p { margin: 2px 0; font-size: 12px; word-break: break-all; }
.device-line { font-size: 12px; word-break: break-all; }

/* Login / dialog */
.login-overlay { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20; background: linear-gradient(135deg, #f4f7ff 0%, #eaf2ff 100%); }
.login-card { width: min(420px, calc(100vw - 36px)); border-radius: 28px; padding: 34px; }
.login-card img { width: 220px; display: block; margin: 0 auto 18px; }
.login-card h1 { color: var(--navy); text-align: center; margin: 0 0 8px; }
.login-card p { color: var(--muted); text-align: center; margin-bottom: 24px; }
.login-card input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none; }
.login-card .primary-btn { width: 100%; margin-top: 8px; }
.form-error { min-height: 22px; color: #d32946; margin-top: 12px; text-align: center; font-size: 13px; }

.settings-dialog { width: min(980px, calc(100vw - 36px)); border: 0; border-radius: 28px; padding: 0; box-shadow: 0 34px 120px rgba(8,15,44,.28); }
.settings-dialog::backdrop { background: rgba(12, 18, 42, .55); backdrop-filter: blur(7px); }
.settings-card { padding: 28px; position: relative; }
.settings-card h2 { margin: 0 0 8px; color: var(--navy); font-size: 26px; }
.dialog-close { position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #f4f6fb; cursor: pointer; font-size: 24px; color: #667085; }
.settings-grid { display: grid; grid-template-columns: .8fr 1fr 1fr; gap: 22px; margin-top: 20px; }
.logo-picker, .avatar-picker { border: 1px dashed rgba(37,99,235,.28); border-radius: 20px; padding: 14px; background: #f8fbff; }
.logo-picker img { width: 100%; max-height: 92px; object-fit: contain; display: block; margin-bottom: 12px; }
.avatar-picker img { width: 86px; height: 86px; border-radius: 50%; object-fit: cover; display: block; background: #fff; margin-bottom: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }

.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  background: rgba(17,26,74,.94); color: #fff; padding: 12px 16px; border-radius: 14px;
  box-shadow: 0 18px 48px rgba(17,26,74,.22); font-weight: 800; animation: toastIn .18s ease-out;
}
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.customer-chat-area::-webkit-scrollbar,
.admin-chat-area::-webkit-scrollbar,
.visitor-list::-webkit-scrollbar,
.admin-inspector::-webkit-scrollbar { width: 9px; }
.customer-chat-area::-webkit-scrollbar-track,
.admin-chat-area::-webkit-scrollbar-track,
.visitor-list::-webkit-scrollbar-track,
.admin-inspector::-webkit-scrollbar-track { background: rgba(17,26,74,.04); border-radius: 999px; }
.customer-chat-area::-webkit-scrollbar-thumb,
.admin-chat-area::-webkit-scrollbar-thumb,
.visitor-list::-webkit-scrollbar-thumb,
.admin-inspector::-webkit-scrollbar-thumb { background: rgba(37,99,235,.28); border-radius: 999px; }

@media (max-width: 1180px) {
  .admin-shell { grid-template-columns: 280px 1fr 300px; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 940px) {
  .portal-page { padding: 22px; }
  .portal-shell { grid-template-columns: 1fr; }
  .admin-page { overflow: auto; }
  .admin-shell { height: auto; min-height: calc(100vh - 32px); grid-template-columns: 1fr; }
  .admin-sidebar, .admin-inspector { max-height: none; }
}
@media (max-width: 560px) {
  .customer-page { padding: 0; }
  .customer-phone { width: 100vw; height: 100vh; min-height: 100vh; border-radius: 0; }
  .customer-header h1 { font-size: 18px; }
  .customer-header p { font-size: 13px; }
  .portal-hero { padding: 28px; border-radius: 24px; }
  .toolbar-actions, .composer-actions, .split-actions { flex-wrap: wrap; grid-template-columns: 1fr; }
}
