:root {
  --bg-app: #071113;
  --bg-panel: #151718;
  --bg-header: #202224;
  --bg-card: #242628;
  --bg-card-hover: #2a2d2f;
  --bg-chat: #071113;
  --chat-wallpaper-base: #0b0b0b;
  --chat-wallpaper-image: url("/background/background-chat.jpg");
  --incoming-bubble-bg: rgba(34, 38, 40, 0.96);
  --outgoing-bubble-bg: #154d37;
  --bubble-in: var(--incoming-bubble-bg);
  --bubble-out: var(--outgoing-bubble-bg);
  --bubble-out-solid: var(--outgoing-bubble-bg);
  --text-main: #e9edef;
  --text-secondary: #aebac1;
  --text-muted: #8696a0;
  --border-soft: rgba(255, 255, 255, 0.07);
  --accent: #00a884;
  --accent-soft: rgba(0, 168, 132, 0.2);
  --success: #00a884;
  --warning: #ffd279;
  --danger: #ff6b6b;
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  --bg: var(--bg-app);
  --surface: var(--bg-panel);
  --surface-strong: var(--bg-card);
  --line: var(--border-soft);
  --text: var(--text-main);
  --muted: var(--text-muted);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #151718;
  background-color: #151718;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background-color: #151718;
  background:
    radial-gradient(circle at top left, rgba(42, 210, 97, 0.06), transparent 18%),
    linear-gradient(180deg, #141617, #071113 54%, #071113);
}

body.job-feed-drawer-open {
  overflow: hidden;
}

button,
textarea,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(circle at 12% 18%, rgba(37, 211, 102, 0.16), transparent 26%),
    radial-gradient(circle at 78% 20%, rgba(27, 124, 181, 0.14), transparent 24%),
    linear-gradient(180deg, #0d171d 0%, #0b141a 58%, #091116 100%);
}

.login-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 440px);
  gap: 40px;
  align-items: center;
}

.login-intro-panel {
  padding: 24px 8px 24px 0;
  animation: loginCardReveal 0.6s ease-out both;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #d8efe8;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}

.login-intro-copy {
  margin-top: 26px;
  max-width: 620px;
}

.login-intro-copy h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.login-intro-copy .muted {
  margin: 18px 0 0;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(233, 237, 239, 0.78);
}

.login-feature-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.login-card {
  width: min(440px, 100%);
  justify-self: end;
  background: rgba(17, 27, 33, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  padding: 34px 30px 26px;
  animation: loginCardReveal 0.58s ease-out both;
}

.login-feature-card {
  min-height: 124px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: rgba(17, 27, 33, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.login-feature-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 10px;
}

.login-feature-card .meta {
  color: rgba(174, 186, 193, 0.82);
  line-height: 1.5;
}

.login-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 36px;
}

.login-brand-logo {
  width: clamp(110px, 18vw, 140px);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 18px rgba(37, 211, 102, 0.22));
  transition: filter 0.18s ease, transform 0.18s ease;
}

.login-brand-logo:hover {
  filter: drop-shadow(0 0 22px rgba(37, 211, 102, 0.3));
  transform: translateY(-1px);
}

.login-card-copy {
  text-align: center;
  margin-bottom: 24px;
}

.login-card-copy h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.login-card-copy .muted {
  margin: 12px auto 0;
  max-width: 320px;
  line-height: 1.55;
}

@keyframes loginCardReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  color: rgba(233, 237, 239, 0.9);
  font-size: 14px;
}

.field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(11, 20, 26, 0.9);
  color: var(--text);
  padding: 14px 16px;
}

.password-field input::placeholder {
  color: transparent;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 86px;
}

.password-field input:focus,
.password-field input:not(:placeholder-shown) {
  background: #ffffff;
  color: #111b21;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.5) !important;
  z-index: 1;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.1) !important;
}

.password-field input:focus + .password-toggle,
.password-field input:not(:placeholder-shown) + .password-toggle {
  color: rgba(0, 0, 0, 0.6) !important;
}

.login-submit-button {
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  background: linear-gradient(135deg, #00a884, #25d366);
  color: #06281f;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 34px rgba(0, 168, 132, 0.24);
}

.error-text {
  color: var(--danger);
  min-height: 20px;
  margin: 12px 0 0;
}

.login-footer-note {
  margin: 18px 0 0;
  text-align: center;
  color: rgba(134, 150, 160, 0.9);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: none;
}

.shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar,
.workspace {
  padding: 20px;
  min-height: 0;
}

.sidebar {
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(25, 27, 28, 0.985), rgba(21, 23, 24, 0.985)),
    var(--bg-panel);
  backdrop-filter: blur(18px);
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  overflow: hidden;
}

.inbox-workspace {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  flex: 1;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 0;
}

.brand,
.panel-title-row,
.chat-header,
.composer-actions,
.view-switcher-inner,
.conversation-item,
.message-card,
.job-item,
.quick-reply {
  display: flex;
}

.brand,
.panel-title-row,
.chat-header,
.composer-actions,
.view-switcher-inner {
  align-items: center;
  justify-content: space-between;
}

.brand {
  margin-bottom: 20px;
}

.brand h1,
.panel-title-row h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 900px) {
  .login-view {
    padding: 20px;
  }

  .login-layout {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 460px;
  }

  .login-intro-panel {
    display: none;
  }

  .login-card {
    justify-self: stretch;
    width: 100%;
    padding: 30px 22px 22px;
  }

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

  .login-brand-logo {
    width: 118px;
  }

  .login-card-copy h2 {
    font-size: 28px;
  }
}

@media (min-width: 700px) and (max-width: 1179px) {
  #inboxWorkspace .chat-bubble {
    max-width: min(78%, calc(100% - 18px));
  }
}

.panel-title-row {
  padding: 18px 20px 0;
}

.conversations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conversation-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conversation-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.conversation-drawer-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.conversation-drawer-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.conversation-drawer-actions button,
.conversation-drawer-actions .unread-global {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.conversations-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.conversations-title h2 {
  margin: 0;
}

.unread-global {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.unread-global svg {
  width: 18px;
  height: 18px;
  color: #e9edef;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.unread-global-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  max-width: 40px;
  animation: pulse 1.2s ease;
  overflow: hidden;
}

.unread-global-badge,
.conversation-filter-badge,
.unread-badge,
.chat-header-more-actions-badge,
.unread-conversation-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #25d366;
  color: #06140f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(17, 27, 33, 0.92), 0 8px 16px rgba(37, 211, 102, 0.28);
}

.conversation-kind-badge {
  margin-top: 4px;
  align-self: flex-start;
}

.is-group-avatar .avatar-fallback {
  background: rgba(0, 168, 132, 0.16);
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes newMessagePulse {
  0% {
    transform: scale(1);
    box-shadow: inset 0 0 0 1px rgba(0, 200, 160, 0.35), 0 0 0 0 rgba(0, 200, 160, 0.28);
  }
  45% {
    transform: scale(1.01);
    box-shadow: inset 0 0 0 1px rgba(0, 200, 160, 0.45), 0 0 0 10px rgba(0, 200, 160, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: inset 0 0 0 1px rgba(0, 200, 160, 0.35), 0 0 0 0 rgba(0, 200, 160, 0);
  }
}

.gateway-panel,
.admin-panel,
.jobs-panel,
.view-switcher {
  margin-bottom: 20px;
  padding-bottom: 18px;
}

.view-switcher {
  margin-bottom: 0;
  padding: 14px 18px;
}

.view-switcher-inner {
  justify-content: flex-start;
  gap: 10px;
}

.active-view {
  background: var(--accent) !important;
  color: #06281f !important;
}

.gateway-meta,
.stats-grid,
.quick-replies,
.conversation-items,
.message-list,
.job-feed,
.quick-reply-list {
  padding: 18px 20px 20px;
}

.gateway-qr {
  padding: 0 20px 20px;
  text-align: center;
}

.gateway-qr img {
  width: 220px;
  max-width: 100%;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #111b21;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(66, 42, 20, 0.08);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--accent-soft);
  color: var(--text-main);
  font-size: 12px;
  font-family: "IBM Plex Mono", monospace;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card,
.quick-reply,
.conversation-item,
.job-item,
.message-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.stat-card {
  padding: 12px;
}

.stat-card strong,
.conversation-item strong,
.message-card strong {
  display: block;
  margin-bottom: 4px;
}

.quick-replies,
.conversation-items,
.message-list,
.job-feed,
.quick-reply-list {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.conversation-items {
  grid-auto-rows: max-content;
  align-content: start;
  justify-items: stretch;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.conversation-panel-toggle {
  display: none;
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  flex: 0 0 auto;
}

.conversation-panel-toggle .label {
  display: none;
}

.conversation-panel-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.conversation-sync-btn {
  width: 36px;
  height: 36px;
}

.conversation-sync-btn.is-syncing svg {
  animation: spin 0.9s linear infinite;
}

.conversation-search-row {
  padding: 12px 20px 0;
}

.conversation-filter-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.conversation-filter-tabs::-webkit-scrollbar {
  display: none;
}

.conversation-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  position: relative;
  overflow: visible;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.conversation-filter-tab-label {
  line-height: 1;
}

.conversation-filter-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 20px 8px;
  color: rgba(174, 186, 193, 0.62);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 500;
}

.conversation-filter-hint-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.conversation-filter-tab-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.conversation-filter-tab-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.conversation-filter-tab.active {
  border-color: rgba(0, 168, 132, 0.42);
  background: rgba(0, 168, 132, 0.14);
  color: #e9edef;
  box-shadow: inset 0 0 0 1px rgba(0, 168, 132, 0.18);
}

.conversation-filter-tab-archive {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.conversation-context-label {
  display: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(174, 186, 193, 0.72);
  margin-bottom: 6px;
}

.conversation-rail {
  display: none;
}

.conversation-rail-top {
  display: grid;
  gap: 12px;
  padding: 12px 10px;
  flex: 0 0 auto;
}

.conversation-rail-tabs {
  display: grid;
  gap: 8px;
}

.conversation-rail-footer {
  display: none;
  margin-top: auto;
  padding: 10px 6px 12px;
  align-items: center;
  justify-items: center;
  gap: 10px;
}

.conversation-rail-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 0 4px rgba(255, 255, 255, 0.02);
}

.conversation-gateway-dot {
  display: none;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 0 4px rgba(255, 255, 255, 0.02);
  flex: 0 0 auto;
}

.conversation-rail-status-dot.status-connected,
.conversation-rail-status-dot.status-stale,
.conversation-rail-status-dot.status-reconnecting,
.conversation-rail-status-dot.status-idle,
.conversation-rail-status-dot.status-unknown,
.conversation-rail-status-dot.status-disconnected,
.conversation-rail-status-dot.status-error,
.conversation-rail-status-dot.status-failed {
  background: currentColor;
}

.conversation-gateway-dot.status-connected,
.conversation-gateway-dot.status-stale,
.conversation-gateway-dot.status-reconnecting,
.conversation-gateway-dot.status-idle,
.conversation-gateway-dot.status-unknown,
.conversation-gateway-dot.status-disconnected,
.conversation-gateway-dot.status-error,
.conversation-gateway-dot.status-failed {
  background: currentColor;
}

.conversation-rail-logout-btn {
  min-height: 40px;
  width: 100%;
  border-radius: 14px;
}

.conversation-rail-tab {
  position: relative;
  width: 100%;
  min-height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.conversation-rail-tab:hover,
.conversation-rail-tab:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.conversation-rail-tab.active {
  color: #e9edef;
  background: rgba(0, 168, 132, 0.16);
  border-color: rgba(0, 168, 132, 0.38);
  box-shadow: inset 3px 0 0 rgba(0, 168, 132, 0.8);
}

.conversation-rail-tab .conversation-filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  padding: 0 4px;
  font-size: 10px;
}

.conversation-filter-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  z-index: 2;
}

.conversation-search-field {
  margin-bottom: 0;
  width: 100%;
}

.conversation-search-input-wrap {
  position: relative;
  width: 100%;
}

.conversation-search {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  padding: 0 48px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #101a1d;
  color: var(--text-main);
}

.conversation-search:focus {
  border-color: rgba(42, 210, 97, 0.34);
  box-shadow: 0 0 0 3px rgba(42, 210, 97, 0.08);
  outline: none;
}

.conversation-search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.conversation-items,
.job-feed {
  flex: 1;
  overflow-y: auto;
}

.conversation-items,
.message-list,
.job-feed,
.quick-reply-list,
.gallery-panel-content,
.emoji-picker-content,
.contacts-list,
.topbar-drawer,
.job-feed-drawer-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-gutter: stable;
}

.conversation-items,
.message-list,
.quick-reply-list,
.contacts-list,
.job-feed,
.job-feed-drawer-body {
  padding-right: 4px;
}

.conversation-items::-webkit-scrollbar,
.message-list::-webkit-scrollbar,
.job-feed::-webkit-scrollbar,
.quick-reply-list::-webkit-scrollbar,
.gallery-panel-content::-webkit-scrollbar,
.emoji-picker-content::-webkit-scrollbar,
.contacts-list::-webkit-scrollbar,
.topbar-drawer::-webkit-scrollbar,
.job-feed-drawer-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.conversation-items::-webkit-scrollbar-track,
.message-list::-webkit-scrollbar-track,
.job-feed::-webkit-scrollbar-track,
.quick-reply-list::-webkit-scrollbar-track,
.gallery-panel-content::-webkit-scrollbar-track,
.emoji-picker-content::-webkit-scrollbar-track,
.contacts-list::-webkit-scrollbar-track,
.topbar-drawer::-webkit-scrollbar-track,
.job-feed-drawer-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
}

.conversation-items::-webkit-scrollbar-thumb,
.message-list::-webkit-scrollbar-thumb,
.job-feed::-webkit-scrollbar-thumb,
.quick-reply-list::-webkit-scrollbar-thumb,
.gallery-panel-content::-webkit-scrollbar-thumb,
.emoji-picker-content::-webkit-scrollbar-thumb,
.contacts-list::-webkit-scrollbar-thumb,
.topbar-drawer::-webkit-scrollbar-thumb,
.job-feed-drawer-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.conversation-items:hover::-webkit-scrollbar-thumb,
.message-list:hover::-webkit-scrollbar-thumb,
.job-feed:hover::-webkit-scrollbar-thumb,
.quick-reply-list:hover::-webkit-scrollbar-thumb,
.gallery-panel-content:hover::-webkit-scrollbar-thumb,
.emoji-picker-content:hover::-webkit-scrollbar-thumb,
.contacts-list:hover::-webkit-scrollbar-thumb,
.topbar-drawer:hover::-webkit-scrollbar-thumb,
.job-feed-drawer-body:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
}

.app-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 29, 0.96);
  color: var(--text-main);
  box-shadow: var(--shadow);
}

.app-toast.is-error {
  border-color: rgba(255, 107, 107, 0.28);
  color: #ffd8d8;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.quick-reply,
.conversation-item,
.job-item {
  flex-direction: column;
  gap: 4px;
  padding: 12px;
}

.conversation-item {
  cursor: pointer;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-radius: 16px;
  flex: 0 0 auto;
  height: auto;
  min-height: 78px;
  max-height: none;
  align-self: start;
}

.conversation-item.compact {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 10px 8px;
  gap: 8px;
}

.conversation-list.collapsed .conversation-items {
  padding: 10px 8px 12px;
  gap: 6px;
  align-content: start;
  justify-items: center;
}

.conversation-list.collapsed {
  width: 72px;
  flex-shrink: 0;
  margin-right: 0;
}

.conversation-list.collapsed .conversation-item {
  height: 56px;
  min-height: 56px;
  padding: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  border-radius: 16px;
  position: relative;
}

.conversation-list.collapsed .conversation-item:not(.active) {
  background: rgba(255, 250, 244, 0.72);
}

.conversation-list.collapsed .conversation-item.compact .conversation-avatar,
.conversation-list.collapsed .conversation-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.conversation-list.collapsed .avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.conversation-list.collapsed .conversation-main,
.conversation-list.collapsed .conversation-content,
.conversation-list.collapsed .conversation-time,
.conversation-list.collapsed .conversation-preview {
  display: none;
}

.conversation-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  position: relative;
}

.conversation-search-section {
  display: grid;
  gap: 8px;
}

.conversation-search-section-title {
  padding: 4px 6px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.conversation-search-section-list {
  display: grid;
  gap: 8px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(32, 44, 51, 0.98), rgba(17, 27, 33, 0.98));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #7b6a5c, #5e5147);
  color: rgba(255, 250, 244, 0.92);
}

