:root {
  --blm-btn-bg: #0078d4;
  --blm-btn-hover: #106ebe;
  --blm-btn-text: #ffffff;
}

#blm-app, .blm-customer-app {
  --blm-accent: #E85A4F;
  --blm-accent-hover: #cf4136;
  --blm-accent-soft: rgba(232, 90, 79, 0.12);
  --blm-danger: #E85A4F;
  --blm-bg: #f7f7f7;
  --blm-card: #ffffff;
  --blm-text: #171717;
  --blm-muted: #6b7280;
  --blm-border: #e5e7ef;
  --blm-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  --blm-font-ui: var(--blm-font-body);
  --blm-font-heading: var(--blm-font-body);
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 28px;
  font-family: var(--blm-font-body);
  color: var(--blm-text);
}

.blm-app-header { margin-bottom: 18px; }
.blm-app-header-top h1 {
  margin: 0 0 4px;
  font-family: var(--blm-font-heading);
  font-size: 18px;
  font-weight: bold;
  letter-spacing: normal;
  line-height: 1.2;
  color: #171717;
}
.blm-app-subtitle {
  margin: 0;
  color: var(--blm-muted);
  font-size: 14px;
}
.blm-unread-banner {
  background: rgba(232, 90, 79, 0.12);
  color: #cf4136;
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 12px;
  font-size: 14px;
}

