@import url("https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&family=Sora:wght@600;700&display=swap");

/* build: 2026-05-30-remote-off */

:root {
  --contat-chat-bg: #f3f7fc;
  --contat-chat-surface: #ffffff;
  --contat-chat-surface-alt: #f7fafe;
  --contat-chat-panel: #eef5fc;
  --contat-chat-ink: #142132;
  --contat-chat-muted: #617286;
  --contat-chat-border: rgba(20, 33, 50, 0.1);
  --contat-chat-border-strong: rgba(20, 33, 50, 0.16);
  --contat-chat-brand: #1f76d2;
  --contat-chat-brand-strong: #185ca4;
  --contat-chat-brand-soft: #e8f2fc;
  --contat-chat-accent: #d85b35;
  --contat-chat-accent-strong: #a9421b;
  --contat-chat-accent-soft: #fdf1ea;
  --contat-chat-danger: #b64242;
  --contat-chat-danger-soft: #fdeceb;
  --contat-chat-shadow: 0 22px 48px rgba(20, 33, 50, 0.14);
  --contat-chat-radius: 16px;
  --contat-chat-radius-sm: 12px;
}

[data-contat-live-chat-app],
.contat-live-chat-root,
.contat-live-chat-root button,
.contat-live-chat-root input,
.contat-live-chat-root textarea,
.contat-live-chat-root select {
  font-family: "Public Sans", sans-serif;
}

.contat-live-chat-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  width: min(380px, calc(100vw - 24px));
  color: var(--contat-chat-ink);
  pointer-events: none;
}

.contat-live-chat-root.is-admin-root,
.contat-live-chat-root.is-embedded {
  position: static;
  right: auto;
  bottom: auto;
  width: 100%;
  pointer-events: auto;
}

.contat-live-chat-root.is-unavailable {
  display: none;
}

.contat-live-chat-iframe-shell.is-crm-admin-embed {
  --contat-chat-bg: #f3f6fb;
  --contat-chat-surface: #ffffff;
  --contat-chat-surface-alt: #f8fafc;
  --contat-chat-panel: #eef3f9;
  --contat-chat-ink: #142132;
  --contat-chat-muted: #617286;
  --contat-chat-border: rgba(148, 163, 184, 0.18);
  --contat-chat-border-strong: rgba(100, 116, 139, 0.26);
  --contat-chat-accent: #d85b35;
  --contat-chat-accent-strong: #a9421b;
  --contat-chat-accent-soft: #fdf1ea;
  --contat-chat-danger: #b42318;
  --contat-chat-danger-soft: #fef1f1;
  --contat-chat-shadow: none;
  background: var(--contat-chat-bg);
}

/* ── Launcher: tawk.to-style FAB ─────────────────────────────── */

.contat-live-chat-launcher-wrap {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Compact round button */
.contat-live-chat-launcher-fab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--contat-chat-brand-strong), var(--contat-chat-brand));
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(20, 33, 50, 0.28);
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease;
}

.contat-live-chat-launcher-fab:hover {
  transform: scale(1.07);
  box-shadow: 0 12px 32px rgba(20, 33, 50, 0.34);
}

.contat-live-chat-launcher-fab-initial {
  font-family: "Sora", sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.contat-live-chat-launcher-fab-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.contat-live-chat-launcher-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e53935;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

/* Incoming message preview bubble */
.contat-live-chat-launcher-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 14px 14px 4px 14px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(20, 33, 50, 0.16);
  border: 1px solid var(--contat-chat-border);
  cursor: pointer;
  animation: contat-preview-in 200ms ease;
}