.avatar-initials {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.avatar.has-image .avatar-fallback {
  display: none;
}

.avatar-icon {
  width: 58%;
  height: 58%;
  fill: currentColor;
}

.conversation-avatar {
  width: 42px;
  height: 42px;
}

.conversation-topline,
.conversation-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.conversation-name,
.conversation-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.conversation-preview-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview-draft-label {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 600;
}

.conversation-preview-draft-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.conversation-preview-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.conversation-preview-status.is-sent {
  color: rgba(233, 237, 239, 0.6);
}

.conversation-preview-status.is-pending {
  color: rgba(233, 237, 239, 0.52);
}

.conversation-preview-status.is-delivered {
  color: rgba(233, 237, 239, 0.74);
}

.conversation-preview-status.is-read {
  color: var(--accent);
}

.conversation-preview-status.is-failed {
  color: var(--danger);
  font-weight: 700;
}

.conversation-name {
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  display: block;
  flex: 1 1 auto;
}

.conversation-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.conversation-pin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  color: rgba(174, 186, 193, 0.78);
  opacity: 0.72;
  flex: 0 0 auto;
  transform: translateY(-0.5px);
  transition: color 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.conversation-item:hover .conversation-pin-icon,
.conversation-item.active .conversation-pin-icon {
  color: rgba(233, 237, 239, 0.9);
  opacity: 1;
}

.conversation-pin-icon span {
  display: block;
}

.conversation-time {
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.1;
}

.conversation-meta {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.conversation-preview {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.conversation-item.has-unread-badge .conversation-preview-row,
.conversation-item.has-unread-badge .conversation-opened-by {
  padding-right: 42px;
}

.conversation-preview mark,
.conversation-name mark,
.conversation-subline mark {
  background: rgba(0, 168, 132, 0.22);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

.conversation-subline,
.conversation-assignee {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.15;
}

.conversation-presence {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.15;
  color: rgba(174, 186, 193, 0.64);
}

.conversation-opened-by {
  margin-top: 1px;
  font-weight: 500;
  color: rgba(42, 210, 97, 0.72);
}

.conversation-indicators {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 24px;
}

.conversation-item.unread .conversation-name {
  color: #e9edef;
  font-weight: 700;
}

.conversation-item.unread .conversation-preview {
  color: #e9edef;
  font-weight: 600;
}

.conversation-item.unread .conversation-time {
  color: #7ef0d2;
  font-weight: 700;
}

.conversation-item.unread .conversation-opened-by {
  color: rgba(42, 210, 97, 0.78);
  font-weight: 500;
}

.conversation-card.is-unread,
.conversation-item.is-unread,
.conversation-item.unread {
  background: rgba(0, 128, 105, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 200, 160, 0.35);
  border-color: rgba(0, 200, 160, 0.35);
}

.conversation-card.new-message-pulse,
.conversation-item.new-message-pulse {
  animation: newMessagePulse 900ms ease;
}

.unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.18);
  flex-shrink: 0;
}

.unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
}

.conversation-unread-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  font-weight: 800;
  color: #062b1f;
  box-shadow: 0 0 0 2px rgba(17, 27, 33, 0.92), 0 8px 16px rgba(37, 211, 102, 0.28);
}

.conversation-item.active {
  background: rgba(0, 255, 180, 0.06);
  box-shadow: inset 3px 0 0 rgba(0, 168, 132, 0.7);
  border-radius: 18px;
}

.conversation-list.collapsed .conversation-item.active {
  background: rgba(0, 255, 180, 0.1);
  box-shadow: inset 4px 0 0 rgba(0, 168, 132, 0.88), 0 0 18px rgba(0, 168, 132, 0.14);
}

.conversation-item.active .conversation-title-wrap {
  padding-left: 2px;
}

.conversation-item.compact .conversation-avatar {
  width: 48px;
  height: 48px;
}

.conversation-avatar-stack {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.conversation-item.compact .conversation-main {
  display: none;
}

.conversation-item.compact .avatar-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  font-size: 10px;
  padding: 0 4px;
}

.conversation-active-indicator {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: #7ef0d2;
  box-shadow: 0 0 0 1px rgba(15, 23, 29, 0.92);
}

.conversation-item.compact .unread-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

.meta,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.chat-room {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  min-width: 0;
  overflow: visible;
}

.chat-room.panel {
  overflow: visible;
  position: relative;
}

.chat-room-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-color: var(--chat-wallpaper-base);
  background-image: var(--chat-wallpaper-image);
  background-position: center top;
  background-size: clamp(760px, 62vw, 1100px) auto;
  background-repeat: repeat;
}

.chat-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  overflow: visible;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  position: relative;
  z-index: 14;
}

.chat-header.search-active {
  gap: 8px;
}

.chat-header.search-active .chat-title-area,
.chat-header.search-active .normal-header-actions {
  display: none;
}

.chat-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  position: relative;
  flex-wrap: nowrap;
}

.chat-wa-pinned-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 211, 102, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(8, 29, 21, 0.96), rgba(10, 22, 18, 0.94));
  box-shadow: inset 0 0 0 1px rgba(37, 211, 102, 0.08);
}

.chat-wa-pinned-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  flex: 1 1 auto;
}

.chat-wa-pinned-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.16);
  color: #c8ffe0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-wa-pinned-preview {
  color: #e9fdf3;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.chat-wa-pinned-meta {
  color: rgba(201, 235, 220, 0.72);
  font-size: 11px;
  line-height: 1.3;
}

.chat-wa-pinned-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.chat-wa-pinned-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
  white-space: nowrap;
}

.chat-wa-pinned-dismiss-btn {
  color: rgba(233, 237, 239, 0.82);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.chat-header-left .topbar-trigger {
  width: 34px;
  height: 34px;
  padding: 0;
  flex: 0 0 auto;
}

.topbar-trigger svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.chat-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.chat-header-meta {
  min-width: 0;
}

.chat-header-avatar {
  width: 38px;
  height: 38px;
}

.chat-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-meta-line {
  font-size: 12px;
  line-height: 1.25;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  justify-content: flex-end;
  position: relative;
  overflow: visible;
  min-width: 0;
}

.normal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 0 auto;
}

.chat-header-action-btn {
  width: 34px;
  height: 34px;
}

.chat-header-danger-btn {
  color: #fca5a5;
}

.chat-header-danger-btn:hover,
.chat-header-danger-btn:focus-visible {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
}

.chat-header-compact-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
}

.job-feed-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-width: 0;
}

.job-feed-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-feed-trigger svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-header-search-layer {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  z-index: 12;
}

.chat-header-more-actions-layer {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 12;
}

.chat-header-more-actions-trigger svg,
.chat-header-more-actions-item svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-header-more-actions-trigger svg {
  width: 18px;
  height: 18px;
  stroke: none;
  fill: currentColor;
}

.chat-header-more-actions-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 176px;
  max-width: min(240px, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(36, 38, 40, 0.985), rgba(24, 26, 27, 0.985)),
    var(--bg-panel);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
  display: grid;
  gap: 4px;
  z-index: 80;
}

.chat-header-more-actions-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text-main);
  padding: 9px 10px;
  font-size: 13px;
}

.chat-header-more-actions-item span:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-header-more-actions-item:hover,
.chat-header-more-actions-item:focus-visible {
  background: var(--bg-card);
}

.chat-header-more-actions-badge {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
}

.chat-notes-layer {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 12;
}

.chat-notes-trigger {
  position: relative;
}

.chat-notes-trigger svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-notes-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f59e0b;
  color: #231102;
  box-shadow: 0 0 0 2px rgba(17, 27, 33, 0.92);
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
  text-align: center;
}

.chat-notes-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(300px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(36, 38, 40, 0.985), rgba(24, 26, 27, 0.985)),
    var(--bg-panel);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  z-index: 80;
}

.chat-notes-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.chat-notes-header-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chat-notes-header-copy strong {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-main);
}

.chat-notes-header-copy .meta {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}

.chat-notes-close-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 999px;
  flex: 0 0 auto;
}

.chat-notes-close-btn svg {
  width: 14px;
  height: 14px;
}

.chat-notes-empty,
.chat-notes-compose-meta,
.chat-note-meta,
.chat-notes-error {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}

.chat-notes-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.chat-note-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-note-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.chat-note-text {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-note-delete-btn {
  min-width: 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  flex: 0 0 auto;
}

.chat-notes-add-btn {
  min-height: 30px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text-main);
}

.chat-notes-compose {
  display: grid;
  gap: 6px;
}

.chat-notes-input {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 10px 12px;
  outline: none;
}

.chat-notes-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.12);
}

.chat-header-assignment {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  transform: translateY(-1px);
}

.chat-assignment-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1;
  min-width: 0;
}

.chat-assignment-status {
  max-width: 180px;
  min-width: 0;
}

.assignment-pill {
  max-width: 100%;
  padding: 0 8px;
  margin-top: -5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.assignment-dot {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.5);
}

.assignment-text {
  min-width: 0;
  font-size: 10.5px;
  line-height: 1.1;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-assignment-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-assignment-btn {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.chat-assignment-btn:hover,
.chat-assignment-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.chat-assignment-picker-wrap {
  position: relative;
  display: inline-flex;
}

.chat-assignment-picker {
  position: fixed;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 32px));
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 29, 0.98);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  z-index: 80;
}

.chat-assignment-option,
.chat-assignment-picker-empty {
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  min-width: 0;
}

.chat-assignment-option {
  border: 0;
  background: transparent;
  color: var(--text-main);
}

.chat-assignment-option:hover,
.chat-assignment-option:focus-visible {
  background: rgba(255, 255, 255, 0.05);
}

.chat-assignment-option strong {
  display: block;
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
}

.chat-assignment-option span,
.chat-assignment-picker-empty {
  display: block;
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-muted);
}

.chat-search-popover {
  position: absolute;
  top: 50%;
  right: calc(100% + 8px);
  transform: translateY(-50%);
  z-index: 13;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-panel);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.chat-search-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.chat-search-input {
  height: 34px;
  min-width: 200px;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #111b21;
  color: var(--text-main);
  padding: 0 12px;
  box-shadow: none;
  outline: none;
}

.chat-search-toolbar .chat-search-input {
  flex: 1 1 auto;
  min-width: 120px;
}

.chat-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.12);
}

.chat-search-count {
  min-width: 72px;
  text-align: center;
}

.chat-search-status {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 13px;
}

.chat-search-close {
  width: 34px;
  height: 34px;
}

.chat-search-nav,
.chat-search-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.message-list {
  flex: 1;
  position: relative;
  z-index: 1;
  align-content: start;
  justify-items: stretch;
  overflow-y: auto;
  overflow-x: hidden;
  isolation: isolate;
  padding: 18px 8px 22px;
  scroll-padding-top: 18px;
  background: transparent;
}

.message-list::before {
  content: none;
}

.message-list::after {
  content: none;
}

.message-list > * {
  position: relative;
  z-index: 1;
}

.scroll-to-latest-btn {
  position: absolute;
  right: 18px;
  bottom: 94px;
  z-index: 18;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(126, 240, 210, 0.28);
  border-radius: 999px;
  background: rgba(7, 17, 19, 0.96);
  color: #eafff7;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.scroll-to-latest-btn:hover,
.scroll-to-latest-btn:focus-visible {
  background: rgba(11, 27, 31, 0.98);
  border-color: rgba(126, 240, 210, 0.44);
}

.scroll-to-latest-copy {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.scroll-to-latest-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #062b1f;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.chat-empty-state {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
}

.chat-empty-state strong {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.chat-empty-state .meta {
  max-width: 280px;
  line-height: 1.45;
}

.message-row {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 2px 16px;
  box-sizing: border-box;
  min-width: 0;
  overflow: visible;
}

.message-row.group-start {
  margin-top: 6px;
}

.message-row.group-continued {
  margin-top: 0;
}

.message-row.inbound {
  justify-content: flex-start;
}

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

.date-separator-row,
.unread-separator-row {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.message-list-sticky-date,
.date-separator-row {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}

.message-list-sticky-date {
  position: sticky;
  top: 0;
  z-index: 6;
  margin: 0 0 12px;
}

.date-separator-row {
  position: relative;
  z-index: 0;
  margin: 10px 0 12px;
}

.message-list-sticky-date::before,
.message-list-sticky-date::after,
.date-separator-row::before,
.date-separator-row::after {
  content: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.message-list-sticky-date-pill,
.date-separator {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  margin: 0 auto;
  padding: 6px 12px;
  min-height: 28px;
  max-width: min(100%, 240px);
  border-radius: 999px;
  background: #202c33;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e9edef;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.date-separator-row.is-active-sticky-source .date-separator {
  opacity: 0;
}

.unread-separator-row {
  gap: 10px;
  margin: 12px 0;
}

.unread-separator-row::before,
.unread-separator-row::after {
  content: "";
  width: 80px;
  max-width: 18%;
  height: 1px;
  background: rgba(0, 168, 132, 0.35);
}

.unread-separator {
  align-self: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 168, 132, 0.16);
  color: #d9fdd3;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.message-card {
  display: block;
  min-width: 0;
  max-width: 100%;
  cursor: default;
  animation: bubbleFadeIn 0.18s ease;
  position: relative;
  margin: 0;
  overflow: visible;
  pointer-events: auto;
}

.message-bubble-wrapper {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.message-bubble-wrapper.outbound {
  text-align: right;
}

.message-card-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.message-card-head strong {
  flex: 1;
  min-width: 0;
}

.message-card-head.has-label {
  margin-bottom: 1px;
}

.message-card-head.no-label {
  gap: 0;
}

.message-card-head.is-group-continuation {
  display: none;
}

.message-card-head.no-label .bubble-label-spacer {
  display: none;
}

.bubble-label-spacer {
  flex: 1;
  min-width: 0;
}

.chat-bubble {
  display: inline-block;
  width: fit-content;
  min-width: 0;
  min-height: 0;
  max-width: min(72%, 560px, calc(100% - 10px));
  padding: 6px 8px 5px 10px;
  position: relative;
  border-radius: 8px;
  border: 1px solid transparent;
  box-sizing: border-box;
  white-space: normal;
  overflow: visible;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
  min-inline-size: 0;
  inset: auto;
  left: auto;
  right: auto;
  transform: none;
  vertical-align: top;
  text-align: left;
}

.chat-bubble.has-media,
.chat-bubble.has-story,
.chat-bubble.has-audio,
.chat-bubble.has-document {
  min-width: min(220px, 100%);
  max-width: min(70%, 520px, calc(100% - 10px));
}

.chat-bubble.has-document {
  min-width: min(180px, 100%);
  max-width: min(340px, calc(100% - 10px));
}

.chat-bubble.has-image-media {
  padding: 3px;
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  border-radius: 11px;
}

.message-row.outbound .chat-bubble.has-image-media {
  padding-right: 3px;
}

.message-row.inbound .chat-bubble {
  margin-left: 0;
  margin-right: auto;
}

.message-row.outbound .chat-bubble {
  margin-left: auto;
  margin-right: 0;
  padding-right: 10px;
  text-align: left;
}

.chat-bubble.group-middle .message-forwarded-label,
.chat-bubble.group-last .message-forwarded-label,
.chat-bubble.group-middle .message-quoted,
.chat-bubble.group-last .message-quoted,
.chat-bubble.group-middle .message-text,
.chat-bubble.group-last .message-text,
.chat-bubble.group-middle .message-media,
.chat-bubble.group-last .message-media,
.chat-bubble.group-middle .bubble-meta,
.chat-bubble.group-last .bubble-meta {
  margin-top: 0;
}

.chat-bubble::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
}

.chat-bubble::before,
.message-card::before,
.message-card::after,
.bubble-overlay,
.bubble-glass {
  pointer-events: none !important;
}

.chat-bubble.group-last::after,
.chat-bubble.group-standalone::after {
  opacity: 1;
}

.bubble-in {
  background: var(--bubble-in);
  color: #e9edef;
  border-color: rgba(255, 255, 255, 0.05);
  border-radius: 12px 12px 12px 4px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.bubble-in::after {
  left: 0;
  transform: translateX(-100%);
  border-width: 0 8px 8px 0;
  border-style: solid;
  border-color: transparent var(--bubble-in) transparent transparent;
}

.bubble-out {
  background: var(--bubble-out);
  color: #e9edef;
  border-color: rgba(0, 0, 0, 0.14);
  border-radius: 12px 12px 4px 12px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.bubble-out::after {
  right: 0;
  transform: translateX(100%);
  border-width: 0 0 8px 8px;
  border-style: solid;
  border-color: transparent transparent transparent var(--bubble-out-solid);
}

.bubble-label {
  display: block;
  margin: 0;
  padding: 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
  opacity: 0.7;
  letter-spacing: 0.01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bubble-meta {
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
  gap: 4px;
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.65;
  margin-top: 4px;
  white-space: nowrap;
  text-align: right;
}

.bubble-meta-time,
.bubble-meta-status {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.bubble-meta-edited {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.76;
}

.bubble-meta-status {
  font-size: 12px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.bubble-meta-status.is-sent {
  color: rgba(233, 237, 239, 0.72);
}

.bubble-meta-status.is-pending {
  color: rgba(233, 237, 239, 0.74);
}

.bubble-meta-status.is-delivered {
  color: rgba(233, 237, 239, 0.82);
}

.bubble-meta-status.is-read {
  color: var(--accent);
}

.bubble-meta-status.is-failed {
  color: #ffb3b3;
}

.message-card.selected {
  box-shadow:
    inset 0 0 0 1px rgba(0, 168, 132, 0.9),
    0 0 0 3px rgba(0, 168, 132, 0.12);
}

.message-bubble {
  position: relative;
}

.message-bubble-content {
  display: block;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  text-align: left;
}

.message-select-checkbox {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.message-select-checkbox input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.message-select-checkbox span {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: block;
  background: rgba(255, 255, 255, 0.02);
}

.message-select-checkbox input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.12);
}

.message-select-indicator {
  position: absolute;
  top: 8px;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.02);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.message-row.outbound .message-select-indicator {
  left: -28px;
  right: auto;
}

.message-row.inbound .message-select-indicator {
  left: auto;
  right: -28px;
}

.message-select-indicator::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(-45deg) translateY(-1px);
}

.message-select-indicator.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.12);
}

.message-select-indicator.is-selected::after {
  border-left-color: #06281f;
  border-bottom-color: #06281f;
}

.message-action-trigger,
.message-action-button {
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 50%;
  z-index: 5;
  border-radius: 999px;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.message-action-trigger,
.message-action-button {
  border: 0;
  background: rgba(17, 27, 33, 0.5) !important;
  color: rgba(233, 237, 239, 0.82) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16) !important;
}

.message-bubble-wrapper:hover .message-action-trigger,
.message-bubble-wrapper:hover .message-action-button,
.message-bubble-wrapper.is-active .message-action-trigger,
.message-bubble-wrapper.is-active .message-action-button,
.message-bubble-wrapper.is-menu-open .message-action-trigger,
.message-bubble-wrapper.is-menu-open .message-action-button,
.message-bubble-wrapper:focus-within .message-action-trigger,
.message-bubble-wrapper:focus-within .message-action-button,
.message-action-trigger:focus-visible,
.message-action-button:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(calc(-50% - 1px));
}

.message-card.select-mode .message-action-trigger {
  display: none;
}

.message-card.select-mode .message-action-button {
  display: none;
}

.message-action-trigger:hover,
.message-action-trigger:focus-visible,
.message-action-button:hover,
.message-action-button:focus-visible {
  background: rgba(17, 27, 33, 0.78) !important;
  color: rgba(233, 237, 239, 0.96) !important;
}

.message-action-trigger svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-bubble[data-bubble-layout="text-only-inline"] .message-bubble-content {
  display: inline;
}

.chat-bubble[data-bubble-layout="text-only-inline"] .message-text {
  display: inline;
}

.chat-bubble[data-bubble-layout="text-only-inline"] .bubble-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  margin-top: 0;
  margin-left: 8px;
  vertical-align: baseline;
  line-height: 1;
  text-align: left;
}

.message-forwarded-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.message-select-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 29, 0.96);
  backdrop-filter: blur(10px);
}

