: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: 62px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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;
  animation: breathe 1.4s ease-in-out infinite;
}

@keyframes breathe {
  50% { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(18, 132, 231, 0.32); }
}

.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;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 178px;
}

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

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

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

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

.brand-lockup--login {
  margin-bottom: 46px;
}

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

.eyebrow,
.section-label {
  margin: 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.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;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.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,
.settings-ip-control 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;
  transition: transform 0.15s, background 0.15s, opacity 0.15s;
}

.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);
  transform: translateY(-1px);
}

.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 {
  height: 100dvh;
  background: var(--surface);
}

.topbar {
  position: relative;
  z-index: 30;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.topbar-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(32, 166, 106, 0.11);
}

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

.topbar-button,
.mobile-menu-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border-radius: 9px;
  background: transparent;
  color: #4e5762;
  font-size: 12px;
  font-weight: 650;
}

.topbar-button:hover,
.mobile-menu-button:hover {
  background: var(--surface-soft);
}

.operator-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-left: 4px;
  border-radius: 50%;
  background: #e9ecf0;
  color: #55606b;
  font-size: 10px;
  font-weight: 800;
}

.mobile-menu-button {
  display: none;
  width: 38px;
  padding: 0;
}

.demo-banner {
  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: calc(100dvh - var(--topbar-height));
  display: grid;
  grid-template-columns: 246px 378px minmax(420px, 1fr);
  min-width: 0;
}

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

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

.accounts-panel {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 22px 13px 12px;
  border-right: 1px solid var(--line);
  background: #fafbfc;
}

.accounts-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.close-mobile-panel {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: transparent;
  font-size: 24px;
}

.connect-button {
  height: 41px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 17px 3px 18px;
  border: 1px solid #b9dfff;
  border-radius: 10px;
  color: var(--blue-dark);
  background: #eef8ff;
  font-size: 12px;
  font-weight: 750;
}

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

.connect-button span {
  font-size: 18px;
  line-height: 1;
}

.inbox-nav {
  display: grid;
  gap: 3px;
}

.nav-item {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 9px;
  background: transparent;
  color: #535d68;
  text-align: left;
  font-size: 12px;
}

.nav-item:hover {
  background: #f0f2f5;
}

.nav-item.active {
  color: var(--blue-dark);
  background: var(--blue-pale);
  font-weight: 700;
}

.nav-icon {
  width: 19px;
  color: #79828c;
  text-align: center;
  font-size: 13px;
}

.nav-item.active .nav-icon {
  color: var(--blue);
}

.nav-item b {
  min-width: 20px;
  color: #9299a1;
  text-align: right;
  font-size: 10px;
}

.nav-item .accent-count {
  min-width: 20px;
  padding: 3px 6px;
  border-radius: 9px;
  color: white;
  background: var(--blue);
  text-align: center;
}

.panel-divider {
  height: 1px;
  margin: 18px 8px 15px;
  background: var(--line);
}

.account-list-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 9px 9px;
  color: #8b929a;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-list-title button {
  padding: 3px;
  color: var(--blue);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
}

.account-list {
  display: grid;
  gap: 4px;
  overflow-y: auto;
}

.account-row {
  width: 100%;
  min-height: 49px;
  display: grid;
  grid-template-columns: 31px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.account-row:hover {
  background: #f1f3f5;
}

.account-row.selected {
  border-color: #d4eaff;
  background: #f0f8ff;
}

.account-avatar,
.customer-avatar,
.conversation-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-copy {
  min-width: 0;
}

.account-copy strong,
.account-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  color: #37414b;
  font-size: 11px;
}

.account-copy small {
  margin-top: 3px;
  color: #9299a1;
  font-size: 9px;
}

.account-row-count {
  min-width: 20px;
  padding: 3px 6px;
  border-radius: 10px;
  color: var(--blue-dark);
  background: var(--blue-pale);
  text-align: center;
  font-size: 9px;
  font-weight: 800;
}

.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; }

.accounts-footer {
  display: grid;
  gap: 2px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.accounts-footer button {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border-radius: 8px;
  color: #717983;
  background: transparent;
  text-align: left;
  font-size: 11px;
}

.accounts-footer button:hover { background: #f0f2f4; }

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

.conversation-head {
  min-height: 85px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 18px 18px 12px;
}

.conversation-head h1 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.conversation-head h1 span {
  color: var(--blue);
  font-size: 11px;
  letter-spacing: 0;
}

.sort-button {
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
}

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

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

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

.search-wrap kbd {
  position: absolute;
  right: 10px;
  min-width: 20px;
  padding: 2px 5px;
  border: 1px solid #d8dce0;
  border-bottom-width: 2px;
  border-radius: 5px;
  color: #8b929a;
  background: white;
  text-align: center;
  font: 10px inherit;
}

.filter-chips {
  display: flex;
  gap: 6px;
  padding: 12px 17px 11px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.chip {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: #747c85;
  background: white;
  font-size: 10px;
  font-weight: 650;
}

.chip.active {
  border-color: #bcdfff;
  color: var(--blue-dark);
  background: var(--blue-pale);
}

.active-filter {
  margin: 9px 14px 0;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--blue-dark);
  background: var(--blue-pale);
  font-size: 10px;
}

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

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

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

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

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

.conversation-avatar {
  width: 43px;
  height: 43px;
  border-radius: 14px;
  font-size: 14px;
}

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

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

.conversation-name-line,
.conversation-account-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-account-line {
  gap: 5px;
  margin-top: 4px;
  color: #8c949d;
  font-size: 9px;
}

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

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

.conversation-item {
  margin-top: 5px;
  color: #4d5660;
  font-size: 10px;
  font-weight: 650;
}

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

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

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

.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;
}

.status-dot-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border-radius: 6px;
  background: #f2f3f5;
  color: #7e8790;
  font-size: 8px;
}

