.workbench-symbols {
  position: absolute;
  pointer-events: none;
}
.wb-icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#brand,
.queue-heading,
.chat-heading,
.context-heading {
  display: flex;
  align-items: center;
}
#brand {
  height: 52px;
  padding-inline: 24px;
  color: var(--ink);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
  gap: 16px;
}
.wb-wordmark,
.wb-tools,
.wb-tools button,
.wb-operator,
.queue-search,
.queue-filter,
.queue-row-heading,
.queue-state,
.profile-identity {
  display: flex;
  align-items: center;
}
.wb-wordmark {
  gap: 6px;
  white-space: nowrap;
  font: 500 18px/1.1 "Helvetica Neue", Arial, sans-serif;
}
.wb-wordmark b {
  font-weight: 600;
}
.wb-wordmark > span {
  color: var(--muted);
}
.wb-wordmark img,
.chatLogo {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
}
.wb-wordmark img {
  margin-right: 4px;
}
.wb-tools {
  gap: 8px;
}
.wb-tools button,
#profile,
#back {
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
}
.wb-tools button {
  white-space: nowrap;
  min-height: 36px;
  padding: 4px 12px;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}
.wb-tools button:hover,
#back:hover,
#profile:hover {
  color: var(--ink);
  background: var(--canvas);
}
.wb-tools button .wb-icon {
  width: 16px;
  height: 16px;
}
.wb-tools button[data-on="1"] .wb-icon {
  fill: var(--accent-soft);
}
.wb-operator {
  padding-left: 16px;
  margin-left: 8px;
  border-left: 1px solid var(--line);
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}
.wb-initial {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-weight: 500;
  font-size: 15px;
  background: #e9e9e3;
  color: #42443e;
}
#agentName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16ch;
}
body.staff main {
  height: calc(100% - 52px);
  width: 100%;
  max-width: none;
}
#queue {
  width: clamp(256px, 22%, 304px);
  flex: none;
  overflow: auto;
  background: #f7f8f6;
  border-right: 1px solid var(--line);
}
.queue-controls {
  padding: 20px 16px 0;
}
.queue-heading h1,
.context-heading h2 {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}
.queue-heading h1 {
  font-size: 20px;
  line-height: 28px;
  margin-bottom: 16px;
}
.queue-search {
  gap: 8px;
  padding: 0 12px;
  min-height: 40px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 8px;
}
.queue-search:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.queue-search .wb-icon {
  width: 16px;
  height: 16px;
  color: var(--faint);
}
#search {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  border: 0;
  background: transparent;
}
#search:focus {
  outline: none;
}
#search::placeholder {
  color: var(--faint);
}
.queue-filter {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 12px 0 8px;
}
#filter {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 6px;
  min-height: 36px;
  padding: 4px 24px 4px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.queue-filter > svg {
  position: absolute;
  right: 4px;
  pointer-events: none;
  width: 14px;
  height: 14px;
  color: var(--muted);
}
#queueStatus {
  margin: 8px 20px;
  font-size: 14px;
}
#queueStatus:empty {
  display: none;
}
#rows {
  margin: 0 8px 16px;
}
#rows .row {
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 88px;
  padding: 12px 12px 12px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: start;
}
#rows .row:hover {
  background: var(--canvas);
}
#rows .row.active {
  background: #f7f5ed;
}
#rows .row.active::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.queue-row-heading {
  gap: 8px;
  justify-content: space-between;
}
.queue-row-heading strong,
.excerpt {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.queue-row-heading strong {
  font-weight: 600;
  font-size: 15px;
}
.queue-row-heading time {
  white-space: nowrap;
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.excerpt {
  color: var(--muted);
  font-size: 14px;
}
.queue-state {
  width: fit-content;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.queue-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a5a7a0;
}
.queue-state[data-stage="open"]::before,
.queue-state[data-stage="pending"]::before {
  background: #a36c00;
}
#chat {
  background: var(--canvas);
}
.chat-heading {
  flex: none;
  min-height: 76px;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.identity {
  flex: 1;
  min-width: 0;
}
.identity > strong,
.identity > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identity > strong {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
}
.identity > small {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}
#subtitle:empty {
  display: none;
}
#threadInitial {
  width: 40px;
  height: 40px;
  font-size: 18px;
}
body.staff .chatLogo,
body.staff #back {
  display: none;
}
#back,
#profile {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--muted);
}
#actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
#actions:empty {
  display: none;
}
#actions button {
  min-height: 36px;
  padding: 4px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--ink);
}
#actions button:hover {
  background: var(--canvas);
}
#actions button.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
body.user #chat .chat-heading {
  min-height: 64px;
  padding: 8px 16px 8px 8px;
  gap: 8px;
}
body.user .identity > strong {
  font-size: 16px;
}
#title > [lang] { display: none; }
html[lang="zh-CN"] body.user #title > [lang="zh-CN"],
html[lang="id"] body.user #title > [lang="id"] { display: inline; }
.desk-empty {
  display: none;
}
body.staff:not(.selected) #chat .chat-heading,
body.staff:not(.selected) #timeline {
  display: none;
}
body.staff:not(.selected) .desk-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  flex: 1;
  color: var(--muted);
}
.desk-empty .wb-icon {
  height: 32px;
  width: 32px;
  stroke-width: 1.2;
}
.desk-empty p {
  margin: 0;
  font-size: 15px;
}
#context {
  flex: none;
  width: clamp(260px, 22%, 320px);
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--paper);
}
.context-heading {
  padding: 20px;
}
.context-heading h2 {
  font-size: 16px;
  line-height: 24px;
}
#contextBody {
  padding: 0 20px 24px;
}
.profile-identity {
  gap: 12px;
  padding-bottom: 20px;
}
.profile-identity > div {
  min-width: 0;
}
.profile-identity small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}
.profile-identity strong {
  display: block;
  font-weight: 600;
  font-size: 18px;
}
.profile-identity .wb-initial {
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: #e9e7de;
  font-size: 20px;
}
.profile-content > details {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 4px 0;
}
.profile-content > details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 0;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.profile-content > details > summary::-webkit-details-marker {
  display: none;
}
.profile-content > details > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 4px;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
}
.profile-content > details[open] > summary::after {
  transform: rotate(45deg);
}
.profile-balance {
  padding: 4px 0 12px;
}
.profile-balance small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.profile-balance strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.profile-content .field {
  align-items: baseline;
  border: 0;
}
.profile-content .field span:last-child {
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.profile-content > details[open] {
  padding-bottom: 12px;
}
@media (min-width: 1060px) {
  body.staff:has(#context:not([hidden])) #profile {
    display: none;
  }
}
@media (max-width: 700px) {
  #brand {
    height: 52px;
    padding-inline: 12px;
    gap: 8px;
  }
  .wb-wordmark {
    gap: 4px;
    font-size: 16px;
  }
  .wb-wordmark img {
    width: 28px;
    height: 28px;
    margin: 0 2px 0 0;
  }
  .wb-tools {
    gap: 0;
  }
  .wb-tools button {
    padding: 4px 8px;
    gap: 4px;
    min-height: 44px;
    font-size: 13px;
  }
  .wb-operator {
    padding-left: 8px;
    margin-left: 4px;
  }
  .wb-operator .wb-initial {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
  #agentName {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  body.staff main {
    height: calc(100% - 52px);
  }
  body.staff #queue {
    width: 100%;
    border: 0;
  }
  body.staff:not(.selected) #chat,
  body.staff.selected #queue {
    display: none;
  }
  body.staff.selected #back {
    display: grid;
  }
  .chat-heading {
    min-height: 60px;
    gap: 4px;
    padding: 8px;
  }
  body.staff #threadInitial {
    display: none;
  }
  .identity > strong {
    font-size: 16px;
    line-height: 24px;
  }
  #actions button {
    font-size: 13px;
    min-height: 36px;
    padding-inline: 8px;
  }
  body.user #chat .chat-heading {
    min-height: 60px;
    gap: 8px;
  }
}
@media (max-width: 420px) {
  .wb-wordmark > span {
    display: none;
  }
}