.message-select-toolbar-copy {
  display: grid;
  gap: 2px;
}

.message-select-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-card.search-match {
  box-shadow: inset 0 0 0 1px rgba(0, 168, 132, 0.42);
}

.message-card.search-active {
  box-shadow:
    inset 0 0 0 1px rgba(0, 168, 132, 0.8),
    0 0 0 3px rgba(0, 168, 132, 0.14);
}

.message-quoted,
.reply-preview {
  border-left: 3px solid #00a884;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9px;
}

.message-quoted {
  display: grid;
  gap: 6px;
  padding: 10px 12px 10px 14px;
  max-width: 100%;
  min-width: 0;
  position: relative;
  border-left: none;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.message-quoted::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 8px;
  width: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 1;
}

.message-quoted.is-clickable {
  cursor: pointer;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.message-quoted.is-clickable:hover,
.message-quoted.is-clickable:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.message-quoted-label,
.reply-preview-label {
  font-size: 10px;
  font-weight: 600;
  color: #9ff4d8;
  opacity: 0.82;
}

.message-quoted-text,
.reply-preview-text {
  font-size: 12px;
  color: inherit;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-quoted-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  padding-left: 10px;
}

.message-quoted-text {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  margin: 0;
  padding-left: 10px;
}

.message-story-thumb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 220px;
  max-width: 100%;
  min-width: 0;
}

.message-story-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.08);
}

.message-story-media {
  display: grid;
  gap: 8px;
  width: 220px;
  max-width: 100%;
}

.message-shared-contact-card {
  display: grid;
  gap: 8px;
  width: min(280px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.message-shared-contact-card.is-loading {
  min-height: 72px;
  align-content: center;
}

.message-shared-contact-label {
  font-size: 11px;
  font-weight: 700;
  color: #9ff4d8;
}

.message-shared-contact-list {
  display: grid;
  gap: 8px;
}

.message-shared-contact-item {
  display: grid;
  gap: 6px;
}

.message-shared-contact-item + .message-shared-contact-item {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.message-shared-contact-name {
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-main);
}

.message-shared-contact-phones {
  display: grid;
  gap: 6px;
}

.message-shared-contact-phone-row {
  display: grid;
  gap: 6px;
}

.message-shared-contact-phone {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #9ff4d8;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-shared-contact-phone.is-static {
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}

.message-shared-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.message-shared-contact-action {
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1;
}

.message-location-card {
  display: grid;
  gap: 10px;
  min-width: min(280px, 72vw);
  max-width: 320px;
}

.message-location-thumb {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    #111b21;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.message-location-thumb.has-image {
  background: #111b21;
}

.message-location-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 132px;
  object-fit: cover;
}

.message-location-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 132px;
  color: rgba(233, 237, 239, 0.76);
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.05), transparent 20%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.04), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    #111b21;
}

.message-location-pin {
  font-size: 24px;
}

.message-location-placeholder-copy {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.message-location-copy {
  display: grid;
  gap: 4px;
}

.message-location-label {
  font-size: 11px;
  line-height: 1.3;
  color: rgba(233, 237, 239, 0.68);
}

.message-location-title {
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-main);
}

.message-location-address {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.message-location-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.message-location-link:hover,
.message-location-link:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

.message-story-media audio,
.message-story-video {
  width: 100%;
  max-width: 100%;
}

.message-story-video {
  max-height: 180px;
  border-radius: 10px;
  display: block;
}

.message-text {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  max-width: 100%;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
  overflow: hidden;
}

.message-text.is-revoked-text,
.chat-bubble.is-revoked .message-text {
  font-style: italic;
  color: rgba(174, 186, 193, 0.82);
}

.message-text.contains-url {
  overflow-wrap: anywhere;
}

.message-text code,
.message-quoted-text code,
.reply-preview-text code {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.message-inline-link {
  display: inline;
  max-width: 100%;
  color: #7dd3fc;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-inline-link:hover,
.message-inline-link:focus-visible {
  color: #b7f0ff;
}

.message-inline-link-phone {
  color: #86efac;
  text-decoration-color: rgba(134, 239, 172, 0.72);
}

.message-inline-link-phone:hover,
.message-inline-link-phone:focus-visible {
  color: #bbf7d0;
}

.chat-search-highlight {
  background: rgba(0, 168, 132, 0.32);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

.message-card strong,
.message-card .meta {
  min-width: 0;
}

.message-media {
  display: block;
  align-items: flex-start;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  margin-top: 1px;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.message-media-image {
  margin-top: 0;
}

.message-media-image-shell {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  border-radius: 10px;
  line-height: 0;
}

.message-album-card {
  width: min(280px, calc(100vw - 84px));
}

.message-album-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.message-album-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.message-album-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.message-album-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 17, 19, 0.56);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.message-album-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.message-album-action {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  cursor: pointer;
}

.message-album-action:hover {
  background: rgba(255, 255, 255, 0.12);
}

.message-media-fallback {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: min(280px, calc(100vw - 72px));
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.message-document-card {
  width: 100%;
  max-width: min(296px, calc(100vw - 72px));
}

.message-document-download,
.message-file-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.message-document-download:hover,
.message-file-download-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

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

.message-document-copy strong,
.message-document-copy .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.optimistic-attachment-card {
  min-width: 220px;
  display: grid;
  gap: 10px;
}

.optimistic-attachment-card.is-failed {
  opacity: 0.96;
}

.optimistic-attachment-thumb {
  max-height: 240px;
  object-fit: cover;
}

.optimistic-attachment-file {
  margin: 0;
}

.optimistic-attachment-file-icon {
  min-width: 44px;
}

.optimistic-attachment-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.optimistic-attachment-status-text {
  font-weight: 600;
}

.optimistic-attachment-status-progress {
  opacity: 0.8;
}

.optimistic-attachment-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.optimistic-attachment-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.88);
  transition: width 0.18s ease;
}

.message-card.is-optimistic-failed .optimistic-attachment-progress span {
  background: #ffb3b3;
}

.message-retry-btn {
  margin: 8px 14px 0;
  align-self: flex-start;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
}

.message-retry-btn:hover,
.message-retry-btn:focus-visible {
  background: rgba(255, 255, 255, 0.24);
}

.view-once-placeholder {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  width: min(250px, 100%);
  max-width: min(280px, calc(100vw - 72px));
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.view-once-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgba(0, 168, 132, 0.18);
  color: #d9fdd3;
}

.view-once-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.view-once-body strong {
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-media a {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: min(280px, calc(100vw - 72px));
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  text-decoration: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
  box-sizing: border-box;
}

.audio-message {
  display: grid;
  gap: 6px;
  width: auto;
  min-width: 220px;
  max-width: min(280px, 100%);
  box-sizing: border-box;
  align-self: flex-start;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.audio-message.voice-note {
  width: auto;
  min-width: 220px;
  max-width: min(280px, 100%);
  padding: 9px 11px;
  border-radius: 16px;
  background: rgba(0, 168, 132, 0.12);
}

.audio-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.audio-message audio {
  width: 100%;
  max-width: 100%;
}

.message-image {
  max-width: 280px;
  max-height: 360px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.16s ease;
}

.message-image:hover {
  transform: translateY(-1px);
}

.bubble-meta-overlay {
  position: absolute;
  right: 8px;
  bottom: 7px;
  z-index: 2;
  width: auto;
  max-width: calc(100% - 16px);
  margin-top: 0;
  padding: 4px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.58));
  color: #f5f7f8 !important;
  opacity: 1;
  gap: 3px;
  font-size: 11px;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.image-bubble-meta .bubble-meta-time,
.image-bubble-meta .bubble-meta-status {
  color: inherit !important;
  opacity: 1 !important;
}

.image-bubble-meta .bubble-meta-status {
  font-size: 11px;
}

.message-sticker-wrap {
  padding: 4px 0;
}

.message-sticker {
  width: auto;
  height: auto;
  max-width: 144px;
  max-height: 144px;
  display: block;
  cursor: pointer;
  filter: drop-shadow(0 8px 18px rgba(66, 42, 20, 0.12));
}

.message-sticker-fallback {
  min-width: 84px;
  min-height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(16, 29, 36, 0.08);
}

.message-sticker-fallback-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(17, 27, 33, 0.68);
}

.message-card .media-preview {
  max-width: 280px;
  max-height: 360px;
  width: auto;
  height: auto;
  border-radius: 10px;
  display: block;
  object-fit: contain;
}

.message-video-shell {
  display: grid;
  gap: 8px;
  max-width: 280px;
}

.message-video-placeholder {
  width: min(280px, 100%);
  min-height: 168px;
  max-height: 220px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(0, 168, 132, 0.14), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.04);
  color: inherit;
  text-align: center;
}

.message-video-placeholder:hover,
.message-video-placeholder:focus-visible {
  background:
    linear-gradient(180deg, rgba(0, 168, 132, 0.18), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.05);
}

.message-video-placeholder-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 40, 31, 0.72);
  color: #d9fdd3;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.message-video-placeholder-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.message-video-placeholder-copy strong,
.message-video-placeholder-copy .meta {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-video-download-link {
  font-size: 12px;
}

.message-story-video-placeholder {
  min-height: 112px;
}

.message-media img,
.message-media video {
  display: block;
  max-width: 280px;
  max-height: 360px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}

.message-pdf-card {
  display: grid;
  gap: 8px;
  max-width: 280px;
}

.message-pdf-thumb {
  position: relative;
  width: 280px;
  max-width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 12px;
  background: #f5f7f8;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.message-pdf-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
  pointer-events: none;
}

.message-pdf-open {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 10px;
  background: linear-gradient(180deg, rgba(6, 40, 31, 0) 45%, rgba(6, 40, 31, 0.72) 100%);
  color: #ffffff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.message-pdf-open span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
}

.message-pdf-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(196, 43, 28, 0.92);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.message-pdf-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-bubble,
.message-content,
.message-card,
.chat-bubble,
.message-media,
.message-card .media-preview,
.message-media video,
.message-bubble video,
.chat-bubble video {
  pointer-events: auto;
}

.message-card .media-preview,
.message-media video,
.message-bubble video,
.chat-bubble video {
  position: relative;
  z-index: 3;
  backdrop-filter: none !important;
  filter: none !important;
  background: #000;
}

.composer {
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
  background: var(--bg-panel);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 8;
}

.composer-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}

.composer-input-shell {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.reply-preview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px 8px 14px;
  margin-bottom: 8px;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(42, 210, 97, 0.24);
  border-left: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(42, 210, 97, 0.06);
}

.reply-preview::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 12px;
  width: 4px;
  border-radius: 999px;
  background: #2AD261;
  box-shadow: 0 0 12px rgba(42, 210, 97, 0.22);
}

.reply-preview-body {
  min-width: 0;
  flex: 1;
  padding-left: 12px;
}

.reply-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.reply-preview-action {
  white-space: nowrap;
}

.reply-preview-close {
  flex-shrink: 0;
}

.pending-media-preview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.pending-media-preview-main {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 8px;
}

.pending-media-preview-thumb {
  max-width: 180px;
  max-height: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

@keyframes bubbleFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pending-media-preview-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.pending-media-preview-file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: min(280px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.pending-media-preview-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 46px;
  padding: 0 8px;
  border-radius: 12px;
  background: rgba(0, 168, 132, 0.12);
  color: #9ff4d8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.pending-media-preview-file-copy {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 2px;
}

.pending-media-preview-file-copy strong,
.pending-media-preview-file-copy span {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
}

.message-media-fallback strong,
.message-media-fallback .meta,
.message-media-fallback a,
.pending-media-preview-title,
.pending-media-preview-meta .meta {
  max-width: 100%;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pending-media-preview-title {
  font-size: 13px;
  color: var(--text);
}

.chat-drop-overlay {
  position: absolute;
  inset: 70px 16px 88px;
  z-index: 11;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(11, 20, 26, 0.46);
  border: 1px dashed rgba(0, 168, 132, 0.4);
  backdrop-filter: blur(3px);
  pointer-events: none;
}

.chat-drop-overlay-card {
  display: grid;
  gap: 4px;
  padding: 18px 22px;
  border-radius: 18px;
  background: rgba(15, 23, 29, 0.88);
  border: 1px solid rgba(0, 168, 132, 0.18);
  text-align: center;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.2);
}

.quick-reply-panel {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(100% - 6px);
  z-index: 12;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.gallery-panel {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(100% - 6px);
  z-index: 14;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.gallery-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 0;
}

.gallery-panel-content {
  max-height: 260px;
  overflow-y: auto;
  padding: 14px 16px 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.gallery-item {
  display: grid;
  gap: 6px;
  padding: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  align-content: start;
  transition: transform 0.16s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
}

.gallery-item:focus-visible {
  outline: 2px solid rgba(0, 168, 132, 0.55);
  outline-offset: 3px;
}

.gallery-item-thumb {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.superadmin-gallery-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  border: 1px solid rgba(58, 41, 28, 0.08);
  max-width: 164px;
  margin: 0 auto;
}

.gallery-item-label {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}

.emoji-picker {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(100% - 6px);
  z-index: 13;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.emoji-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 0;
}

.emoji-picker-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 0;
}

.emoji-picker-tab {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  padding: 8px 12px;
}

.emoji-picker-tab.active {
  background: var(--accent);
  color: white;
}

.emoji-picker-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 16px 18px 18px;
}

.emoji-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 24px;
  line-height: 1;
}

.emoji-option:hover {
  background: rgba(0, 168, 132, 0.14);
}

.quick-reply-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 0;
}

.quick-reply-panel-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
}

.quick-reply-panel-close svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-reply-search-field {
  padding: 12px 18px 0;
  margin-bottom: 0;
}

.quick-reply-search-field input {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #111b21;
  color: var(--text-main);
  padding: 10px 12px;
}

.quick-reply-list {
  max-height: 260px;
  overflow-y: auto;
  padding-top: 14px;
}

