:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --panel: #eef3f8;
  --text: #172033;
  --muted: #657186;
  --line: #dbe3ee;
  --teal: #0f766e;
  --teal-soft: #e2f5f2;
  --blue: #2563eb;
  --blue-soft: #e8f0ff;
  --amber: #a16207;
  --amber-soft: #fff4d6;
  --red: #b42318;
  --red-soft: #fee7e4;
  --shadow: 0 18px 42px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

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

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

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

h1,
h2,
p {
  margin: 0;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-card .brand-mark {
  width: 48px;
  height: 48px;
}

.login-card h1 {
  margin-bottom: 4px;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.login-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.admin-entry-link {
  justify-self: center;
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.admin-entry-link:hover {
  text-decoration: underline;
}

.service-shell {
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-block,
.topbar-actions,
.chat-head-actions,
.composer-actions,
.side-actions,
.meta-line {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.eyebrow {
  margin-bottom: 3px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.mode-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  min-height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.mode-segment button {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.mode-segment button.active {
  background: var(--teal);
  color: #fff;
}

.status-chip,
.mode-pill,
.risk-badge,
#handoffBadge,
.status-pill-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 0 12px;
  font-weight: 900;
  text-decoration: none;
}

.status-chip.ok,
.risk-a {
  border-color: rgba(15, 118, 110, 0.22);
  background: var(--teal-soft);
  color: var(--teal);
}

.status-chip.warn,
.risk-b {
  border-color: rgba(161, 98, 7, 0.22);
  background: var(--amber-soft);
  color: var(--amber);
}

.status-chip.error,
.risk-c {
  border-color: rgba(180, 35, 24, 0.22);
  background: var(--red-soft);
  color: var(--red);
}

.status-chip.muted {
  background: #f2f5f9;
}

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

.metric-row article {
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-row span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.metric-row strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(460px, 1fr) minmax(300px, 360px);
  gap: 14px;
  align-items: stretch;
}

.queue-panel,
.chat-panel,
.control-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.queue-panel,
.control-panel {
  min-height: 680px;
}

.queue-panel,
.control-panel,
.chat-panel {
  min-width: 0;
}

.panel-head,
.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  padding: 14px;
}

.panel-head.compact {
  align-items: center;
  padding: 0;
  margin-bottom: 12px;
}

.panel-head p,
.hint {
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--teal);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 14px 12px;
}

.store-filter {
  margin: 0 14px 12px;
}

.filter-tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.filter-tabs button.active {
  border-color: rgba(37, 99, 235, 0.3);
  background: var(--blue-soft);
  color: var(--blue);
}

.conversation-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  gap: 5px;
  max-height: 568px;
  overflow: auto;
  padding: 0 8px 10px;
}

.conversation-empty {
  display: grid;
  min-height: 360px;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.conversation-item {
  width: 100%;
  height: 56px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 6px 8px;
  overflow: hidden;
  align-self: start;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.conversation-item.active {
  border-color: rgba(15, 118, 110, 0.45);
  background: var(--teal-soft);
}

.conversation-item.needs-reply {
  border-color: rgba(220, 38, 38, 0.42);
  background: #fff1f1;
  animation: replyPulse 1.4s ease-in-out infinite;
}

.conversation-item.needs-reply.active {
  border-color: rgba(220, 38, 38, 0.56);
  background: #ffe8e8;
}

.conversation-top,
.conversation-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversation-top strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item p {
  display: -webkit-box;
  min-height: 16px;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.conversation-meta {
  display: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  flex-wrap: wrap;
}

.conversation-alert {
  display: inline-grid;
  min-width: 34px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
}

.dot.waiting {
  background: var(--blue);
}

.dot.resolved {
  background: var(--teal);
}

.dot.handoff {
  background: var(--amber);
}

@keyframes replyPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.16);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
  }
}

.dot.risk {
  background: var(--red);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  min-height: 680px;
  overflow: hidden;
}

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

.chat-head h2 {
  margin-bottom: 7px;
}

.chat-head-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.meta-line {
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.assign-line {
  margin-top: 5px;
  color: var(--teal);
  font-weight: 900;
}

.message-stream {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(238, 243, 248, 0.72), rgba(248, 250, 252, 0.72)),
    var(--surface-soft);
}

.message {
  display: grid;
  max-width: min(620px, 88%);
  gap: 5px;
}

.message.customer {
  align-self: flex-start;
}

.message.agent,
.message.ai {
  align-self: flex-end;
}

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

.message-bubble {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  line-height: 1.6;
  word-break: break-word;
}

.message.customer .message-bubble {
  border-color: rgba(37, 99, 235, 0.16);
  background: #fff;
}

.message.agent .message-bubble {
  border-color: rgba(15, 118, 110, 0.2);
  background: var(--teal);
  color: #fff;
}

.message.ai .message-bubble {
  border-color: rgba(37, 99, 235, 0.24);
  background: var(--blue);
  color: #fff;
}

.message.system .message-bubble {
  background: #fff9e8;
  color: var(--amber);
  text-align: center;
}

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

.message.agent .message-meta,
.message.ai .message-meta {
  text-align: right;
}

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

.reply-composer textarea {
  min-height: 64px;
  max-height: 140px;
  resize: none;
}

.reply-composer .composer-actions {
  align-items: center;
  flex-wrap: nowrap;
}

.composer-shortcut {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.wechat-emoji {
  display: block;
  min-width: 38px;
  font-size: 30px;
  line-height: 1.2;
  text-align: center;
}

.reference-message {
  display: grid;
  gap: 4px;
  border-left: 3px solid #94a3b8;
  padding-left: 10px;
}

.reference-message strong {
  font-size: 13px;
}

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

.message-context-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  width: min(360px, 100%);
  margin-top: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.context-card-thumb {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #f1f5f9;
}

.context-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.context-card-thumb.placeholder {
  color: #64748b;
  font-size: 18px;
  font-weight: 900;
}

.context-card-body {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.context-card-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.context-card-title {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-card-meta {
  display: grid;
  gap: 3px;
}

.context-card-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.context-card-row strong {
  max-width: 180px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-context-card.order-card {
  border-color: rgba(14, 165, 233, 0.22);
  background: #f8fcff;
}

.message-context-card.order-card .context-card-thumb {
  background: #e0f2fe;
  color: #0369a1;
}

.message-context-card.product-card {
  border-color: rgba(22, 163, 74, 0.18);
  background: #fbfefc;
}

.message-context-card.product-card .context-card-thumb {
  background: #dcfce7;
  color: #15803d;
}

.official-chat-order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(340px, 100%);
  min-width: 0;
  gap: 0;
  border: 1px solid #dfe5ed;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0;
  text-align: left;
  box-shadow: none;
  overflow: hidden;
}

.message.agent .official-chat-order-card,
.message.ai .official-chat-order-card {
  color: var(--text);
  background: #fff;
}

.official-chat-order-card:hover,
.official-side-order-card:hover {
  border-color: rgba(24, 183, 167, 0.45);
  background: #fbfffe;
}

.official-chat-product-card {
  border-color: #cfeee1;
  cursor: pointer;
}

.official-chat-product-card .context-card-thumb {
  border-color: #b9ead4;
  background: #dcfce7;
  color: #15803d;
}

.chat-order-title {
  padding: 14px 14px 10px;
  color: #111827;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.chat-order-product {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0 14px 12px;
}

.chat-order-product .context-card-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
}

.chat-order-product strong,
.chat-order-product span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-order-product strong {
  color: #111827;
  font-size: 13px;
}

.chat-order-product span,
.chat-order-lines {
  color: #6b7280;
  font-size: 12px;
}

.chat-order-lines {
  display: grid;
  border-top: 1px solid #eef0f3;
  padding: 10px 14px;
  gap: 7px;
}

.chat-order-lines div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  line-height: 1.45;
}

.chat-order-lines strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #374151;
  font-weight: 700;
}

.chat-order-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e5e7eb;
  padding: 11px 14px;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}

.chat-order-actions strong {
  color: #9ca3af;
  font-size: 22px;
  line-height: 1;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 82px;
  padding: 10px 11px;
  line-height: 1.58;
  resize: vertical;
}

select {
  min-height: 40px;
  padding: 0 10px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.composer-grid,
.decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.composer-actions,
.side-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.assignment-actions {
  margin-top: 10px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 13px;
  font-weight: 900;
}

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

.secondary-button {
  border-color: rgba(37, 99, 235, 0.22);
  background: var(--blue-soft);
  color: var(--blue);
}

.ghost-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.control-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.control-card {
  padding: 14px;
}

.mode-card {
  background: linear-gradient(180deg, #fff, #f8fbfd);
}

.switch-stack {
  display: grid;
  gap: 9px;
}

.toggle-row {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0 10px;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.decision-grid {
  margin-bottom: 10px;
}

.decision-grid div {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.decision-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.decision-grid strong {
  display: block;
  font-size: 14px;
  line-height: 1.45;
}

#draftReply {
  min-height: 144px;
  margin-bottom: 10px;
  background: #fff;
}

.info-list {
  display: grid;
  gap: 8px;
}

.info-subtitle {
  margin: 2px 0 -2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.info-list > div:not(.info-subtitle):not(.order-empty):not(.order-item-list):not(.order-data-note) {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  min-height: 36px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 9px 10px;
}

.info-list > div:not(.info-subtitle):not(.order-empty):not(.order-item-list):not(.order-data-note) > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.info-list > div:not(.info-subtitle):not(.order-empty):not(.order-item-list):not(.order-data-note) > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
}

.order-empty {
  border: 1px dashed rgba(100, 116, 139, 0.35);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px;
}

.order-data-note {
  margin: 0;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1.5;
  padding: 9px 10px;
}

.order-item-list {
  display: grid;
  gap: 8px;
}

.order-item-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid rgba(22, 163, 74, 0.16);
  border-radius: 8px;
  background: #fbfefc;
  padding: 8px;
}

.order-item-card .context-card-thumb {
  width: 48px;
  height: 48px;
}

.order-item-card strong,
.order-item-card span {
  display: block;
  min-width: 0;
}

.order-item-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-item-card span {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.hint {
  min-height: 20px;
  margin-top: 9px;
  line-height: 1.45;
}

.handoff-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.handoff-item {
  border: 1px solid rgba(161, 98, 7, 0.2);
  border-radius: 8px;
  background: var(--amber-soft);
  padding: 10px;
}

.handoff-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.handoff-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (min-width: 1021px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .service-shell {
    display: grid;
    width: min(1600px, 100%);
    height: 100vh;
    min-height: 0;
    grid-template-rows: 64px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .topbar {
    min-height: 64px;
    padding: 8px 12px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .metric-row {
    display: none;
  }

  .workspace {
    min-height: 0;
    gap: 10px;
  }

  .queue-panel,
  .chat-panel,
  .control-panel {
    height: 100%;
    min-height: 0;
  }

  .queue-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .conversation-list {
    flex: 1;
    max-height: none;
    min-height: 0;
  }

  .chat-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .message-stream {
    min-height: 0;
  }

  .control-panel {
    align-content: start;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
  }

  .control-card {
    padding: 12px;
  }

  #draftReply {
    min-height: 96px;
  }
}

@media (max-width: 1020px) {
  .workspace {
    grid-template-columns: minmax(220px, 250px) minmax(420px, 1fr);
  }

  .control-panel {
    grid-column: 1 / -1;
    min-height: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .service-shell {
    padding: 10px;
  }

  .topbar,
  .workspace,
  .control-panel,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .mode-segment {
    width: 100%;
  }

  .queue-panel,
  .chat-panel {
    min-height: auto;
  }

  .conversation-list {
    max-height: 280px;
  }

  .message-stream {
    min-height: 360px;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 22px;
  }

  .composer-grid,
  .decision-grid,
  .chat-head {
    grid-template-columns: 1fr;
  }

  .chat-head {
    display: grid;
  }

  .message {
    max-width: 96%;
  }

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

.composer-main {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 8px;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.tool-button:hover,
.tool-button.active {
  border-color: rgba(15, 118, 110, 0.34);
  background: var(--teal-soft);
  color: var(--teal);
}

.composer-tool-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.emoji-panel {
  position: absolute;
  bottom: calc(100% - 34px);
  left: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(10, 36px);
  gap: 5px;
  max-width: min(430px, calc(100vw - 44px));
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
  box-shadow: var(--shadow);
}

.emoji-choice {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 21px;
}

.emoji-choice:hover {
  background: var(--surface-soft);
}

.attachment-tray {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.attachment-chip {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 6px;
}

.attachment-thumb {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #e8eef7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attachment-meta strong,
.message-attachment strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.remove-attachment {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.remove-attachment:hover {
  background: var(--red-soft);
  color: var(--red);
}

.message-attachments {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.message-attachment {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.message-attachment img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.message.agent .message-attachment span,
.message.ai .message-attachment span {
  color: rgba(255, 255, 255, 0.78);
}

.message.agent .message-attachment .attachment-thumb,
.message.ai .message-attachment .attachment-thumb {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

@media (max-width: 560px) {
  .emoji-panel {
    grid-template-columns: repeat(6, 34px);
  }
}

/* Reception desk redesign inspired by the official WeChat customer-service console. */
:root {
  --desk-bg: #f4f5f7;
  --desk-panel: #ffffff;
  --desk-soft: #f7f8fa;
  --desk-line: #e5e7eb;
  --desk-text: #111827;
  --desk-muted: #8a94a6;
  --desk-teal: #18b7a7;
  --desk-teal-dark: #0f8f83;
  --desk-red: #e02424;
  --desk-red-soft: #fff1f1;
}

body {
  background: var(--desk-bg);
}

.app-rail {
  display: none;
}

.plain-action-button,
.refresh-button,
.together-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--desk-text);
  font-weight: 900;
}

.plain-action-button {
  min-height: 34px;
  padding: 0 8px;
  gap: 4px;
}

.plain-action-button:hover {
  background: #eef1f4;
}

.plain-action-button.icon-only {
  width: 34px;
  padding: 0;
  font-size: 22px;
}

.detail-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 22px;
  min-height: 58px;
  align-items: center;
  border-bottom: 1px solid var(--desk-line);
  background: var(--desk-panel);
  padding: 0 18px;
  order: 0;
}

.detail-tabs button {
  border: 0;
  background: transparent;
  color: #7a8495;
  font-size: 16px;
  font-weight: 900;
}

.detail-tabs button.active {
  color: var(--desk-text);
  font-size: 18px;
}

.conversation-context-menu {
  position: fixed;
  z-index: 40;
  min-width: 138px;
  border: 1px solid var(--desk-line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.16);
}

.conversation-context-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--desk-red);
  font-weight: 900;
  text-align: left;
}

.conversation-context-menu button:hover {
  background: var(--desk-red-soft);
}

.user-profile-card {
  order: 1;
}

.product-detail-card {
  order: 2;
}

.order-detail-card {
  order: 3;
}

.assignment-card {
  order: 4;
}

.mode-card {
  order: 5;
}

.ai-decision-card {
  order: 6;
}

.handoff-card {
  order: 7;
}

.user-profile-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.user-avatar,
.conversation-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, #d9f4ef, #f3f7ff);
  color: var(--desk-teal-dark);
  font-weight: 900;
}

.user-avatar {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.user-avatar img,
.conversation-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-profile-head h2 {
  overflow: hidden;
  font-size: 17px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-head p {
  overflow: hidden;
  margin-top: 4px;
  color: var(--desk-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.refresh-button {
  width: 30px;
  height: 30px;
  color: #8aa0b8;
  font-size: 20px;
}

.profile-lines {
  display: grid;
  gap: 10px;
}

.profile-lines > div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 24px;
}

.profile-lines span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 900;
}

.profile-lines strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--desk-text);
  font-size: 13px;
  line-height: 1.45;
}

.together-button {
  min-height: 38px;
  margin-top: 14px;
  background: #f0f1f2;
  padding: 0 16px;
  font-size: 14px;
}

.source-product-card,
.official-order-card {
  border: 1px solid var(--desk-line);
  border-radius: 8px;
  background: #fff;
}

.source-product-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.source-product-card-button {
  width: 100%;
  color: var(--desk-text);
  cursor: pointer;
  text-align: left;
}

.source-product-card-button:hover {
  border-color: rgba(24, 183, 167, 0.45);
  background: #fbfffe;
}

.source-product-card .context-card-thumb {
  width: 72px;
  height: 72px;
}

.source-product-card strong,
.order-item-card strong {
  display: block;
  overflow: hidden;
  color: var(--desk-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-product-card span {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}

.official-order-card {
  padding: 12px;
}

.official-side-order-card {
  display: grid;
  width: 100%;
  gap: 10px;
  color: var(--desk-text);
  cursor: pointer;
  text-align: left;
}

.official-order-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.official-order-head strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-order-head span {
  flex: 0 0 auto;
  color: var(--desk-teal-dark);
  font-weight: 900;
}

.official-order-facts {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}

.official-order-view {
  border-top: 1px solid var(--desk-line);
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
  padding-top: 10px;
}

.order-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.order-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.26);
}

.order-detail-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.22);
  transform: translate(-50%, -50%);
}

.order-detail-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9ca3af;
  font-size: 24px;
}

.order-detail-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.order-detail-content {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.order-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-right: 38px;
}

.order-detail-head h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.order-detail-head p,
.order-detail-head span {
  color: #6b7280;
  font-size: 13px;
}

.order-detail-head span {
  flex: 0 0 auto;
  color: var(--desk-teal-dark);
  font-weight: 900;
}

.order-detail-card-main {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--desk-line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.order-detail-card-main .context-card-thumb {
  width: 64px;
  height: 64px;
}

.order-detail-card-main strong,
.order-detail-card-main span {
  display: block;
  min-width: 0;
}

.order-detail-card-main strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.4;
}

.order-detail-card-main span {
  margin-top: 6px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.order-detail-section {
  display: grid;
  gap: 10px;
}

.order-detail-section h3 {
  margin: 0;
  color: #374151;
  font-size: 13px;
}

.order-detail-rows {
  display: grid;
  gap: 0;
  border: 1px solid var(--desk-line);
  border-radius: 8px;
  overflow: hidden;
}

.order-detail-rows div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--desk-line);
  padding: 12px;
}

.order-detail-rows div:last-child {
  border-bottom: 0;
}

.order-detail-rows span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.order-detail-rows strong {
  overflow-wrap: anywhere;
  color: #111827;
  font-size: 13px;
}

@media (min-width: 1021px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .service-shell {
    display: grid;
    width: 100%;
    max-width: none;
    height: 100vh;
    min-height: 0;
    grid-template-columns: 74px minmax(274px, 320px) minmax(520px, 1fr) minmax(340px, 390px);
    grid-template-rows: 48px minmax(0, 1fr);
    gap: 0;
    margin: 0;
    padding: 0;
    background: var(--desk-bg);
  }

  .app-rail {
    display: flex;
    grid-column: 1;
    grid-row: 1 / 3;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--desk-line);
    background: var(--desk-panel);
    padding: 12px 0;
  }

  .rail-group {
    display: grid;
    gap: 10px;
  }

  .rail-item {
    display: grid;
    min-height: 58px;
    place-items: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
  }

  .rail-item.active {
    color: var(--desk-teal);
  }

  .rail-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    color: currentColor;
    font-size: 20px;
    line-height: 1;
  }

  .rail-dot {
    position: relative;
  }

  .rail-dot::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    margin: -20px 0 0 18px;
    border-radius: 999px;
    background: #ff4d4f;
  }

  .topbar {
    grid-column: 2 / 5;
    grid-row: 1;
    min-height: 48px;
    border: 0;
    border-bottom: 1px solid var(--desk-line);
    border-radius: 0;
    background: var(--desk-panel);
    box-shadow: none;
    padding: 6px 12px;
  }

  .topbar .brand-block {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
  }

  .topbar-actions .status-chip,
  .topbar-actions .link-button,
  .topbar-actions .ghost-button {
    min-height: 32px;
    border-radius: 8px;
    font-size: 12px;
  }

  .mode-segment {
    min-height: 34px;
    border-radius: 8px;
  }

  .mode-segment button {
    min-height: 26px;
    border-radius: 6px;
  }

  .metric-row {
    display: none;
  }

  .workspace {
    display: grid;
    grid-column: 2 / 5;
    grid-row: 2;
    min-height: 0;
    grid-template-columns: minmax(274px, 320px) minmax(520px, 1fr) minmax(340px, 390px);
    gap: 0;
    overflow: hidden;
  }

  .queue-panel,
  .chat-panel,
  .control-panel {
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .queue-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--desk-line);
    background: var(--desk-panel);
    overflow: hidden;
  }

  .queue-home {
    display: grid;
    flex: 0 0 46px;
    place-items: center;
    border-bottom: 1px solid var(--desk-line);
    color: #4b5563;
    font-size: 24px;
  }

  .queue-notice {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 76px;
    background: #eaf8ff;
    padding: 12px 16px;
  }

  .queue-notice.notice-warn {
    background: #fff7df;
  }

  .queue-notice.notice-error {
    background: #fff1f1;
  }

  .queue-notice span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: #24a8ff;
    color: #fff;
    font-weight: 900;
  }

  .queue-notice.notice-warn span {
    background: #f59e0b;
  }

  .queue-notice.notice-error span {
    background: #ef4444;
  }

  .queue-notice p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
  }

  .queue-notice a {
    color: #2563eb;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
  }

  .conversation-search {
    position: relative;
    display: block;
    margin: 14px 16px 10px;
  }

  .conversation-search > span {
    position: absolute;
    left: 12px;
    top: 50%;
    color: #9ca3af;
    font-size: 20px;
    transform: translateY(-50%);
  }

  .conversation-search input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--desk-line);
    border-radius: 8px;
    background: #fff;
    padding: 0 12px 0 38px;
    color: var(--desk-text);
    outline: none;
  }

  .conversation-search input:focus {
    border-color: rgba(24, 183, 167, 0.6);
    box-shadow: 0 0 0 3px rgba(24, 183, 167, 0.12);
  }

  .queue-panel .panel-head {
    min-height: 40px;
    border: 0;
    padding: 0 16px 8px;
  }

  .queue-panel .panel-head h2 {
    font-size: 15px;
  }

  .queue-panel .panel-head p {
    font-size: 12px;
  }

  .queue-panel .icon-button {
    width: 32px;
    height: 32px;
    border-color: #cbd5e1;
    color: var(--desk-teal-dark);
    font-size: 20px;
  }

  .queue-filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 0 16px 10px;
  }

  .store-filter {
    margin: 0;
  }

  .store-filter select {
    min-height: 34px;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
  }

  .filter-tabs {
    display: flex;
    gap: 22px;
    padding: 0 16px 10px;
  }

  .filter-tabs button {
    min-height: 28px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #6b7280;
    padding: 0;
    font-size: 14px;
  }

  .filter-tabs button.active {
    background: transparent;
    color: var(--desk-text);
    box-shadow: inset 0 -2px 0 var(--desk-teal);
  }

  .conversation-list {
    flex: 1;
    max-height: none;
    min-height: 0;
    gap: 0;
    overflow: auto;
    padding: 0;
  }

  .conversation-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    height: 72px;
    min-height: 72px;
    align-items: center;
    border: 0;
    border-radius: 0;
    border-left: 3px solid transparent;
    background: #fff;
    padding: 8px 14px 8px 12px;
    text-align: left;
  }

  .conversation-item:hover {
    background: #f6f7f8;
  }

  .conversation-item.active {
    border-color: var(--desk-teal);
    background: var(--desk-teal);
    color: #fff;
    box-shadow: none;
  }

  .conversation-item.needs-reply {
    border-color: #ff5a5f;
    background: var(--desk-red-soft);
    animation: replyPulse 1.8s ease-in-out infinite;
  }

  .conversation-item.needs-reply.active {
    background: var(--desk-teal);
    border-color: var(--desk-teal);
  }

  .conversation-avatar {
    width: 44px;
    height: 44px;
    font-size: 17px;
  }

  .conversation-item.active .conversation-avatar {
    background: rgba(255, 255, 255, 0.9);
    color: var(--desk-teal-dark);
  }

  .conversation-body {
    min-width: 0;
  }

  .conversation-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .conversation-top strong,
  .conversation-top span,
  .conversation-item p {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .conversation-top strong {
    color: inherit;
    font-size: 14px;
    line-height: 1.25;
  }

  .conversation-top span {
    color: #a4adba;
    font-size: 12px;
    font-weight: 800;
  }

  .conversation-item.active .conversation-top span {
    color: rgba(255, 255, 255, 0.72);
  }

  .conversation-item p {
    display: block;
    margin-top: 4px;
    color: #1f2937;
    font-size: 13px;
    line-height: 1.35;
  }

  .conversation-item.active p {
    color: rgba(255, 255, 255, 0.9);
  }

  .conversation-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    color: #9ca3af;
    font-size: 11px;
  }

  .conversation-item.active .conversation-meta {
    color: rgba(255, 255, 255, 0.72);
  }

  .conversation-alert {
    min-width: 34px;
    height: 18px;
    background: #ef4444;
    color: #fff;
  }

  .chat-panel {
    display: grid;
    grid-template-rows: 64px minmax(0, 1fr) 148px;
    border-right: 1px solid var(--desk-line);
    background: #f4f4f4;
    overflow: hidden;
  }

  .chat-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 64px;
    border-bottom: 1px solid var(--desk-line);
    background: #fff;
    padding: 0 18px;
  }

  .chat-head .eyebrow {
    display: none;
  }