/* The inbox, correspondence and customer record have separate reading columns. */
body.staff .chat-heading { min-height: 64px; padding: 8px 24px; }
body.staff #threadInitial {
  height: 36px;
  width: 36px;
  border-radius: 12px;
  background: #e9ece7;
}
body.staff #timeline {
  --timeline-paper: var(--paper);
  padding: 0 clamp(16px, 2vw, 32px) 16px;
}
body.staff #timeline article { margin-bottom: 12px; }
body.staff #timeline .bubble:not(.has-record) {
  background: #f4f5f3;
  border-color: transparent;
  border-radius: 12px 12px 12px 4px;
  padding: 10px 14px;
}
body.staff #timeline .mine .bubble:not(.has-record) {
  background: #e9eeea;
  border-radius: 12px 12px 4px;
}
body.staff #timeline .note .bubble {
  background: #faf3dd;
  border-color: #e6dbb6;
}
body.staff #timeline .day-divider { font-weight: 500; }
body.staff #timeline .meta { gap: 6px; color: var(--faint); }
@media (hover: hover) and (pointer: fine) {
  body.staff #timeline .message-more { opacity: 0; }
  body.staff #timeline article:is(:hover, :focus-within) .message-more { opacity: 1; }
}
body.staff #composer {
  border-top: 0;
  padding: 8px clamp(16px, 2vw, 32px) max(16px, env(safe-area-inset-bottom));
}
body.staff #composer .composer-surface {
  border: 1px solid #c8cec6;
  border-radius: 12px;
  padding: 4px 8px 8px;
  background: var(--paper);
}
body.staff #composer .composer-surface:focus-within { border-color: #7b847c; }
body.staff #composer[data-note] .composer-surface { background: #fffcf2; border-color: #cebf91; }
body.staff .composer-modes { display: flex; gap: 16px; margin-inline: 4px; }
body.staff .composer-modes label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 36px;
  cursor: pointer;
}
body.staff .composer-modes input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
body.staff .composer-modes span {
  color: var(--muted);
  border-bottom: 2px solid transparent;
  padding-block: 6px 4px;
  font-size: 13px;
  line-height: 20px;
}
body.staff .composer-modes input:checked + span { color: var(--ink); font-weight: 600; border-color: currentColor; }
body.staff .composer-modes input:focus-visible + span { outline: 2px solid currentColor; outline-offset: 2px; }
body.staff #composer .writing { padding: 0; border: 0; background: transparent; }
body.staff #draft .cm-content, body.staff #draft .composer-native { padding: 8px 4px; }
body.staff #composer #send { color: white; background: #2a302c; padding-inline: 14px; }
body.staff #composer #send:hover:not(:disabled) { background: #151a17; }
body.staff #composer #send:disabled { background: #edeFEB; color: #7a807a; opacity: 1; }
body.staff #composer[data-note] #add { visibility: hidden; }
@media (max-width: 700px) {
  body.staff #queue { background: white; }
  body.staff .queue-search { background: #f4f5f3; box-shadow: none; }
  body.staff .chat-heading { min-height: 56px; padding: 4px 8px; }
  body.staff #composer { padding: 4px 12px max(8px, env(safe-area-inset-bottom)); }
  body.staff #composer .composer-surface { padding: 0 8px 4px; }
  body.staff .composer-modes label, body.staff #composer #send, body.staff #composer #add { min-height: 44px; }
}