.quick-reply-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--text-main);
  color: var(--text);
  padding: 14px;
}

.quick-reply-item strong {
  margin: 0;
}

.quick-reply-item-text {
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reply-preview-body {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 4px;
}

.reply-preview-close {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.composer-status {
  min-height: 20px;
  margin: 0;
}

.composer-status.is-empty {
  min-height: 0;
  display: none;
}

#messageInput {
  flex: 1 1 auto;
  width: 100%;
  min-height: 52px;
  max-height: 152px;
  resize: none;
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #111b21;
  color: var(--text-main);
  margin: 0;
  line-height: 1.4;
}

.composer-emoji-btn {
  flex: 0 0 auto;
}

#messageInput::placeholder,
input::placeholder {
  color: var(--text-muted);
}

button,
select,
.file-input span {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--accent);
  color: white;
}

button.secondary {
  background: #23313a;
  color: var(--text-main);
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 auto;
}

.icon-btn svg,
.more-actions-item svg,
.composer-upload-button span svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.send-btn {
  background: var(--accent);
}

.composer-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.composer-upload-button span {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  color: inherit;
}

.composer-upload-button.is-disabled,
.composer-upload-button.is-disabled span {
  cursor: not-allowed;
  opacity: 0.46;
}

#messageInput:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.composer-actions {
  flex: 0 0 auto;
  gap: 6px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.composer-actions .icon-btn,
.composer-actions .composer-upload-button,
.composer-actions .send-btn {
  width: 36px;
  height: 36px;
}

.composer-primary-action {
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.04) !important;
  color: rgba(233, 237, 239, 0.82) !important;
}

.composer-primary-action:hover:not(:disabled),
.composer-primary-action:focus-visible {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e9edef !important;
}

.composer-actions .send-btn {
  box-shadow: 0 4px 10px rgba(0, 168, 132, 0.18);
}

.composer-plus-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.composer-plus-btn svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.composer-plus-menu {
  position: fixed;
  z-index: 9999;
  min-width: 220px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(36, 38, 40, 0.985), rgba(24, 26, 27, 0.985)),
    var(--bg-panel);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.36);
  display: grid;
  gap: 4px;
}

.composer-plus-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 0;
  background: transparent;
  color: var(--text-main);
  text-align: left;
}

.composer-plus-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.composer-plus-item:hover,
.composer-plus-item:focus-visible {
  background: var(--bg-card);
}

.composer-plus-item.danger {
  color: #ffb4a9;
}

.composer-plus-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.composer-plus-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

.app-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  background: rgba(60, 45, 35, 0.95);
  color: white;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.app-tooltip.tooltip-below {
  transform-origin: top center;
}

.more-actions-wrap {
  display: inline-flex;
  align-items: center;
}

.more-actions-button {
  display: inline-flex;
}

.more-actions-popover {
  position: fixed;
  min-width: 196px;
  max-width: min(280px, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(36, 38, 40, 0.985), rgba(24, 26, 27, 0.985)),
    var(--bg-panel);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
  display: grid;
  gap: 4px;
  z-index: 9999;
}

.message-action-menu {
  min-width: 160px;
}

.more-actions-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  border-radius: 10px;
  background: transparent;
  color: var(--text-main);
  padding: 9px 10px;
  font-size: 13px;
}

.more-actions-item:hover:not(:disabled) {
  background: var(--bg-card);
}

.more-actions-item.danger {
  color: #ffb4a9;
}

select {
  border: 1px solid var(--line);
  background: #111b21;
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: 16px;
}

button:disabled,
.file-input.disabled span {
  opacity: 0.55;
  cursor: not-allowed;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.compact-field {
  margin-bottom: 0;
}

.contacts-workspace,
.contacts-panel {
  min-height: 0;
}

.contacts-workspace {
  flex: 1;
  overflow: hidden;
}

.contacts-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.contacts-sticky-shell {
  position: relative;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(24, 26, 27, 0.985), rgba(21, 23, 24, 0.97)),
    var(--bg-panel);
  border-bottom: 1px solid var(--line);
}

.contacts-header-row {
  align-items: flex-start;
}

.contacts-back-btn {
  display: none;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.contacts-header-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.contacts-header-meta {
  color: rgba(174, 186, 193, 0.84);
}

.contacts-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(170px, 0.75fr) auto;
  gap: 12px;
  padding: 18px 20px 0;
  align-items: end;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  background: transparent;
}

.contacts-toolbar .field input,
.contacts-toolbar .field select {
  min-height: 44px;
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--line);
}

.contacts-toolbar .field input::placeholder {
  color: var(--text-muted);
}

.contacts-toolbar .field input:focus,
.contacts-toolbar .field select:focus {
  background: var(--bg-card);
}

.contacts-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(2px);
  z-index: 30;
}

.job-feed-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9998;
}

.job-feed-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100%;
  background: var(--bg-panel);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

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

.job-feed-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
}

.job-feed-drawer-header h2 {
  margin: 0;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 18, 12, 0.72);
  backdrop-filter: blur(3px);
}

.image-viewer-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  max-width: min(92vw, 960px);
  max-height: 92vh;
}

.image-viewer-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.image-viewer-img {
  display: block;
  max-width: min(92vw, 960px);
  max-height: calc(92vh - 56px);
  width: auto;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.28);
}

.album-viewer-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 980px);
  max-height: 92vh;
  overflow: auto;
  border-radius: 24px;
  background: rgba(21, 23, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.28);
  padding: 20px;
}

.album-viewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.album-viewer-copy h2 {
  margin: 0;
  font-size: 22px;
}

.album-viewer-copy .meta {
  margin-top: 6px;
}

.album-viewer-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.album-viewer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.album-viewer-item {
  display: grid;
  gap: 10px;
}

.album-viewer-image-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.album-viewer-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 16px;
}

.album-viewer-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.album-viewer-item-copy {
  display: grid;
  min-width: 0;
}

.album-viewer-item-copy strong {
  font-size: 13px;
  line-height: 1.4;
}

.album-viewer-download {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.image-annotation-modal {
  position: fixed;
  inset: 0;
  z-index: 66;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.image-annotation-dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  height: min(92vh, 920px);
}

.image-annotation-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 29, 0.98);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.4);
}

.image-annotation-header,
.image-annotation-toolbar,
.image-annotation-actions,
.image-annotation-tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.image-annotation-header {
  justify-content: space-between;
}

.image-annotation-header h2 {
  margin: 0;
}

.image-annotation-toolbar {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.image-annotation-tool-group-spread {
  margin-left: auto;
}

.image-annotation-icon-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.image-annotation-icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.image-annotation-send-btn svg {
  width: 17px;
  height: 17px;
}

.image-annotation-tool-btn.is-active,
.image-annotation-size-btn.is-active {
  background: rgba(42, 210, 97, 0.18);
  border-color: rgba(42, 210, 97, 0.36);
  color: #f3fff8;
}

.image-annotation-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.24);
}

.image-annotation-color-btn.is-active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(42, 210, 97, 0.2);
}

.image-annotation-color-btn[data-annotation-color="#ff4d4f"] { background: #ff4d4f; }
.image-annotation-color-btn[data-annotation-color="#2ad261"] { background: #2ad261; }
.image-annotation-color-btn[data-annotation-color="#ffd43b"] { background: #ffd43b; }
.image-annotation-color-btn[data-annotation-color="#ffffff"] { background: #ffffff; }

.image-annotation-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  border-radius: 20px;
  background: rgba(8, 13, 17, 0.96);
}

.image-annotation-canvas-wrap {
  position: relative;
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
}

.image-annotation-preview,
.image-annotation-canvas {
  display: block;
  max-width: min(100%, 1000px);
  max-height: min(100%, 72vh);
  border-radius: 16px;
}

.image-annotation-preview {
  width: auto;
  height: auto;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.image-annotation-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.edit-contact-modal {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.edit-contact-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
}

.edit-contact-dialog.is-profile-detail {
  width: min(480px, 100%);
}

.edit-contact-form[data-edit-contact-mode="profile-detail"] {
  gap: 18px;
  padding: 22px;
}

.edit-contact-form[data-edit-contact-mode="profile-detail"] .panel-title-row {
  align-items: flex-start;
}

.edit-contact-title-wrap {
  display: grid;
  gap: 4px;
}

.forward-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.edit-contact-form {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-panel);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.4);
}

.forward-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-panel);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.4);
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

.forward-form .panel-title-row {
  gap: 6px;
  padding-bottom: 2px;
  flex: 0 0 auto;
}

.forward-form .panel-title-row h2 {
  font-size: 20px;
  line-height: 1.2;
}

.forward-form .panel-title-row .meta {
  font-size: 12px;
  line-height: 1.35;
}

.forward-form .quick-reply-search-field {
  padding: 0;
  gap: 6px;
  flex: 0 0 auto;
}

.forward-form .quick-reply-search-field span {
  font-size: 12px;
}

.forward-form .quick-reply-search-field input {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.remove-conversation-form {
  gap: 18px;
}

.assignment-logs-form {
  gap: 14px;
}

.idle-warning-form {
  gap: 18px;
}

.idle-warning-body {
  padding: 14px 16px;
  border: 1px solid rgba(255, 210, 121, 0.24);
  border-radius: 18px;
  background: rgba(255, 210, 121, 0.08);
}

.idle-warning-countdown {
  margin: 0;
  color: #ffe3ac;
  line-height: 1.5;
}

.assignment-logs-list {
  display: grid;
  gap: 10px;
  max-height: min(56vh, 460px);
  overflow: auto;
}

.assignment-log-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-card);
}

.assignment-log-copy {
  display: grid;
  gap: 4px;
}

.assignment-log-copy strong {
  font-size: 13px;
  line-height: 1.35;
}

.assignment-log-meta,
.assignment-log-note {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-secondary);
}

.danger-btn {
  background: #b91c1c;
  color: #fef2f2;
}

.danger-btn:hover,
.danger-btn:focus-visible {
  background: #dc2626;
  color: #fff;
}

.danger-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.forward-target-list {
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.forward-pinned-section {
  display: grid;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 0;
  max-height: min(22vh, 168px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.forward-pinned-header {
  display: grid;
  gap: 4px;
}

.forward-pinned-header strong {
  font-size: 13px;
  line-height: 1.3;
}

.forward-pinned-header .meta {
  font-size: 11px;
  line-height: 1.3;
}

.forward-pinned-grid {
  display: grid;
  gap: 6px;
}

.forward-target-item {
  display: grid;
  grid-template-columns: auto 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-card);
  cursor: pointer;
}

.forward-target-item.is-compact {
  grid-template-columns: auto 38px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
}

.forward-target-item input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.forward-target-item.selected {
  border-color: rgba(0, 168, 132, 0.52);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 132, 0.28);
}

.forward-target-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.forward-target-avatar .conversation-avatar,
.forward-target-avatar .chat-header-avatar {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.forward-target-item.is-compact .forward-target-avatar .conversation-avatar,
.forward-target-item.is-compact .forward-target-avatar .chat-header-avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.forward-target-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.forward-target-copy strong,
.forward-target-copy span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forward-target-copy strong {
  font-size: 13px;
  line-height: 1.3;
}

.forward-target-copy .conversation-kind-badge,
.forward-target-copy .meta {
  font-size: 11px;
  line-height: 1.3;
}

.forward-target-copy .conversation-kind-badge {
  margin-top: 2px;
  padding: 2px 8px;
  min-width: 0;
  height: auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  box-shadow: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.forward-target-item.is-compact .forward-target-copy {
  gap: 2px;
}

.forward-target-item.is-compact .forward-target-copy strong {
  font-size: 12px;
}

.forward-target-item.is-compact .conversation-kind-badge,
.forward-target-item.is-compact .meta {
  font-size: 10px;
}

.forward-target-item.is-compact .forward-target-copy .conversation-kind-badge {
  padding: 2px 7px;
}

.forward-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  padding-bottom: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(18, 20, 21, 0) 0%, rgba(18, 20, 21, 0.88) 26%, rgba(18, 20, 21, 0.98) 100%),
    var(--bg-panel);
  position: sticky;
  bottom: 0;
  z-index: 1;
}

@media (max-width: 640px) {
  .forward-dialog {
    width: min(100%, 460px);
    max-height: calc(100vh - 32px);
  }

  .forward-form {
    padding: 14px;
    gap: 10px;
    border-radius: 20px;
    max-height: calc(100vh - 32px);
  }

  .forward-target-list {
    gap: 6px;
  }

  .forward-actions {
    gap: 8px;
    padding-top: 8px;
  }
}

.edit-contact-body {
  display: grid;
  gap: 16px;
}

.edit-contact-body.is-profile-detail {
  gap: 18px;
}

.edit-contact-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.edit-contact-identity.is-profile-detail {
  align-items: flex-start;
  gap: 16px;
}

.edit-contact-avatar-btn {
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: 0;
  flex: 0 0 auto;
}

.edit-contact-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.edit-contact-meta strong,
.edit-contact-meta .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-contact-body.is-profile-detail .edit-contact-meta {
  gap: 8px;
}

.edit-contact-body.is-profile-detail .edit-contact-meta strong {
  font-size: 20px;
  line-height: 1.1;
}

.edit-contact-avatar-large {
  width: 88px;
  height: 88px;
  min-width: 88px;
}

.edit-contact-phone-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.edit-contact-phone-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 168, 132, 0.16);
  border: 1px solid rgba(0, 168, 132, 0.26);
  color: #bff4e6;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.edit-contact-copy-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.edit-contact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 640px) {
  .edit-contact-modal {
    padding: 16px;
  }

  .edit-contact-form[data-edit-contact-mode="profile-detail"] {
    padding: 18px;
  }

  .edit-contact-identity.is-profile-detail {
    align-items: center;
  }

  .edit-contact-avatar-large {
    width: 76px;
    height: 76px;
    min-width: 76px;
  }

  .edit-contact-body.is-profile-detail .edit-contact-meta strong,
  .edit-contact-meta strong {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .edit-contact-meta .meta {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}

.avatar-button {
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: 0;
}

.avatar-button:hover .avatar,
.avatar-button:focus-visible .avatar {
  transform: scale(1.04);
  box-shadow: 0 8px 18px rgba(66, 42, 20, 0.12);
}

.avatar {
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.job-feed-drawer-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.drawer-title-row {
  padding-top: 18px;
}

.contacts-summary {
  padding: 0 20px 12px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

#contactsImportStatus {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 20px;
}

.contacts-stats-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 12px;
}

.contacts-bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 14px;
  color: var(--text-main);
}

.contacts-bulk-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.contacts-stat-pill {
  background: var(--bg-card);
  color: rgba(233, 237, 239, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px 20px;
  overflow-y: auto;
  min-height: 0;
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  scrollbar-gutter: stable both-edges;
}

.contacts-empty-state {
  display: grid;
  place-items: center;
  justify-items: center;
  gap: 10px;
  min-height: 220px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  padding: 24px;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-strong);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto minmax(260px, 1.2fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.contact-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.18);
}

.contact-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.contact-select-control {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.contact-select-control input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #e25555;
  cursor: pointer;
}

