:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #eef5f2;
  --ink: #18211f;
  --muted: #65716e;
  --line: #dce7e2;
  --brand: #117a63;
  --brand-dark: #0a5445;
  --brand-soft: #dff2ec;
  --amber: #f6b545;
  --red: #d94c3f;
  --blue: #2f6b90;
  --shadow: 0 18px 50px rgba(30, 51, 45, 0.13);
  --radius: 8px;
  font-family:
    Inter,
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 247, 245, 0.92)),
    radial-gradient(circle at 15% 0%, rgba(17, 122, 99, 0.12), transparent 32%),
    var(--bg);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
}

.customer-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-top,
.chat-log,
.composer,
.top-row,
.station-line,
.quick-actions,
.chat-form {
  min-width: 0;
  max-width: 100%;
}

.chat-top {
  padding: 11px 13px 10px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(14, 82, 68, 0.92), rgba(17, 122, 99, 0.92)),
    url("https://images.unsplash.com/photo-1607860108855-64acf2078ed9?auto=format&fit=crop&w=900&q=70") center 52% / cover;
}

.selector-shell {
  grid-template-rows: auto 1fr;
}

.selector-top {
  min-height: 128px;
}

.selector-body {
  display: grid;
  place-items: start center;
  padding: 22px 16px;
  background: #f8fbf9;
  /* 壳层是固定 100dvh + overflow:hidden，此区必须能内部滚动，
     否则内容（如领券成功卡片的密码行）会被挤到可视区外。 */
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.selector-card {
  display: grid;
  gap: 14px;
  width: min(100%, 420px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(30, 51, 45, 0.08);
}

.top-row,
.station-line,
.toolbar,
.queue-meta,
.summary-row,
.reply-actions,
.chat-form,
.ticket-tags,
.ticket-title,
.staff-header,
.desk-tabs,
.stat-grid,
.qr-actions {
  display: flex;
  align-items: center;
}

.top-row {
  justify-content: space-between;
  gap: 12px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.logo-mark {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.logo-mark svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle,
.station-line,
.mini-label,
.context-value,
.hint,
.empty-copy,
.ticket-preview,
.qr-url,
.stat-label {
  color: var(--muted);
}

.brand-subtitle {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.station-line {
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
}

.station-line span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-line span:last-child {
  flex: 0 0 auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ghost-button {
  gap: 8px;
  padding: 0 12px;
  white-space: nowrap;
}

.ghost-button svg,
.icon-button svg,
.primary-button svg,
.plain-button svg,
.danger-button svg,
.chip svg {
  width: 17px;
  height: 17px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  padding: 12px 10px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(238, 245, 242, 0.84), transparent 190px),
    #f8fbf9;
}

.message {
  display: grid;
  max-width: 86%;
  gap: 5px;
}

.message.user {
  align-self: flex-end;
  justify-items: end;
}

.message.bot,
.message.agent,
.message.system {
  align-self: flex-start;
}

.bubble {
  padding: 9px 11px;
  border-radius: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user .bubble {
  border-top-right-radius: 2px;
  background: var(--brand);
  color: #fff;
}

.message.bot .bubble {
  border: 1px solid var(--line);
  border-top-left-radius: 2px;
  background: #fff;
}

.message.agent .bubble {
  border-top-left-radius: 2px;
  background: #fff3d8;
  color: #31220b;
}

.message.system .bubble {
  border: 1px dashed #c8d8d1;
  background: #eef5f2;
  color: #34413d;
  font-size: 13px;
}

.message.has-image .bubble {
  display: grid;
  gap: 6px;
  padding: 5px;
}

.image-link {
  display: block;
  line-height: 0;
}

.chat-image {
  display: block;
  max-width: min(230px, 66vw);
  max-height: 260px;
  border-radius: 7px;
  object-fit: cover;
}

.staff-chat-log .chat-image {
  max-width: min(320px, 42vw);
  max-height: 340px;
}

.message-text {
  padding: 2px 4px 3px;
  line-height: 1.45;
}

.time {
  color: #8c9995;
  font-size: 11px;
}

.composer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.quick-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  padding: 7px 9px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #25322f;
  font-size: 12px;
  white-space: nowrap;
}

.chip.urgent {
  border-color: #f2c0b8;
  background: #fff0ed;
  color: #923229;
}

.chat-form {
  gap: 7px;
  width: 100%;
  padding: 8px 9px 9px;
}

.chat-form input,
.reply-box textarea,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

.chat-form input {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  height: 38px;
  padding: 0 11px;
}

.chat-form .primary-button {
  flex: 0 0 38px;
  width: 38px;
  padding: 0;
}

.image-upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
}

.image-upload-button input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.image-upload-button.disabled {
  pointer-events: none;
  opacity: 0.52;
}

.image-upload-button svg {
  width: 17px;
  height: 17px;
}

.chat-form .image-upload-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #25322f;
  font-size: 12px;
}

.chat-form input:focus,
.reply-box textarea:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(17, 122, 99, 0.12);
}

.primary-button,
.plain-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.plain-button {
  border: 1px solid var(--line);
  background: #fff;
  color: #23302c;
}

.plain-button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.danger-button {
  background: #fff0ed;
  color: #9d3128;
}

.handoff-panel {
  margin: 10px 12px 0;
  padding: 12px;
  border: 1px solid #ffd899;
  border-radius: 8px;
  background: #fff7e8;
}

.handoff-title {
  margin: 0 0 8px;
  font-size: 14px;
}

.handoff-copy {
  margin: 0 0 10px;
  color: #6f5a37;
  font-size: 12px;
  line-height: 1.55;
}

.field-grid {
  display: grid;
  gap: 8px;
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  color: #58452a;
  font-size: 12px;
}

.field span {
  color: #58452a;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  height: 38px;
  padding: 0 10px;
}

.field-hint {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #7a6137;
  font-size: 12px;
  line-height: 1.55;
}

.handoff-panel .primary-button {
  width: 100%;
}

.groupbuy-body {
  display: grid;
  gap: 14px;
}

.groupbuy-card {
  gap: 12px;
}

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

.success-card {
  border-color: rgba(17, 122, 99, 0.35);
  background: #f2faf6;
}

.coupon-secret {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px dashed rgba(17, 122, 99, 0.35);
  border-radius: 10px;
  background: #fff;
}

.coupon-secret span {
  color: var(--muted);
  font-size: 12px;
}

.coupon-secret strong {
  font-size: 22px;
  letter-spacing: 0.08em;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
  padding: 10px;
  line-height: 1.5;
}

.desk-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.staff-header {
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
}

.staff-title {
  margin: 0;
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1.15;
}

.staff-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.desk-tabs {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-layout {
  display: grid;
  gap: 16px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.settings-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 16px 0;
}

.settings-tabs .plain-button {
  font-size: 14px;
}

.settings-shell .admin-layout {
  padding-top: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.admin-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-panel {
  overflow: hidden;
}

.manager-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.manager-form .wide {
  grid-column: span 2;
}

.manager-card,
.reply-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.manager-actions,
.reply-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.reply-tools .field {
  min-width: min(220px, 100%);
}

.suggest-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfa;
  padding: 8px 10px;
}

.suggest-box > summary {
  cursor: pointer;
  font-size: 12.5px;
  color: #5a6b64;
  user-select: none;
}

.suggestions {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
}

.suggest-item:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.suggest-item.match {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.suggest-cat {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.suggest-text {
  flex: 1 1 auto;
  font-size: 12.5px;
  color: #23302c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-empty {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: #8a958f;
}

.reply-card textarea {
  min-height: 110px;
}

.reply-image-preview {
  display: inline-flex;
  width: fit-content;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.reply-image-preview img {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 6px;
  object-fit: cover;
}

.reply-text {
  margin: 0;
  color: #26332f;
  line-height: 1.55;
  white-space: pre-wrap;
}

.manager-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #33423e;
  font-size: 13px;
}

.check-row input {
  width: auto;
  margin: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric-button {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.metric-button:hover,
.metric-button.active {
  border-color: rgba(17, 122, 99, 0.42);
  box-shadow: 0 10px 24px rgba(18, 82, 70, 0.12);
  transform: translateY(-1px);
}

.metric-button.active {
  background: #f2faf6;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.metric em {
  display: block;
  margin-top: 8px;
  color: #64756f;
  font-size: 12px;
  font-style: normal;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: #f3f7f5;
  color: #3a4a45;
  font-size: 13px;
}

.data-table td {
  color: #202c29;
  font-size: 14px;
}

.customer-table {
  min-width: 980px;
}

.customer-search-form,
.dashboard-filter-form {
  align-items: end;
}

.table-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.customer-detail-panel {
  scroll-margin-top: 18px;
}

.customer-detail-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 14px;
}

.customer-detail-context {
  align-content: start;
}

.customer-history-log {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfa;
}

.compact-stats {
  margin-top: 12px;
}

.desk-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(360px, 1fr) minmax(260px, 340px);
  gap: 16px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(30, 51, 45, 0.07);
}

.queue-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.panel-head {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 16px;
}

.panel-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.ticket-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
}

.ticket-card::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: transparent;
}

.ticket-card.waiting {
  border-color: rgba(246, 181, 69, 0.68);
  background: #fffaf0;
}

.ticket-card.waiting::before {
  background: var(--amber);
}

.ticket-card.active::before {
  background: var(--brand);
}

.ticket-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(17, 122, 99, 0.12);
}

.ticket-customer-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.ticket-customer-line strong {
  color: var(--ink);
  font-size: 14px;
}

.ticket-title {
  justify-content: space-between;
  gap: 10px;
}

.ticket-title strong,
.ticket-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-preview {
  font-size: 13px;
}

.ticket-tags {
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf3f0;
  color: #41504c;
  font-size: 12px;
}

.tag.waiting {
  background: #fff0d6;
  color: #7d4b00;
}

.tag.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.tag.closed {
  background: #e9edf0;
  color: #59636a;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: calc(100vh - 110px);
}

.staff-chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  background: #f8fbf9;
}

.reply-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.reply-focus span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf3f0;
  color: #41504c;
  font-size: 12px;
}

