:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #d8dee8;
  --line-strong: #c7d0de;
  --text: #172033;
  --muted: #64748b;
  --primary: #409eff;
  --primary-dark: #2f7fd0;
  --primary-soft: #ecf5ff;
  --danger: #c43d3d;
  --danger-soft: #fff0f0;
  --warning: #d9850d;
  --shadow: 0 12px 30px rgba(22, 34, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

body.agent-page {
  height: 100vh;
  overflow: hidden;
}

body.admin-page {
  height: 100vh;
  overflow: hidden;
  min-height: 100vh;
  background: #eef2f7;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 0 16px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.plain-button {
  border-color: var(--line-strong);
  color: var(--text);
  background: #fff;
}

.plain-button:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 95, 191, 0.12);
}

textarea {
  resize: none;
  line-height: 1.5;
  overflow-y: auto;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.visitor-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.chat-window {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  position: relative;
  width: min(100%, 760px);
  height: min(760px, calc(100vh - 48px));
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.user-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.visitor-back-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #d8e1ee;
  border-radius: 50%;
  line-height: 1;
  color: #4b5f7a;
  background: #fff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08);
}

.visitor-back-button:hover {
  border-color: #b7c6da;
  color: var(--primary);
  background: #f8fbff;
}

.visitor-back-button span {
  width: 9px;
  height: 9px;
  border-left: 2.2px solid currentColor;
  border-bottom: 2.2px solid currentColor;
  border-radius: 1px;
  transform: translateX(1px) rotate(45deg);
}

.user-title h1,
.brand-block h1,
.empty-state h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.user-title p,
.brand-block p,
.empty-state p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.visitor-meta {
  margin-top: 2px !important;
  font-size: 12px !important;
}

.avatar,
.message-avatar,
.session-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: #409eff;
  font-weight: 700;
}

.avatar {
  width: 36px;
  height: 36px;
}

.avatar img,
.message-avatar img,
.session-avatar img,
.profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
  padding: 2px;
  background: #fff;
}

.notice-bar {
  min-height: 32px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid #bfd2ee;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.online {
  color: #2f8f46;
  border-color: #b9e6c5;
  background: #edf9f0;
}

.status-pill.offline {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-soft);
}

.status-dot-inline {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(103, 194, 58, 0.14);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background: #f7f9fc;
  scroll-behavior: auto;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(76%, 680px);
}

.message-row.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-row.system {
  max-width: 100%;
  align-self: center;
}

.message-avatar {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.message-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mine .message-content {
  justify-items: end;
}

.message-meta {
  color: var(--muted);
  font-size: 12px;
}

.read-state {
  color: #67c23a;
  font-size: 11px;
}

.mine .read-state {
  text-align: right;
}

.mine .message-state-line {
  justify-self: end;
}

.message-state-line {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  width: auto;
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.sent-time {
  color: var(--muted);
}

.bubble {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(22, 34, 51, 0.05);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

.bubble.media-bubble {
  padding: 6px;
}

.link-card {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--primary);
  background: #fff;
  text-decoration: none;
  font-weight: 700;
}

.link-card::before {
  content: "🔗";
  margin-right: 6px;
}

.mine .link-card {
  color: var(--primary-dark);
}

.message-context-menu {
  position: fixed;
  z-index: 50;
  min-width: 116px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.message-context-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
}

.message-context-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
}

.message-context-menu button:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.mine .bubble {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.system .bubble {
  color: var(--muted);
  border-color: var(--line);
  background: #fff;
  box-shadow: none;
  font-size: 12px;
}

.message-image {
  display: block;
  max-width: 240px;
  max-height: 220px;
  border-radius: 6px;
  cursor: zoom-in;
  object-fit: contain;
}

.message-media-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(240px, 48vw);
  height: min(220px, 44vw);
  max-width: 240px;
  max-height: 220px;
  min-width: 120px;
  min-height: 92px;
  border-radius: 7px;
  overflow: hidden;
  background: #eef3f9;
  cursor: zoom-in;
}

.message-media-frame.loaded {
  height: auto;
}

.message-media-frame.loaded .message-image {
  width: auto;
  height: auto;
  max-width: 240px;
  max-height: 220px;
  opacity: 1;
}

.message-media-frame .message-image {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.message-media-frame.image-loading::before {
  content: "图片加载中";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  color: #7b8ca5;
  font-size: 12px;
  transform: translate(-50%, -50%);
}

.message-media-frame.image-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(238, 243, 249, 0.3), rgba(255, 255, 255, 0.62), rgba(238, 243, 249, 0.3));
  background-size: 220% 100%;
  animation: skeleton-shimmer 0.9s ease-in-out infinite;
}