.contact-primary {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.contact-secondary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.contact-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.contact-avatar {
  width: 48px;
  height: 48px;
}

.contact-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.contact-name {
  margin: 0;
  font-size: 15px;
}

.contact-phone-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.contact-phone {
  color: rgba(233, 237, 239, 0.74);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.source-badge {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(233, 237, 239, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.business-badge {
  background: rgba(0, 168, 132, 0.18);
  color: var(--accent);
}

.contact-sync-time {
  color: rgba(174, 186, 193, 0.78);
  font-size: 12px;
  white-space: nowrap;
}

.contact-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(233, 237, 239, 0.78);
  font-size: 12px;
  line-height: 1.2;
}

.contact-meta-label {
  color: rgba(174, 186, 193, 0.68);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.contact-meta-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.contact-actions-compact {
  gap: 6px;
  align-self: center;
}

.contact-edit-btn,
.contact-start-chat-btn,
.contact-sync-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
}

.contact-start-chat-btn {
  background: linear-gradient(135deg, #00a884, #25d366);
  color: #06281f;
  border: 0;
  box-shadow: 0 12px 24px rgba(0, 168, 132, 0.22);
}

.contact-start-chat-btn:hover,
.contact-start-chat-btn:focus-visible {
  background: linear-gradient(135deg, #12b48f, #38dd75);
  color: #031b15;
}

.contact-edit-btn svg,
.contact-start-chat-btn svg,
.contact-sync-btn svg {
  width: 18px;
  height: 18px;
}

.contact-sync-btn.is-syncing svg {
  animation: contactSyncSpin 0.9s linear infinite;
}

.contact-start-chat-pill {
  width: auto;
  min-width: 72px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contact-start-chat-pill span {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.contact-name mark,
.contact-phone mark,
.source-badge mark,
.contact-meta-value mark {
  background: rgba(0, 168, 132, 0.24);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

@keyframes contactSyncSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.file-input input {
  display: none;
}

.composer-actions {
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(58, 41, 28, 0.05);
}

.emoji-toggle {
  min-width: 44px;
  padding-inline: 0;
  font-size: 20px;
  line-height: 1;
}

@media (max-width: 1180px) {
  .inbox-workspace {
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .chat-room {
    grid-column: 2;
    grid-row: 1;
  }

  .contacts-toolbar {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr);
  }

  .contacts-toolbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .image-annotation-dialog {
    width: 100%;
    height: min(94vh, 900px);
  }
}

@media (max-width: 900px) {
  .app-logo {
    height: 24px;
  }

  body {
    overflow: hidden;
  }

  .shell {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  .topbar {
    flex-shrink: 0;
  }

  .workspace {
    min-height: 0;
    overflow: hidden;
  }

  .inbox-workspace {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .inbox-workspace.conversation-panel-compact {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
  }

  .conversation-list {
    width: 84px;
    height: 100%;
  }

  .conversation-list.collapsed {
    width: 72px;
    margin-right: 0;
    border-right: 1px solid rgba(58, 41, 28, 0.05);
  }

  .conversation-list .panel-title-row {
    padding: 18px 12px 0;
    justify-content: center;
  }

  .conversation-list .panel-title-row h2,
  .conversation-search-row {
    display: none;
  }

  .conversation-panel-toggle {
    display: inline-flex;
    min-width: 56px;
    padding: 8px 10px;
    justify-content: center;
  }

  .conversation-items {
    padding: 10px 8px 12px;
    gap: 6px;
    align-content: start;
    justify-items: stretch;
  }

  .chat-room {
    height: 100%;
    min-height: 0;
  }

  .message-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .composer {
    gap: 6px;
    padding: 10px 12px 12px;
  }

  .scroll-to-latest-btn {
    right: 14px;
    bottom: 88px;
  }

  .chat-room-background {
    background-size: clamp(760px, 135vw, 1080px) auto;
  }

  .composer-actions {
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-top: 0;
    padding-top: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .desktop-secondary-action {
    display: none;
  }

  .more-actions-button {
    display: inline-flex;
  }

  .inbox-workspace.conversation-panel-expanded {
    grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  }

  .inbox-workspace.conversation-panel-expanded .conversation-list {
    width: auto;
  }

  .inbox-workspace.conversation-panel-expanded .conversation-list .panel-title-row {
    padding: 18px 20px 0;
    justify-content: space-between;
  }

  .inbox-workspace.conversation-panel-expanded .conversation-list .panel-title-row h2,
  .inbox-workspace.conversation-panel-expanded .conversation-search-row {
    display: block;
  }

  .inbox-workspace.conversation-panel-expanded .conversation-items {
    padding: 18px 20px 20px;
    justify-items: stretch;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  .sidebar {
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    overflow: hidden;
  }

  .chat-bubble {
    max-width: 75%;
  }

  .conversation-topline,
  .conversation-preview-row {
    gap: 10px;
  }

  .conversation-indicators {
    min-width: 40px;
  }

  .contacts-toolbar {
    grid-template-columns: 1fr;
  }

  .contacts-toolbar-actions {
    justify-content: stretch;
  }

  .contacts-toolbar-actions > * {
    flex: 1 1 auto;
  }

  .contact-card {
    grid-template-columns: 1fr;
  }

  .contact-select-control {
    justify-content: flex-start;
  }

  .contact-main {
    order: 2;
  }

  .contact-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .job-feed-drawer {
    width: min(100vw, 360px);
  }

  .quick-reply-panel {
    left: 14px;
    right: 14px;
    bottom: calc(100% - 2px);
  }

  .emoji-picker {
    left: 14px;
    right: 14px;
    bottom: calc(100% - 2px);
  }

  .gallery-panel {
    left: 14px;
    right: 14px;
    bottom: calc(100% - 2px);
  }

  .gallery-panel-content {
    max-height: 220px;
    padding: 12px 14px 14px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  }

  .gallery-item-thumb {
    height: 86px;
  }
}

@media (max-width: 900px) {
  .chat-bubble {
    max-width: min(75%, calc(100% - 10px));
    min-width: 0;
  }

  .chat-bubble.has-media,
  .chat-bubble.has-story,
  .chat-bubble.has-audio,
  .chat-bubble.has-document {
    min-width: min(190px, 100%);
    max-width: min(82%, calc(100% - 10px));
  }

  .message-image,
  .message-card .media-preview,
  .message-media img,
  .message-media video {
    max-width: 220px;
  }

  .message-media a,
  .audio-message,
  .audio-message.voice-note,
  .view-once-placeholder {
    max-width: min(280px, 100%);
  }

  .audio-message,
  .audio-message.voice-note {
    min-width: 190px;
  }
}

@media (max-width: 600px) {
  .inbox-workspace {
    grid-template-columns: minmax(0, 1fr);
    height: 100%;
    overflow: hidden;
  }

  .conversation-list {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(340px, 88vw);
    z-index: 45;
    transform: translateX(-110%);
    transition: transform 0.22s ease;
    border-radius: 0 24px 24px 0;
    min-height: 100vh;
  }

  .inbox-workspace.conversation-panel-expanded .conversation-list {
    transform: translateX(0);
  }

  .conversation-list .panel-title-row {
    padding: 18px 20px 0;
    justify-content: space-between;
  }

  .conversation-list .panel-title-row h2,
  .conversation-search-row {
    display: block;
  }

  .conversation-items {
    padding: 18px 20px 20px;
    justify-items: stretch;
  }

  .conversation-panel-toggle {
    display: inline-flex;
  }

  .chat-room {
    min-height: 0;
    height: 100%;
  }

  .chat-header-main {
    align-items: flex-start;
  }

  .chat-header-right {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .chat-search-popover {
    right: 0;
    top: calc(100% + 8px);
    transform: none;
    min-width: min(100%, 360px);
    max-width: min(100vw - 56px, 360px);
    flex-wrap: wrap;
  }

  .chat-search-input,
  .chat-search-count {
    min-width: 0;
    text-align: left;
  }

  .chat-search-input {
    width: 100%;
  }

  .chat-header-compact-btn {
    min-height: 32px;
    padding: 0 9px;
  }

  .chat-header.search-active {
    padding-inline: 10px;
  }

  .chat-header.search-active .chat-header-main {
    align-items: center;
  }

  .chat-search-toolbar {
    flex-wrap: nowrap;
  }

  .chat-search-toolbar .chat-search-input {
    min-width: 0;
  }

  .chat-search-status {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

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

  .composer-actions {
    justify-content: flex-start;
    gap: 6px;
  }

  .more-actions-popover {
    min-width: 148px;
  }

  .message-list {
    padding: 12px 8px 18px;
  }

  .image-annotation-modal {
    padding: 10px;
  }

  .image-annotation-shell {
    padding: 12px;
    border-radius: 20px;
  }

  .image-annotation-header {
    align-items: flex-start;
  }

  .image-annotation-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .image-annotation-tool-group-spread {
    margin-left: 0;
  }
}

@media (hover: none) {
  .message-bubble-wrapper:not(.is-active):not(.is-menu-open) .message-action-trigger,
  .message-bubble-wrapper:not(.is-active):not(.is-menu-open) .message-action-button {
    opacity: 0;
    pointer-events: none;
  }
}

.status-connected {
  background: rgba(0, 168, 132, 0.16);
  color: var(--success);
}

.status-stale {
  background: rgba(255, 210, 121, 0.16);
  color: var(--warning);
}

.status-reconnecting {
  background: rgba(125, 178, 255, 0.16);
  color: #9ec5ff;
}

.status-idle,
.status-unknown {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.status-disconnected,
.status-error {
  background: rgba(159, 47, 31, 0.12);
  color: var(--danger);
}

.status-failed {
  background: rgba(159, 47, 31, 0.12);
  color: var(--danger);
}

.status-queued {
  background: rgba(181, 108, 17, 0.12);
  color: var(--warning);
}

audio,
img,
video {
  max-width: 100%;
}

@media (max-width: 1180px) {
  .shell,
  .inbox-workspace {
    grid-template-columns: 1fr;
  }

  .chat-room {
    min-height: auto;
  }

  #inboxWorkspace.inbox-workspace {
    grid-template-columns: 320px minmax(0, 1fr);
  }
}

.shell {
  display: flex;
  flex-direction: column;
}

.workspace {
  padding: 0;
  flex: 1;
  min-height: 0;
}

.workspace-panel {
  flex: 1;
  min-height: 0;
}

#inboxWorkspace {
  background: var(--bg-app);
}

#inboxWorkspace.inbox-workspace {
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
  height: calc(100vh - 48px);
  min-height: 0;
  align-items: stretch;
}

#inboxWorkspace .inbox-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#inboxWorkspace .panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--bg-chat);
}

#inboxWorkspace .conversation-rail {
  border-right: 1px solid var(--line);
  background: var(--bg-panel);
}

#inboxWorkspace .conversation-list {
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(24, 26, 27, 0.985), rgba(21, 23, 24, 0.985)),
    var(--bg-panel);
}

#inboxWorkspace .chat-room {
  background: var(--bg-chat);
}

#inboxWorkspace .panel-title-row {
  padding: 14px 16px 0;
}

#inboxWorkspace .conversation-search-row {
  padding: 10px 16px 0;
}

#inboxWorkspace .conversation-search {
  border-color: rgba(255, 255, 255, 0.08);
  background: #161819;
  color: var(--text-main);
}

#inboxWorkspace .conversation-search:focus {
  border-color: rgba(42, 210, 97, 0.34);
  box-shadow: 0 0 0 3px rgba(42, 210, 97, 0.08);
}

#inboxWorkspace .conversation-filter-tabs {
  padding: 8px 16px 10px;
}

#inboxWorkspace .conversation-items {
  padding: 8px 8px 10px;
  gap: 4px;
  grid-auto-rows: max-content;
  align-content: start;
  justify-items: stretch;
}

#inboxWorkspace .message-list {
  padding: 12px 8px 18px;
  background: transparent;
}

#inboxWorkspace .scroll-to-latest-btn {
  right: 14px;
  bottom: 86px;
}

#inboxWorkspace .composer {
  border-top: 1px solid var(--line);
  padding: 8px 10px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  background:
    linear-gradient(180deg, rgba(34, 36, 37, 0.985), rgba(29, 31, 32, 0.985)),
    var(--bg-header);
}

#inboxWorkspace .chat-header {
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

.topbar {
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.topbar,
.topbar-nav,
.topbar-actions,
.inline-actions {
  display: flex;
  align-items: center;
}

.topbar-trigger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  flex: 0 0 auto;
}

.chat-drawer-trigger {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.unread-conversation-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 11px;
  font-weight: 800;
}

.topbar-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(2px);
  z-index: 9998;
}

.topbar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(260px, calc(100vw - 24px));
  height: 100vh;
  padding: 18px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.35);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 9999;
}

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

.topbar-drawer-header,
.topbar-drawer-section,
.topbar-drawer-actions {
  display: flex;
  align-items: center;
}

.topbar-drawer-header {
  justify-content: space-between;
  gap: 12px;
}

.topbar-drawer-header h2 {
  margin: 0;
}

.topbar-drawer-nav {
  display: grid;
  gap: 10px;
}

.topbar-drawer-nav button,
.topbar-drawer-actions button {
  width: 100%;
  justify-content: center;
}

.topbar-drawer-section {
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.topbar-drawer-actions {
  margin-top: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
  backdrop-filter: blur(18px);
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
}

.app-logo {
  height: 28px;
  max-height: 32px;
  width: auto;
  max-width: min(220px, 24vw);
  object-fit: contain;
  display: block;
}

.header-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.header-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar h1 {
  margin: 0;
}

.topbar .brand-kicker {
  display: none;
}

.topbar .workspace-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.topbar-nav,
.topbar-actions,
.inline-actions {
  gap: 8px;
  flex-wrap: nowrap;
}

.topbar-nav {
  justify-content: center;
}

.topbar-actions {
  justify-content: flex-end;
}

.topbar-icon-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.topbar-icon-btn svg {
  width: 18px;
  height: 18px;
}

.topbar-icon-btn:hover,
.topbar-icon-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.topbar-status-badge,
#meBadge.badge {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 11px;
}

.topbar-status-badge {
  text-transform: lowercase;
}

#meBadge.badge {
  max-width: min(32vw, 260px);
}

#meBadge.badge,
#drawerMeBadge.badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.session-identity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.session-identity-tenant {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

.session-identity-separator,
.session-identity-user {
  flex: 0 0 auto;
}

.session-identity-user {
  color: var(--text-main);
}

#drawerMeBadge.badge {
  max-width: 100%;
}

@media (max-width: 900px) {
  #inboxWorkspace.inbox-workspace {
    height: calc(100vh - 48px);
    gap: 0;
  }

  #inboxWorkspace.inbox-workspace.conversation-panel-compact {
    gap: 0;
  }

  #inboxWorkspace .conversation-list {
    border-right: 1px solid var(--line);
  }

  #meBadge.badge {
    max-width: min(42vw, 220px);
  }

  #inboxWorkspace.conversation-panel-expanded .conversation-list .panel-title-row {
    padding: 14px 16px 0;
  }

  #inboxWorkspace.conversation-panel-expanded .conversation-items {
    padding: 8px 8px 10px;
  }
}

@media (max-width: 600px) {
  #inboxWorkspace.inbox-workspace {
    grid-template-columns: minmax(0, 1fr);
    height: calc(100vh - 48px);
  }

  #inboxWorkspace .conversation-list {
    border-right: 1px solid var(--line);
    border-radius: 0;
  }
}

.gateway-panel,
.superadmin-panel {
  padding-bottom: 18px;
}

.superadmin-workspace {
  overflow: auto;
}

.superadmin-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0;
  padding: 16px;
  overflow: visible;
}

.superadmin-tab-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: thin;
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
  background: var(--bg-app);
}

.superadmin-tab-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(21, 32, 39, 0.92);
  color: var(--text-secondary);
  font-weight: 600;
  box-shadow: none;
}

.superadmin-tab-button:hover,
.superadmin-tab-button:focus-visible {
  background: rgba(32, 44, 51, 0.96);
  color: var(--text-main);
}

.superadmin-tab-button.active {
  background: rgba(0, 168, 132, 0.18);
  border-color: rgba(0, 168, 132, 0.52);
  color: #d9fdd3;
}

.superadmin-tab-panel {
  min-height: 0;
  flex: 1 1 auto;
  overflow: visible;
}

#superadminStatus {
  padding: 0 4px 4px;
}

.gateway-panel,
.superadmin-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.superadmin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px 0;
  align-items: end;
}

.superadmin-form-wide {
  grid-column: 1 / -1;
}

.superadmin-form textarea {
  min-height: 110px;
  margin-bottom: 0;
}

.superadmin-admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 34%) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.superadmin-admin-form-panel,
.superadmin-admin-list-panel {
  min-height: 0;
}

.superadmin-admin-form-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 20px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(0, 168, 132, 0.08), rgba(0, 168, 132, 0.01) 34%),
    rgba(255, 255, 255, 0.02);
}

.superadmin-admin-form-header {
  display: grid;
  gap: 6px;
}

.superadmin-admin-form-header .meta:last-child {
  color: var(--text-muted);
}

.superadmin-admin-form {
  grid-template-columns: 1fr;
  padding: 0;
  align-content: start;
}

.superadmin-admin-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.superadmin-admin-list-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.superadmin-tenant-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
  gap: 16px;
  align-items: start;
  flex: 1 1 auto;
  overflow: visible;
}

.superadmin-tenant-form-panel,
.superadmin-tenant-content-panel {
  min-height: 0;
}

.superadmin-tenant-form-panel {
  overflow: visible;
  padding: 18px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(0, 168, 132, 0.08), rgba(0, 168, 132, 0.01) 34%),
    rgba(255, 255, 255, 0.02);
}

.superadmin-tenant-form-sticky {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 0;
}

.superadmin-tenant-form {
  grid-template-columns: 1fr;
  padding: 0;
  align-content: start;
}

.superadmin-tenant-content-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow: visible;
}

.superadmin-tenant-list-section,
.superadmin-tenant-mapping-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.superadmin-tenant-card-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  overflow: visible;
}

.superadmin-section-header {
  padding: 18px 20px 0;
}

.superadmin-section-header strong {
  display: block;
  margin-bottom: 4px;
}

.superadmin-tenant-list,
.superadmin-tenant-mapping-list {
  align-content: start;
  overflow: visible;
}

.superadmin-tenant-list {
  flex: 0 0 auto;
}

.superadmin-tenant-mapping-section .composer-status {
  margin: 12px 20px 0;
}

.superadmin-tenant-mapping-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 14px;
}

