:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #6f7782;
  --subtle: #9299a2;
  --line: #e3e6ea;
  --line-strong: #d8dce1;
  --surface: #ffffff;
  --surface-soft: #f6f7f8;
  --surface-blue: #edf7ff;
  --blue: #1284e7;
  --blue-dark: #086fc8;
  --blue-pale: #e7f4ff;
  --green: #20a66a;
  --orange: #f59b23;
  --red: #de4c53;
  --violet: #7656d8;
  --shadow: 0 18px 55px rgba(31, 45, 61, 0.16);
  --topbar-height: 48px;
  --conversation-width: 390px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  animation: none !important;
  scroll-behavior: auto !important;
  transition: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #eef0f3;
  color: var(--ink);
}

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

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid rgba(18, 132, 231, 0.28);
  outline-offset: 2px;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: #f5f6f8;
  color: var(--muted);
}

.boot-mark,
.brand-mark {
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #14a7eb, #0879e1 60%, #0863c0);
  box-shadow: 0 8px 20px rgba(18, 132, 231, 0.25);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.boot-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  font-size: 25px;
}

.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 14% 10%, rgba(73, 180, 255, 0.19), transparent 28%),
    radial-gradient(circle at 88% 88%, rgba(99, 224, 176, 0.16), transparent 30%),
    #f2f4f7;
}

.login-card {
  position: relative;
  width: min(100%, 480px);
  padding: 42px 44px 32px;
  overflow: hidden;
  border: 1px solid rgba(215, 221, 228, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 26px 80px rgba(31, 45, 61, 0.13);
}

.login-card::after {
  content: "";
  position: absolute;
  right: -100px;
  top: -120px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(43, 165, 240, 0.13), rgba(43, 165, 240, 0));
  pointer-events: none;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 178px;
  margin-bottom: 46px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 18px;
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.login-brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-brand .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.login-copy h1 {
  margin: 9px 0 14px;
  font-size: clamp(31px, 6vw, 39px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.login-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.login-form {
  margin-top: 32px;
}

.login-form label,
.modal-form > label {
  display: grid;
  gap: 8px;
  color: #313943;
  font-size: 13px;
  font-weight: 700;
}

.password-row {
  position: relative;
}

.password-row input,
.modal-form input,
.modal-form select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: white;
}

.password-row input {
  padding-right: 78px;
}

.password-row input:focus,
.modal-form input:focus,
.modal-form select:focus,
.search-wrap input:focus,
.composer textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 132, 231, 0.1);
  outline: none;
}

.modal-form select {
  padding: 0 40px 0 14px;
}

.modal-form select:disabled,
.drawer-ip-editor select:disabled {
  cursor: not-allowed;
  color: #7d858e;
  background: var(--surface-soft);
}

.outbound-ip-field small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}