.message-media-frame.load-error::before {
  content: attr(data-error);
  color: #94a3b8;
  font-size: 12px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.mine .message-image {
  background: #fff;
}

.scroll-bottom-button {
  position: absolute;
  right: 28px;
  bottom: 150px;
  z-index: 6;
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  border-color: #c7d3e3;
  border-radius: 50%;
  padding: 0;
  color: #475569;
  background: #fff;
  box-shadow: 0 10px 26px rgba(22, 34, 51, 0.16);
}

.scroll-bottom-button:hover {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.scroll-bottom-button span {
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.typing-line {
  min-height: 24px;
  margin: 0;
  padding: 0 18px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.composer-tools {
  display: flex;
  gap: 8px;
  padding: 8px 12px 0;
  border-top: 1px solid var(--line);
  background: #fff;
}

.tool-button {
  min-height: 32px;
  border-color: var(--line-strong);
  color: var(--text);
  background: #fff;
  padding: 0 12px;
}

.tool-button:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.tool-button.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

#linkButton {
  position: relative;
  z-index: 4;
  pointer-events: auto;
}

#linkButton.disabled-soft {
  opacity: 0.62;
}

.composer {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.composer textarea {
  min-height: 48px;
  max-height: 136px;
  padding-top: 11px;
  padding-bottom: 11px;
}

.composer button[type="submit"] {
  min-height: 48px;
  padding: 0 18px;
}

.icon-button {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-color: var(--line-strong);
  color: var(--text);
  background: #fff;
  font-size: 18px;
}

.icon-button:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.image-icon-button {
  display: inline-grid;
  place-items: center;
}

.picture-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.picture-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.picture-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 10px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: skewX(-28deg);
}

.icon-button.loading .picture-icon {
  display: none;
}

.icon-button.loading::after {
  content: "...";
  font-size: 14px;
  letter-spacing: 0;
}

.emoji-panel {
  position: absolute;
  left: 12px;
  bottom: 74px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(6, 38px);
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.emoji-panel button {
  min-height: 34px;
  padding: 0;
  border-color: var(--line);
  color: var(--text);
  background: #fff;
  font-size: 18px;
}

.visitor-shell .composer {
  position: relative;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
}

.visitor-shell .composer .icon-button {
  grid-row: 1;
  width: 36px;
  min-height: 36px;
  border-color: transparent;
  background: transparent;
}

.visitor-shell .composer .image-icon-button {
  grid-column: 2;
  justify-self: start;
}

.visitor-shell .composer textarea {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 78px;
  max-height: 126px;
  border-radius: 10px;
  padding: 14px 92px 14px 14px;
}

.visitor-shell .composer button[type="submit"] {
  position: absolute;
  right: 26px;
  bottom: 28px;
  min-width: 60px;
  min-height: 30px;
  margin: 0;
  border-color: transparent;
  border-radius: 999px;
  padding: 0 13px;
  color: #fff;
  background: rgba(64, 158, 255, 0.36);
  font-size: 14px;
  z-index: 1;
}

.visitor-shell .composer button[type="submit"]:hover {
  border-color: transparent;
  background: rgba(64, 158, 255, 0.5);
}

.visitor-shell .composer button[type="submit"].has-text {
  background: #409eff;
}

.visitor-shell .composer button[type="submit"].has-text:hover {
  background: #2f7fd0;
}

.visitor-shell .emoji-panel {
  left: 12px;
  bottom: 150px;
}

.agent-auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(100%, 380px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0;
  font-size: 24px;
}

.login-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-card button {
  min-height: 44px;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  color: #64748b;
  background: transparent;
}

.password-toggle:hover {
  color: var(--primary);
  background: transparent;
}

.password-toggle::before {
  content: "";
  width: 21px;
  height: 21px;
  border: 0;
  border-radius: 0;
  background: currentColor;
  transform: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M2%2012s3-7%2010-7%2010%207%2010%207-3%207-10%207S2%2012%202%2012Z'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M2%2012s3-7%2010-7%2010%207%2010%207-3%207-10%207S2%2012%202%2012Z'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.password-toggle::after {
  content: none;
}

.password-toggle.visible::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10.733%205.076A10.744%2010.744%200%200%201%2012%205c7%200%2010%207%2010%207a13.16%2013.16%200%200%201-1.67%202.68'/%3E%3Cpath%20d='M14.084%2014.158a3%203%200%200%201-4.242-4.242'/%3E%3Cpath%20d='M17.479%2017.499A10.75%2010.75%200%200%201%2012%2019c-7%200-10-7-10-7a13.16%2013.16%200%200%201%204.146-5.016'/%3E%3Cpath%20d='m2%202%2020%2020'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10.733%205.076A10.744%2010.744%200%200%201%2012%205c7%200%2010%207%2010%207a13.16%2013.16%200%200%201-1.67%202.68'/%3E%3Cpath%20d='M14.084%2014.158a3%203%200%200%201-4.242-4.242'/%3E%3Cpath%20d='M17.479%2017.499A10.75%2010.75%200%200%201%2012%2019c-7%200-10-7-10-7a13.16%2013.16%200%200%201%204.146-5.016'/%3E%3Cpath%20d='m2%202%2020%2020'/%3E%3C/svg%3E");
}

.admin-auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.admin-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 16px;
}

.admin-header,
.admin-route,
.admin-list-panel,
.admin-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-header h1,
.admin-panel-head h2 {
  margin: 0;
}

.admin-header p,
.admin-route p {
  margin: 4px 0 0;
  color: var(--muted);
}

.admin-route {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  padding: 14px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 300px;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.admin-list-panel,
.admin-detail {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-list-panel > input,
.admin-detail > textarea {
  margin: 12px;
  width: calc(100% - 24px);
}

.admin-session-list,
.admin-messages,
.admin-blacklist {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.admin-session-item {
  display: grid;
  gap: 4px;
  min-height: 82px;
  border-color: var(--line);
  color: var(--text);
  background: #fff;
  text-align: left;
}

.admin-session-item:hover,
.admin-session-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.admin-session-item span,
.admin-session-item em,
.admin-message-item span,
.blacklist-item span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.admin-session-avatar {
  color: #fff !important;
}

.admin-message-item,
.blacklist-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.admin-message-item p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-danger-zone {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.form-error {
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.agent-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: #eef2f7;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100vh;
  min-height: 0;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  background: #fff;
  contain: layout paint;
  overflow: hidden;
}

.brand-block {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 2px 2px 0;
}

.brand-block h1 {
  font-size: 18px;
}

.brand-block p {
  margin-top: 2px;
  font-size: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #409eff;
  box-shadow: 0 0 0 5px rgba(64, 158, 255, 0.12);
}

.desk-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
}

.desk-actions button {
  min-height: 34px;
  padding: 0 10px;
}

.danger-text {
  color: var(--danger);
}

.danger-text:hover {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.agent-profile {
  display: grid;
  gap: 16px;
}

.agent-profile label {
  min-width: 0;
}

.agent-profile button:not(.profile-avatar) {
  min-height: 38px;
  padding: 0 12px;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  min-height: 58px;
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: #409eff;
  overflow: hidden;
}

.profile-avatar span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.session-search {
  display: block;
}

.session-search input {
  height: 36px;
  padding-left: 34px;
  background:
    linear-gradient(transparent, transparent),
    #fff;
}

.session-search {
  position: relative;
}

.session-search::after {
  content: "";
  position: absolute;
  left: 11px;
  bottom: 11px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  opacity: 0.72;
}

.session-search::before {
  content: "";
  position: absolute;
  left: 23px;
  bottom: 8px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.72;
  transform: rotate(45deg);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px;
  background: var(--surface-soft);
}

.filter {
  min-height: 32px;
  padding: 0 10px;
  border-color: transparent;
  color: var(--text);
  background: transparent;
}

.filter.active,
.filter:hover {
  color: var(--primary);
  border-color: #fff;
  background: #fff;
  box-shadow: 0 2px 8px rgba(22, 34, 51, 0.07);
}

.session-list {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
  padding-right: 4px;
}

.session-list.has-scrollbar {
  scrollbar-gutter: stable;
}

.session-list.is-rendering {
  cursor: progress;
}

.session-list-loading {
  display: grid;
  gap: 8px;
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
}

.session-list-loading span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
}

.session-list-loading i {
  display: block;
  height: 72px;
  border: 1px solid #e4eaf2;
  border-radius: 7px;
  background: linear-gradient(90deg, #f4f7fb 0%, #ffffff 46%, #f4f7fb 100%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 0.9s ease-in-out infinite;
}

.empty-list {
  margin: 18px 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.session-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  position: relative;
  align-items: start;
  gap: 9px;
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 46px 8px 10px;
  color: var(--text);
  text-align: left;
  background: #fff;
  overflow: hidden;
  overflow-anchor: none;
}

.session-item:hover {
  border-color: #b7c7dc;
  background: #f8fafc;
}

.session-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.session-item.loading::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(47, 140, 255, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.session-item.online {
  border-left: 1px solid var(--line);
}

.session-item.offline {
  border-left: 1px solid var(--line);
  opacity: 0.86;
}

.session-item.online .session-avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #22c55e;
}

.session-item.offline .session-avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #94a3b8;
}

.session-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.session-body {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow: visible;
}

.session-top,
.session-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.session-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 2px;
}

.session-snippet {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-origin {
  overflow: hidden;
  color: #7b8798;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-bottom {
  max-height: none;
  overflow: hidden;
}

.session-bottom .message-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.session-time {
  flex: 0 0 auto;
  color: #7b8798;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.presence-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.presence-pill.online {
  color: var(--primary-dark);
}

.presence-pill.online .presence-dot {
  background: #409eff;
  box-shadow: 0 0 0 4px rgba(64, 158, 255, 0.12);
}

.presence-pill.offline {
  color: var(--muted);
}

.presence-pill.offline .presence-dot {
  background: #94a3b8;
}

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 20px;
  border-radius: 999px;
  padding: 0 7px;
  color: #fff;
  background: var(--warning);
  font-size: 12px;
  font-weight: 700;
}

.load-more {
  min-height: 34px;
  border-color: var(--line);
  color: var(--primary);
  background: #fff;
}

.load-more:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.workspace.quick-open {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.empty-state {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.agent-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  position: relative;
  height: 100vh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}

.quick-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  min-width: 0;
  border-left: 1px solid var(--line);
  background: #fff;
}

.quick-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.quick-panel h2 {
  margin: 0;
  font-size: 18px;
}

.quick-panel header div {
  display: flex;
  gap: 12px;
}

.text-button {
  min-height: auto;
  border: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
}

.text-button:hover {
  color: var(--primary-dark);
  background: transparent;
}

.quick-list {
  display: grid;
  align-content: start;
  gap: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.quick-empty {
  margin: 30px 0 0;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

.quick-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 70px;
  grid-template-rows: 34px 22px;
  align-items: center;
  gap: 0;
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.quick-item + .quick-item {
  border-top: 0;
}

.quick-item:first-of-type {
  border-radius: 6px 6px 0 0;
}

.quick-item:last-of-type {
  border-radius: 0 0 6px 6px;
}

.quick-item:first-of-type:last-of-type {
  border-radius: 6px;
}

.quick-item:hover {
  position: relative;
  z-index: 1;
  border-color: #cbd8ea;
  background: #f8fbff;
}

.quick-content {
  grid-row: 1;
  grid-column: 1;
  overflow: hidden;
  min-width: 0;
  padding: 0 12px;
  color: var(--text);
  line-height: 34px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-meta {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  padding: 0 12px 5px;
  color: var(--muted);
  font-size: 11px;
}

.quick-action {
  position: relative;
  z-index: 2;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  border-left: 1px solid var(--line);
  padding: 0 6px;
  color: var(--primary);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.quick-action:disabled {
  color: var(--muted);
  opacity: 0.5;
}

.quick-action[data-quick-action="send"] {
  grid-column: 2;
  grid-row: 1 / 3;
}

.quick-action[data-quick-action="edit"] {
  grid-column: 3;
  grid-row: 1 / 3;
}

.quick-preview {
  position: fixed;
  z-index: 80;
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #d7e0ee;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
}

.quick-context-menu {
  z-index: 90;
}

.agent-topbar {
  min-height: 60px;
  padding: 10px 16px;
}

.active-user-title {
  align-items: flex-start;
}

.active-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.active-title-row h1 {
  overflow: hidden;
  max-width: 42vw;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-messages {
  position: relative;
  min-height: 0;
  padding: 18px clamp(18px, 4.8vw, 82px);
  background: #f5f7fb;
}

.message-skeleton-list {
  display: grid;
  align-content: end;
  gap: 14px;
  min-height: 100%;
}

.message-skeleton-list span {
  display: block;
  width: min(64%, 420px);
  height: 54px;
  border-radius: 12px;
  background: linear-gradient(90deg, #eef3f9 0%, #ffffff 48%, #eef3f9 100%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 0.9s ease-in-out infinite;
}

.message-skeleton-list span:nth-child(2) {
  justify-self: end;
  width: min(58%, 360px);
}

.message-skeleton-list span:nth-child(3) {
  width: min(72%, 460px);
}

.agent-chat .composer {
  grid-template-columns: 1fr;
}

.agent-composer {
  display: grid;
  gap: 0;
  align-items: stretch;
  padding: 0;
  border-top: 1px solid var(--line);
  background: #fff;
}

.agent-composer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px 6px;
}

.agent-composer-toolbar .icon-button {
  width: 34px;
  min-height: 34px;
  font-size: 17px;
}

.agent-composer-toolbar .tool-button {
  min-height: 34px;
}

.composer-tip {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.agent-composer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: stretch;
  gap: 12px;
  padding: 0 14px 14px;
}

.agent-composer textarea {
  min-height: 118px;
  max-height: 180px;
  border-color: transparent;
  padding: 12px 0;
  box-shadow: none;
}

.agent-composer textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

.agent-composer .send-button {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 118px;
  padding: 0 12px;
  border-radius: 6px;
}

.agent-composer .send-button span {
  font-weight: 700;
}

.agent-composer .send-button small {
  display: block;
  margin-top: 4px;
  opacity: 0.76;
  font-size: 12px;
}

.agent-chat .emoji-panel {
  left: 14px;
  bottom: 198px;
}

.agent-chat .scroll-bottom-button {
  right: 30px;
  bottom: 224px;
}

.profile-modal-card {
  width: min(100%, 460px);
}

.profile-setting {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 2px 20px 0;
}

.profile-setting p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.header-actions .plain-button,
.header-actions .ghost-button {
  min-width: 74px;
  min-height: 34px;
  padding: 0 12px;
  line-height: 1;
  white-space: nowrap;
}

.ghost-button {
  border-color: #f0b8b8;
  color: var(--danger);
  background: var(--danger-soft);
}

.ghost-button:hover {
  border-color: var(--danger);
  color: #fff;
  background: var(--danger);
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 76px 16px 24px;
  background: rgba(15, 23, 42, 0.72);
}

.image-viewer img {
  position: relative;
  z-index: 1;
  width: auto;
  height: auto;
  max-width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 96px);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  transform-origin: center center;
  transition: transform 0.12s ease;
  user-select: none;
  touch-action: none;
}

.image-viewer.is-zoomed img {
  cursor: grab;
}

.image-viewer.is-panning img {
  cursor: grabbing;
  transition: none;
}

.viewer-toolbar {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 18px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.viewer-toolbar button {
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.42);
  padding: 0 12px;
  color: #fff;
  background: rgba(15, 23, 42, 0.75);
}

.viewer-toolbar button:hover {
  border-color: #fff;
  background: rgba(15, 23, 42, 0.92);
}

.viewer-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.viewer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 6px;
  padding: 0 10px;
  color: #fff;
  background: rgba(15, 23, 42, 0.62);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
}

.modal-card {
  display: grid;
  gap: 18px;
  width: min(100%, 560px);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.modal-card.profile-modal-card {
  width: min(100%, 460px);
}

.modal-card header,
.modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface-soft);
}

.modal-card header {
  border-bottom: 1px solid var(--line);
}

.modal-card footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.modal-card h2 {
  margin: 0;
  font-size: 18px;
}

.modal-card label {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 20px;
}

.modal-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 0 20px;
}

.modal-card label span,
.modal-row > span {
  margin: 0;
  text-align: right;
  font-size: 14px;
  color: var(--muted);
  line-height: 38px;
}

.modal-row .plain-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-row .picture-icon {
  width: 18px;
  height: 14px;
}

.modal-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-close {
  min-height: 32px;
  border: 0;
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  font-size: 28px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
  background: transparent;
}

.workspace.quick-open {
  grid-template-columns: minmax(0, 1fr) 8px var(--quick-panel-width, 300px);
}

.workspace-resizer {
  width: 8px;
  height: 100vh;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #f1f5f9;
  cursor: col-resize;
}

.workspace-resizer:hover,
body.resizing .workspace-resizer {
  background: #dbeafe;
}

body.resizing {
  cursor: col-resize;
  user-select: none;
}

.emoji-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.emoji-icon::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor;
}

.emoji-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 4px;
  width: 7px;
  height: 4px;
  border-bottom: 2px solid currentColor;
  border-radius: 0 0 999px 999px;
}

.message-video {
  display: block;
  width: min(320px, 64vw);
  max-height: 260px;
  border-radius: 6px;
  background: #0f172a;
}

.mine .message-video {
  background: #0f172a;
}

.admin-session-list {
  gap: 10px;
  padding: 14px 12px 18px;
}

.admin-session-item {
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  min-height: 92px;
  padding: 12px;
  margin: 0;
  line-height: 1.35;
}

.admin-session-avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: #409eff;
  font-weight: 700;
}

.admin-session-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-session-content strong,
.admin-session-content span,
.admin-session-content em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: #f5f7fb;
}

.admin-message-item {
  display: grid;
  gap: 5px;
  max-width: min(74%, 680px);
  border: 0;
  padding: 0;
  background: transparent;
}

.admin-message-item.visitor {
  align-self: flex-start;
}

.admin-message-item.agent {
  align-self: flex-end;
  justify-items: end;
}

.admin-message-item.system {
  align-self: center;
  max-width: 100%;
}

.admin-message-item .admin-bubble {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(22, 34, 51, 0.05);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

.admin-message-item.agent .admin-bubble {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.admin-message-item.system .admin-bubble {
  color: var(--muted);
  border-style: dashed;
  background: #fff;
}

.admin-message-item .message-image,
.admin-message-item .message-video {
  max-width: min(320px, 52vw);
}

.blacklist-modal-card {
  width: min(100%, 620px);
}

.blacklist-manage {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 56vh;
  overflow-y: auto;
  padding: 0 20px;
}

.blacklist-manage-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}

.blacklist-manage-item div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.blacklist-manage-item span,
.blacklist-manage-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.route-modal-card {
  width: min(100%, 520px);
}

.credential-modal-card {
  width: min(100%, 620px);
}

.credential-section {
  display: grid;
  gap: 12px;
  padding: 0 20px;
}

.credential-section + .credential-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.credential-section h3 {
  margin: 0;
  color: #344054;
  font-size: 15px;
}

.credential-section label {
  padding: 0;
}

.route-hint {
  padding: 0 20px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  transform: translate(-50%, 16px);
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  background: rgba(15, 23, 42, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.desk-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.desk-actions button {
  min-width: 0;
  padding: 0 8px;
  font-size: 13px;
}

.agent-composer-main {
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: end;
}

.agent-composer .send-button {
  min-height: 36px;
  align-self: end;
  margin-bottom: 8px;
  padding: 0 12px;
}

.agent-composer .send-button small {
  display: none;
}

@media (max-width: 860px) {
  body.agent-page,
  body.admin-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .agent-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(420px, 1fr);
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .workspace.quick-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-resizer {
    display: none !important;
  }

  .quick-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 25;
    display: grid;
    height: min(360px, 62vh);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(23, 32, 51, 0.18);
  }

  .sidebar {
    height: auto;
    max-height: none;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .session-list {
    max-height: 42vh;
    overflow-y: auto;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 1fr);
    min-height: 420px;
    padding: 0;
    overflow: visible;
  }

  .empty-state {
    margin: 24px auto;
  }

  .agent-chat {
    height: auto;
    min-height: 70vh;
    max-height: none;
    grid-template-rows: auto minmax(320px, 1fr) auto auto;
  }

  .agent-topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .header-actions .plain-button,
  .header-actions .ghost-button {
    flex: 1 1 96px;
  }

  .agent-messages {
    max-height: 52vh;
    overflow-y: auto;
  }

  .agent-chat .scroll-bottom-button {
    right: 16px;
    bottom: 226px;
  }

  .agent-composer-toolbar {
    flex-wrap: wrap;
  }

  .composer-tip {
    display: none;
  }

  .admin-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 12px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-header-actions {
    width: 100%;
  }

  .admin-header-actions button {
    flex: 1;
  }

  .admin-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .admin-list-panel,
  .admin-detail {
    min-height: 360px;
    max-height: none;
  }

  .admin-session-list,
  .admin-blacklist {
    max-height: 45vh;
    overflow-y: auto;
  }

  .admin-messages {
    max-height: 54vh;
    overflow-y: auto;
  }

  .admin-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-actions button {
    flex: 1 1 120px;
  }

  .modal {
    align-items: start;
    overflow-y: auto;
    padding: 16px;
  }

  .modal-card {
    margin: 16px 0;
    min-height: 0;
  }

}

@media (max-width: 560px) {
  .image-viewer {
    padding-top: 92px;
  }

  .viewer-toolbar {
    left: 10px;
    right: 10px;
    top: 12px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .viewer-toolbar button,
  .viewer-count {
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
  }

  .viewer-count {
    min-width: 46px;
  }

  .visitor-shell {
    display: block;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 0;
  }

  .chat-window {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .visitor-shell .chat-window {
    min-height: 0;
  }

  .chat-topbar {
    min-height: 54px;
    padding: 8px 10px;
  }

  .user-title {
    gap: 8px;
  }

  .visitor-back-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }

  .user-title h1 {
    font-size: 18px;
  }

  .user-title p {
    font-size: 12px;
  }

  .avatar {
    width: 34px;
    height: 34px;
  }

  .composer {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 12px 12px;
  }

  .composer textarea {
    min-height: 70px;
    max-height: 118px;
    border-radius: 10px;
    padding: 14px 88px 14px 14px;
  }

  .composer button[type="submit"] {
    min-width: 60px;
    min-height: 30px;
    border-color: transparent;
    border-radius: 999px;
    padding: 0 13px;
    color: #fff;
    background: rgba(64, 158, 255, 0.36);
    font-size: 14px;
    z-index: 1;
  }

  .icon-button {
    width: 38px;
    min-height: 38px;
  }

  .composer .icon-button {
    align-self: start;
    grid-row: 1;
    width: 34px;
    min-height: 34px;
    border-color: transparent;
    background: transparent;
  }

  .composer .image-icon-button {
    grid-column: 2;
    justify-self: start;
  }

  .composer textarea {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .composer button[type="submit"] {
    grid-column: 3;
    grid-row: 2;
  }

  .visitor-shell .composer button[type="submit"] {
    position: absolute;
    right: 24px;
    bottom: 28px;
    margin: 0;
  }

  .scroll-bottom-button {
    right: 16px;
    bottom: 148px;
    width: 38px;
    min-height: 38px;
  }

  .agent-profile {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .agent-profile button:not(.profile-avatar) {
    min-height: 34px;
  }

  .message-row {
    max-width: 92%;
  }

  .message-image {
    max-width: 190px;
  }

  .message-media-frame {
    width: min(190px, 72vw);
    height: min(176px, 58vw);
  }

  .message-media-frame.loaded .message-image {
    max-width: 190px;
    max-height: 176px;
  }

  .emoji-panel {
    left: 8px;
    bottom: 58px;
  }

.visitor-shell .emoji-panel {
  left: 12px;
  bottom: 146px;
}

  .agent-messages {
    padding-left: 12px;
    padding-right: 12px;
  }

  .modal-card label,
  .modal-row {
    grid-template-columns: 1fr;
  }

  .modal-card label span,
  .modal-row > span {
    text-align: left;
    line-height: 1.4;
  }
}

/* Refinements */
body.visitor-shell,
body.agent-page,
body.admin-page {
  background:
    radial-gradient(circle at top left, rgba(64, 158, 255, 0.12), transparent 34vw),
    linear-gradient(180deg, #f6f8fc 0%, #eef3f9 100%);
}

.chat-window,
.login-card,
.modal-card {
  box-shadow: 0 18px 50px rgba(23, 32, 51, 0.1);
}

.login-card {
  border-color: #e2e8f0;
  padding: 30px;
}

.login-card h1 {
  letter-spacing: 0;
}

.chat-topbar {
  background: rgba(255, 255, 255, 0.96);
}

.sidebar {
  padding: 16px 12px;
  gap: 10px;
}

.brand-block {
  padding: 0 4px;
}

.brand-block h1 {
  font-size: 21px;
}

.agent-self-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid #e0e7f1;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.agent-self-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.agent-self-avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: #409eff;
  font-weight: 700;
}

.agent-self-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
  border-radius: inherit;
  background: #fff;
}

.agent-self-card span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.agent-self-card strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-self-card small {
  color: #2f8f46;
  font-size: 12px;
}

.desk-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.desk-actions button {
  min-width: 0;
  min-height: 32px;
  padding: 0 6px;
  font-size: 13px;
  white-space: nowrap;
}

.session-item.blacklisted {
  border-color: #f1b5b5;
  background: #fff7f7;
}

.session-item.blacklisted.active {
  border-color: var(--danger);
  background: #fff2f2;
  box-shadow: inset 3px 0 0 var(--danger);
}

.sidebar {
  gap: 8px;
  padding: 12px 10px;
}

.brand-block {
  min-height: 42px;
}

.brand-block h1 {
  font-size: 20px;
  line-height: 1.12;
}

.brand-block p {
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.2;
}

.status-dot {
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 8px rgba(64, 158, 255, 0.11);
}

.agent-self-card {
  grid-template-columns: 36px minmax(0, 1fr);
  min-height: 48px;
  gap: 8px;
  padding: 6px 8px;
}

.agent-self-avatar {
  width: 36px;
  height: 36px;
}

.agent-self-card strong {
  font-size: 14px;
}

.desk-actions {
  gap: 5px;
}

.desk-actions button {
  min-height: 30px;
  font-size: 13px;
}

.session-search input {
  height: 34px;
}

.toolbar {
  padding: 2px;
}

.filter {
  min-height: 30px;
}

.session-list {
  gap: 7px;
}

.session-item {
  min-height: 82px;
  padding: 9px 38px 8px 9px;
}

.session-body {
  max-height: none;
}

.session-snippet {
  font-size: 12px;
  color: #50627a;
}

.session-name {
  font-size: 15px;
}

.session-time {
  color: #8a96a8;
  font-size: 11px;
  font-weight: 500;
}

.session-flags .status-pill {
  min-height: 22px;
  padding: 0 9px;
  font-size: 12px;
}

.brand-block {
  align-items: flex-start;
  gap: 8px;
  min-height: 36px;
  padding: 0 2px 2px;
}

.brand-block h1 {
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
}

.brand-block p {
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.2;
}

.brand-block .status-dot {
  flex: 0 0 auto;
  margin-top: 8px;
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 7px rgba(64, 158, 255, 0.12);
}

.agent-self-card {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 46px;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fbfdff;
}

.agent-self-avatar {
  width: 34px;
  height: 34px;
}

.agent-self-card strong {
  font-size: 14px;
}

.agent-self-card small {
  color: #2f8f46;
  font-size: 12px;
}

.session-flags {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.session-bottom {
  justify-content: flex-end;
}

.session-status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #b9d4f5;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--primary-dark);
  background: #f5f9ff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.session-status-tag.waiting {
  color: #8a5a00;
  border-color: #f4d08a;
  background: #fff8e8;
}

.session-status-tag.closed {
  color: #64748b;
  border-color: #d8dee8;
  background: #f8fafc;
}

.session-item.offline {
  background: #fbfcfe;
}

.session-item.offline .session-avatar {
  background: #94a3b8;
}

.session-item.offline .session-name,
.session-item.offline .session-snippet,
.session-item.offline .session-origin {
  color: #7b8798;
}

.blacklist-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 7px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.icon-button {
  border-color: #c7d3e3;
}

.emoji-icon {
  width: 22px;
  height: 22px;
  border-width: 2px;
  color: #172033;
}

.emoji-icon::before {
  top: 6px;
  left: 6px;
  width: 3px;
  height: 3px;
  box-shadow: 7px 0 0 currentColor;
}

.emoji-icon::after {
  left: 5px;
  bottom: 5px;
  width: 9px;
  height: 5px;
  border: 0;
  border-bottom: 2px solid currentColor;
  border-radius: 0 0 12px 12px;
}

.video-icon-button,
.image-icon-button,
.emoji-icon-button {
  display: inline-grid;
  place-items: center;
}

.video-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.video-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid currentColor;
}

.video-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: -5px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.4;
}

.icon-button.loading .video-icon {
  display: none;
}

.visitor-shell .composer {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  border-top-color: #dce3ee;
}

.visitor-shell .composer textarea {
  border-color: #d7e0ec;
  background: #fbfdff;
}

.agent-composer-toolbar {
  border-bottom: 1px solid #eef2f7;
}

.agent-composer-main {
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: end;
}

.agent-composer textarea {
  min-height: 92px;
  padding: 12px 2px;
}

.agent-composer .send-button {
  min-height: 36px;
  align-self: end;
  margin-bottom: 8px;
  padding: 0 12px;
}

@media (max-height: 760px) and (min-width: 861px) {
  .agent-topbar {
    min-height: 54px;
    padding: 8px 14px;
  }

  .agent-messages {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .agent-composer-toolbar {
    min-height: 38px;
    padding: 6px 14px 4px;
  }

  .agent-composer textarea {
    min-height: 76px;
    max-height: 120px;
  }
}

.agent-composer .send-button small {
  display: none;
}

@media (max-width: 560px) {
  .visitor-shell .composer textarea {
    grid-column: 1 / -1;
  }

  body.visitor-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 0;
  }

  .visitor-shell .chat-window {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .visitor-shell .messages {
    min-height: 0;
    overflow-y: auto;
  }

  .visitor-shell .composer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Agent sidebar polish: compact, official, list-first layout. */
.agent-page .sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  padding: 10px;
  background: #fbfcfe;
}

.agent-page .sidebar-controls {
  display: grid;
  grid-auto-rows: max-content;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 0;
  contain: layout;
}

.agent-page .brand-block {
  min-height: 30px;
  align-items: center;
  padding: 0 2px 1px;
}

.agent-page .brand-block h1 {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
  color: #101828;
}

.agent-page .brand-block p {
  margin-top: 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.25;
}

.agent-page .brand-block .status-dot {
  width: 8px;
  height: 8px;
  margin: 0 7px 0 0;
  background: #2f8cff;
  box-shadow: 0 0 0 6px rgba(47, 140, 255, 0.12);
}

.agent-page .agent-self-card {
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 42px;
  gap: 8px;
  border-color: #e4eaf2;
  border-radius: 6px;
  padding: 5px 8px;
  background: #fff;
  box-shadow: none;
}

.agent-page .agent-self-avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.agent-page .agent-self-card strong {
  font-size: 14px;
  line-height: 1.2;
}

.agent-page .agent-self-card small {
  color: #16803a;
  font-size: 11px;
  line-height: 1.15;
}

.agent-page .desk-actions {
  position: relative;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 6px;
}

.agent-page .desk-actions button {
  min-height: 28px;
  border-radius: 5px;
  padding: 0 6px;
  font-size: 12px;
}

.agent-page .desk-menu {
  position: relative;
  min-width: 0;
}

.agent-page .desk-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.menu-caret {
  width: 0;
  height: 0;
  border-top: 4px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  opacity: 0.75;
}

.agent-page .desk-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  border: 1px solid #d8e0ec;
  border-radius: 7px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(22, 34, 51, 0.14);
  transform: translateX(-50%);
}

.agent-page .desk-menu-panel button {
  justify-content: center;
  width: 100%;
  min-height: 28px;
  border-color: transparent;
  padding: 0 6px;
  text-align: center;
  white-space: nowrap;
}

.agent-page #logoutButton {
  width: 100%;
}

.agent-page .session-search input {
  height: 32px;
  border-radius: 6px;
  font-size: 13px;
}

.agent-page .toolbar {
  height: 34px;
  border-radius: 6px;
  padding: 2px;
  flex: 0 0 auto;
}

.agent-page .filter {
  height: 28px;
  min-height: 28px;
  border-radius: 5px;
  padding: 0 10px;
  line-height: 1;
  font-size: 13px;
}

.agent-page .filter:focus,
.agent-page .filter:focus-visible {
  outline: none;
  box-shadow: none;
}

.agent-page .filter.active,
.agent-page .filter:hover {
  box-shadow: inset 0 0 0 1px #fff, 0 2px 8px rgba(22, 34, 51, 0.07);
}

.agent-page .session-list {
  gap: 6px;
  height: 100%;
  min-height: 0;
  padding-right: 3px;
}

.agent-page .session-item {
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 9px;
  min-height: 72px;
  border-color: #e4eaf2;
  border-radius: 7px;
  padding: 8px 34px 8px 9px;
  background: #fff;
}

.agent-page .session-item:hover {
  border-color: #cbd8ea;
  background: #f8fbff;
}

.agent-page .session-item.active {
  border-color: #2f8cff;
  background: #eef6ff;
  box-shadow: inset 3px 0 0 #2f8cff;
}

.agent-page .session-item.offline {
  opacity: 1;
  background: #f8fafc;
}

.agent-page .session-item.blacklisted {
  background: #fff7f7;
}

.agent-page .session-avatar {
  width: 36px;
  height: 36px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  background: #409eff;
}

.agent-page .session-item.offline .session-avatar {
  background: #a8b3c1;
  filter: grayscale(0.3);
}

.agent-page .session-item.online .session-avatar::after,
.agent-page .session-item.offline .session-avatar::after {
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-width: 2px;
}

.agent-page .session-item.online .session-avatar::after {
  background: #22c55e;
}

.agent-page .session-item.offline .session-avatar::after {
  background: #98a2b3;
}

.agent-page .session-body {
  gap: 3px;
}

.agent-page .session-top {
  align-items: center;
  gap: 8px;
}

.agent-page .session-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.agent-page .session-name {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 132px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
}

.agent-page .session-time {
  margin-left: auto;
  color: #8a96a8;
  font-size: 11px;
  font-weight: 500;
}

.agent-page .session-snippet {
  color: #4f5f73;
  font-size: 12px;
  line-height: 1.25;
}

.agent-page .session-origin {
  color: #8a96a8;
  font-size: 11px;
  line-height: 1.3;
}

.agent-page .session-bottom,
.agent-page .session-item .presence-pill {
  display: none;
}

.agent-page .session-flags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.agent-page .session-status-tag,
.agent-page .blacklist-chip {
  min-height: 18px;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}

.agent-page .session-status-tag {
  border-color: #bfdbfe;
  color: #2563eb;
  background: #eff6ff;
}

.agent-page .session-status-tag.waiting {
  border-color: #fed7aa;
  color: #b45309;
  background: #fff7ed;
}

.agent-page .session-status-tag.closed {
  border-color: #d0d5dd;
  color: #667085;
  background: #f2f4f7;
}

.agent-page .blacklist-chip {
  border: 1px solid #fecaca;
  color: #dc2626;
  background: #fff1f2;
}

@media (max-height: 760px) and (min-width: 861px) {
  .agent-page .brand-block {
    min-height: 28px;
  }

  .agent-page .agent-self-card {
    min-height: 38px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .agent-page .session-item {
    min-height: 68px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

body.visitor-booting .chat-window::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(248, 251, 255, 0.92);
  backdrop-filter: blur(2px);
}

body.visitor-booting .chat-window::after {
  content: "正在进入...";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 21;
  transform: translate(-50%, -50%);
  border: 1px solid #d8e6f7;
  border-radius: 999px;
  padding: 11px 18px 11px 40px;
  color: #344054;
  background:
    radial-gradient(circle at 18px 50%, #2f8cff 0 4px, transparent 5px),
    #fff;
  box-shadow: 0 14px 34px rgba(22, 34, 51, 0.1);
  font-size: 14px;
  font-weight: 600;
  animation: visitorBootFloat 0.8s ease both;
}

body.visitor-ready .chat-window {
  animation: visitorReadyFade 0.18s ease both;
}

@keyframes visitorBootFloat {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 8px));
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes visitorReadyFade {
  from {
    opacity: 0.96;
  }

  to {
    opacity: 1;
  }
}

.action-dialog {
  z-index: 80;
}

.action-dialog-card {
  width: min(92vw, 420px);
}

.action-dialog-content {
  padding: 14px 20px 4px;
}

.action-dialog-content p {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.7;
}

.action-dialog-content label {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  padding: 0;
}

.action-dialog-content textarea {
  min-height: 88px;
  resize: vertical;
}

.danger-button {
  border-color: var(--danger);
  color: #fff;
  background: var(--danger);
}

.danger-button:hover {
  border-color: #a72f2f;
  background: #a72f2f;
}

.agent-page .session-status-tag.offline-state {
  border-color: #d0d5dd;
  color: #667085;
  background: #f2f4f7;
}

.admin-page .admin-shell {
  gap: 10px;
  padding: 12px;
}

.admin-page .admin-header {
  min-height: 58px;
  padding: 9px 14px;
  border-radius: 7px;
}

.admin-page .admin-header h1 {
  font-size: 22px;
  line-height: 1.15;
}

.admin-page .admin-header p {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.25;
}

.admin-page .admin-header-actions button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.admin-page .admin-layout {
  gap: 10px;
  grid-template-columns: 300px minmax(0, 1fr) 270px;
}

.admin-page .admin-panel-head {
  min-height: 45px;
  padding: 8px 10px;
}

.admin-page .admin-panel-head h2 {
  font-size: 18px;
  line-height: 1.2;
}

.admin-page .admin-actions {
  gap: 6px;
}

.admin-page .admin-actions button,
.admin-page #refreshAdmin {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.admin-page .admin-list-panel > input {
  height: 36px;
  margin: 10px;
  width: calc(100% - 20px);
}

.admin-page .admin-detail > textarea {
  min-height: 54px;
  height: 54px;
  margin: 10px;
  width: calc(100% - 20px);
  padding-top: 8px;
  padding-bottom: 8px;
}

.admin-page .admin-session-list,
.admin-page .admin-messages,
.admin-page .admin-blacklist {
  padding: 10px;
}

.admin-page .admin-session-item {
  min-height: 74px;
  padding: 9px 10px;
}

.admin-page .admin-message-item .admin-bubble {
  padding: 8px 11px;
}

@media (max-width: 860px) {
  .admin-page .admin-header {
    gap: 8px;
    padding: 10px;
  }

  .admin-page .admin-header h1 {
    font-size: 20px;
  }

  .admin-page .admin-header p {
    display: none;
  }
}