.superadmin-tenant-mapping-list {
  flex: 0 0 auto;
  padding-top: 12px;
}

.superadmin-quick-reply-layout {
  display: grid;
  grid-template-columns: minmax(280px, 34%) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.superadmin-quick-reply-form-panel,
.superadmin-quick-reply-list-panel {
  min-height: 0;
}

.superadmin-quick-reply-form-panel {
  overflow-y: auto;
  padding: 18px 20px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(0, 168, 132, 0.08), rgba(0, 168, 132, 0.01) 34%),
    rgba(255, 255, 255, 0.02);
}

.superadmin-quick-reply-form-sticky {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 0;
}

.superadmin-quick-reply-form {
  grid-template-columns: 1fr;
  padding: 0;
  align-content: start;
}

.superadmin-quick-reply-list-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.superadmin-quick-reply-list {
  flex: 1 1 auto;
  align-content: start;
}

.superadmin-gallery-layout {
  display: grid;
  grid-template-columns: minmax(280px, 34%) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.superadmin-gallery-form-panel,
.superadmin-gallery-list-panel {
  min-height: 0;
}

.superadmin-gallery-form-panel {
  overflow-y: auto;
  padding: 18px 20px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(0, 168, 132, 0.08), rgba(0, 168, 132, 0.01) 34%),
    rgba(255, 255, 255, 0.02);
}

.superadmin-gallery-form-sticky {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 0;
}

.superadmin-gallery-form {
  grid-template-columns: 1fr;
  padding: 0;
  align-content: start;
}

.superadmin-gallery-list-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.superadmin-gallery-list {
  flex: 1 1 auto;
}

.superadmin-admin-list {
  flex: 1 1 auto;
  align-content: start;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.superadmin-card.is-selected {
  border-color: rgba(0, 168, 132, 0.6);
  box-shadow: 0 0 0 1px rgba(0, 168, 132, 0.22);
}

.superadmin-admin-card {
  min-height: 178px;
  align-content: space-between;
}

.superadmin-admin-heading {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.superadmin-admin-heading strong {
  line-height: 1.2;
}

.superadmin-admin-heading .meta {
  font-size: 12px;
}

.superadmin-admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.superadmin-admin-tenant-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(126, 153, 168, 0.22);
  border-radius: 999px;
  background: rgba(126, 153, 168, 0.12);
  color: rgba(236, 247, 255, 0.92);
  font-size: 12px;
  line-height: 1.2;
}

.superadmin-admin-role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 168, 132, 0.2);
  background: rgba(0, 168, 132, 0.08);
  color: #b8ffe2;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.superadmin-gateway-toolbar {
  padding: 0;
}

.gateway-create-form {
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.8fr) auto;
}

.superadmin-gateway-list {
  flex: 1 1 auto;
  align-content: start;
}

.superadmin-gateway-layout {
  display: grid;
  grid-template-columns: minmax(280px, 34%) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.superadmin-gateway-form-panel,
.superadmin-gateway-list-panel {
  min-height: 0;
}

.superadmin-gateway-form-panel {
  overflow-y: auto;
  padding: 18px 20px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(0, 168, 132, 0.08), rgba(0, 168, 132, 0.01) 34%),
    rgba(255, 255, 255, 0.02);
}

.superadmin-gateway-form-sticky {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 0;
}

.superadmin-gateway-header-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.superadmin-gateway-form {
  grid-template-columns: 1fr;
  padding: 0;
  align-content: start;
}

.superadmin-gateway-list-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.superadmin-gateway-meta-panel {
  padding: 0;
}

.superadmin-gateway-card {
  gap: 14px;
}

.superadmin-gateway-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.superadmin-gateway-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 12px;
  color: var(--text-secondary);
  font-size: 12px;
}

.superadmin-gateway-controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.gateway-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 13px;
}

.gateway-toggle input {
  margin: 0;
}

.superadmin-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 20px;
}

.superadmin-list.superadmin-gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(196px, 196px));
  align-content: start;
  justify-content: flex-start;
}

.superadmin-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.superadmin-card-main {
  display: grid;
  gap: 6px;
}

.superadmin-card-submeta {
  font-size: 12px;
  color: var(--text-muted);
}

.superadmin-card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.superadmin-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.superadmin-status-pill.is-active,
.superadmin-status-pill.is-connected {
  border-color: rgba(0, 168, 132, 0.38);
  background: rgba(0, 168, 132, 0.16);
  color: #d9fdd3;
}

.superadmin-status-pill.is-inactive,
.superadmin-status-pill.is-disconnected {
  border-color: rgba(255, 107, 107, 0.24);
  background: rgba(255, 107, 107, 0.1);
  color: #ffd0d0;
}

.superadmin-status-pill.is-warning {
  border-color: rgba(255, 210, 121, 0.24);
  background: rgba(255, 210, 121, 0.1);
  color: #ffe8b5;
}

.superadmin-tenant-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.superadmin-tenant-kpi {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.superadmin-tenant-kpi-label {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.superadmin-tenant-kpi-value {
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.35;
}

.superadmin-tenant-summary-group {
  display: grid;
  gap: 8px;
}

.superadmin-tenant-summary-label {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.superadmin-tenant-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.superadmin-tenant-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(126, 153, 168, 0.2);
  border-radius: 999px;
  background: rgba(126, 153, 168, 0.1);
  color: rgba(236, 247, 255, 0.9);
  font-size: 12px;
  line-height: 1.2;
}

.superadmin-tenant-chip strong {
  display: inline;
  margin: 0;
  font-size: inherit;
}

.superadmin-tenant-chip-subtle {
  color: var(--text-muted);
}

.superadmin-tenant-empty {
  padding: 0 20px 20px;
}

.superadmin-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.superadmin-admin-card .superadmin-card-actions {
  gap: 8px;
  justify-content: flex-end;
  margin-top: auto;
}

.superadmin-admin-action {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.superadmin-admin-action:hover,
.superadmin-admin-action:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.superadmin-admin-action.danger {
  background: rgba(0, 168, 132, 0.14);
  color: #d9fdd3;
}

.superadmin-admin-action.danger:hover,
.superadmin-admin-action.danger:focus-visible {
  background: rgba(255, 107, 107, 0.16);
  color: #ffd0d0;
}

.erp-location-mapping-list {
  align-content: start;
}

.erp-location-mapping-card {
  gap: 10px;
}

.erp-location-mapping-meta {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.assignment-kpi-card {
  display: grid;
  gap: 6px;
}

.assignment-kpi-card strong {
  font-size: 20px;
  line-height: 1.15;
  margin-bottom: 0;
}

#superadminAssignmentSummary {
  padding-bottom: 10px;
}

.assignment-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.assignment-kpi-compact-card {
  min-height: 84px;
  align-content: start;
}

.assignment-kpi-compact-card .meta {
  line-height: 1.2;
}

.assignment-kpi-compact-card strong {
  font-size: 24px;
}

.assignment-leaderboard-compact {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.assignment-leaderboard-group {
  display: grid;
  gap: 6px;
}

.assignment-kpi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assignment-kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 82%, var(--accent-soft) 18%);
}

.assignment-kpi-chip strong,
.assignment-kpi-chip span {
  margin: 0;
  font-size: 12px;
  line-height: 1;
}

.assignment-kpi-chip span {
  font-family: "IBM Plex Mono", monospace;
  color: var(--text-secondary);
}

.assignment-kpi-chip-empty {
  color: var(--text-secondary);
}

@media (max-width: 1180px) {
  .assignment-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .assignment-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#createAdminTenant,
#createAdminRole {
  min-width: 0;
}

.superadmin-gallery-card {
  width: 196px;
  min-height: 0;
}

.superadmin-gallery-card .superadmin-card-main {
  gap: 8px;
}

@media (max-width: 1180px) {
  .superadmin-shell {
    padding: 14px;
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: center;
  }

  .app-header {
    gap: 10px;
  }

  .header-right {
    gap: 8px;
  }

  .superadmin-form {
    grid-template-columns: 1fr;
  }

  .superadmin-admin-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .superadmin-tenant-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .superadmin-quick-reply-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .superadmin-gateway-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .superadmin-gallery-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .superadmin-admin-form-panel {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .superadmin-tenant-form-panel {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .superadmin-quick-reply-form-panel {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .superadmin-gateway-form-panel {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .superadmin-gallery-form-panel {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .superadmin-admin-list-panel,
  .superadmin-admin-form-panel,
  .superadmin-tenant-content-panel,
  .superadmin-tenant-form-panel,
  .superadmin-quick-reply-form-panel,
  .superadmin-quick-reply-list-panel,
  .superadmin-gateway-form-panel,
  .superadmin-gateway-list-panel,
  .superadmin-gallery-form-panel,
  .superadmin-gallery-list-panel {
    min-height: auto;
  }

  .superadmin-tenant-content-panel {
    gap: 14px;
  }

  .superadmin-tenant-form-panel,
  .superadmin-tenant-card-section {
    border-radius: 16px;
  }

  .superadmin-tenant-form-sticky {
    position: static;
  }

  .superadmin-quick-reply-form-sticky {
    position: static;
  }

  .superadmin-gateway-form-sticky {
    position: static;
  }

  .superadmin-gallery-form-sticky {
    position: static;
  }

  .superadmin-tenant-mapping-form {
    grid-template-columns: 1fr;
  }

  .superadmin-tenant-kpis {
    grid-template-columns: 1fr;
  }

  .superadmin-list.superadmin-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(156px, 156px));
  }

  .superadmin-gallery-card {
    width: 156px;
  }

  .superadmin-gallery-thumb {
    max-width: 124px;
  }
}

@media (max-width: 1000px) {
  .topbar {
    display: none;
  }

  .topbar-trigger {
    display: inline-flex;
  }
}

body,
.workspace,
.shell,
.workspace-panel,
.conversation-list,
.chat-room,
.topbar,
.topbar-drawer,
.job-feed-drawer,
.edit-contact-form,
.quick-reply-panel,
.gallery-panel,
.emoji-picker,
.contacts-panel,
.gateway-panel,
.superadmin-panel {
  color: var(--text-main);
}

.workspace,
.shell {
  background: var(--bg-app);
}

.chat-room {
  background-color: var(--bg-chat);
}

.conversation-item,
.quick-reply-item,
.job-item,
.contact-card,
.stat-card,
.superadmin-card {
  background: var(--surface-strong);
  color: var(--text-main);
  border-color: var(--line);
}

.conversation-item strong,
.conversation-name,
.contact-name,
.panel-title-row h2,
.workspace-title {
  color: var(--text-main);
}

.conversation-item:hover,
.quick-reply-item:hover,
.job-item:hover,
.contact-card:hover {
  background: var(--bg-card-hover);
}

.contacts-workspace.is-split-mode {
  overflow: hidden;
}

.contacts-workspace.is-split-mode .contacts-panel {
  background: var(--bg-panel);
}

.contacts-workspace.is-split-mode .contacts-sticky-shell {
  position: sticky;
  top: 0;
  background:
    linear-gradient(180deg, rgba(24, 26, 27, 0.99), rgba(21, 23, 24, 0.97)),
    var(--bg-panel);
  border-bottom: 1px solid var(--line);
}

.contacts-workspace.is-split-mode .contacts-header-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px 10px;
  margin: 0;
}

.contacts-workspace.is-split-mode .contacts-back-btn {
  display: inline-flex;
}

.contacts-workspace.is-split-mode .contacts-header-copy {
  gap: 2px;
}

.contacts-workspace.is-split-mode .contacts-header-copy h2 {
  font-size: 16px;
}

.contacts-workspace.is-split-mode .contacts-header-meta {
  font-size: 12px;
}

.contacts-workspace.is-split-mode .contacts-toolbar {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  max-width: none;
  margin: 0;
  padding: 0 14px 12px;
  background: transparent;
}

.contacts-workspace.is-split-mode .contacts-search-field {
  width: 100%;
}

.contacts-workspace.is-split-mode .contacts-search-field span {
  display: none;
}

.contacts-workspace.is-split-mode .contacts-list {
  gap: 0;
  max-width: none;
  margin: 0;
  padding: 0 0 16px;
}

.contacts-workspace.is-split-mode .contacts-empty-state {
  margin: 14px;
  min-height: 180px;
}

.contacts-workspace.is-split-mode .contact-card.contact-card-compact {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.contacts-workspace.is-split-mode .contact-card.contact-card-compact:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.contacts-workspace.is-split-mode .contact-card.contact-card-compact:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.contacts-workspace.is-split-mode .contact-avatar {
  width: 42px;
  height: 42px;
}

.contacts-workspace.is-split-mode .contact-primary {
  gap: 4px;
  min-width: 0;
}

.contacts-workspace.is-split-mode .contact-name-row {
  min-width: 0;
  flex-wrap: nowrap;
}

.contacts-workspace.is-split-mode .contact-name {
  font-size: 14px;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contacts-workspace.is-split-mode .contact-secondary-row {
  gap: 6px;
  overflow: hidden;
}

.contacts-workspace.is-split-mode .contact-phone {
  font-size: 11px;
  max-width: 100%;
}

.contacts-workspace.is-split-mode .source-badge,
.contacts-workspace.is-split-mode .business-badge {
  padding: 2px 7px;
  font-size: 10px;
}

.contacts-workspace.is-split-mode .contact-actions-compact {
  justify-content: flex-end;
  width: auto;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}

.contacts-workspace.is-split-mode .contact-edit-btn,
.contacts-workspace.is-split-mode .contact-sync-btn,
.contacts-workspace.is-split-mode .contact-delete-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
}

.contacts-workspace.is-split-mode .contact-start-chat-pill {
  min-width: 64px;
  height: 32px;
  padding: 0 10px;
}

.contacts-workspace.is-split-mode .contact-start-chat-pill svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 1180px) {
  .contacts-workspace.is-split-mode .contacts-source-field,
  .contacts-workspace.is-split-mode .contacts-toolbar-actions,
  .contacts-workspace.is-split-mode #contactsImportSummary,
  .contacts-workspace.is-split-mode #contactsStatsSummary,
  .contacts-workspace.is-split-mode #contactsImportStatus {
    display: none;
  }
}

.conversation-list.collapsed .conversation-item:not(.active) {
  background: var(--bg-card);
}

.conversation-items {
  gap: 10px;
}

.conversation-item {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  border-radius: 16px;
  padding: 11px 12px;
}

.conversation-item strong,
.conversation-name {
  color: rgba(233, 237, 239, 0.9);
}

.conversation-preview,
.conversation-subline,
.conversation-time,
.conversation-preview-status {
  color: rgba(174, 186, 193, 0.74);
}

.conversation-preview-status.is-sent {
  color: rgba(174, 186, 193, 0.56);
}

.conversation-preview-status.is-delivered {
  color: rgba(174, 186, 193, 0.66);
}

.conversation-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: transparent;
  box-shadow: none;
}

.conversation-item.unread .conversation-name {
  color: var(--text-main);
  font-weight: 700;
}

.conversation-item.unread .conversation-preview {
  color: rgba(233, 237, 239, 0.88);
  font-weight: 500;
}

.conversation-item.unread .conversation-time,
.conversation-item.unread .conversation-subline,
.conversation-item.unread .conversation-preview-status {
  color: rgba(233, 237, 239, 0.82);
}

.conversation-card.is-unread,
.conversation-item.is-unread,
.conversation-item.unread {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}

.conversation-item.active {
  background: rgba(0, 168, 132, 0.12);
  border-color: rgba(0, 168, 132, 0.26);
  box-shadow:
    inset 0 0 0 1px rgba(0, 168, 132, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.14);
}

.conversation-item.active:hover {
  background: rgba(0, 168, 132, 0.14);
  border-color: rgba(0, 168, 132, 0.3);
}

.conversation-item.active .conversation-name,
.conversation-item.active .conversation-preview {
  color: var(--text-main);
}

.conversation-item.active .conversation-name {
  font-weight: 600;
}

.conversation-item.active .conversation-preview {
  font-weight: 500;
}

.conversation-item.active .conversation-time,
.conversation-item.active .conversation-subline {
  color: rgba(233, 237, 239, 0.78);
}

.unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 2px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
  box-shadow: 0 1px 6px rgba(0, 168, 132, 0.24);
}

.unread-dot {
  width: 9px;
  height: 9px;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.14);
}

.message-card,
.message-card .meta,
.message-card strong,
.message-text,
.message-quoted-text,
.reply-preview-text,
.audio-message-meta,
.pending-media-preview-title,
.gallery-item-label,
.quick-reply-item,
.job-item,
.contact-detail,
.chat-phone,
.chat-assignment,
.conversation-preview,
.conversation-subline,
.meta,
.muted,
.panel-title-row,
.topbar-drawer-section {
  color: var(--text-main);
}

.meta,
.muted,
.message-card .meta,
.conversation-preview,
.conversation-subline,
.chat-phone,
.chat-assignment,
.gallery-item-label,
.eyebrow {
  color: var(--text-muted);
}