@keyframes contat-preview-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.contat-live-chat-launcher-preview-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--contat-chat-brand-strong), var(--contat-chat-brand));
  color: #ffffff;
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.contat-live-chat-launcher-preview-body {
  flex: 1 1 auto;
  font-size: 13px;
  line-height: 1.45;
  color: var(--contat-chat-ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.contat-live-chat-launcher-preview-close {
  flex: 0 0 auto;
  background: none;
  border: none;
  padding: 0;
  font-size: 10px;
  color: var(--contat-chat-muted);
  cursor: pointer;
  line-height: 1;
  margin-top: 1px;
}

/* ── Shared badge / pill styles ──────────────────────────────── */

.contat-live-chat-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  flex: 0 0 auto;
  font-family: "Sora", sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.contat-live-chat-status-pill,
.contat-live-chat-session-meta span,
.contat-live-chat-head-actions > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.contat-live-chat-surface {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 12px;
  height: min(720px, calc(100vh - 28px));
  border: 1px solid var(--contat-chat-border);
  border-radius: var(--contat-chat-radius);
  background: linear-gradient(180deg, var(--contat-chat-brand-soft) 0%, #ffffff 18%);
  box-shadow: var(--contat-chat-shadow);
}

.contat-live-chat-root:not(.is-admin-root):not(.is-embedded) .contat-live-chat-surface {
  max-height: calc(100vh - 150px);
}

.contat-live-chat-root.is-open .contat-live-chat-surface {
  margin-top: 0;
}

.contat-live-chat-root.is-admin-root .contat-live-chat-surface,
.contat-live-chat-root.is-embedded .contat-live-chat-surface {
  margin-top: 0;
  width: 100%;
  height: min(700px, calc(100vh - 40px));
  min-height: 560px;
}

.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-surface {
  min-height: 0;
  height: calc(100vh - 16px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.contat-live-chat-surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--contat-chat-brand-strong), var(--contat-chat-brand) 58%, #3e8fe4);
  color: #ffffff;
}

.contat-live-chat-surface-head.is-visitor-compact {
  align-items: center;
  padding: 12px 14px;
}

.contat-live-chat-surface-head.is-visitor-compact .contat-live-chat-head-identity {
  gap: 0;
}

.contat-live-chat-surface-head.is-visitor-compact h2 {
  margin-top: 0;
  font-size: 18px;
}

.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-surface-head {
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--contat-chat-border);
  color: var(--contat-chat-ink);
}

.contat-live-chat-head-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.contat-live-chat-avatar {
  color: var(--contat-chat-brand-strong);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(31, 118, 210, 0.1);
}

.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-avatar {
  color: var(--contat-chat-accent-strong);
  background: var(--contat-chat-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(216, 91, 53, 0.14);
}

.contat-live-chat-head-copy {
  min-width: 0;
}

.contat-live-chat-eyebrow,
.contat-live-chat-realtime-pill {
  margin: 0;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contat-live-chat-surface-head h2,
.contat-live-chat-thread-head h3,
.contat-live-chat-prompt-card h3,
.contat-live-chat-tool-card h4,
.contat-live-chat-empty-state h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.contat-live-chat-surface-head h2 {
  margin-top: 2px;
  font-size: 22px;
  line-height: 1.15;
}

.contat-live-chat-subhead,
.contat-live-chat-muted,
.contat-live-chat-thread-head p,
.contat-live-chat-empty-state p,
.contat-live-chat-tool-card p {
  margin: 5px 0 0;
  color: var(--contat-chat-muted);
  font-size: 13px;
  line-height: 1.5;
}

.contat-live-chat-surface-head .contat-live-chat-subhead {
  color: rgba(255, 255, 255, 0.88);
}

.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-surface-head .contat-live-chat-subhead,
.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-eyebrow {
  color: var(--contat-chat-muted);
}

.contat-live-chat-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.contat-live-chat-close,
.contat-live-chat-root .button,
.contat-live-chat-root button.button {
  border: 1px solid var(--contat-chat-border-strong);
  border-radius: 10px;
  background: #ffffff;
  color: var(--contat-chat-ink);
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.contat-live-chat-close {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.contat-live-chat-root .button-primary,
.contat-live-chat-root button.button-primary {
  background: var(--contat-chat-accent);
  border-color: var(--contat-chat-accent-strong);
  color: #ffffff;
  height: 100%;
}

.contat-live-chat-root .button-secondary,
.contat-live-chat-root button.button-secondary {
  background: var(--contat-chat-surface-alt);
  border-color: var(--contat-chat-border);
}

.contat-live-chat-close:hover,
.contat-live-chat-root .button:hover,
.contat-live-chat-root button.button:hover {
  transform: translateY(-1px);
}

.contat-live-chat-status-pill,
.contat-live-chat-session-meta span,
.contat-live-chat-realtime-pill {
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-status-pill,
.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-head-actions > span,
.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-realtime-pill {
  background: var(--contat-chat-accent-soft);
  color: var(--contat-chat-accent-strong);
  border-color: rgba(216, 91, 53, 0.16);
}

.contat-live-chat-root .contat-live-chat-composer .contat-live-chat-realtime-pill,
.contat-live-chat-root .contat-live-chat-thread-panel .contat-live-chat-realtime-pill,
.contat-live-chat-root .contat-live-chat-visitor-shell .contat-live-chat-realtime-pill {
  color: var(--contat-chat-brand-strong);
  background: var(--contat-chat-brand-soft);
  border-color: rgba(31, 118, 210, 0.24);
}

.contat-live-chat-status-pill[data-status="waiting"],
.contat-live-chat-session-meta span[data-status="waiting"] {
  background: #fff0d9;
  color: #8b5d14;
  border-color: rgba(139, 93, 20, 0.18);
}

.contat-live-chat-status-pill[data-status="active"],
.contat-live-chat-session-meta span[data-status="active"] {
  background: var(--contat-chat-brand-soft);
  color: var(--contat-chat-brand-strong);
  border-color: rgba(31, 118, 210, 0.18);
}

.contat-live-chat-status-pill[data-status="closed"],
.contat-live-chat-session-meta span[data-status="closed"] {
  background: #ecf0eb;
  color: #5f6b63;
  border-color: rgba(95, 107, 99, 0.18);
}

.contat-live-chat-error,
.contat-live-chat-realtime-warning,
.contat-live-chat-typing-chip,
.contat-live-chat-consent-row,
.contat-live-chat-profile-grid,
.contat-live-chat-identity-card,
.contat-live-chat-composer,
.contat-live-chat-tool-card,
.contat-live-chat-prompt-card,
.contat-live-chat-empty-state {
  margin: 0 16px 16px;
}

.contat-live-chat-error,
.contat-live-chat-realtime-warning {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.contat-live-chat-error {
  background: var(--contat-chat-danger-soft);
  color: var(--contat-chat-danger);
  border: 1px solid rgba(182, 66, 66, 0.14);
}

.contat-live-chat-realtime-warning {
  background: #fff7d7;
  color: #7d6000;
  border: 1px solid rgba(125, 96, 0, 0.16);
}

.contat-live-chat-admin-shell,
.contat-live-chat-visitor-shell {
  flex: 1 1 auto;
  min-height: 0;
}

.contat-live-chat-visitor-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.contat-live-chat-admin-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) minmax(260px, 24vw);
  min-height: 0;
}

.contat-live-chat-admin-sidebar,
.contat-live-chat-admin-tools {
  background: var(--contat-chat-surface-alt);
  min-height: 0;
}

.contat-live-chat-admin-sidebar {
  padding: 16px;
  border-right: 1px solid var(--contat-chat-border);
  overflow: hidden;
}

.contat-live-chat-admin-tools {
  padding: 16px 16px 0;
  border-left: 1px solid var(--contat-chat-border);
  overflow: auto;
}

.contat-live-chat-thread-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.contat-live-chat-thread-head,
.contat-live-chat-inline-actions,
.contat-live-chat-composer-actions,
.contat-live-chat-tool-head,
.contat-live-chat-session-item-head,
.contat-live-chat-session-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.contat-live-chat-thread-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--contat-chat-border);
}

.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-thread-head {
  padding-top: 10px;
}

.contat-live-chat-queue-card,
.contat-live-chat-session-item,
.contat-live-chat-tool-card,
.contat-live-chat-prompt-card,
.contat-live-chat-empty-state,
.contat-live-chat-consent-row,
.contat-live-chat-identity-card {
  border: 1px solid var(--contat-chat-border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(16, 34, 23, 0.05);
}

.contat-live-chat-queue-card,
.contat-live-chat-tool-card,
.contat-live-chat-prompt-card,
.contat-live-chat-empty-state,
.contat-live-chat-identity-card {
  padding: 14px;
}

.contat-live-chat-session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-right: 2px;
  max-height: calc(100% - 180px);
  overflow: auto;
}

.contat-live-chat-session-item {
  width: 100%;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.contat-live-chat-session-item.is-active,
.contat-live-chat-session-item.is-selected {
  border-color: rgba(31, 118, 210, 0.24);
  box-shadow: 0 14px 28px rgba(31, 118, 210, 0.12);
  transform: translateY(-1px);
}

.contat-live-chat-session-item.has-unread {
  border-color: rgba(216, 91, 53, 0.2);
}

.contat-live-chat-session-item-head span,
.contat-live-chat-field span,
.contat-live-chat-tool-head span,
.contat-live-chat-session-meta {
  color: var(--contat-chat-muted);
  font-size: 12px;
}

.contat-live-chat-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.contat-live-chat-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.contat-live-chat-profile-grid input,
.contat-live-chat-field input,
.contat-live-chat-field textarea,
.contat-live-chat-field select,
.contat-live-chat-composer textarea {
  width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--contat-chat-border-strong);
  border-radius: 10px;
  background: #ffffff;
  color: var(--contat-chat-ink);
  font-size: 14px;
  line-height: 1.4;
}

.contat-live-chat-root input::placeholder,
.contat-live-chat-root textarea::placeholder {
  color: #91a094;
}

.contat-live-chat-field textarea,
.contat-live-chat-composer textarea {
  resize: auto;
}

.contat-live-chat-composer {
  display: flex;
  flex-direction: row;
  gap: 5px;
  margin: 0;
  padding: 5px;
}

.contat-live-chat-composer-actions {
  justify-content: flex-end;
  height: 100%;
}

.contat-live-chat-thread-messages,
.contat-live-chat-visitor-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  min-height: 0;
  overflow: auto;
  background: radial-gradient(circle at top right, rgba(31, 118, 210, 0.08), transparent 24%), linear-gradient(180deg, #ffffff 0%, #f7fafe 100%);
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.contat-live-chat-thread-messages::-webkit-scrollbar,
.contat-live-chat-visitor-body::-webkit-scrollbar {
  display: none;
}

.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-thread-messages,
.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-visitor-body {
  background: radial-gradient(circle at top right, rgba(216, 91, 53, 0.06), transparent 24%), linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.contat-live-chat-message {
  max-width: min(82%, 460px);
  padding: 4px 8px;
  border-radius: 14px;
  background: #f7fafe;
  border: 1px solid rgba(20, 33, 50, 0.06);
  position: relative;
}

.contat-live-chat-message.is-self {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--contat-chat-accent), var(--contat-chat-accent-strong));
  color: #ffffff;
  border-color: rgba(169, 66, 27, 0.32);
}

.contat-live-chat-message.is-pending {
  opacity: 0.55;
  transition: opacity 200ms ease;
}

.contat-live-chat-iframe-shell.is-crm-admin-embed .contat-live-chat-message.is-self {
  background: linear-gradient(135deg, #d85b35, #a9421b);
  border-color: rgba(169, 66, 27, 0.34);
}

.contat-live-chat-message.is-other {
  align-self: flex-start;
}

.contat-live-chat-message.is-system,
.contat-live-chat-message.is-command {
  align-self: center;
  max-width: 100%;
  background: var(--contat-chat-brand-soft);
  color: var(--contat-chat-brand-strong);
  padding: 3px 10px;
  opacity: 0.7;
}

.contat-live-chat-message p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.contat-live-chat-message-meta {
  position: absolute;
  bottom: calc(100% + 1px);
  left: 0;
  right: 0;
  margin: 0 !important;
  padding: 3px 6px;
  pointer-events: none;
  opacity: 0;
  color: var(--contat-chat-muted);
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 120ms ease;
  z-index: 2;
}

.contat-live-chat-message:hover .contat-live-chat-message-meta,
.contat-live-chat-message:focus-within .contat-live-chat-message-meta {
  opacity: 1;
}

.contat-live-chat-message.is-self .contat-live-chat-message-meta {
  color: var(--contat-chat-accent);
  text-align: right;
  min-width: 200px;
  right: 0;
  left: auto;
}

.contat-live-chat-typing-chip {
  padding: 9px 12px;
  background: var(--contat-chat-brand-soft);
  border: 1px solid rgba(31, 118, 210, 0.18);
  border-radius: 11px;
  color: var(--contat-chat-brand-strong);
  font-size: 12px;
  font-weight: 600;
}

.contat-live-chat-consent-row {
  padding: 12px 14px;
}

.contat-live-chat-consent-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.contat-live-chat-identity-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contat-live-chat-identity-card strong {
  font-size: 14px;
}

.contat-live-chat-identity-card span {
  color: var(--contat-chat-muted);
  font-size: 12px;
}

.contat-live-chat-video-wrap {
  overflow: hidden;
  border-radius: 12px;
  margin-top: 12px;
  background: #0e1811;
}

.contat-live-chat-video-wrap video {
  display: block;
  width: 100%;
  min-height: 170px;
  object-fit: cover;
}

.contat-live-chat-empty-state {
  margin-top: 16px;
  text-align: center;
}

.contat-live-chat-toast,
.contat-live-chat-assist-banner {
  position: fixed;
  z-index: 10001;
  padding: 12px 14px;
  border-radius: 12px;
  background: #162236;
  color: #ffffff;
  box-shadow: 0 20px 36px rgba(20, 33, 50, 0.24);
}

.contat-live-chat-toast {
  top: 20px;
  right: 20px;
}

.contat-live-chat-assist-banner {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.contat-live-chat-guidance-highlight {
  outline: 3px solid rgba(31, 118, 210, 0.92) !important;
  box-shadow: 0 0 0 6px rgba(31, 118, 210, 0.22) !important;
  transition:
    box-shadow 180ms ease,
    outline-color 180ms ease;
}

/* ── Mobile tab bar (hidden on desktop) ─────────────────────── */

.contat-live-chat-mobile-tabs {
  display: none;
}

@media (min-width: 481px) and (max-width: 800px) {
  .contat-live-chat-admin-shell {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 34vw);
  }

  .contat-live-chat-admin-sidebar {
    display: none;
  }

  .contat-live-chat-admin-tools {
    display: block;
    padding: 16px 16px 0;
  }

  .contat-live-chat-tool-card {
    margin: 0;
  }
}

@media (max-width: 768px) {
  .contat-live-chat-root {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .contat-live-chat-root:not(.is-admin-root).is-open {
    right: 0;
    bottom: 0;
    width: 100vw;
  }

  .contat-live-chat-root:not(.is-admin-root).is-open .contat-live-chat-surface,
  .contat-live-chat-root.is-embedded .contat-live-chat-surface {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    margin-top: 0;
    border-radius: 0;
  }

  .contat-live-chat-launcher-fab {
    width: 52px;
    height: 52px;
  }

  .contat-live-chat-surface-head {
    padding: 14px;
  }

  .contat-live-chat-surface-head.is-visitor-compact {
    padding: 12px 14px;
  }

  .contat-live-chat-surface-head h2 {
    font-size: 19px;
  }

  .contat-live-chat-head-actions {
    gap: 6px;
  }

  .contat-live-chat-thread-head,
  .contat-live-chat-surface-head,
  .contat-live-chat-inline-actions {
    flex-wrap: wrap;
  }

  .contat-live-chat-profile-grid {
    grid-template-columns: 1fr;
  }

  .contat-live-chat-thread-messages,
  .contat-live-chat-visitor-body {
    padding: 14px;
  }

  .contat-live-chat-message {
    max-width: 90%;
  }

  .contat-live-chat-error,
  .contat-live-chat-realtime-warning,
  .contat-live-chat-typing-chip,
  .contat-live-chat-profile-grid,
  .contat-live-chat-composer,
  .contat-live-chat-tool-card,
  .contat-live-chat-prompt-card,
  .contat-live-chat-empty-state {
    margin-left: 14px;
    margin-right: 14px;
    margin-bottom: 14px;
  }

  .contat-live-chat-toast,
  .contat-live-chat-assist-banner {
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
  }

  .contat-live-chat-toast {
    top: 12px;
  }

  .contat-live-chat-assist-banner {
    top: auto;
    bottom: 12px;
  }
}

/* ── Admin panel: 3-tab mobile layout (≤ 480 px) ────────────── */

@media (max-width: 480px) {
  /* Show the tab bar */
  .contat-live-chat-mobile-tabs {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    background: var(--contat-chat-surface);
    border-bottom: 1px solid var(--contat-chat-border);
  }

  .contat-live-chat-mobile-tab {
    flex: 1 1 0;
    padding: 10px 4px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--contat-chat-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    position: relative;
    transition: color 140ms ease, border-bottom-color 140ms ease;
  }

  .contat-live-chat-mobile-tab.is-active {
    color: var(--contat-chat-accent);
    border-bottom-color: var(--contat-chat-accent);
  }

  .contat-live-chat-mobile-tab:disabled {
    opacity: 0.38;
    cursor: default;
  }

  .contat-live-chat-mobile-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 4px;
    border-radius: 999px;
    background: var(--contat-chat-accent);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    vertical-align: middle;
    line-height: 1;
  }

  /* Admin shell switches to flex column so panels can fill remaining height */
  .contat-live-chat-admin-shell {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
  }

  .contat-live-chat-admin-sidebar {
    display: block !important;
  }

  .contat-live-chat-thread-panel {
    display: flex !important;
  }

  .contat-live-chat-admin-tools {
    display: block !important;
  }

  /* Panel visibility driven by data-mobile-tab attribute */
  .contat-live-chat-admin-shell[data-mobile-tab="chats"] .contat-live-chat-thread-panel,
  .contat-live-chat-admin-shell[data-mobile-tab="chats"] .contat-live-chat-admin-tools {
    display: none !important;
  }

  .contat-live-chat-admin-shell[data-mobile-tab="chat"] .contat-live-chat-admin-sidebar,
  .contat-live-chat-admin-shell[data-mobile-tab="chat"] .contat-live-chat-admin-tools {
    display: none !important;
  }

  .contat-live-chat-admin-shell[data-mobile-tab="client"] .contat-live-chat-admin-sidebar,
  .contat-live-chat-admin-shell[data-mobile-tab="client"] .contat-live-chat-thread-panel {
    display: none !important;
  }

  /* Each visible panel fills all remaining space */
  .contat-live-chat-admin-sidebar,
  .contat-live-chat-thread-panel,
  .contat-live-chat-admin-tools {
    flex: 1 1 auto !important;
    min-height: 0;
    overflow: auto;
    border: none !important;
    border-top: none !important;
    padding-top: 0;
    grid-column: auto !important;
  }

  /* Session list: remove fixed max-height so list fills panel */
  .contat-live-chat-session-list {
    max-height: none;
    flex: 1 1 auto;
    overflow: auto;
  }

  /* Client info (tools) needs some padding */
  .contat-live-chat-admin-tools {
    padding: 14px !important;
    display: block !important;
    grid-template-columns: none !important;
  }
}
