.cm-referral-explanation { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid #dbe5df; border-radius: 8px; background: #f3f7f4; color: #526459; font-size: 12px; line-height: 1.5; }
.cm-request-link { color: #166534; text-decoration: underline; text-underline-offset: 2px; }
.cm-request-link:focus-visible { outline: 2px solid #166534; outline-offset: 3px; }
.cm-request-error { padding: 12px; color: #b91c1c; font-size: 13px; }
.status-pill.status-connected-customer,
.customer-introductions {
  /* Shared Lucide users-round artwork for Connection badges. */
  --connection-people-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 21a8 8 0 0 0-16 0'/%3E%3Ccircle cx='10' cy='8' r='5'/%3E%3Cpath d='M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3'/%3E%3C/svg%3E");
}
.status-pill.status-connected-customer {
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  white-space: normal;
  overflow-wrap: anywhere;
}
.status-pill.status-connected-customer::before {
  content: "";
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  /* Same Lucide users-round artwork as the Account Connections heading. */
  -webkit-mask: var(--connection-people-icon) center / contain no-repeat;
  mask: var(--connection-people-icon) center / contain no-repeat;
}
#cm-overlay .chat-overlay-panel{height:100dvh;max-height:100dvh;display:flex;flex-direction:column}
#cm-overlay .chat-messages-wrapper{flex:1;min-height:0;overflow:auto}
#cm-overlay .chat-overlay-footer{padding-bottom:8px;flex:none}
#cm-overlay .chat-overlay-nav{position:fixed;left:0;right:0;bottom:0;width:100%;box-sizing:border-box}
#cm-overlay.keyboard-open .chat-overlay-footer{padding-bottom:max(env(safe-area-inset-bottom,0px),12px)}
#cm-overlay .chat-header-name{background:none;border:0;text-align:left;color:inherit}
.bottom-nav-item .cm-unread-count{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;box-sizing:border-box;padding:0 5px;margin-left:4px;border-radius:999px;background:#ef4444;color:#fff;font-size:11px;font-weight:700;line-height:1;vertical-align:middle}
.bottom-nav-item .cm-unread-count[hidden]{display:none}
#cm-messages{display:flex;flex-direction:column;gap:.35rem;padding:.35rem .85rem .75rem;min-height:0}
#cm-accepted-introductions{display:flex;flex-direction:column;gap:.35rem;padding:.5rem .85rem 0}
#cm-accepted-introductions:empty{display:none}
.cm-bubble{white-space:pre-wrap;overflow-wrap:anywhere}
.cm-bubble time{display:block}
.cm-bubble img,.cm-bubble video{display:block;max-width:100%;max-height:320px;border-radius:8px}
#cm-attachments{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
#cm-attachments img{width:56px;height:56px;object-fit:cover}
#cm-error,#cm-send-error{color:#b91c1c;font-size:13px}
.cm-thread{display:grid;grid-template-columns:minmax(180px,.65fr) minmax(0,2.15fr);align-items:center;gap:8px 16px;width:100%;min-width:0;box-sizing:border-box;padding:12px 14px;text-align:left;text-transform:none;cursor:pointer;color:inherit;font-family:inherit;white-space:normal}
.cm-thread:focus-visible{outline:2px solid #15803d;outline-offset:3px}
.cm-thread:hover{border-color:#bbd9c4}
.cm-thread-header{display:flex;align-items:flex-start;align-self:start;gap:10px;min-width:0;grid-column:1;grid-row:1/3}
.cm-thread-avatar{position:relative;display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;overflow:hidden;border-radius:50%;background:#f0fdf4;color:#166534;font-size:14px;font-weight:600}
.cm-thread-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.cm-thread-avatar,#cm-avatar{padding:0;border:0;cursor:pointer;font-family:inherit}
#cm-avatar{background:transparent}
.cm-thread-avatar:focus-visible,#cm-avatar:focus-visible{outline:2px solid #15803d;outline-offset:2px}
.cm-thread-identity{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px;overflow-wrap:anywhere}
.cm-thread-name{font-size:.9rem;line-height:1.35;color:#111827}
.cm-thread-business{font-size:.75rem;line-height:1.4;color:#6b7280}
.cm-thread-statuses{display:flex;align-items:center;justify-content:center;grid-column:1/-1;grid-row:1;justify-self:center;align-self:start}
.cm-thread-connected{display:inline-block;border-radius:999px;padding:3px 9px;background:#dcfce7;color:#166534;font-size:.7rem;font-weight:600;line-height:1.4}
.cm-thread-copy{display:flex;min-width:0;grid-column:2;grid-row:2;flex-direction:column;gap:8px;font-size:.78rem;line-height:1.45;color:#6b7280;overflow-wrap:anywhere}
.cm-thread-preview{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;white-space:normal}
.cm-thread-footer{display:flex;min-width:0;grid-column:1/-1;grid-row:1;justify-self:end;align-self:start;max-width:calc(50% - 55px)}
.cm-thread-time{text-align:right;color:#6b7280;font-size:.67rem;line-height:1.4}
.cm-thread-rating{display:flex;align-items:center;flex-wrap:wrap;gap:4px;font-size:.7rem;color:#6b7280;line-height:1.4}
.cm-thread-stars{display:inline-flex;gap:1px;color:#f59e0b;font-size:13px;line-height:1}
.cm-thread-star-empty{color:#d1d5db}
.cm-thread .profile-new-provider-badge{align-self:flex-start;margin:0;padding:2px 7px;font-size:.65rem;letter-spacing:0;text-transform:none}
#cm-list>.empty-hint{grid-column:1/-1}
@media(max-width:600px){
  .cm-thread{grid-template-columns:minmax(0,1fr);gap:10px;padding:12px}
  .cm-thread-header{grid-row:1;flex-direction:column;max-width:calc(50% - 55px);gap:6px}
  .cm-thread-copy{grid-column:1;grid-row:2}
}
#cm-search{width:100%;box-sizing:border-box}
.cm-actions-wrap{position:relative;margin-left:auto}
.cm-actions-wrap .cm-actions-toggle{width:44px;height:44px;padding:0;justify-content:center}
.cm-actions-wrap .cm-actions-toggle:active{background:#bfdbfe}
.cm-actions-wrap .cm-actions-toggle:focus-visible{outline:2px solid #1d4ed8;outline-offset:2px}
.cm-actions-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:20;width:270px;max-width:calc(100vw - 32px);max-height:65dvh;overflow-y:auto;box-sizing:border-box;padding:6px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 6px 18px #0002}
.cm-actions-menu .cm-action-item{display:block;width:100%;box-sizing:border-box;text-align:left;border:0;border-radius:4px;background:transparent;padding:10px 12px;color:#374151;font:inherit;font-size:.875rem;text-transform:none;cursor:pointer}
.cm-actions-menu .cm-action-item:hover,.cm-actions-menu .cm-action-item:focus-visible{background:#f3f4f6}
.cm-actions-menu .cm-action-item:disabled{color:#9ca3af;cursor:default}
.cm-actions-menu .cm-action-destructive{color:#b91c1c}
.cm-actions-menu .cm-action-separated{border-top:1px solid #e5e7eb;border-radius:0;margin-top:6px;padding-top:12px}
.cm-actions-menu .cm-action-help,.cm-actions-menu>p{margin:4px 12px 10px;color:#6b7280;font-size:.75rem;line-height:1.4}
.cm-introduction-controls{padding-top:12px;border-top:1px solid #e5e7eb;margin-top:12px}
.cm-introduction-controls button{margin:4px}
.cm-introduction-controls .provider-remove-job-note{margin:6px 4px 0;color:#6b7280;font-size:.75rem;line-height:1.4;text-align:left}
.customer-card .customer-close-request-note{flex-basis:100%;min-width:0;margin:6px 4px 0;color:#6b7280;font-size:.75rem;line-height:1.4;text-align:left;overflow-wrap:anywhere}
.cm-introduction-controls.provider-introduction{padding:12px;border:1px solid #e5e7eb;border-radius:10px;background:#f9fafb;color:#374151;overflow-wrap:anywhere}
.provider-introduction[data-introduction-status="pending"]{background:#fffbeb;border-color:#fde68a}
.provider-introduction[data-introduction-status="connected"]{background:#f0fdf4;border-color:#bbf7d0}
.provider-introduction-heading{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 8px}
.provider-introduction-status{display:inline-block;padding:3px 9px;border-radius:999px;background:#e5e7eb;color:#374151;font-weight:600;font-size:.75rem;line-height:1.4}
.provider-introduction[data-introduction-status="pending"] .provider-introduction-status{background:#fef3c7;color:#92400e}
.provider-introduction[data-introduction-status="connected"] .provider-introduction-status{background:#dcfce7;color:#166534}
.provider-introduction-content{margin:0 0 8px;white-space:pre-wrap}
.provider-introduction .provider-introduction-edit{background:#fff7ed;color:#c2410c;border:1px solid #fed7aa}
.provider-introduction .provider-introduction-edit:hover{background:#ffedd5;border-color:#fdba74}
.provider-introduction .provider-introduction-withdraw,
.cm-introduction-controls .close-job-btn,
.introduction-standard-actions .provider-introduction-withdraw{background:#fef2f2;color:#b91c1c;border:1px solid #fca5a5}
.provider-introduction .provider-introduction-withdraw:hover,
.cm-introduction-controls .close-job-btn:hover,
.introduction-standard-actions .provider-introduction-withdraw:hover{background:#fee2e2;border-color:#f87171}
.cm-dialog{width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 48px);box-sizing:border-box;overflow:auto;border:0;border-radius:16px;padding:24px}
.cm-dialog::backdrop{background:#0006}
.cm-dialog textarea{width:100%;min-height:140px;box-sizing:border-box}
.cm-dialog footer{display:flex;gap:8px;justify-content:flex-end;margin-top:16px;padding-bottom:env(safe-area-inset-bottom)}

/* Native top-layer dialog; only the body scrolls, keeping both actions visible. */
dialog.close-service-modal[data-close-service-dialog] {
  --close-top-gap: max(16px, var(--safe-area-top, env(safe-area-inset-top, 0px)));
  --close-bottom-gap: max(16px, var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)), var(--android-bottom-safe-area, 0px));
  --close-left-gap: max(16px, var(--safe-area-left, env(safe-area-inset-left, 0px)));
  --close-right-gap: max(16px, var(--safe-area-right, env(safe-area-inset-right, 0px)));
  box-sizing: border-box;
  position: fixed;
  inset: var(--close-top-gap) var(--close-right-gap) var(--close-bottom-gap) var(--close-left-gap);
  width: min(440px, calc(100% - var(--close-left-gap) - var(--close-right-gap)));
  max-width: none;
  height: fit-content;
  max-height: calc(100vh - var(--close-top-gap) - var(--close-bottom-gap));
  max-height: calc(100dvh - var(--close-top-gap) - var(--close-bottom-gap));
  min-height: 0;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #374151;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  font-family: inherit;
  font-size: .875rem;
  line-height: 1.5;
  text-align: left;
}

dialog.close-service-modal[data-close-service-dialog][open] {
  display: flex;
  flex-direction: column;
}

dialog.close-service-modal[data-close-service-dialog]::backdrop {
  background: rgba(17, 24, 39, .6);
}

dialog.close-service-modal[data-close-service-dialog] .close-service-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin: 0;
  padding: 20px 20px 12px;
  background: transparent;
  border: 0;
}

dialog.close-service-modal[data-close-service-dialog] .close-service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  color: #a16207;
}

dialog.close-service-modal[data-close-service-dialog] .close-service-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

dialog.close-service-modal[data-close-service-dialog] .close-service-heading h2 {
  min-width: 0;
  margin: 0;
  color: #111827;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

dialog.close-service-modal[data-close-service-dialog] .close-service-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}

dialog.close-service-modal[data-close-service-dialog] .close-service-body p {
  margin: 0 0 12px;
}

dialog.close-service-modal[data-close-service-dialog] .close-service-body p:last-child {
  margin-bottom: 0;
}

.close-service-modal .expired-request-identity {
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.close-service-modal .expired-request-identity > strong {
  color: #111827;
  font-size: 1rem;
}
.close-service-modal .expired-request-id {
  display: inline-block;
  margin-left: 8px;
  color: #6b7280;
  font-size: .8125rem;
}
.close-service-modal .expired-request-identity p {
  margin-top: 6px;
  color: #4b5563;
  font-size: .8125rem;
}

dialog.close-service-modal[data-close-service-dialog] p > strong {
  color: #111827;
  font-weight: 600;
}

dialog.close-service-modal[data-close-service-dialog] .close-service-error {
  color: #b91c1c;
  font-size: .8125rem;
}

dialog.close-service-modal[data-close-service-dialog] .close-service-error:empty {
  display: none;
}

dialog.close-service-modal[data-close-service-dialog] footer {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 12px 20px 16px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

/* Use the shared MTC action styles, not modal-specific pill buttons. */
dialog.close-service-modal[data-close-service-dialog] footer button:focus {
  outline: none;
  box-shadow: none;
}
dialog.close-service-modal[data-close-service-dialog] footer .secondary-btn:focus-visible {
  background: #f3f4f6;
}
dialog.close-service-modal[data-close-service-dialog] footer .primary-btn:focus-visible {
  background: #16a34a;
}

dialog.close-service-modal[data-close-service-dialog] footer button:disabled {
  opacity: .6;
  cursor: default;
}

@media (max-height: 400px) {
  dialog.close-service-modal[data-close-service-dialog] .close-service-heading {
    padding-block: 12px 8px;
  }
  dialog.close-service-modal[data-close-service-dialog] footer {
    padding-block: 8px;
  }
}