.conversation-time,
.conversation-assignee,
.topbar-drawer-section .meta {
  color: var(--text-secondary);
}

.message-card.in {
  background: var(--bubble-in);
}

.message-card.out {
  background: var(--bubble-out);
}

.message-card.search-match {
  box-shadow: inset 0 0 0 1px rgba(0, 168, 132, 0.42);
}

.message-card.search-active {
  box-shadow:
    inset 0 0 0 1px rgba(0, 168, 132, 0.8),
    0 0 0 3px rgba(0, 168, 132, 0.14);
}

.message-card.reply-jump-highlight {
  animation: replyJumpHighlight 1.8s ease;
}

@keyframes replyJumpHighlight {
  0% {
    box-shadow:
      inset 0 0 0 1px rgba(0, 168, 132, 0.92),
      0 0 0 0 rgba(0, 168, 132, 0.24);
  }

  20% {
    box-shadow:
      inset 0 0 0 1px rgba(0, 168, 132, 0.92),
      0 0 0 5px rgba(0, 168, 132, 0.2);
  }

  100% {
    box-shadow:
      inset 0 0 0 1px rgba(0, 168, 132, 0),
      0 0 0 0 rgba(0, 168, 132, 0);
  }
}

.message-quoted,
.reply-preview,
.pending-media-preview,
.audio-message,
.audio-message.voice-note {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.reply-preview {
  border-color: rgba(42, 210, 97, 0.24);
  background: rgba(255, 255, 255, 0.04);
}

.message-quoted-label,
.reply-preview-label,
.status-connected {
  color: var(--accent);
}

.reply-preview-label {
  color: #2AD261;
  opacity: 1;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 2px;
}

.bubble-in .bubble-label,
.bubble-in .message-text,
.bubble-in .message-quoted-text,
.bubble-in .message-media a,
.bubble-in .audio-message-meta,
.bubble-in a {
  color: #e9edef;
}

.message-card.out,
.message-card.out strong,
.message-card.out .meta,
.message-card.out .message-text,
.message-card.out .message-quoted-text,
.message-card.out .message-media a,
.message-card.out .audio-message-meta,
.message-card.out a,
.bubble-out .bubble-label,
.bubble-out .message-text,
.bubble-out .message-quoted-text,
.bubble-out .message-media a,
.bubble-out .audio-message-meta,
.bubble-out a {
  color: #e9edef;
}

.message-card.out .message-text,
.bubble-out .message-text {
  color: #f1f5f3;
}

.message-card.out .bubble-label,
.bubble-out .bubble-label {
  color: #d9fdd3;
  opacity: 0.9;
}

.bubble-in .bubble-meta {
  color: rgba(233, 237, 239, 0.72);
}

.message-card.out .bubble-meta,
.bubble-out .bubble-meta {
  color: #b8d8d1;
  opacity: 0.75;
}

.message-card.out .message-forwarded-label,
.bubble-out .message-forwarded-label {
  color: #b8d8d1;
  opacity: 0.8;
}

.bubble-in .message-quoted {
  background: rgba(36, 39, 43, 0.96);
  color: #58a6ff;
}

.bubble-in .message-quoted::before {
  background: #58a6ff;
}

.bubble-out .message-quoted {
  background: rgba(255, 255, 255, 0.16);
  color: #2AD261;
}

.bubble-out .message-quoted::before,
.message-row.outbound .message-card .message-quoted::before,
.message-card.out .message-quoted::before,
.message-card.outbound .message-quoted::before,
.message-card.from-me .message-quoted::before,
.chat-bubble.out .message-quoted::before,
.chat-bubble.outbound .message-quoted::before {
  background: #2AD261;
}

.message-card.out a,
.bubble-out a {
  color: #53bdeb;
  text-decoration: underline;
}

.unread-badge {
  background: rgba(0, 168, 132, 0.18);
  color: #d7fff6;
}

.conversation-unread-badge,
.conversation-item.compact .avatar-unread-badge {
  background: #25d366;
  color: #062b1f;
  box-shadow: 0 0 0 2px rgba(17, 27, 33, 0.92), 0 8px 16px rgba(37, 211, 102, 0.28);
}

.conversation-item .conversation-meta .unread-badge {
  background: #25d366;
  color: #062b1f;
  box-shadow: 0 0 0 2px rgba(17, 27, 33, 0.92), 0 8px 16px rgba(37, 211, 102, 0.28);
}

.unread-dot {
  background: var(--accent);
}

.composer,
.chat-header,
.topbar,
.topbar-drawer-section,
.job-feed-drawer-header {
  background:
    linear-gradient(180deg, rgba(35, 37, 39, 0.985), rgba(31, 33, 35, 0.985)),
    var(--bg-header);
  border-color: var(--line);
}

.conversation-search,
.quick-reply-search-field input,
.chat-search-input,
.field input,
textarea,
select {
  background: #111b21;
  color: var(--text-main);
  border-color: var(--line);
}

.conversation-search:focus,
.quick-reply-search-field input:focus,
.chat-search-input:focus,
.field input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.12);
  outline: none;
}

.emoji-picker-tab,
.emoji-option,
.reply-preview-close,
.more-actions-item,
.topbar-drawer-nav button,
.topbar-drawer-actions button,
button.secondary {
  background: var(--bg-card);
  color: var(--text-main);
}

.emoji-picker-tab.active,
.active-view {
  background: var(--accent) !important;
  color: #06281f !important;
}

.send-btn {
  background: var(--accent) !important;
  color: #e9edef !important;
}

.gallery-item-thumb,
.pending-media-preview-thumb,
.message-image,
.message-card .media-preview,
.superadmin-gallery-thumb,
.gateway-qr img {
  background: #111b21;
  border-color: var(--line);
}

/* Final outbound bubble override.
   The actual DOM classes are: .message-row.outbound > .message-card.chat-bubble.out.bubble-out */
.message-row.outbound .message-card,
.message-card.out,
.message-card.outbound,
.message-card.from-me,
.chat-bubble.out,
.chat-bubble.outbound,
.bubble-out {
  background: var(--outgoing-bubble-bg) !important;
  background-image: none !important;
  color: #f1f5f3 !important;
  border-color: rgba(0, 0, 0, 0.14) !important;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.message-row.inbound .message-card::after,
.message-card.in::after,
.message-card.inbound::after,
.chat-bubble.in::after,
.chat-bubble.inbound::after,
.bubble-in::after {
  border-color: transparent var(--incoming-bubble-bg) transparent transparent !important;
}

.message-row.outbound .message-card::after,
.message-card.out::after,
.message-card.outbound::after,
.message-card.from-me::after,
.chat-bubble.out::after,
.chat-bubble.outbound::after,
.bubble-out::after {
  border-color: transparent transparent transparent var(--outgoing-bubble-bg) !important;
}

.message-row.outbound .message-card *,
.message-card.out *,
.message-card.outbound *,
.message-card.from-me *,
.chat-bubble.out *,
.chat-bubble.outbound *,
.bubble-out * {
  color: inherit;
}

.message-row.outbound .message-card .message-text,
.message-card.out .message-text,
.message-card.outbound .message-text,
.message-card.from-me .message-text,
.chat-bubble.out .message-text,
.chat-bubble.outbound .message-text,
.bubble-out .message-text {
  color: #f1f5f3 !important;
}

.message-row.outbound .message-card.is-revoked .message-text,
.message-card.out.is-revoked .message-text,
.message-card.outbound.is-revoked .message-text,
.message-card.from-me.is-revoked .message-text,
.chat-bubble.out.is-revoked .message-text,
.chat-bubble.outbound.is-revoked .message-text,
.bubble-out.is-revoked .message-text {
  color: rgba(217, 253, 211, 0.72) !important;
  font-style: italic;
}

.message-row.outbound .message-card .bubble-label,
.message-card.out .bubble-label,
.message-card.outbound .bubble-label,
.message-card.from-me .bubble-label,
.chat-bubble.out .bubble-label,
.chat-bubble.outbound .bubble-label,
.bubble-out .bubble-label {
  color: #d9fdd3 !important;
  opacity: 0.9 !important;
}

.message-row.outbound .message-card .meta,
.message-row.outbound .message-card .bubble-meta,
.message-card.out .meta,
.message-card.out .bubble-meta,
.message-card.outbound .meta,
.message-card.outbound .bubble-meta,
.message-card.from-me .meta,
.message-card.from-me .bubble-meta,
.chat-bubble.out .meta,
.chat-bubble.out .bubble-meta,
.chat-bubble.outbound .meta,
.chat-bubble.outbound .bubble-meta,
.bubble-out .meta,
.bubble-out .bubble-meta {
  color: #b8d8d1 !important;
  opacity: 0.8 !important;
}

.bubble-in .message-quoted-label,
.message-row.inbound .message-card .message-quoted-label,
.chat-bubble.in .message-quoted-label {
  color: #58a6ff !important;
  opacity: 1 !important;
}

.bubble-out .message-quoted-label,
.message-row.outbound .message-card .message-quoted-label,
.message-card.out .message-quoted-label,
.message-card.outbound .message-quoted-label,
.message-card.from-me .message-quoted-label,
.chat-bubble.out .message-quoted-label,
.chat-bubble.outbound .message-quoted-label {
  color: #2AD261 !important;
  opacity: 1 !important;
}

.bubble-in .message-quoted-text,
.message-row.inbound .message-card .message-quoted-text,
.chat-bubble.in .message-quoted-text {
  color: rgba(255, 255, 255, 0.92) !important;
}

.bubble-out .message-quoted-text,
.message-row.outbound .message-card .message-quoted-text,
.message-card.out .message-quoted-text,
.message-card.outbound .message-quoted-text,
.message-card.from-me .message-quoted-text,
.chat-bubble.out .message-quoted-text,
.chat-bubble.outbound .message-quoted-text {
  color: rgba(255, 255, 255, 0.9) !important;
}

.message-row.outbound .message-card .message-forwarded-label,
.message-card.out .message-forwarded-label,
.message-card.outbound .message-forwarded-label,
.message-card.from-me .message-forwarded-label,
.chat-bubble.out .message-forwarded-label,
.chat-bubble.outbound .message-forwarded-label,
.bubble-out .message-forwarded-label {
  color: #b8d8d1 !important;
  opacity: 0.8 !important;
}

.message-row.outbound .message-card a,
.message-card.out a,
.message-card.outbound a,
.message-card.from-me a,
.chat-bubble.out a,
.chat-bubble.outbound a,
.bubble-out a {
  color: #53bdeb !important;
  text-decoration: underline !important;
}

.message-row .message-card .message-inline-link,
.message-row .chat-bubble .message-inline-link,
.bubble-in .message-inline-link,
.bubble-out .message-inline-link {
  color: #7dd3fc !important;
  text-decoration: underline !important;
}

.message-row .message-card .message-inline-link-phone,
.message-row .chat-bubble .message-inline-link-phone,
.bubble-in .message-inline-link-phone,
.bubble-out .message-inline-link-phone {
  color: #86efac !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(134, 239, 172, 0.72) !important;
}

/* Final message action alignment override.
   Incoming/customer bubbles use right-side action outside the bubble,
   outgoing/admin bubbles use left-side action outside the bubble. */
.message-row.inbound .message-bubble-wrapper .message-action-trigger,
.message-row.inbound .message-bubble-wrapper .message-action-button,
.message-action-button-incoming,
.message-bubble-wrapper.inbound .message-action-trigger,
.message-bubble-wrapper.inbound .message-action-button,
.message-bubble-wrapper .message-action-button-incoming,
.message-bubble-wrapper .message-action-button-incoming.message-action-trigger,
.message-bubble-wrapper .message-action-button-incoming.message-action-button,
.message-action-button-incoming {
  inset: 50% -12px auto auto !important;
  left: auto !important;
  right: -12px !important;
  inset-inline-start: auto !important;
  inset-inline-end: -12px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  top: 50% !important;
}

.message-row.outbound .message-bubble-wrapper .message-action-trigger,
.message-row.outbound .message-bubble-wrapper .message-action-button,
.message-action-button-outgoing,
.message-bubble-wrapper.outbound .message-action-trigger,
.message-bubble-wrapper.outbound .message-action-button,
.message-bubble-wrapper .message-action-button-outgoing,
.message-bubble-wrapper .message-action-button-outgoing.message-action-trigger,
.message-bubble-wrapper .message-action-button-outgoing.message-action-button,
.message-action-button-outgoing {
  inset: 50% auto auto -12px !important;
  left: -12px !important;
  right: auto !important;
  inset-inline-start: -12px !important;
  inset-inline-end: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  top: 50% !important;
}

.message-action-button {
  position: absolute !important;
  inset: var(--message-action-inset) !important;
  left: var(--message-action-left) !important;
  right: var(--message-action-right) !important;
  inset-inline-start: var(--message-action-inline-start) !important;
  inset-inline-end: var(--message-action-inline-end) !important;
  top: var(--message-action-top, 50%) !important;
}

/* Responsive split / narrow desktop stabilization */
html,
body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.shell,
.workspace,
.workspace-panel,
#inboxWorkspace.inbox-workspace,
#inboxWorkspace .conversation-list,
#inboxWorkspace .chat-room,
#inboxWorkspace .chat-header,
#inboxWorkspace .message-list,
#inboxWorkspace .composer,
#inboxWorkspace .composer-bar {
  min-width: 0;
}

.shell,
.workspace,
#inboxWorkspace.inbox-workspace {
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  background: var(--bg-app);
}

#inboxWorkspace.inbox-workspace {
  grid-template-columns: clamp(280px, 30vw, 360px) minmax(0, 1fr);
}

#inboxWorkspace .conversation-list {
  width: auto;
  max-width: 100%;
  overflow: hidden;
}

#inboxWorkspace .conversation-items {
  min-width: 0;
  overflow-x: hidden;
}

#inboxWorkspace .chat-room {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

#inboxWorkspace .chat-header {
  min-width: 0;
  max-width: 100%;
}

#inboxWorkspace .message-list {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.chat-panel {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.messages-container {
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

#inboxWorkspace .composer {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}

#inboxWorkspace .composer-bar,
#inboxWorkspace .composer-actions,
#inboxWorkspace .reply-preview,
#inboxWorkspace .pending-media-preview {
  min-width: 0;
  max-width: 100%;
}

#inboxWorkspace .composer-actions {
  overflow-x: auto;
  overflow-y: hidden;
}

#inboxWorkspace .composer textarea,
#inboxWorkspace .composer input,
#inboxWorkspace .composer .field,
#inboxWorkspace .composer .message-input {
  min-width: 0;
  max-width: 100%;
}

#inboxWorkspace .composer-input-shell {
  background: #161819;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 0 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

#inboxWorkspace #messageInput {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-main);
  min-height: 38px;
  max-height: 120px;
  padding: 8px 10px 7px;
  border-radius: 14px;
  line-height: 1.3;
}

#inboxWorkspace #messageInput::placeholder {
  color: rgba(134, 150, 160, 0.88);
}