.chat-head h2 {
  margin: 0 0 4px;
  overflow: visible;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

  .meta-line {
    gap: 8px;
    color: #8a94a6;
    font-size: 12px;
  }

  .assign-line {
    display: none;
  }

  .chat-head-actions {
    gap: 6px;
  }

  .chat-head-actions .status-chip {
    min-height: 30px;
    border-radius: 999px;
    font-size: 12px;
  }

  .message-stream {
    min-height: 0;
    background: #f4f4f4;
    padding: 18px 22px;
  }

.message {
  max-width: min(70%, 620px);
  margin-bottom: 14px;
}

.message.has-order-card {
  width: min(440px, 86%);
  max-width: min(440px, 86%);
}

.message.has-order-card .message-bubble {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

  .message-bubble {
    border: 0;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    font-size: 15px;
  }

  .message.customer .message-bubble {
    background: #fff;
  }

  .message.agent .message-bubble,
  .message.ai .message-bubble {
    background: #9fe3da;
    color: #082f2a;
  }

  .message.system {
    max-width: 100%;
    justify-items: center;
  }

  .message.system .message-bubble {
    display: inline-flex;
    max-width: 70%;
    border: 1px solid #f5dfb1;
    background: #fff8e8;
    color: #a16207;
    padding: 8px 12px;
  }

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

  .composer-tools {
    gap: 12px;
  }

  .tool-button {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #4b5563;
    font-size: 22px;
  }

  .tool-button:hover,
  .tool-button.active {
    background: #edf7f5;
    color: var(--desk-teal-dark);
  }

  .composer-tool-hint {
    display: none;
  }

  .reply-composer textarea {
    min-height: 72px;
    max-height: 92px;
    border: 0;
    border-radius: 0;
    background: #fff;
    padding: 8px 2px;
    box-shadow: none;
    font-size: 15px;
  }

  .reply-composer textarea:focus {
    box-shadow: none;
  }

  .composer-actions {
    align-items: center;
    gap: 8px;
  }

  .composer-shortcut {
    color: #9ca3af;
    font-size: 12px;
  }

  .composer-actions .secondary-button,
  .composer-actions .primary-button {
    min-height: 36px;
    border-radius: 8px;
  }

  .control-panel {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f6f6f6;
    padding: 0;
  }

  .control-card {
    flex: 0 0 auto;
    border: 0;
    border-bottom: 1px solid var(--desk-line);
    border-radius: 0;
    background: #f6f6f6;
    padding: 18px;
    box-shadow: none;
  }

  .control-card .panel-head {
    min-height: 28px;
    border: 0;
    padding: 0 0 12px;
  }

  .control-card h2 {
    font-size: 15px;
  }

  .info-list {
    gap: 10px;
  }

  .info-subtitle {
    margin: 2px 0 8px;
    color: #6b7280;
    font-size: 13px;
  }

.info-list > div:not(.info-subtitle):not(.order-empty):not(.order-item-list):not(.order-data-note):not(.official-order-card):not(.source-product-card) {
    grid-template-columns: 64px minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 4px 0;
  }

.info-list > div:not(.info-subtitle):not(.order-empty):not(.order-item-list):not(.order-data-note):not(.official-order-card):not(.source-product-card) span {
    color: #6b7280;
  }

  .order-item-list {
    gap: 8px;
  }

  .order-item-card {
    grid-template-columns: 54px minmax(0, 1fr);
    border: 0;
    border-radius: 8px;
    background: #fff;
    padding: 10px;
  }

  .order-item-card .context-card-thumb {
    width: 54px;
    height: 54px;
  }

  .decision-grid div {
    border: 1px solid var(--desk-line);
    background: #fff;
  }

  #draftReply {
    min-height: 96px;
    background: #fff;
  }

  .handoff-list {
    max-height: 220px;
  }
}

@media (max-width: 1020px) {
  .service-shell {
    width: 100%;
    padding: 0;
  }

  .app-rail {
    display: none;
  }

  .workspace {
    gap: 0;
  }

  .queue-notice,
  .conversation-search,
  .detail-tabs {
    display: none;
  }
}
