/* ==========================================================================
   SpotRealty — Buyer Detail Card (Stitch Redesign Glacier Light Theme)
   Scoped strictly under .buyer-stitch-modal to protect Sale/Rent & other views.
   ========================================================================== */

.buyer-stitch-modal {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #111827;
  box-sizing: border-box;
}

.buyer-stitch-modal * {
  box-sizing: border-box;
}

/* Material Symbols support inside Stitch Modal */
.buyer-stitch-modal .material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* Modal Window Outer */
.buyer-stitch-window {
  width: min(1200px, 96vw);
  height: min(90vh, 880px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* 1. Top Bar */
.buyer-stitch-topbar {
  height: 56px;
  min-height: 56px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  z-index: 30;
}

.buyer-topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.buyer-id-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.buyer-lead-id-text {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}

.buyer-lead-status-pill {
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.buyer-status-approved {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.buyer-status-pending {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.buyer-status-disapproved {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.buyer-topbar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
}

.buyer-nav-item {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.buyer-nav-item:hover {
  color: #111827;
}

.buyer-nav-item.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
}

.buyer-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.buyer-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.buyer-search-input-wrap .material-symbols-outlined {
  position: absolute;
  left: 10px;
  font-size: 16px;
  color: #9ca3af;
  pointer-events: none;
}

.buyer-search-input {
  width: 150px;
  height: 32px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 0 12px 0 32px;
  font-size: 12px;
  color: #111827;
  outline: none;
  transition: width 0.2s, border-color 0.2s, background-color 0.2s;
}

.buyer-search-input:focus {
  width: 200px;
  background: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.buyer-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.buyer-icon-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

.buyer-icon-btn.is-shared {
  color: #4f46e5;
}

.buyer-icon-btn.is-shared:hover {
  background: #eef2ff;
  color: #4338ca;
}

.buyer-icon-btn.is-indicator-only {
  cursor: default !important;
}

.buyer-icon-btn.is-indicator-only:hover {
  background: transparent !important;
}

.buyer-icon-btn.is-shared.is-indicator-only:hover {
  background: #eef2ff !important;
}

.buyer-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #e0e7ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Phase 31B: Assignee Capsule in Buyer Detail Header */
.buyer-assignee-capsule-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin: 0 4px;
}

.buyer-assignee-capsule {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 12px;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: none;
}

.buyer-assignee-capsule.unassigned {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
}

.buyer-assignee-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  border-radius: 9999px;
  background: #3b82f6;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  margin-left: -6px;
  border: 1.5px solid #ffffff;
  user-select: none;
  flex-shrink: 0;
}

/* 2. Main Scrollable Container */
.buyer-stitch-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #ffffff;
}

/* Identity Card */
.buyer-identity-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1024px) {
  .buyer-identity-card {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.buyer-identity-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.buyer-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.buyer-name-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.buyer-header-members-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.buyer-header-avatars {
  display: inline-flex;
  align-items: center;
}

.buyer-header-avatars .buyer-collab-avatar:first-child {
  margin-left: 0;
}

.buyer-header-members-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 6px 14px;
  height: 30px;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.buyer-header-members-pill:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.buyer-header-members-pill .pill-icon {
  color: #4f46e5;
  display: inline-flex;
  align-items: center;
}

.buyer-title-name {
  font-size: 38px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.1;
}

.buyer-edit-pill-btn {
  padding: 6px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s, border-color 0.15s;
}

.buyer-edit-pill-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Contacts Layout */
.buyer-contacts-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.buyer-contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 6px 12px;
  transition: border-color 0.15s, background-color 0.15s;
}

.buyer-contact-pill:hover {
  border-color: #c7d2fe;
  background: #fdfdff;
}

.buyer-contact-pill .pill-icon {
  color: #4f46e5;
  display: flex;
  align-items: center;
}

.buyer-contact-pill .pill-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.buyer-contact-pill .pill-val-email {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
}

.buyer-contact-pill .pill-val-email:hover {
  color: #4f46e5;
}

.buyer-contact-pill .pill-action-btn {
  background: transparent;
  border: none;
  padding: 2px;
  color: #9ca3af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.15s;
}

.buyer-contact-pill .pill-action-btn:hover {
  color: #4f46e5;
}

.buyer-contact-pill .pill-wa-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.buyer-contact-pill .pill-wa-link:hover {
  opacity: 1;
}

/* Right Tag Area */
.buyer-identity-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 4px;
}

@media (min-width: 1024px) {
  .buyer-identity-tags {
    max-width: 320px;
    align-items: flex-end;
  }
}

.buyer-tags-assigned-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

@media (min-width: 1024px) {
  .buyer-tags-assigned-wrap {
    justify-content: flex-end;
  }
}

.buyer-tags-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

@media (min-width: 1024px) {
  .buyer-tags-controls-row {
    justify-content: flex-end;
  }
}

.buyer-tag-more-btn {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.buyer-tag-more-btn:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.buyer-tag-chip {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.buyer-tag-hot {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.buyer-tag-primary {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.buyer-add-tag-btn {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: #ffffff;
  color: #6b7280;
  border: 1px dashed #d1d5db;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.buyer-add-tag-btn:hover {
  background: #f9fafb;
  border-color: #4f46e5;
  color: #4f46e5;
}

/* 3. Requirement Strip */
.buyer-req-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.buyer-req-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.buyer-req-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.buyer-req-title-text {
  font-size: 11px;
  font-weight: 700;
  color: #4f46e5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.buyer-req-gradient-line {
  height: 1px;
  flex: 1;
  background: linear-gradient(to right, #c7d2fe, rgba(255, 255, 255, 0));
}

.buyer-req-edit-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #f5f3ff;
  border: 1px solid #c7d2fe;
  color: #4f46e5;
  cursor: pointer;
}

.buyer-req-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 20px;
  padding: 0 4px;
}

@media (min-width: 768px) {
  .buyer-req-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .buyer-req-grid {
    grid-template-columns: repeat(5, 1fr);
    align-items: flex-start;
    justify-content: space-between;
  }
}

.buyer-req-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.buyer-req-lbl {
  font-size: 10px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.buyer-req-val {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  word-break: break-word;
}

.buyer-req-val.highlight {
  color: #4f46e5;
}

.buyer-req-val.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 4. Split Layout (70% Workspace / 30% Operational Rail) */
.buyer-split-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

@media (min-width: 1024px) {
  .buyer-split-layout {
    flex-direction: row;
    align-items: flex-start;
  }
}

.buyer-workspace-70 {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1024px) {
  .buyer-workspace-70 {
    width: 68%;
  }
}

.buyer-action-rail-30 {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1024px) {
  .buyer-action-rail-30 {
    width: 32%;
  }
}

/* Segmented Switcher */
.buyer-switcher-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  width: fit-content;
}

.buyer-switcher-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.buyer-switcher-btn.active {
  background: #ffffff;
  color: #4f46e5;
  border-color: #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.buyer-count-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: #e0e7ff;
  color: #4338ca;
}

.buyer-switcher-btn:not(.active) .buyer-count-badge {
  background: #e5e7eb;
  color: #6b7280;
}

/* Notes & Visits Box */
.buyer-notes-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  height: 560px;
  overflow: hidden;
  position: relative;
}

.buyer-box-filter-bar {
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.buyer-box-scroll-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Timeline items */
.buyer-timeline-item {
  display: flex;
  gap: 12px;
  position: relative;
}

.buyer-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: -16px;
  width: 1px;
  background: #e5e7eb;
}

.buyer-timeline-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  z-index: 2;
}

.buyer-timeline-content-card {
  flex: 1;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.15s;
}

.buyer-timeline-content-card:hover {
  border-color: #c7d2fe;
}

.buyer-timeline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
}

.buyer-timeline-who {
  font-weight: 700;
  color: #4338ca;
}

.buyer-timeline-ts {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #6b7280;
  font-size: 11px;
}

.buyer-timeline-body {
  font-size: 13px;
  color: #1f2937;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Sticky Composer */
.buyer-box-composer {
  padding: 12px 16px;
  background: rgba(250, 250, 250, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.buyer-composer-inner {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.buyer-composer-inner:focus-within {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.buyer-composer-textarea {
  width: 100%;
  min-height: 56px;
  max-height: 140px;
  overflow-y: auto;
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 13px;
  color: #111827;
  outline: none;
  font-family: inherit;
  resize: none;
}

.buyer-composer-toolbar {
  padding: 6px 12px;
  background: #f9fafb;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.buyer-toolbar-btn-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.buyer-tool-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  transition: background-color 0.15s, color 0.15s;
}

.buyer-tool-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

.buyer-post-btn {
  padding: 6px 18px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.buyer-post-btn:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

/* 5. Right Action Rail Cards */
.buyer-rail-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.buyer-rail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.buyer-rail-title {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

/* Follow Up */
.buyer-followup-display {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.buyer-followup-icon {
  font-size: 32px;
  color: #4f46e5;
  line-height: 1;
}

.buyer-followup-dt {
  display: flex;
  flex-direction: column;
}

.buyer-followup-date {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}

.buyer-followup-time {
  font-size: 14px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #4f46e5;
}

/* Quick Actions */
.buyer-qa-btn-call {
  width: 100%;
  padding: 12px 0;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
  margin-bottom: 10px;
}

.buyer-qa-btn-call:hover, .buyer-qa-btn-call.active {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

.buyer-qa-sub-row {
  display: flex;
  gap: 10px;
}

.buyer-qa-btn-wa {
  flex: 1;
  padding: 10px 0;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.buyer-qa-btn-wa:hover, .buyer-qa-btn-wa.active {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.buyer-qa-btn-email {
  flex: 1;
  padding: 10px 0;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #374151;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.buyer-qa-btn-email:hover, .buyer-qa-btn-email.active {
  background: #374151;
  color: #ffffff;
  border-color: #374151;
}

/* Outcome Grid */
.buyer-outcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.buyer-outcome-btn {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  text-align: center;
  transition: all 0.15s;
}

.buyer-outcome-btn:hover {
  border-color: #c7d2fe;
  background: #ffffff;
}

.buyer-outcome-connected {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.buyer-outcome-connected:hover {
  background: #d1fae5;
}

/* Last Communication List */
.buyer-last-comm-list {
  display: flex;
  flex-direction: column;
}

.buyer-last-comm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.buyer-last-comm-row:not(:last-child) {
  border-bottom: 1px solid #f3f4f6;
}

.buyer-last-comm-ch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #4b5563;
}

.buyer-last-comm-val {
  font-size: 12px;
  font-weight: 600;
}

.buyer-comm-connected {
  color: #059669;
}

.buyer-comm-failed {
  color: #dc2626;
}

.buyer-comm-sent {
  color: #4f46e5;
}

.buyer-comm-idle {
  color: #9ca3af;
}

/* Phase 31B: Last Communication Value Wrap & Actor Avatar */
.buyer-last-comm-val-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.buyer-comm-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}

/* 9. Inline Edit Controls (Scoped to Stitch Modal) */
.buyer-stitch-modal .buyer-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.buyer-stitch-modal .buyer-edit-lbl {
  font-size: 10px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.buyer-stitch-modal .buyer-edit-input,
.buyer-stitch-modal .buyer-edit-select {
  height: 36px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  color: #111827;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.buyer-stitch-modal .buyer-edit-input:focus,
.buyer-stitch-modal .buyer-edit-select:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.buyer-stitch-modal .buyer-btn-save {
  background: #4f46e5;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s, transform 0.1s;
}

.buyer-stitch-modal .buyer-btn-save:hover {
  background: #4338ca;
}

.buyer-stitch-modal .buyer-btn-cancel {
  background: #f3f4f6;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.15s, color 0.15s;
}

.buyer-stitch-modal .buyer-btn-cancel:hover {
  background: #e5e7eb;
  color: #111827;
}

/* Upper Band: Requirement + Currently Considering Side-by-Side */
.buyer-upper-band {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1200px) {
  .buyer-upper-band {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
  }
}

.buyer-upper-req-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.buyer-upper-considering-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
}

.buyer-considering-title-text {
  font-size: 11px;
  font-weight: 700;
  color: #4338ca;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.buyer-considering-history-btn,
.buyer-considering-edit-btn {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #c7d2fe;
  color: #4f46e5;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.buyer-considering-history-btn:hover,
.buyer-considering-edit-btn:hover {
  background: #eef2ff;
  border-color: #818cf8;
}

.buyer-considering-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.buyer-considering-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 84px;
  overflow-y: auto;
  padding-right: 4px;
}

.buyer-considering-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  max-width: 100%;
}

.buyer-considering-pill .considering-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6366f1;
  flex-shrink: 0;
}

.buyer-considering-pill .considering-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buyer-considering-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}

.buyer-considering-quick-add-btn {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px dashed #6366f1;
  background: #ffffff;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.buyer-considering-quick-add-btn:hover {
  background: #eef2ff;
}

/* Phase 28E: Contextual Buyer Assignment Box */
.buyer-assign-context-panel {
  position: absolute;
  top: 60px;
  right: 24px;
  width: 320px;
  max-width: calc(100% - 48px);
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid rgba(199, 196, 216, 0.6);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 14px 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: buyerAssignFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes buyerAssignFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.buyer-assign-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.buyer-assign-context-close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.buyer-assign-context-close:hover {
  color: #1e293b;
  background: #f1f5f9;
}

/* Phase 3.5: Contextual Buyer Share Box */
.buyer-share-context-panel {
  position: absolute;
  top: 60px;
  right: 24px;
  width: 320px;
  max-width: calc(100% - 48px);
  max-height: min(480px, calc(100% - 80px));
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid rgba(199, 196, 216, 0.6);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 14px 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  animation: buyerAssignFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Phase 3C: Board Requests Workspace & Restricted Preview */
.buyer-requests-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 16px;
  background: #f8fafc;
}

.buyer-requests-tab {
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.buyer-requests-tab:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.buyer-requests-tab.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
  background: #ffffff;
}

.buyer-requests-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
}

.buyer-requests-tab.active .buyer-requests-badge {
  background: #e0e7ff;
  color: #4338ca;
}

.buyer-request-preview-window {
  width: 560px;
  max-width: calc(100% - 32px);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: buyerAssignFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.buyer-request-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.buyer-request-preview-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.buyer-request-preview-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.buyer-request-preview-value {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
}

.buyer-rejection-chip {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 11px;
  color: #475569;
  cursor: pointer;
  transition: all 0.12s ease;
}

.buyer-rejection-chip:hover, .buyer-rejection-chip.active {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}