.password-toggle {
  position: absolute;
  right: 7px;
  top: 7px;
  width: auto !important;
  height: 34px !important;
  padding: 0 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

.primary-button,
.secondary-button {
  min-height: 43px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 750;
}

.primary-button {
  color: white;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(18, 132, 231, 0.18);
}

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

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.primary-button--wide {
  width: 100%;
  margin-top: 18px;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: white;
}

.form-error {
  margin: 10px 0 0;
  color: var(--red);
  font-size: 12px;
  line-height: 1.4;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 0;
  padding-top: 21px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.security-note span {
  color: var(--green);
  font-size: 8px;
}

.workspace {
  position: relative;
  height: 100dvh;
  background: var(--surface);
}

.topbar {
  position: fixed;
  z-index: 70;
  inset: 0 0 auto var(--conversation-width);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.topbar-chat-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-left: 2px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #59636d;
  background: #f6f7f8;
}

.profile-button:hover,
.profile-button[aria-expanded="true"] {
  border-color: #b9dfff;
  background: var(--blue-pale);
  box-shadow: 0 0 0 3px rgba(18, 132, 231, 0.08);
}

.person-glyph {
  position: relative;
  width: 18px;
  height: 18px;
}

.person-glyph::before,
.person-glyph::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: currentColor;
}

.person-glyph::before {
  top: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.person-glyph::after {
  bottom: 1px;
  width: 15px;
  height: 8px;
  border-radius: 9px 9px 4px 4px;
}

.demo-banner {
  position: fixed;
  z-index: 25;
  inset: var(--topbar-height) 0 auto var(--conversation-width);
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 16px;
  background: #fff7dd;
  color: #705718;
  font-size: 12px;
  border-bottom: 1px solid #f0dfac;
}

.demo-banner button {
  padding: 5px 10px;
  border-radius: 7px;
  color: #6a4e08;
  background: #ffe69a;
  font-size: 11px;
  font-weight: 750;
}

.workspace-grid {
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--conversation-width) minmax(420px, 1fr);
  min-width: 0;
}

.workspace:has(.demo-banner:not(.hidden)) .workspace-grid {
  height: 100dvh;
}

.conversation-panel,
.chat-panel {
  min-width: 0;
  min-height: 0;
  background: var(--surface);
}

.account-avatar,
.customer-avatar {
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: linear-gradient(145deg, #8697b6, #687b9d);
  font-weight: 800;
}

.account-avatar {
  width: 31px;
  height: 31px;
  font-size: 11px;
}

.account-avatar.color-1 { background: linear-gradient(145deg, #4ba8e8, #267dcc); }
.account-avatar.color-2 { background: linear-gradient(145deg, #ae7ce6, #7656c2); }
.account-avatar.color-3 { background: linear-gradient(145deg, #f1a85d, #db7e32); }
.account-avatar.color-4 { background: linear-gradient(145deg, #55bd91, #258f68); }

.account-state-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--green);
}

.account-state-dot.error { background: var(--red); }
.account-state-dot.paused { background: var(--orange); }
.account-state-dot.demo { background: #8f98a2; }

.conversation-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.conversation-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 14px 17px 0;
}

.conversation-filter-field {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #7c858f;
  font-size: 9px;
  font-weight: 700;
}

.conversation-filter-field > span,
.conversation-date-range label > span {
  padding-left: 2px;
}

.conversation-filter-field select,
.conversation-date-range input {
  width: 100%;
  height: 36px;
  min-width: 0;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8f9fa;
  font-size: 10px;
}

.account-filter-field,
.account-multiselect {
  position: relative;
  min-width: 0;
}

.account-filter-trigger {
  width: 100%;
  height: 36px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8f9fa;
  font-size: 10px;
  text-align: left;
}

.account-filter-trigger:focus-visible {
  outline: 2px solid rgba(45, 155, 240, 0.28);
  outline-offset: 1px;
}

#accountFilterSummary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-filter-caret {
  flex: 0 0 auto;
  color: #7f8994;
  font-size: 13px;
  line-height: 1;
}

.account-filter-trigger[aria-expanded="true"] .account-filter-caret {
  transform: rotate(180deg);
}

.account-filter-menu {
  position: absolute;
  z-index: 45;
  top: calc(100% + 6px);
  left: 0;
  width: min(260px, calc(100vw - 34px));
  max-height: 290px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 14px 34px rgba(33, 43, 54, 0.16);
}

.account-filter-option {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 7px;
  color: #4d5863;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.account-filter-option:hover,
.account-filter-option:focus-within {
  background: var(--surface-soft);
}

.account-filter-option input {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--blue);
}

.account-filter-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-filter-all {
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 7px 7px 3px 3px;
}

.conversation-date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 9px 17px 0;
}

.conversation-date-range label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #7c858f;
  font-size: 9px;
  font-weight: 700;
}

.conversation-date-range input {
  padding-right: 8px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin: 10px 17px 12px;
}

.search-wrap > span {
  position: absolute;
  left: 12px;
  color: #8d959e;
  font-size: 19px;
  transform: rotate(-15deg);
}

.search-wrap input {
  width: 100%;
  height: 39px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f9fa;
  font-size: 11px;
}

.conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d6dbe0 transparent;
}

.dialog-row {
  position: relative;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 43px;
  gap: 5px;
  padding: 11px 11px 10px 14px;
  border-bottom: 1px solid #edf0f2;
  background: white;
  text-align: left;
}

.dialog-row:hover {
  background: #f9fbfc;
}

.dialog-row.active {
  background: var(--surface-blue);
}

.dialog-row.active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--blue);
}

.dialog-open {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  text-align: left;
}

.dialog-thumb {
  position: relative;
  width: 48px;
  height: 48px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(145deg, #8697b6, #687b9d);
  font-size: 14px;
  font-weight: 800;
}

.dialog-thumb.avatar-1 { background: linear-gradient(145deg, #ec8e75, #d36655); }
.dialog-thumb.avatar-2 { background: linear-gradient(145deg, #6ab4ec, #3c83c3); }
.dialog-thumb.avatar-3 { background: linear-gradient(145deg, #bd8de8, #8156c0); }
.dialog-thumb.avatar-4 { background: linear-gradient(145deg, #75c5a3, #3c916c); }
.dialog-thumb.avatar-5 { background: linear-gradient(145deg, #e6ae5e, #bf7a2e); }

.dialog-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-thumb.image-failed img {
  display: none;
}

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

.conversation-name-line {
  display: flex;
  align-items: center;
  min-width: 0;
}

.conversation-name-line {
  gap: 6px;
}

.conversation-name-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.conversation-preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview {
  margin-top: 7px;
  color: #8a929c;
  font-size: 10px;
}

.dialog-row.unread .conversation-name-line strong,
.dialog-row.unread .conversation-preview {
  color: var(--ink);
  font-weight: 750;
}

.conversation-meta {
  min-width: 43px;
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 5px;
  padding-top: 1px;
  color: #9aa1a8;
  font-size: 9px;
}

.dialog-pin {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 7px;
  color: #8f98a2;
  background: transparent;
  opacity: 0.5;
  font-size: 13px;
  line-height: 1;
}

.dialog-row:hover .dialog-pin,
.dialog-pin:focus-visible,
.dialog-pin.active {
  opacity: 1;
}

.dialog-pin.active {
  background: var(--blue-pale);
}

.dialog-pin:disabled {
  cursor: progress;
}

.unread-badge {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 10px;
  color: white;
  background: var(--blue);
  font-size: 9px;
  font-weight: 800;
}

.list-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 260px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.list-empty strong {
  margin-bottom: 6px;
  color: #49525c;
  font-size: 14px;
}

.list-empty span {
  max-width: 220px;
  font-size: 11px;
  line-height: 1.45;
}

.chat-panel {
  position: relative;
  overflow: hidden;
  padding-top: var(--topbar-height);
  background: #f8f9fa;
}

.workspace:has(.demo-banner:not(.hidden)) .chat-panel {
  padding-top: calc(var(--topbar-height) + 39px);
}

.empty-chat {
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-chat h2 {
  margin: 20px 0 6px;
  color: #3d4650;
  font-size: 18px;
}

.empty-chat p {
  margin: 0;
  font-size: 12px;
}

.empty-illustration {
  position: relative;
  width: 76px;
  height: 60px;
}

.empty-illustration::before,
.empty-illustration::after {
  content: "";
  position: absolute;
  border-radius: 17px;
}

.empty-illustration::before {
  inset: 0 12px 8px 0;
  background: #dceeff;
}

.empty-illustration::after {
  inset: 18px 0 0 18px;
  border: 4px solid #f8f9fa;
  background: #dfe3e8;
}

.empty-illustration span {
  position: relative;
  z-index: 2;
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 22px 2px 0;
  border-radius: 50%;
  background: #80bde9;
}

.chat-view {
  height: 100%;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) auto;
}

.customer-avatar {
  width: 39px;
  height: 39px;
  border-radius: 13px;
  background: linear-gradient(145deg, #e88d73, #c96652);
  font-size: 13px;
}

.chat-person {
  min-width: 0;
}

.chat-person h2 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.chat-person > div {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.account-mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.back-to-list {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface-soft);
}

.listing-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 18px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.listing-card[href]:hover {
  border-color: #b7daf7;
}

.listing-thumb {
  flex: 0 0 auto;
  width: 51px;
  height: 51px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(145deg, #aebbc7, #798a98);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  overflow: hidden;
}

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

.listing-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.listing-copy small {
  color: #9aa1a9;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.listing-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.listing-copy span {
  color: #4f5862;
  font-size: 10px;
  font-weight: 650;
}

.listing-open {
  margin-left: auto;
  color: var(--blue);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.message-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 12px 18px 16px;
  background:
    radial-gradient(circle at 50% 20%, rgba(233, 238, 243, 0.38), transparent 34%),
    #f7f8f9;
}

.message-list {
  width: min(100%, 780px);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
  margin: 0 auto;
}

.date-divider {
  align-self: center;
  margin: 8px 0;
  padding: 4px 9px;
  border-radius: 10px;
  color: #9199a2;
  background: rgba(229, 232, 235, 0.9);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.message-row {
  display: flex;
  align-items: end;
  gap: 7px;
}

.message-row.out {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(70%, 540px);
  padding: 9px 11px 7px;
  border: 1px solid #e1e4e7;
  border-radius: 5px 14px 14px 14px;
  color: #313a44;
  background: white;
  box-shadow: 0 2px 6px rgba(40, 51, 62, 0.04);
}

.message-row.out .message-bubble {
  border-color: #c9e6fc;
  border-radius: 14px 5px 14px 14px;
  background: #e7f5ff;
}

.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.42;
}

.message-meta {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 4px;
  color: #979fa7;
  font-size: 8px;
}

.message-state {
  color: var(--blue);
}

.message-pending {
  opacity: 0.6;
}

.message-row.message-failed .message-bubble {
  border-color: #efc5c8;
  background: #fff1f2;
}

.message-state.failed {
  color: var(--red);
  font-weight: 750;
}

.system-message {
  align-self: center;
  margin: 9px 0;
  color: #9198a1;
  font-size: 9px;
  text-align: center;
}

.api-access-block {
  align-self: center;
  width: min(100%, 520px);
  display: flex;
  gap: 13px;
  margin: auto;
  padding: 17px;
  border: 1px solid #f0d493;
  border-radius: 14px;
  color: #6c5318;
  background: #fff8e5;
  box-shadow: 0 8px 25px rgba(105, 78, 17, 0.07);
}

.api-access-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--orange);
  font-size: 14px;
  font-weight: 850;
}

.api-access-block strong {
  display: block;
  font-size: 12px;
}

.api-access-block p {
  margin: 5px 0 11px;
  font-size: 10px;
  line-height: 1.45;
}

.api-access-block button {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  color: #745511;
  background: #ffe7a9;
  font-size: 9px;
  font-weight: 750;
}

.api-access-block button:disabled,
.quick-replies button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.composer {
  padding: 8px 18px 10px;
  border-top: 1px solid var(--line);
  background: white;
}

.quick-replies {
  display: flex;
  gap: 6px;
  width: min(100%, 780px);
  margin: 0 auto 7px;
  overflow-x: auto;
}

.quick-replies button {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #d7e9f8;
  border-radius: 14px;
  color: #4e7898;
  background: #f4faff;
  font-size: 9px;
}

.composer-row {
  width: min(100%, 780px);
  display: flex;
  align-items: end;
  gap: 8px;
  margin: 0 auto;
}

.attach-button {
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  color: #7a838d;
  background: #f1f3f5;
  font-size: 20px;
}

.composer textarea {
  flex: 1;
  min-height: 39px;
  max-height: 118px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: white;
  font-size: 12px;
  line-height: 1.35;
}

.send-button {
  min-width: 94px;
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 11px;
  color: white;
  background: var(--blue);
  font-size: 10px;
  font-weight: 750;
}

.send-button:hover { background: var(--blue-dark); }
.send-button:disabled { opacity: 0.5; cursor: not-allowed; }
.send-button b { font-size: 12px; transform: rotate(-8deg); }

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
}

.modal-backdrop {
  position: fixed;
  z-index: 130;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(23, 33, 43, 0.46);
}

.modal-card {
  width: min(100%, 500px);
  max-height: calc(100dvh - 44px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow);
}

.modal-card--wide {
  width: min(100%, 760px);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.modal-head h2 {
  margin: 5px 0 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.modal-form {
  display: grid;
  gap: 17px;
  margin-top: 24px;
}

.info-box {
  display: flex;
  gap: 11px;
  padding: 12px;
  border: 1px solid #cfe7f8;
  border-radius: 11px;
  color: #4d6a80;
  background: #f1f9ff;
}

.info-box > span {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.info-box p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 4px;
}

.drawer-scrim {
  position: fixed;
  z-index: 100;
  inset: 0;
  background: rgba(23, 33, 43, 0.38);
}

.account-drawer {
  position: fixed;
  z-index: 110;
  inset: var(--topbar-height) 0 0 auto;
  width: min(440px, 100vw);
  display: flex;
  flex-direction: column;
  padding: 0 20px 18px;
  border-left: 1px solid var(--line);
  background: white;
  box-shadow: -22px 0 54px rgba(32, 45, 58, 0.17);
  transform: translateX(105%);
  visibility: hidden;
}

.account-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.account-drawer-header {
  min-height: 79px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.account-drawer-header h2 {
  margin: 5px 0 0;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.drawer-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 24px;
}

.drawer-close:hover {
  background: var(--surface-soft);
}

.connected-items {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 9px;
  margin-top: 14px;
  overflow-y: auto;
  padding: 1px 2px 10px;
  scrollbar-width: thin;
}

.drawer-empty {
  display: grid;
  gap: 6px;
  padding: 24px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
}

.drawer-empty strong {
  color: #424c56;
  font-size: 13px;
}

.drawer-empty span {
  font-size: 10px;
  line-height: 1.45;
}

.drawer-account-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}

.drawer-account-card .account-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 12px;
}

.drawer-account-copy {
  min-width: 0;
}

.drawer-account-copy strong,
.drawer-account-copy span,
.drawer-account-copy small {
  display: block;
}

.drawer-account-copy strong {
  overflow: hidden;
  color: #303a44;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-account-copy .drawer-account-ip {
  margin-top: 4px;
  color: #59636d;
  font-size: 10px;
  font-weight: 650;
}

.drawer-account-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.drawer-account-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.drawer-account-actions button {
  min-height: 27px;
  padding: 0 6px;
  border-radius: 7px;
  color: var(--blue-dark);
  background: transparent;
  font-size: 9px;
  font-weight: 700;
}

.drawer-account-actions button:hover {
  background: var(--blue-pale);
}

.drawer-account-actions button.danger {
  color: var(--red);
}

.drawer-account-actions button.danger:hover {
  background: #fff0f1;
}

.drawer-ip-editor {
  grid-column: 2 / -1;
  display: grid;
  gap: 9px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.drawer-ip-editor label {
  display: grid;
  gap: 5px;
  color: #59636d;
  font-size: 9px;
  font-weight: 700;
}

.drawer-ip-editor select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  font-size: 10px;
}

.drawer-ip-editor select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 132, 231, 0.1);
  outline: none;
}

.drawer-ip-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.drawer-ip-actions button {
  min-height: 31px;
  padding: 0 10px;
  border-radius: 8px;
  color: #66717b;
  background: #e9ecef;
  font-size: 9px;
  font-weight: 700;
}

.drawer-ip-actions button.save {
  color: white;
  background: var(--blue);
}

.drawer-ip-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.drawer-connect {
  flex: 0 0 auto;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
  border: 1px solid #b9dfff;
  border-radius: 11px;
  color: var(--blue-dark);
  background: #eef8ff;
  font-size: 12px;
  font-weight: 750;
}

.drawer-connect:hover {
  background: #e1f2ff;
}

.drawer-connect span {
  font-size: 18px;
}

.drawer-warning {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #f0d893;
  border-radius: 11px;
  color: #705718;
  background: #fff8e1;
}

.drawer-warning strong { font-size: 11px; }
.drawer-warning span { font-size: 9px; line-height: 1.45; }

.drawer-utility-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.drawer-utility-actions button {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border-radius: 8px;
  color: #6f7881;
  background: transparent;
  font-size: 10px;
}

.drawer-utility-actions button:hover {
  background: var(--surface-soft);
}

.security-settings {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(280px, 1.2fr);
  gap: 26px;
  margin-top: 22px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
}

.security-settings-copy h3 {
  margin: 6px 0 7px;
  font-size: 14px;
}

.security-settings-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.password-change-form {
  display: grid;
  gap: 10px;
}

.password-change-form label {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #59636d;
  font-size: 10px;
  font-weight: 650;
}

.password-change-form input {
  width: 100%;
  height: 37px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: white;
}

.password-change-form .secondary-button {
  justify-self: end;
  min-height: 37px;
}

.toast-stack {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid #d9e1e7;
  border-radius: 11px;
  color: #39434d;
  background: white;
  box-shadow: 0 12px 36px rgba(32, 45, 58, 0.16);
  font-size: 11px;
  line-height: 1.4;
}

.toast.error { border-color: #f1c5c8; color: #9d3439; }
.toast.success { border-color: #bfe6d1; color: #28764f; }

.mobile-nav {
  display: none;
}

.danger-copy {
  color: var(--red) !important;
}

@media (max-width: 1100px) {
  :root {
    --conversation-width: 340px;
  }

  .workspace-grid {
    grid-template-columns: var(--conversation-width) minmax(390px, 1fr);
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 48px;
    --conversation-width: 0px;
  }

  .topbar {
    left: auto;
    width: 58px;
    padding: 0 10px;
    border-bottom: 0;
    background: transparent;
  }

  .topbar.chat-open {
    left: 0;
    width: 100%;
    padding: 0 10px;
    border-bottom: 1px solid var(--line);
    background: white;
  }

  .topbar.chat-open .topbar-chat-info {
    flex: 1;
  }

  .topbar.chat-open .chat-person {
    overflow: hidden;
  }

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

  .login-brand small {
    display: none;
  }

  .login-brand strong { font-size: 13px; }
  .brand-mark { width: 32px; height: 32px; }
  .topbar-actions { gap: 1px; }
  .profile-button { width: 34px; height: 34px; }

  .conversation-panel .search-wrap {
    margin-right: 63px;
  }

  .account-drawer {
    width: 100%;
    padding: 0 14px calc(15px + env(safe-area-inset-bottom));
  }

  .drawer-account-card {
    grid-template-columns: 39px minmax(0, 1fr);
  }

  .drawer-account-card .account-avatar {
    width: 39px;
    height: 39px;
  }

  .drawer-account-actions {
    grid-column: 2;
    flex-direction: row;
    justify-content: flex-end;
  }

  .drawer-ip-editor {
    grid-column: 1 / -1;
  }

  .demo-banner {
    inset: auto 0 55px;
    height: auto;
    min-height: 44px;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 11px;
    font-size: 9px;
  }

  .workspace-grid,
  .workspace:has(.demo-banner:not(.hidden)) .workspace-grid {
    height: calc(100dvh - 55px);
    grid-template-columns: 1fr;
  }

  .conversation-panel {
    border-right: 0;
  }

  .chat-panel {
    position: fixed;
    z-index: 60;
    inset: 0 0 55px;
    padding-top: var(--topbar-height);
    transform: translateX(102%);
  }

  .workspace:has(.demo-banner:not(.hidden)) .chat-panel {
    top: 0;
    padding-top: var(--topbar-height);
  }

  .chat-panel.mobile-open {
    transform: translateX(0);
  }

  .back-to-list {
    display: inline-grid;
    place-items: center;
  }

  .listing-card {
    margin: 7px 9px;
  }

  .listing-open { display: none; }
  .message-scroll { padding: 10px 10px 13px; }
  .message-bubble { max-width: 84%; }
  .composer { padding: 7px 9px 8px; }
  .quick-replies { margin-bottom: 6px; }
  .send-button { min-width: 42px; width: 42px; padding: 0; }
  .send-button span { display: none; }
  .mobile-nav {
    position: fixed;
    z-index: 90;
    inset: auto 0 0;
    height: 55px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: white;
  }

  .mobile-nav button {
    display: grid;
    place-content: center;
    gap: 2px;
    color: #858d96;
    background: transparent;
    font-size: 8px;
  }

  .mobile-nav button span { font-size: 15px; }
  .mobile-nav button.active { color: var(--blue); }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: 92dvh;
    padding: 21px 17px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }

  .security-settings {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .password-change-form label {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .toast-stack {
    right: 10px;
    bottom: 66px;
    left: 10px;
  }

  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 520px) {
  .login-screen { padding: 0; background: white; }
  .login-card {
    width: 100%;
    min-height: 100dvh;
    padding: 30px 23px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .login-brand { margin-bottom: 70px; }
}

/* Unified, motion-free interface */
:root {
  --ink: #18212b;
  --muted: #5f6b76;
  --subtle: #7c8792;
  --line: #e2e7ec;
  --line-strong: #cdd5dd;
  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --surface-blue: #eaf4fe;
  --blue: #086fc8;
  --blue-dark: #055fae;
  --blue-pale: #eaf4fe;
  --green: #168a55;
  --orange: #a96800;
  --red: #c63d49;
  --shadow: 0 12px 32px rgba(24, 33, 43, 0.14);
  --topbar-height: 56px;
  --conversation-width: 384px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html,
body {
  background: #f5f7f9;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

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

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.password-row input:focus-visible,
.modal-form input:focus-visible,
.modal-form select:focus-visible,
.search-wrap input:focus-visible,
.composer textarea:focus-visible,
.drawer-ip-editor select:focus-visible,
.account-filter-trigger:focus-visible {
  border-color: var(--blue);
  box-shadow: none;
  outline: 2px solid var(--blue) !important;
  outline-offset: 2px;
}

.boot {
  gap: 12px;
  background: #f5f7f9;
  color: var(--muted);
  font-size: 13px;
}

.boot-mark,
.brand-mark {
  color: white;
  background: var(--blue);
  box-shadow: none;
  font-weight: 700;
}

.boot-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 22px;
}

.login-screen {
  height: 100dvh;
  padding: 24px;
  overflow-y: auto;
  place-items: start center;
  background: #f5f7f9;
}

.login-card {
  width: min(100%, 420px);
  margin: auto 0;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 12px 32px rgba(24, 33, 43, 0.08);
}

.login-card::after {
  display: none;
}

.login-brand {
  min-width: 0;
  gap: 10px;
  margin-bottom: 28px;
}

.login-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.login-brand strong {
  font-size: 15px;
  font-weight: 600;
}

.login-brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.login-copy h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 34px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.login-form {
  margin-top: 28px;
}

.login-form label,
.modal-form > label {
  gap: 7px;
  color: #34404b;
  font-size: 13px;
  font-weight: 600;
}

.password-row input,
.modal-form input,
.modal-form select {
  height: 44px;
  padding: 0 12px;
  border-color: var(--line-strong);
  border-radius: 8px;
  font-size: 14px;
}

.password-row input {
  padding-right: 82px;
}

.password-toggle {
  top: 5px;
  right: 5px;
  height: 34px !important;
  padding: 0 9px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  background: transparent;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.primary-button {
  background: var(--blue);
  box-shadow: none;
}

.primary-button:hover {
  background: var(--blue-dark);
  transform: none;
}

.secondary-button {
  border-color: var(--line-strong);
  background: white;
}

.primary-button--wide {
  margin-top: 16px;
}

.form-error {
  font-size: 12px;
}

.security-note {
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  background: white;
}

.topbar {
  height: var(--topbar-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.topbar-chat-info {
  flex: 1;
  gap: 12px;
  overflow: hidden;
}

.topbar-actions {
  gap: 8px;
}

.profile-button {
  width: 40px;
  height: 40px;
  margin: 0;
  border-color: var(--line);
  border-radius: 10px;
  color: #52606d;
  background: white;
  box-shadow: none;
}

.profile-button:hover,
.profile-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  box-shadow: none;
}

.demo-banner {
  height: 40px;
  gap: 12px;
  padding: 0 16px;
  border-bottom-color: #ead7a5;
  color: #6f5317;
  background: #fff8e7;
  font-size: 12px;
}

.demo-banner button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  color: #62480e;
  background: #f5dfa4;
  font-size: 12px;
  font-weight: 600;
}

.workspace-grid {
  grid-template-columns: var(--conversation-width) minmax(440px, 1fr);
}

.account-avatar,
.customer-avatar,
.dialog-thumb,
.listing-thumb {
  color: white;
  background: #66788a;
  font-weight: 700;
}

.account-avatar.color-1,
.dialog-thumb.avatar-1 { background: #377fb6; }
.account-avatar.color-2,
.dialog-thumb.avatar-2 { background: #765ca8; }
.account-avatar.color-3,
.dialog-thumb.avatar-3 { background: #b36a45; }
.account-avatar.color-4,
.dialog-thumb.avatar-4 { background: #3e8364; }
.dialog-thumb.avatar-5 { background: #9a6b2f; }

.conversation-panel {
  border-right: 1px solid var(--line);
  background: white;
}

.conversation-filters {
  grid-template-columns: minmax(0, 1.2fr) minmax(120px, 0.8fr);
  gap: 8px;
  padding: 12px 14px 0;
}

.conversation-filter-field,
.conversation-date-range label {
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.conversation-filter-field select,
.conversation-date-range input,
.account-filter-trigger {
  height: 40px;
  padding: 0 30px 0 11px;
  border-color: var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  font-size: 13px;
}

.account-filter-trigger {
  padding-right: 10px;
}

.account-filter-caret {
  color: var(--muted);
  font-size: 14px;
}

.account-filter-menu {
  z-index: 80;
  top: calc(100% + 5px);
  width: min(272px, calc(100vw - 28px));
  max-height: 300px;
  padding: 6px;
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.account-filter-option {
  position: relative;
  min-height: 40px;
  gap: 10px;
  padding: 8px;
  border-radius: 7px;
  color: #34404b;
  font-size: 13px;
  font-weight: 500;
}

.account-filter-option input[type="checkbox"] {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 18px;
  height: 18px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  transform: translateY(-50%);
}

.account-filter-check {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 18px;
  border: 1px solid #9da8b3;
  border-radius: 5px;
  background: white;
}

.account-filter-check::after {
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  content: "";
  opacity: 0;
  transform: rotate(45deg);
}

.account-filter-option input[type="checkbox"]:checked + .account-filter-check,
.account-filter-option input[type="checkbox"]:indeterminate + .account-filter-check {
  border-color: var(--blue);
  background: var(--blue);
}

.account-filter-option input[type="checkbox"]:checked + .account-filter-check::after {
  opacity: 1;
}

.account-filter-option input[type="checkbox"]:indeterminate + .account-filter-check::after {
  top: 7px;
  left: 4px;
  width: 8px;
  height: 2px;
  border: 0;
  border-radius: 1px;
  background: white;
  opacity: 1;
  transform: none;
}

.account-filter-option input[type="checkbox"]:focus-visible {
  outline: none;
}

.account-filter-option input[type="checkbox"]:focus-visible + .account-filter-check {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.account-filter-option input[type="checkbox"]:disabled + .account-filter-check {
  border-color: #d7dde3;
  background: #eef1f4;
}

.conversation-date-range {
  gap: 8px;
  padding: 10px 14px 0;
}

.search-wrap {
  margin: 10px 14px 12px;
}

.search-wrap > span {
  display: none;
}

.search-wrap input {
  height: 40px;
  padding: 0 11px;
  border-color: var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 13px;
}

.search-wrap input::placeholder,
.composer textarea::placeholder {
  color: #7a8590;
}

.conversation-list {
  scrollbar-color: #cfd6dd transparent;
}

.dialog-row {
  min-height: 80px;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  padding: 10px 10px 10px 11px;
  border-bottom-color: #edf0f3;
  border-left: 3px solid transparent;
  background: white;
  content-visibility: auto;
  contain-intrinsic-size: auto 80px;
}

.dialog-row:hover {
  background: #f8fafb;
}

.dialog-row.active {
  border-left-color: var(--blue);
  background: var(--surface-blue);
}

.dialog-row.active::before {
  display: none;
}

.dialog-open {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
}

.dialog-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-size: 13px;
}

.conversation-name-line strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.conversation-preview {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.dialog-row.unread .conversation-name-line strong,
.dialog-row.unread .conversation-preview {
  color: var(--ink);
  font-weight: 600;
}

.conversation-meta {
  min-width: 48px;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.dialog-pin {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  opacity: 0.72;
  font-size: 14px;
}

.dialog-row:hover .dialog-pin,
.dialog-pin:focus-visible,
.dialog-pin.active {
  opacity: 1;
}

.dialog-pin.active {
  color: var(--blue);
  background: var(--blue-pale);
}

.unread-badge {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  background: var(--blue);
  font-size: 11px;
  font-weight: 600;
}

.list-empty {
  min-height: 240px;
  padding: 24px;
}

.list-empty strong {
  color: #34404b;
  font-size: 15px;
  font-weight: 600;
}

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

.chat-panel {
  padding-top: var(--topbar-height);
  background: #f5f7f9;
}

.workspace:has(.demo-banner:not(.hidden)) .chat-panel {
  padding-top: calc(var(--topbar-height) + 40px);
}

.empty-chat h2 {
  margin: 0;
  color: #34404b;
  font-size: 18px;
  font-weight: 600;
}

.empty-chat p,
.empty-illustration {
  display: none;
}

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

.customer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #b45f49;
  font-size: 13px;
}

.chat-person h2 {
  font-size: 15px;
  font-weight: 600;
}

.chat-person > div {
  gap: 6px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.back-to-list {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  color: #46535f;
  background: var(--surface-soft);
  font-size: 18px;
}

.listing-card {
  gap: 12px;
  margin: 0;
  padding: 9px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: white;
}

.listing-card[href]:hover {
  border-color: var(--line);
  background: #fbfcfd;
  transform: none;
}

.listing-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #718292;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.listing-copy {
  gap: 2px;
}

.listing-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.listing-copy span,
.listing-open {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.listing-open {
  color: var(--blue);
}

.message-scroll {
  padding: 16px;
  background: #f5f7f9;
}

.message-list,
.quick-replies,
.composer-row {
  width: min(100%, 820px);
}

.message-list {
  gap: 8px;
}

.date-divider {
  margin: 8px 0;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
}

.message-bubble {
  max-width: min(72%, 560px);
  padding: 10px 12px 8px;
  border-color: var(--line);
  border-radius: 6px 12px 12px 12px;
  color: var(--ink);
  background: white;
  box-shadow: none;
}

.message-row.out .message-bubble {
  border-color: #c9e1f5;
  border-radius: 12px 6px 12px 12px;
  background: #eaf4fe;
}

.message-bubble p {
  font-size: 14px;
  line-height: 1.45;
}

.message-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

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

.api-access-block {
  width: min(100%, 520px);
  gap: 12px;
  padding: 16px;
  border-color: #e5cc8c;
  border-radius: 12px;
  color: #654d17;
  background: #fff8e7;
  box-shadow: none;
}

.api-access-icon {
  width: 28px;
  height: 28px;
  background: var(--orange);
  font-size: 14px;
  font-weight: 700;
}

.api-access-block strong {
  font-size: 14px;
  font-weight: 600;
}

.api-access-block p {
  margin: 5px 0 12px;
  font-size: 12px;
  line-height: 1.45;
}

.api-access-block button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: #654d17;
  background: #f3dfa8;
  font-size: 12px;
  font-weight: 600;
}

.composer {
  padding: 10px 16px 12px;
  border-top-color: var(--line);
  background: white;
}

.quick-replies {
  gap: 7px;
  margin-bottom: 8px;
}

.quick-replies button {
  min-height: 32px;
  padding: 0 10px;
  border-color: #cfe1ef;
  border-radius: 8px;
  color: #3e6b8d;
  background: #f5faff;
  font-size: 12px;
}

.composer-row {
  align-items: end;
  gap: 8px;
}

.composer textarea {
  min-height: 44px;
  max-height: 120px;
  padding: 11px 12px;
  border-color: var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  font-size: 14px;
  line-height: 1.4;
}

.composer textarea:disabled {
  color: var(--muted);
  background: var(--surface-soft);
}

.send-button {
  min-width: 96px;
  height: 44px;
  gap: 0;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.send-button b {
  display: none;
  transform: none;
  font-size: 18px;
}

.modal-backdrop {
  padding: 20px;
  background: rgba(24, 33, 43, 0.56);
  backdrop-filter: none;
}

.modal-card {
  max-height: calc(100dvh - 40px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.modal-head {
  align-items: center;
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.modal-close,
.drawer-close {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 24px;
}

.modal-form {
  gap: 16px;
  margin-top: 22px;
}

.outbound-ip-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.info-box {
  display: block;
  padding: 11px 12px;
  border-color: var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

.info-box > span {
  display: none;
}

.info-box p {
  font-size: 12px;
}

.drawer-scrim {
  background: rgba(24, 33, 43, 0.46);
  backdrop-filter: none;
}

.account-drawer {
  inset: 0 0 0 auto;
  width: min(400px, 100vw);
  display: none;
  padding: env(safe-area-inset-top) 16px 16px;
  border-left-color: var(--line);
  box-shadow: -10px 0 28px rgba(24, 33, 43, 0.12);
  transform: none;
  visibility: hidden;
}

.account-drawer.open {
  display: flex;
  transform: none;
  visibility: visible;
}

.account-drawer-header {
  min-height: 64px;
  border-bottom-color: var(--line);
}

.account-drawer-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.connected-items {
  gap: 8px;
  margin-top: 12px;
  padding-bottom: 10px;
}

.drawer-empty {
  gap: 5px;
  padding: 22px 16px;
  border-color: var(--line-strong);
  border-radius: 10px;
}

.drawer-empty strong {
  font-size: 14px;
  font-weight: 600;
}

.drawer-empty span {
  font-size: 12px;
}

.drawer-account-card {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-color: var(--line);
  border-radius: 10px;
  box-shadow: none;
}

.drawer-account-card .account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  font-size: 12px;
}

.drawer-account-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.drawer-account-copy .drawer-account-ip,
.drawer-account-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.drawer-account-actions {
  gap: 3px;
}

.drawer-account-actions button {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
}

.drawer-ip-editor {
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.drawer-ip-editor label {
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.drawer-ip-editor select {
  height: 40px;
  border-radius: 8px;
  font-size: 13px;
}

.drawer-ip-actions button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.drawer-connect {
  min-height: 44px;
  border-color: #bcd9ee;
  border-radius: 9px;
  color: var(--blue);
  background: #f2f8fd;
  font-size: 14px;
  font-weight: 600;
}

.drawer-warning {
  border-color: #e5cc8c;
  border-radius: 9px;
  background: #fff8e7;
}

.drawer-warning strong,
.drawer-warning span {
  font-size: 12px;
}

.drawer-utility-actions {
  margin-top: 12px;
  padding-top: 12px;
}

.drawer-utility-actions button {
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.security-settings {
  gap: 24px;
  margin-top: 20px;
  padding-top: 20px;
}

.security-settings-copy h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.security-settings-copy p {
  font-size: 12px;
}

.password-change-form {
  gap: 12px;
}

.password-change-form label {
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 12px;
  color: #34404b;
  font-size: 13px;
  font-weight: 500;
}

.password-change-form input {
  height: 40px;
  border-color: var(--line-strong);
  border-radius: 8px;
  font-size: 13px;
}

.toast-stack {
  right: 16px;
  bottom: 16px;
  gap: 8px;
}

.toast {
  min-width: 260px;
  max-width: 380px;
  padding: 12px 14px;
  border-color: var(--line);
  border-radius: 10px;
  color: #34404b;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.mobile-nav {
  display: none !important;
}

@media (max-width: 1100px) {
  :root {
    --conversation-width: 360px;
  }

  .workspace-grid {
    grid-template-columns: var(--conversation-width) minmax(390px, 1fr);
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 56px;
    --conversation-width: 0px;
  }

  .topbar {
    left: auto;
    width: 56px;
    height: var(--topbar-height);
    padding: 0 8px;
    border-bottom: 0;
    background: transparent;
  }

  .topbar.chat-open {
    left: 0;
    width: 100%;
    padding: 0 10px;
    border-bottom: 1px solid var(--line);
    background: white;
  }

  .profile-button,
  .back-to-list,
  .modal-close,
  .drawer-close {
    width: 44px;
    height: 44px;
  }

  .conversation-filter-field select,
  .conversation-date-range input,
  .account-filter-trigger,
  .search-wrap input {
    height: 44px;
  }

  .account-filter-option {
    min-height: 44px;
  }

  .conversation-filters {
    grid-template-columns: minmax(0, 1.2fr) minmax(104px, 0.8fr);
    padding: 12px 68px 0 12px;
  }

  .conversation-date-range {
    padding: 10px 12px 0;
  }

  .search-wrap,
  .conversation-panel .search-wrap {
    margin: 10px 12px 12px;
  }

  .workspace-grid,
  .workspace:has(.demo-banner:not(.hidden)) .workspace-grid {
    height: 100dvh;
    grid-template-columns: 1fr;
  }

  .demo-banner {
    inset: auto 0 0;
    min-height: 44px;
    height: auto;
    padding: 7px 12px;
    font-size: 12px;
  }

  .workspace:has(.demo-banner:not(.hidden)) .workspace-grid {
    height: calc(100dvh - 44px);
  }

  .chat-panel {
    position: fixed;
    z-index: 60;
    inset: 0;
    display: none;
    padding-top: var(--topbar-height);
    transform: none;
    visibility: hidden;
    pointer-events: none;
  }

  .chat-panel.mobile-open {
    display: block;
    transform: none;
    visibility: visible;
    pointer-events: auto;
  }

  .workspace:has(.demo-banner:not(.hidden)) .chat-panel {
    top: 0;
    bottom: 44px;
    padding-top: var(--topbar-height);
  }

  .listing-card {
    padding: 8px 12px;
  }

  .message-scroll {
    padding: 12px;
  }

  .message-bubble {
    max-width: 88%;
  }

  .dialog-pin,
  .quick-replies button,
  .drawer-account-actions button,
  .drawer-ip-actions button,
  .drawer-utility-actions button {
    min-height: 40px;
  }

  .dialog-pin {
    width: 40px;
    height: 40px;
  }

  .composer {
    padding: 8px 10px 10px;
  }

  .quick-replies {
    margin-bottom: 7px;
  }

  .send-button {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .send-button span {
    display: none;
  }

  .send-button b {
    display: block;
  }

  .account-drawer {
    inset: 0;
    width: 100%;
    padding: env(safe-area-inset-top) 12px calc(14px + env(safe-area-inset-bottom));
  }

  .drawer-account-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .drawer-account-actions {
    grid-column: 2;
    flex-direction: row;
    justify-content: flex-end;
  }

  .drawer-ip-editor {
    grid-column: 1 / -1;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: 94dvh;
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
  }

  .security-settings {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .password-change-form label {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .toast-stack {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .login-screen {
    padding: 0;
    background: white;
  }

  .login-card {
    width: 100%;
    min-height: 100dvh;
    padding: 28px 22px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
  }

  .login-brand {
    margin-bottom: 52px;
  }
}