.status-dot-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8c949c;
}

.status-dot-label.new { color: var(--blue-dark); background: #eaf5ff; }
.status-dot-label.new::before { background: var(--blue); }
.status-dot-label.in_progress { color: #7b5b0b; background: #fff5d9; }
.status-dot-label.in_progress::before { background: var(--orange); }
.status-dot-label.waiting { color: #6948b1; background: #f1ebff; }
.status-dot-label.waiting::before { background: var(--violet); }
.status-dot-label.done { color: #40805e; background: #e9f7ef; }
.status-dot-label.done::before { background: var(--green); }

.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;
  background: #f8f9fa;
}

.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: 67px 72px minmax(0, 1fr) auto;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.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);
}

.chat-header-spacer {
  flex: 1;
}

.status-select-wrap select {
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8f9fa;
  font-size: 10px;
  font-weight: 650;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: transparent;
  color: #727b84;
}

.icon-button:hover {
  background: var(--surface-soft);
}

.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;
  transition: border-color 0.15s, transform 0.15s;
}

.listing-card[href]:hover {
  border-color: #b7daf7;
  transform: translateY(-1px);
}

.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;
}

.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); }

.composer-hint {
  width: min(100%, 780px);
  margin: 5px auto 0;
  color: #a0a7ae;
  text-align: right;
  font-size: 8px;
}

.details-drawer {
  position: absolute;
  z-index: 20;
  inset: 0 0 0 auto;
  width: min(330px, 92%);
  padding: 0 18px 20px;
  border-left: 1px solid var(--line);
  background: white;
  box-shadow: -18px 0 45px rgba(35, 48, 61, 0.12);
  transform: translateX(105%);
  transition: transform 0.22s ease;
}

.details-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

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

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

.detail-section {
  padding: 17px 2px;
  border-bottom: 1px solid var(--line);
}

.detail-section small {
  display: block;
  margin-bottom: 9px;
  color: #939aa2;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.detail-section strong,
.detail-section span {
  display: block;
  font-size: 11px;
}

.detail-section span {
  margin-top: 5px;
  color: var(--muted);
}

.detail-note {
  width: 100%;
  min-height: 76px;
  padding: 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 10px;
}

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

.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;
}

.settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 22px 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.settings-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.settings-account-list {
  display: grid;
  gap: 9px;
}

.settings-account-card {
  display: grid;
  grid-template-columns: 42px minmax(150px, 1fr) minmax(180px, 220px);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.settings-ip-control {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.settings-ip-control > span {
  padding-left: 2px;
}

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

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

.settings-account-card .account-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.settings-account-copy strong {
  display: block;
  font-size: 12px;
}

.settings-account-copy span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.settings-card-actions {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.settings-card-actions button {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  color: #69727c;
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 700;
}

.settings-card-actions button:hover { background: #e9edf0; }
.settings-card-actions button.danger { color: var(--red); background: #fff0f1; }

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

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

.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;
  animation: toast-in 0.2s ease-out;
}

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

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

.mobile-nav,
.mobile-panel-scrim {
  display: none;
}

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

@media (max-width: 1100px) {
  .workspace-grid {
    grid-template-columns: 340px minmax(390px, 1fr);
  }

  .accounts-panel {
    position: fixed;
    z-index: 80;
    left: 0;
    top: var(--topbar-height);
    bottom: 0;
    width: 270px;
    box-shadow: 18px 0 45px rgba(34, 47, 59, 0.15);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

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

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

  .mobile-menu-button,
  .close-mobile-panel {
    display: inline-grid;
    place-items: center;
  }

  .mobile-panel-scrim {
    position: fixed;
    z-index: 70;
    inset: var(--topbar-height) 0 0;
    background: rgba(23, 33, 43, 0.35);
  }

  .mobile-panel-scrim:not(.hidden) {
    display: block;
  }
}

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

  .topbar {
    gap: 10px;
    padding: 0 11px;
  }

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

  .brand-lockup small,
  .topbar-summary,
  .desktop-only,
  .operator-avatar {
    display: none;
  }

  .brand-lockup strong { font-size: 13px; }
  .brand-mark { width: 32px; height: 32px; }
  .topbar-actions { gap: 1px; }
  .topbar-button { width: 36px; padding: 0; font-size: 15px; }

  .demo-banner {
    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 - var(--topbar-height) - 55px);
    grid-template-columns: 1fr;
  }

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

  .accounts-panel {
    bottom: 55px;
    width: min(86vw, 310px);
  }

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

  .conversation-head {
    min-height: 75px;
    padding-top: 13px;
  }

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

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

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

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

  .chat-header {
    padding: 0 10px;
  }

  .status-select-wrap select {
    width: 35px;
    padding: 0;
    color: transparent;
  }

  .status-select-wrap {
    position: relative;
  }

  .status-select-wrap::after {
    content: "◐";
    position: absolute;
    inset: 7px 0 0 11px;
    pointer-events: none;
    color: #6d7680;
    font-size: 13px;
  }

  .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; }
  .composer-hint { 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;
  }

  .settings-toolbar {
    align-items: start;
    flex-direction: column;
  }

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

  .settings-ip-control {
    grid-column: 1 / -1;
  }

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

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

  .settings-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .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;
  }
  .brand-lockup--login { margin-bottom: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