.blm-thread-list { display: flex; flex-direction: column; gap: 10px; }
.blm-thread-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--blm-border);
  border-radius: 14px;
  background: var(--blm-card);
  color: var(--blm-text);
  text-decoration: none;
  position: relative;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.blm-thread-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
  border-color: rgba(232, 90, 79, 0.28);
}
.blm-thread-row.is-unread {
  border-color: rgba(232, 90, 79, 0.45);
  background: linear-gradient(90deg, rgba(232, 90, 79, 0.06), #fff 28%);
}
.blm-thread-avatar {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  background: #eceff7;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.blm-thread-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blm-thread-body { flex: 1; min-width: 0; }
.blm-thread-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.blm-thread-title {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blm-thread-time {
  flex: 0 0 auto;
  font-family: var(--blm-font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--blm-muted);
}
.blm-thread-preview {
  display: block;
  font-size: 14px;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blm-thread-lastseen {
  display: block;
  margin-top: 4px;
  font-family: var(--blm-font-ui);
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
  font-style: normal;
}
.blm-thread-status-deleted,
.blm-profile-status-deleted {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(107, 114, 128, 0.14);
  color: #4b5563;
  font-family: var(--blm-font-ui);
  font-size: 11px;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.blm-thread-row.is-deleted-profile {
  border-color: rgba(107, 114, 128, 0.35);
  background: linear-gradient(90deg, rgba(107, 114, 128, 0.08), #fff 30%);
}
.blm-thread-avatar.is-deleted,
.blm-chat-avatar.is-deleted {
  opacity: 0.55;
  filter: grayscale(1);
}
.blm-deleted-notice {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #4b5563;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 14px;
}
.blm-thread-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: var(--blm-danger);
  color: #fff;
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

.blm-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--blm-border);
  border-radius: 16px;
  background: var(--blm-card);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.blm-back {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--blm-bg);
  color: var(--blm-accent);
  text-decoration: none;
}
.blm-chat-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.blm-chat-avatar {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  background: #eceff7;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.blm-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blm-chat-header-meta { min-width: 0; }
.blm-chat-header-meta h1 {
  margin: 0;
  font-family: var(--blm-font-heading);
  font-size: 18px;
  font-weight: bold;
  letter-spacing: normal;
  line-height: 1.2;
  color: #171717;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blm-chat-header-meta h1 a {
  color: inherit;
  text-decoration: none;
}
.blm-chat-lastseen {
  margin: 2px 0 0;
  font-family: var(--blm-font-ui);
  font-size: 12px;
  font-weight: 500;
  color: #9ca3af;
  font-style: normal;
}

.blm-chat-log {
  min-height: 360px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 16px;
  background: var(--blm-bg);
  border: 1px solid var(--blm-border);
  border-radius: 16px;
  margin-bottom: 14px;
}
.blm-msg {
  max-width: 78%;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--blm-border);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.blm-msg.from-me {
  margin-left: auto;
  background: var(--blm-accent-soft);
  border-color: rgba(232, 90, 79, 0.22);
}
.blm-msg.from-profile { margin-right: auto; }
.blm-msg.is-unread { box-shadow: inset 3px 0 0 var(--blm-danger); }
.blm-msg-body {
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
}
.blm-msg-time {
  font-family: var(--blm-font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--blm-muted);
  margin-top: 8px;
}
.blm-msg-attachment a {
  color: var(--blm-accent);
  font-family: var(--blm-font-ui);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.blm-msg.has-booking-btn .blm-msg-body {
  padding: 0;
  background: transparent;
  border: 0;
}
.blm-booking-blob {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff7f6;
  border: 1px solid rgba(232, 90, 79, 0.25);
  max-width: 320px;
}
.blm-booking-blob-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 90, 79, 0.12);
  color: var(--blm-accent);
}
.blm-booking-blob-icon i {
  font-size: 15px;
  line-height: 1;
}
.blm-booking-blob-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.blm-booking-blob-copy strong {
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.blm-booking-blob-copy span {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.35;
}
.blm-booking-blob-copy a {
  color: var(--blm-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.blm-booking-blob-copy a:hover {
  text-decoration: underline;
}

.blm-compose-box {
  border: 1px solid var(--blm-border);
  border-radius: 16px;
  background: var(--blm-card);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.blm-compose-row {
  display: flex;
  align-items: stretch;
  min-height: 92px;
}
.blm-compose-input {
  flex: 1;
  min-width: 0;
  display: flex;
}
.blm-compose-form textarea {
  flex: 1;
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 14px 12px;
  resize: none;
  min-height: 92px;
  max-height: 180px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  background: transparent;
}
.blm-compose-form textarea:focus {
  outline: none;
  background: #fffaf9;
  border-color: transparent !important;
  box-shadow: none !important;
}
.blm-compose-form input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  background: transparent;
}
.blm-compose-form input[type="file"]:focus {
  outline: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
.blm-compose-row > .blm-upload-btn {
  flex: 0 0 auto;
  align-self: flex-end;
  position: relative;
  margin: 0 0 10px 10px;
  padding: 10px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.blm-compose-row > .blm-upload-btn:hover { background: rgba(232, 90, 79, 0.08); }
.blm-compose-row > .blm-upload-btn:focus,
.blm-compose-row > .blm-upload-btn:focus-within,
.blm-compose-row > .blm-upload-btn.has-file {
  outline: none;
  box-shadow: none;
  border: 0;
  background: var(--blm-accent-soft);
}
.blm-compose-row > .blm-upload-btn .blm-upload-name {
  display: none;
}
.blm-send-column {
  flex: 0 0 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-left: 1px solid var(--blm-border);
  background: linear-gradient(180deg, #fffaf9 0%, #f7f7f7 100%);
}
.blm-send-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--blm-accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}
.blm-send-btn:hover {
  background: var(--blm-accent-hover);
  transform: translateY(-1px);
}
.blm-send-hint {
  font-family: var(--blm-font-ui);
  font-size: 10px;
  line-height: 1.25;
  color: #9ca3af;
  font-style: normal;
  text-align: center;
  max-width: 72px;
}
.blm-send-hint-keys {
  display: block;
  font-family: var(--blm-font-ui);
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: -0.02em;
}

.blm-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--blm-bg);
  color: #374151;
  cursor: pointer;
  font-family: var(--blm-font-ui);
  font-size: 13px;
  font-weight: 500;
  margin: 0;
}
.blm-upload-btn:hover { background: rgba(232, 90, 79, 0.08); }
.blm-upload-btn i { color: var(--blm-accent); font-size: 16px; }
.blm-upload-btn.has-file { background: var(--blm-accent-soft); color: var(--blm-accent); }

.blm-blocked-notice {
  background: #fff8e6;
  border: 1px solid #ffe6a0;
  color: #7a5b00;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 14px;
}
.blm-empty-state {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--blm-border);
  border-radius: 16px;
  background: var(--blm-card);
  color: var(--blm-muted);
}
.blm-empty-state i {
  font-size: 34px;
  color: var(--blm-accent);
  margin-bottom: 12px;
}

#item-side .master-button.blm-message-button {
  background: var(--blm-btn-bg);
  color: var(--blm-btn-text);
  display: flex;
  align-items: stretch;
  padding: 0;
  text-align: center;
  min-height: 42px;
  overflow: hidden;
}
#item-side .master-button.blm-message-button:hover {
  background: var(--blm-btn-hover);
  color: var(--blm-btn-text);
}
#item-side .master-button.blm-message-button > i {
  position: relative;
  left: auto;
  top: auto;
  flex: 0 0 42px;
  width: 42px;
  min-height: 42px;
  height: auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-indent: 0;
  color: var(--blm-btn-text);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
}
#item-side .master-button.blm-message-button .blm-message-button-text {
  flex: 1;
  min-width: 0;
  padding: 10px 10px 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
}
#item-side .master-button.blm-message-button.blm-message-button--stacked .blm-message-button-text {
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 8px 0;
}
#item-side .master-button.blm-message-button .blm-message-button-lead,
#item-side .master-button.blm-message-button .blm-message-button-inline,
#item-side .master-button.blm-message-button .blm-message-button-name {
  color: var(--blm-btn-text);
}
#item-side .master-button.blm-message-button .blm-message-button-lead,
#item-side .master-button.blm-message-button .blm-message-button-inline {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}
#item-side .master-button.blm-message-button .blm-message-button-name {
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  max-width: 100%;
}
#item-side .master-button.blm-message-button.blm-message-button--stacked .blm-message-button-name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
#item-side .master-button.blm-message-button .blm-message-button-inline .blm-message-button-name {
  display: inline;
}
.blm-message-button.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  line-height: 1.3;
  text-decoration: none;
  background: var(--blm-btn-bg);
  color: var(--blm-btn-text);
  border-radius: 6px;
  padding: 8px 12px;
}
.blm-message-button.inline:hover {
  background: var(--blm-btn-hover);
  color: var(--blm-btn-text);
  text-decoration: none;
}
.blm-message-button.inline .blm-message-button-lead,
.blm-message-button.inline .blm-message-button-inline,
.blm-message-button.inline .blm-message-button-name {
  color: var(--blm-btn-text);
}
.blm-message-button.inline > i {
  color: var(--blm-btn-text);
}
.blm-message-button.inline .blm-message-button-text {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.blm-message-button.inline.blm-message-button--stacked .blm-message-button-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
html[dir="rtl"] #item-side .master-button.blm-message-button {
  flex-direction: row-reverse;
}
html[dir="rtl"] #item-side .master-button.blm-message-button > i {
  border-radius: 0 6px 6px 0;
  border-right: none;
  border-left: 1px solid rgba(0, 0, 0, 0.15);
}
html[dir="rtl"] #item-side .master-button.blm-message-button .blm-message-button-text {
  padding: 10px 0 10px 10px;
}
html[dir="rtl"] #item-side .master-button.blm-message-button.blm-message-button--stacked .blm-message-button-text {
  padding: 8px 0 8px 10px;
}
.blm-external-messengers { display: inline-flex; gap: 8px; margin-left: 8px; vertical-align: middle; }
.blm-external-messengers a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  text-decoration: none;
  color: #fff;
  font-size: 16px;
}
.blm-wa-link { background: #25D366; }
.blm-tg-link { background: #0088cc; }
.blm-phone-gate-notice {
  display: none;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(232, 90, 79, 0.1);
  color: #333;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid rgba(232, 90, 79, 0.25);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
}
.blm-phone-gate-notice a {
  color: #E85A4F;
  font-weight: 600;
  text-decoration: underline;
}
.blm-phone-gate-notice a:hover {
  color: #cf4136;
}
.blm-phone-gate-notice.is-visible { display: block; }
#item-main .details .blm-phone-gate-notice,
#item-main .row.details .blm-phone-gate-notice {
  font-size: 13px;
  line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
}
#item-side .blm-phone-gate-notice.is-visible,
.row.details .blm-phone-gate-notice.is-visible,
#item-main .details .blm-phone-gate-notice.is-visible {
  margin: 0 0 8px;
}
.sticky-button-wrap .blm-phone-gate-notice {
  margin: 8px 12px 0;
  font-size: 12px;
}
.sticky-button-wrap .blm-phone-gate-notice.is-visible {
  margin: 8px 12px;
}

@media (max-width: 640px) {
  .blm-compose-row {
    min-height: 80px;
  }
  .blm-compose-form textarea {
    min-height: 80px;
    padding: 12px 10px;
    font-size: 16px;
  }
  .blm-compose-row > .blm-upload-btn {
    margin: 0 0 8px 8px;
    padding: 8px;
  }
  .blm-send-column {
    flex: 0 0 64px;
    padding: 8px 6px;
    gap: 4px;
  }
  .blm-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .blm-send-hint {
    font-size: 9px;
    max-width: 58px;
  }
  .blm-send-hint-keys {
    font-size: 9px;
  }
  .blm-thread-row { padding-right: 42px; }
}
