.webchat-admin {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: 1rem;
}
.webchat-admin > .webchat-notice { grid-column: 1 / -1; }
.webchat-inbox, .webchat-history { list-style: none; padding: 0; margin: 0; }
.webchat-inbox { display: grid; gap: .4rem; }
.webchat-inbox button {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .75rem;
  width: 100%;
  min-height: 44px;
  padding: .5rem .75rem;
  text-align: left;
  background: var(--sdn-surface, #fff);
  color: var(--sdn-ink, #1a3549);
  border: 1px solid var(--sdn-line, #d5e2eb);
  border-radius: .55rem;
  overflow-wrap: anywhere;
}
.webchat-inbox button:hover, .webchat-inbox .is-current { border-color: var(--sdn-accent-deep, #19665a); }
.webchat-inbox button small { flex: 1 1 100%; }
.webchat-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .75rem; }
.webchat-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.webchat-inbox-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: end; }
.webchat-inbox-filters label { margin-bottom: .25rem; }
.webchat-history { max-height: 45vh; overflow: auto; scrollbar-gutter: stable; padding-inline: .2rem; }
.webchat-message {
  box-sizing: border-box;
  width: fit-content;
  max-width: min(76%, 34rem);
  margin-block: .55rem;
  margin-inline: 0 auto;
  padding: .65rem .8rem;
  color: var(--sdn-ink, #1a3549);
  background: var(--sdn-surface, #fff);
  border: 1px solid var(--sdn-line, #d5e2eb);
  border-radius: .85rem;
  border-end-start-radius: .25rem;
  overflow-wrap: anywhere;
}
.webchat-message.is-own {
  margin-inline: auto 0;
  background: var(--sdn-paper, #eaf5f1);
  background: color-mix(in srgb, var(--sdn-surface, #fff) 87%, var(--sdn-accent-deep, #19665a));
  border-end-start-radius: .85rem;
  border-end-end-radius: .25rem;
}
.webchat-message p { white-space: pre-wrap; margin: .3rem 0; }
.webchat-form { display: grid; gap: .55rem; margin-top: .75rem; }
.webchat-form :is(button,textarea,input) { min-height: 44px; }
.webchat-form button { justify-self: start; }
.webchat-notice { margin-block: .5rem 0; }
.webchat-notice:empty { display: none; }
.webchat-visitor {
  margin-top: .85rem;
  padding: .7rem;
  border: 1px solid var(--line, #d5e2eb);
  border-radius: .65rem;
}
.webchat-visitor summary { cursor: pointer; font-weight: 700; }
.webchat-visitor .webchat-help { margin: .5rem 0; font-size: .88rem; }
.webchat-visitor .webchat-history { max-height: 28vh; }
.webchat-visitor .webchat-form label { display: grid; gap: .3rem; }
.webchat-visitor :is(input,textarea) {
  width: 100%; min-width: 0; box-sizing: border-box;
  padding: .55rem; border-radius: .45rem; border: 1px solid var(--line, #b9cbd7);
  font: inherit; color: inherit; background: var(--paper, #fff);
}
.webchat-visitor textarea { resize: vertical; }
.webchat-button {
  padding: .5rem .75rem;
  min-height: 44px;
  border: 0;
  border-radius: .5rem;
  background: var(--sdn-accent-deep, #19665a);
  color: #fff;
  font: inherit;
  font-weight: 700;
}
.webchat-button:disabled { opacity: .6; }
:is(.webchat-admin,.webchat-visitor) [hidden], [data-webchat-unread][hidden] { display: none !important; }
@media (max-width: 767px) {
  .webchat-admin { grid-template-columns: minmax(0, 1fr); }
  .webchat-inbox { max-height: 30vh; overflow: auto; }
  .webchat-message { max-width: 87%; }
}