@media (max-width: 1180px) {
  #inboxWorkspace.inbox-workspace {
    grid-template-columns: clamp(240px, 28vw, 320px) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .chat-panel {
    margin-left: 0 !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .chat-header,
  .messages-container,
  .composer {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  #inboxWorkspace .chat-room {
    grid-column: 2 / -1;
    margin-left: 0 !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #inboxWorkspace.inbox-workspace,
  #inboxWorkspace.inbox-workspace.conversation-panel-compact {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  #inboxWorkspace .conversation-list,
  #inboxWorkspace .conversation-list.collapsed {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    flex: 0 0 72px;
  }

  #inboxWorkspace .conversation-search-row,
  #inboxWorkspace .conversation-list .panel-title-row h2 {
    display: none;
  }

  #inboxWorkspace .conversation-filter-tabs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 8px 10px;
    overflow: visible;
  }

  #inboxWorkspace .conversation-filter-tab {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 16px;
    position: relative;
  }

  #inboxWorkspace .conversation-filter-tab-label {
    display: none;
  }

  #inboxWorkspace .conversation-filter-tab-unread {
    display: none;
  }

  #inboxWorkspace .conversation-filter-badge {
    position: absolute;
    top: -3px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 10px;
    box-shadow: 0 0 0 2px rgba(17, 27, 33, 0.95);
  }

  #inboxWorkspace .conversation-list .panel-title-row {
    padding: 14px 8px 0;
    justify-content: center;
  }

  #inboxWorkspace .conversation-drawer-header {
    justify-content: space-between;
    gap: 8px;
  }

  #inboxWorkspace .conversation-drawer-title {
    font-size: 24px;
  }

  #inboxWorkspace .conversation-drawer-actions {
    gap: 6px;
    flex-direction: column;
  }

  #inboxWorkspace .conversation-items {
    padding: 8px 6px 10px;
    justify-items: center;
  }

  #inboxWorkspace .chat-room {
    min-width: 0;
  }

  #inboxWorkspace .chat-header {
    padding: 8px 10px;
  }

  #inboxWorkspace .chat-header-main {
    align-items: center;
    gap: 8px;
  }

  #inboxWorkspace .chat-header-left,
  #inboxWorkspace .chat-title-area,
  #inboxWorkspace .chat-header-info {
    min-width: 0;
    flex: 1 1 auto;
  }

  #inboxWorkspace .chat-title-area {
    gap: 8px;
  }

  #inboxWorkspace .chat-header-avatar {
    width: 34px;
    height: 34px;
  }

  #inboxWorkspace .chat-name,
  #inboxWorkspace .chat-meta-line {
    max-width: 100%;
  }

  #inboxWorkspace .chat-header-right,
  #inboxWorkspace .normal-header-actions {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 5px;
  }

  #inboxWorkspace .chat-header-assignment {
    transform: none;
    min-width: 0;
  }

  #inboxWorkspace .chat-assignment-stack {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  #inboxWorkspace .chat-assignment-actions,
  #inboxWorkspace .chat-assignment-status {
    min-width: 0;
    flex: 0 0 auto;
  }

  #inboxWorkspace .assignment-pill {
    max-width: 112px;
    margin-top: 0;
    padding: 0 6px;
  }

  #inboxWorkspace .assignment-text {
    max-width: 92px;
  }

  #inboxWorkspace .chat-assignment-btn {
    min-height: 24px;
    padding: 0 8px;
  }

  #inboxWorkspace .chat-header-action-btn {
    width: 32px;
    height: 32px;
  }

  #inboxWorkspace .chat-header-compact-btn {
    min-height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  #inboxWorkspace .job-feed-trigger {
    gap: 4px;
    max-width: 92px;
  }

  #inboxWorkspace .job-feed-label {
    max-width: 48px;
  }

  #inboxWorkspace .composer {
    padding-inline: 8px;
  }

  .chat-bubble {
    max-width: min(82%, calc(100% - 10px));
  }
}

@media (max-width: 700px) {
  #inboxWorkspace .conversation-rail {
    display: none;
  }

  #inboxWorkspace .chat-room {
    grid-column: 1 / -1;
  }

  #inboxWorkspace.inbox-workspace,
  #inboxWorkspace.inbox-workspace.conversation-panel-compact,
  #inboxWorkspace.inbox-workspace.conversation-panel-expanded {
    grid-template-columns: minmax(0, 1fr);
  }

  #inboxWorkspace .conversation-list,
  #inboxWorkspace .conversation-list.collapsed {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    min-width: 0;
    max-width: min(320px, 86vw);
    flex: none;
    z-index: 45;
    transform: translateX(-110%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--line);
    border-radius: 0 20px 20px 0;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.35);
  }

  #inboxWorkspace.conversation-panel-expanded .conversation-list,
  #inboxWorkspace .conversation-list.drawer-open {
    transform: translateX(0);
  }

  #inboxWorkspace .conversation-list .panel-title-row {
    padding: 14px 16px 0;
    justify-content: space-between;
  }

  #inboxWorkspace .conversation-list .panel-title-row h2,
  #inboxWorkspace .conversation-search-row,
  #inboxWorkspace .conversation-filter-tabs {
    display: block;
  }

  #inboxWorkspace .conversation-filter-tabs {
    display: flex;
  }

  #inboxWorkspace .conversation-drawer-actions {
    gap: 6px;
    flex-direction: row;
  }

  #inboxWorkspace .conversation-drawer-actions button,
  #inboxWorkspace .conversation-drawer-actions .unread-global,
  #inboxWorkspace .conversation-panel-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  #inboxWorkspace .conversation-items {
    padding: 10px 10px 12px;
    justify-items: stretch;
  }

  #inboxWorkspace .chat-header-right {
    min-width: 0;
    gap: 6px;
  }

  #inboxWorkspace .job-feed-label {
    display: none;
  }

  #inboxWorkspace .chat-header-assignment {
    min-width: 0;
  }

  #inboxWorkspace .chat-assignment-status {
    max-width: 110px;
  }

  #inboxWorkspace .chat-assignment-btn {
    padding: 0 8px;
  }

  #inboxWorkspace .chat-search-popover {
    right: 0;
    left: auto;
    transform: none;
    top: calc(100% + 8px);
    max-width: min(100%, calc(100vw - 32px));
  }

  #inboxWorkspace .chat-search-input {
    min-width: 0;
    width: min(44vw, 220px);
  }

  #inboxWorkspace .composer {
    padding-inline: 8px;
  }

.chat-bubble {
  max-width: min(90%, calc(100% - 8px));
  }
}

/* Container-measured inbox layout modes */
#inboxWorkspace.is-wide-split,
#inboxWorkspace.is-narrow-split {
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

#inboxWorkspace.is-mobile .conversation-rail {
  display: none !important;
}

#inboxWorkspace.is-mobile {
  grid-template-columns: minmax(0, 1fr);
}

#inboxWorkspace.is-wide-split {
  grid-template-columns: minmax(0, 1fr);
}

#inboxWorkspace.inbox-workspace.is-narrow-split,
#inboxWorkspace.inbox-workspace.is-narrow-split.conversation-panel-compact {
  grid-template-columns: 56px minmax(0, 1fr);
}

#inboxWorkspace.inbox-workspace.is-narrow-split .conversation-rail,
#inboxWorkspace.inbox-workspace.is-narrow-split.conversation-panel-compact .conversation-rail {
  display: flex;
  flex-direction: column;
  grid-column: 1;
  min-width: 56px;
  max-width: 56px;
  position: relative;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  background:
    linear-gradient(180deg, rgba(24, 26, 27, 0.985), rgba(21, 23, 24, 0.985)),
    var(--bg-panel);
}

#inboxWorkspace.is-wide-split .conversation-rail {
  display: none !important;
}

#inboxWorkspace.is-wide-split .inbox-content,
#inboxWorkspace.is-narrow-split .inbox-content,
#inboxWorkspace.is-mobile .inbox-content {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#inboxWorkspace.is-wide-split .inbox-content {
  display: grid;
  grid-column: 1;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
}

#inboxWorkspace.is-narrow-split .inbox-content {
  display: grid;
  grid-column: 2;
  grid-template-columns: minmax(250px, 260px) minmax(0, 1fr);
}

#inboxWorkspace.is-mobile .inbox-content {
  display: grid;
  grid-column: 1;
  grid-template-columns: minmax(0, 1fr);
}

#inboxWorkspace.is-wide-split .conversation-list,
#inboxWorkspace.is-narrow-split .conversation-list,
#inboxWorkspace.is-mobile .conversation-list {
  position: relative;
  inset: auto;
  transform: none;
  transition: none;
  width: auto;
  min-width: 0;
  max-width: none;
  flex: none;
  z-index: auto;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

#inboxWorkspace.is-wide-split .conversation-list {
  grid-column: 1;
}

#inboxWorkspace.is-wide-split .chat-room {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#inboxWorkspace.is-wide-split .composer-bar,
#inboxWorkspace.is-narrow-split .composer-bar,
#inboxWorkspace.is-mobile .composer-bar {
  align-items: center;
}

#inboxWorkspace.is-wide-split .composer-input-shell,
#inboxWorkspace.is-narrow-split .composer-input-shell,
#inboxWorkspace.is-mobile .composer-input-shell {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

#inboxWorkspace.is-wide-split #messageInput,
#inboxWorkspace.is-narrow-split #messageInput,
#inboxWorkspace.is-mobile #messageInput {
  min-height: 36px;
  height: 36px;
  max-height: 96px;
  padding: 7px 54px 7px 12px;
  font-size: 14px;
  line-height: 18px;
  overflow-y: hidden;
  resize: none;
}

#inboxWorkspace.is-wide-split .composer-emoji-btn,
#inboxWorkspace.is-narrow-split .composer-emoji-btn,
#inboxWorkspace.is-mobile .composer-emoji-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  z-index: 1;
}

#inboxWorkspace.is-narrow-split .conversation-list,
#inboxWorkspace.is-narrow-split .chat-room,
#inboxWorkspace.is-mobile .conversation-list,
#inboxWorkspace.is-mobile .chat-room {
  grid-column: 1;
  width: 100%;
  min-width: 0;
  max-width: none;
  position: relative;
  inset: auto;
  z-index: auto;
  overflow: hidden;
}

#inboxWorkspace.inbox-workspace.is-narrow-split .conversation-list,
#inboxWorkspace.inbox-workspace.is-narrow-split.conversation-panel-compact .conversation-list,
#inboxWorkspace.inbox-workspace.is-narrow-split .conversation-list.collapsed,
#inboxWorkspace.inbox-workspace.is-narrow-split.conversation-panel-compact .conversation-list.collapsed {
  grid-column: 1;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: 1 1 auto !important;
  margin: 0 !important;
  justify-self: stretch;
  align-self: stretch;
}

#inboxWorkspace.is-narrow-split .conversation-rail-top {
  padding: 10px 6px;
  gap: 10px;
}

#inboxWorkspace.is-narrow-split .conversation-rail-tabs {
  gap: 6px;
}

#inboxWorkspace.is-narrow-split .conversation-rail-tab,
#inboxWorkspace.is-narrow-split .conversation-rail-sync-btn {
  min-height: 40px;
  border-radius: 14px;
}

#inboxWorkspace.is-narrow-split .conversation-rail-footer {
  display: grid;
}

#inboxWorkspace.is-narrow-split .chat-room {
  grid-column: 2;
  display: flex;
  flex-direction: column;
}

#inboxWorkspace.is-mobile .chat-room {
  display: none;
  flex-direction: column;
}

#inboxWorkspace.is-mobile.is-chat-view .conversation-list {
  display: none;
}

#inboxWorkspace.is-mobile.is-chat-view .chat-room {
  display: flex;
}

#inboxWorkspace.is-mobile.is-list-view .conversation-list {
  display: flex;
}

#inboxWorkspace.is-mobile.is-list-view .chat-room {
  display: none;
}

#inboxWorkspace.is-wide-split .conversation-filter-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

#inboxWorkspace.is-narrow-split .conversation-filter-tabs {
  display: none !important;
}

#inboxWorkspace.is-mobile .conversation-filter-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 32;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 8px 10px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(24, 26, 27, 0.985), rgba(21, 23, 24, 0.985)),
    var(--bg-panel);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 -14px 32px rgba(0, 0, 0, 0.28);
}

#inboxWorkspace.is-mobile .conversation-filter-tab {
  position: relative;
  flex: none;
  min-height: 52px;
  min-width: 0;
  gap: 4px;
  justify-content: center;
  padding: 6px 4px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  flex-direction: column;
  font-size: 10px;
  line-height: 1.2;
  color: rgba(174, 186, 193, 0.82);
}

#inboxWorkspace.is-mobile .conversation-filter-tab-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

#inboxWorkspace.is-mobile .conversation-filter-tab-label {
  display: inline;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#inboxWorkspace.is-mobile .conversation-filter-tab-unread {
  display: inline-flex;
}

#inboxWorkspace.is-mobile .conversation-filter-tab.active {
  color: #25d366;
  background: rgba(0, 168, 132, 0.12);
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 168, 132, 0.24);
}

#inboxWorkspace.is-mobile .conversation-filter-tab:hover,
#inboxWorkspace.is-mobile .conversation-filter-tab:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

#inboxWorkspace.is-mobile .conversation-filter-tab .conversation-filter-badge {
  position: absolute;
  top: 4px;
  right: 9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  box-shadow: 0 0 0 2px rgba(17, 27, 33, 0.96);
}

#inboxWorkspace.is-wide-split .conversation-filter-tab {
  flex: 1 1 0;
  gap: 0;
  min-width: 0;
  justify-content: center;
  padding: 0 8px;
  font-size: 11px;
}

#inboxWorkspace.is-wide-split .conversation-filter-tab-icon {
  display: none;
}

#inboxWorkspace.is-wide-split .conversation-drawer-title {
  display: block;
}

#inboxWorkspace.is-narrow-split .conversation-drawer-title {
  display: block;
}

#inboxWorkspace.is-mobile .conversation-drawer-title {
  display: block;
}

#inboxWorkspace.is-wide-split .conversation-context-label {
  display: none;
}

#inboxWorkspace.is-narrow-split .conversation-context-label {
  display: block;
}

#inboxWorkspace.is-mobile .conversation-context-label {
  display: none;
}

#inboxWorkspace.is-wide-split .conversation-list .panel-title-row,
#inboxWorkspace.is-narrow-split .conversation-list .panel-title-row,
#inboxWorkspace.is-mobile .conversation-list .panel-title-row {
  padding: 12px 14px 0;
  justify-content: space-between;
}

#inboxWorkspace.is-mobile .conversation-list .panel-title-row {
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}

#inboxWorkspace.is-narrow-split .conversation-list .panel-title-row {
  padding: 10px 10px 0;
}

#inboxWorkspace.is-wide-split .conversation-search-row,
#inboxWorkspace.is-narrow-split .conversation-search-row,
#inboxWorkspace.is-mobile .conversation-search-row {
  display: block;
  padding: 6px 14px 0;
}

#inboxWorkspace.is-narrow-split .conversation-search-row {
  padding: 6px 10px 0;
}

#inboxWorkspace.is-wide-split .conversation-drawer-actions,
#inboxWorkspace.is-narrow-split .conversation-drawer-actions,
#inboxWorkspace.is-mobile .conversation-drawer-actions {
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

#inboxWorkspace.is-wide-split #conversationHeaderSyncBtn {
  display: inline-flex;
}

#inboxWorkspace.is-narrow-split #conversationHeaderSyncBtn {
  display: inline-flex;
}

#inboxWorkspace.is-mobile #conversationHeaderSyncBtn,
#inboxWorkspace.is-mobile #conversationHeaderContactsBtn {
  display: inline-flex;
}

#inboxWorkspace.is-mobile #conversationHeaderGatewayDot {
  display: inline-flex;
}

#inboxWorkspace.is-mobile .chat-header {
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
}

#inboxWorkspace.is-wide-split .conversation-drawer-actions #globalUnreadIndicator {
  display: inline-flex;
}

#inboxWorkspace.is-narrow-split .conversation-drawer-actions #globalUnreadIndicator {
  display: none;
}

#inboxWorkspace.is-mobile .conversation-drawer-actions #globalUnreadIndicator {
  display: none;
}

#inboxWorkspace.is-mobile.is-chat-view .conversation-filter-tabs {
  display: none;
}

#inboxWorkspace.is-wide-split #conversationHeaderContactsBtn {
  display: none !important;
}

#inboxWorkspace.is-narrow-split #conversationHeaderContactsBtn {
  display: none !important;
}

#inboxWorkspace.is-wide-split .conversation-panel-toggle,
#inboxWorkspace.is-narrow-split .conversation-panel-toggle,
#inboxWorkspace.is-mobile .conversation-panel-toggle {
  display: none !important;
}

#inboxWorkspace.is-wide-split .conversation-items,
#inboxWorkspace.is-narrow-split .conversation-items,
#inboxWorkspace.is-mobile .conversation-items {
  padding: 8px 8px 12px;
  justify-items: stretch;
  align-content: start;
}

#inboxWorkspace.is-mobile .conversation-items {
  padding-bottom: 92px;
}

#inboxWorkspace.is-narrow-split .conversation-items {
  padding: 6px 6px 10px;
  gap: 6px;
}

#inboxWorkspace.is-wide-split .conversation-item,
#inboxWorkspace.is-narrow-split .conversation-item,
#inboxWorkspace.is-mobile .conversation-item {
  min-height: 68px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 9px 10px;
}

#inboxWorkspace.is-narrow-split .conversation-item {
  min-height: 62px;
  padding: 8px 9px;
  gap: 8px;
}

#inboxWorkspace.is-wide-split .conversation-main,
#inboxWorkspace.is-narrow-split .conversation-main,
#inboxWorkspace.is-mobile .conversation-main {
  display: grid;
}

#inboxWorkspace.is-narrow-split .conversation-avatar {
  width: 38px;
  height: 38px;
}

#inboxWorkspace.is-narrow-split .conversation-name {
  font-size: 13px;
}

#inboxWorkspace.is-narrow-split .conversation-preview {
  font-size: 12px;
}

#inboxWorkspace.is-narrow-split .conversation-opened-by {
  font-size: 10px;
}

#inboxWorkspace.is-mobile .chat-header-back-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
}

#inboxWorkspace.is-wide-split .chat-bubble {
  max-width: min(78%, calc(100% - 18px));
}

#inboxWorkspace.is-narrow-split .chat-bubble {
  max-width: min(80%, calc(100% - 14px));
}

#inboxWorkspace.is-mobile .chat-bubble {
  max-width: min(88%, calc(100% - 10px));
}