.reply-notice {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(17, 122, 99, 0.18);
  border-radius: 8px;
  background: #eff8f4;
  color: var(--brand-dark);
  font-size: 13px;
  line-height: 1.5;
}

.reply-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.reply-box textarea {
  min-height: 78px;
  resize: vertical;
  padding: 10px 12px;
}

.reply-actions {
  justify-content: space-between;
  gap: 10px;
}

.context-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.context-body {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.context-item {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.context-item.important {
  padding: 10px;
  border: 1px solid rgba(17, 122, 99, 0.18);
  border-radius: 8px;
  background: #f2faf6;
}

.mini-label {
  font-size: 12px;
}

.context-value {
  color: var(--ink);
  line-height: 1.45;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  width: min(680px, 100%);
}

.stat {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.urgent-stat {
  border-color: rgba(246, 181, 69, 0.7);
  background: #fff7e8;
}

.stat-value {
  font-size: 24px;
  font-weight: 780;
}

.stat-label {
  margin-top: 2px;
  font-size: 12px;
}

.qr-layout {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 16px;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.qr-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.single-qr-wrap {
  display: grid;
  place-items: start center;
}

.single-qr-card {
  width: min(100%, 360px);
}

.qr-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-canvas {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-canvas canvas,
.qr-canvas img {
  width: 240px !important;
  height: 240px !important;
  image-rendering: pixelated;
}

.qr-url {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
}

.qr-actions {
  justify-content: space-between;
  gap: 8px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 24px;
  text-align: center;
}

.empty-card {
  display: grid;
  gap: 10px;
  width: min(360px, 100%);
  justify-items: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.empty-icon svg {
  width: 25px;
  height: 25px;
}

.empty-title {
  margin: 0;
  font-size: 16px;
}

.empty-copy {
  margin: 0;
  line-height: 1.5;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  padding: 11px 14px;
  border-radius: 8px;
  background: #17211f;
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .desk-layout {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    min-height: 620px;
  }

  .context-panel {
    min-height: 320px;
  }

  .qr-layout {
    grid-template-columns: 1fr;
  }

  .admin-grid.two,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .customer-detail-grid {
    grid-template-columns: 1fr;
  }

  .manager-form {
    grid-template-columns: 1fr 1fr;
  }

  .manager-form .wide {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  body {
    background: #fff;
  }

  .customer-shell {
    width: 100%;
    min-height: 100dvh;
    height: 100dvh;
    box-shadow: none;
  }

  .chat-top {
    padding: 9px 10px 8px;
  }

  .selector-top {
    min-height: 116px;
  }

  .selector-body {
    padding: 16px 10px;
  }

  .selector-card {
    padding: 14px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .status-pill {
    min-height: 24px;
    padding: 0 7px;
    font-size: 11px;
  }

  .chat-log {
    padding: 10px 8px;
  }

  .station-line {
    gap: 6px;
  }

  .bubble {
    padding: 8px 10px;
    font-size: 14px;
  }

  .time {
    font-size: 10px;
  }

  .quick-actions {
    padding: 6px 8px 0;
  }

  .chip {
    min-height: 29px;
    font-size: 12px;
  }

  .chat-form {
    padding: 7px 8px 8px;
  }

  .chat-form input {
    height: 36px;
    font-size: 14px;
  }

  .chat-form .primary-button {
    min-width: 38px;
    min-height: 36px;
    flex-basis: 38px;
    padding: 0;
  }

  .message {
    max-width: 92%;
  }

  .staff-header {
    display: grid;
    padding: 14px;
  }

  .desk-tabs {
    justify-content: stretch;
  }

  .desk-tabs .plain-button {
    flex: 1 1 110px;
  }

  .desk-layout,
  .qr-layout,
  .admin-layout {
    padding: 10px;
  }

  .manager-form,
  .manager-form .wide {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .reply-actions,
  .qr-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .reply-actions .primary-button,
  .reply-actions .plain-button,
  .reply-actions .danger-button,
  .qr-actions .plain-button,
  .qr-actions .primary-button {
    width: 100%;
  }
}
