/**
 * Site-wide ivory canvas + patient CTA + minimal menu close + BA labels + header plus
 * Marker: BN_IVORY_SEC_V10
 */

/* Ivory background everywhere (app cream) */
html[data-theme="light"],
html[data-theme="light"] body,
body:not([data-theme="dark"]),
body.app-shell,
body.auth-page,
body.index-page {
  --bn-cream: #F5F2EB;
  --bn-cream-2: #F3EFE6;
  --bn-ivory: #FFFCF8;
  --bn-surface: #FFFCF8;
  --bn-surface-2: #F5F2EB;
  background-color: #F5F2EB !important;
}

html[data-theme="light"] body.app-shell .main-content,
body.app-shell .main-content,
.bn-app-page,
.bn-feed-page,
.bn-profile-page,
.bn-explore-page,
.explore-page,
.search-page,
.bn-search-page,
.bn-chat-page,
body.app-shell.bn-chat-active .main-content {
  background: #F5F2EB !important;
}

html[data-theme="light"] .card,
html[data-theme="light"] .bn-card,
html[data-theme="light"] .bn-feed-card,
html[data-theme="light"] .bn-panel,
html[data-theme="light"] .glass-card {
  background: #FFFCF8 !important;
}

/* Search + chat middle canvas ivory */
body.app-shell:has(.bn-search-page) .main-content,
body.app-shell:has(.bn-chat-page) .main-content,
body.app-shell.bn-chat-active .main-content {
  background: #F5F2EB !important;
}

.bn-chat-layout,
.bn-chat-main,
.bn-chat-thread,
.smart-search-panel {
  background: #FFFCF8 !important;
}

/* Luxury elevated cards — search / chat list / services (NOT mine bubbles) */
.bn-chat-list-item,
.smart-entity-card,
.bn-search-bar,
.bn-search-lux-filter,
.bn-search-quick-services .bn-chip,
.bn-search-quick-services button,
.smart-search-panel--compact,
.doctors-search-panel {
  background: linear-gradient(165deg, #FFFEFE 0%, #FFFCF8 55%, #F8F4EC 100%) !important;
  border: 1px solid rgba(26, 61, 54, 0.08) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 10px 28px rgba(20, 40, 36, 0.1),
    0 2px 6px rgba(201, 166, 107, 0.08) !important;
}

.bn-chat-list-item {
  margin: 8px 10px !important;
  border-radius: 18px !important;
  border-bottom: none !important;
}

.bn-chat-bubble--mine,
.bn-chat-bubble--theirs {
  border-radius: 18px !important;
}

.bn-chat-bubble--mine {
  background: #0C4A43 !important;
  background-image: none !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  border: none !important;
  box-shadow:
    0 8px 22px rgba(26, 61, 54, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.12) inset !important;
}
.bn-chat-bubble--mine p,
.bn-chat-bubble--mine span,
.bn-chat-bubble--mine time,
.bn-chat-bubble--mine strong,
.bn-chat-bubble--mine a {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  opacity: 1 !important;
  font-weight: 700 !important;
}

.smart-entity-card:hover,
.bn-chat-list-item:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 16px 36px rgba(20, 40, 36, 0.14),
    0 4px 10px rgba(201, 166, 107, 0.12) !important;
}

/* Patient profile — green buttons: white bold text */
body.patient-profile-page .btn-primary,
body.patient-profile-page .btn.btn-primary,
body.patient-profile-page .bn-btn--primary,
.patient-profile .btn-primary,
.patient-profile .bn-btn--primary,
.patient-profile .patient-appts-cta,
.patient-profile .fs-scan-actions .btn-primary,
.patient-profile #fsStartCameraBtn,
.patient-profile #fsAnalyzeBtn,
.patient-health-lux__save,
.patient-health-lux__save.dp-book-lux-cta,
.patient-profile .patient-health-lux__save {
  color: #fffcf8 !important;
  -webkit-text-fill-color: #fffcf8 !important;
  font-weight: 900 !important;
  letter-spacing: 0.01em;
}

body.patient-profile-page .btn-primary span,
body.patient-profile-page .btn-primary i,
.patient-profile .btn-primary span,
.patient-profile .btn-primary i,
.patient-profile .bn-btn--primary span,
.patient-profile .bn-btn--primary i,
.patient-health-lux__save strong,
.patient-health-lux__save small,
.patient-health-lux__save i,
.patient-health-lux__save .dp-book-lux-cta__text,
.patient-health-lux__save .dp-book-lux-cta__text strong,
.patient-health-lux__save .dp-book-lux-cta__text small {
  color: #fffcf8 !important;
  -webkit-text-fill-color: #fffcf8 !important;
}

.patient-health-lux__save .dp-book-lux-cta__text strong {
  font-weight: 900 !important;
  font-size: 0.98rem !important;
}

/* Menu close — minimal red X */
.lux-menu-close,
aside#luxMenuPanel .lux-menu-close {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  border-radius: 10px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #d62828 !important;
  opacity: 0.92;
}

.lux-menu-close:hover,
.lux-menu-close:active {
  background: rgba(214, 40, 40, 0.1) !important;
  transform: none !important;
}

.lux-menu-close .bn-ui-icon,
.lux-menu-close svg,
.lux-menu-close i {
  color: #d62828 !important;
  stroke: #d62828 !important;
  stroke-width: 2.25 !important;
  width: 18px !important;
  height: 18px !important;
}

[data-theme="dark"] .lux-menu-close {
  background: transparent !important;
  color: #ff6b6b !important;
}

/* Before/after — labels at top; tiny handle sits under the gold divider line */
.ba-slider--minimal .ba-slider-bar--minimal,
.ba-slider-bar--minimal {
  position: absolute;
  inset-inline: 10px;
  top: 8px !important;
  bottom: auto !important;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 4;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  height: auto !important;
}

.ba-slider-bar--minimal .ba-label {
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em;
  padding: 4px 9px !important;
  border-radius: 999px !important;
  background: rgba(20, 40, 36, 0.48) !important;
  color: #fffcf8 !important;
  -webkit-text-fill-color: #fffcf8 !important;
  backdrop-filter: blur(6px);
  text-shadow: none !important;
  border: 1px solid rgba(255, 252, 248, 0.18);
}

.ba-slider--minimal .ba-slider-line,
.feed-post-media .ba-slider--minimal .ba-slider-line,
.explore-card-media .ba-slider--minimal .ba-slider-line,
.explore-ba-mount .ba-slider-line,
.bn-explore-page .ba-slider-line {
  width: 1.5px !important;
  background: rgba(255, 252, 248, 0.88) !important;
  box-shadow: none !important;
  top: 0 !important;
  bottom: 18px !important;
  height: auto !important;
}

.ba-slider--minimal.ba-slider-premium::after,
.feed-post-media .ba-slider--minimal.ba-slider-premium::after,
.explore-card-media .ba-slider--minimal.ba-slider-premium::after,
.explore-ba-mount .ba-slider.ba-slider-premium::after,
.bn-explore-page .ba-slider.ba-slider-premium::after {
  bottom: 14px !important;
  height: 2px !important;
  opacity: 0.95;
}

.ba-slider--minimal .ba-slider-handle,
.feed-post-media .ba-slider--minimal .ba-slider-handle,
.explore-card-media .ba-slider--minimal .ba-slider-handle,
.explore-ba-mount .ba-slider-handle,
.bn-explore-page .ba-slider-handle,
.feed-post-media .ba-slider-handle,
.bn-post-detail-media .ba-slider-handle,
.explore-card-media .ba-slider-handle,
.explore-modal-media .ba-slider-handle {
  width: 12px !important;
  height: 12px !important;
  border-radius: 50% !important;
  top: auto !important;
  bottom: 6px !important;
  transform: translateX(-50%) !important;
  background: rgba(255, 252, 248, 0.92) !important;
  border: 1px solid rgba(26, 61, 54, 0.16) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16) !important;
  z-index: 8 !important;
}

.ba-slider--minimal .ba-handle-grip,
.explore-ba-mount .ba-handle-grip,
.bn-explore-page .ba-handle-grip,
.feed-post-media .ba-handle-grip,
.explore-card-media .ba-handle-grip,
.explore-modal-media .ba-handle-grip,
.bn-post-detail-media .ba-handle-grip {
  top: 50% !important;
  bottom: auto !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  color: #1A3D36 !important;
  font-size: 0.32rem !important;
  width: 12px !important;
  height: 12px !important;
  border-width: 1px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18) !important;
  background: rgba(255, 252, 248, 0.95) !important;
}

.explore-ba-mount {
  width: 100%;
  height: 100%;
  min-height: inherit;
}

/* Home: hide stories block when empty so posts sit under hero */
.bn-home-stories-section[hidden],
.bn-home-stories-section.is-empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
}

.bn-feed-page.bn-feed--no-stories .bn-feed-stream,
.bn-feed-page:not(:has(.bn-home-stories-section:not([hidden]))) .bn-feed-stream {
  margin-top: 4px !important;
  padding-top: 0 !important;
}

.bn-feed-page .bn-home-stories-section:not([hidden]) {
  margin-bottom: 8px;
}

.bn-chat-bubble--theirs,
body.app-shell .bn-chat-bubble--theirs {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  background-image: none !important;
  color: #111111 !important;
  -webkit-text-fill-color: #111111 !important;
  border: 1px solid rgba(12, 74, 67, 0.18) !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow:
    0 0 0 1px #ffffff,
    0 4px 14px rgba(12, 74, 67, 0.12) !important;
}

.bn-chat-bubble--theirs p,
.bn-chat-bubble--theirs span,
.bn-chat-bubble--theirs time {
  color: #111111 !important;
  -webkit-text-fill-color: #111111 !important;
  opacity: 1 !important;
  font-weight: 700;
}

/* Chat header action icons — champagne gold */
body.app-shell .bn-chat-head-btn {
  background: linear-gradient(145deg, #0C4A43, #1A3D36) !important;
  border: 1px solid rgba(214, 188, 126, 0.45) !important;
  color: #D6BC7E !important;
}
body.app-shell .bn-chat-head-btn i {
  color: #D6BC7E !important;
  -webkit-text-fill-color: #D6BC7E !important;
}

/* Desktop chat layout — full usable height */
@media (min-width: 900px) {
  body.app-shell.bn-chat-active .main-content {
    padding-bottom: 16px !important;
    max-width: 1280px;
    margin-inline: auto;
  }
  body.app-shell.bn-chat-active .bn-chat-layout {
    height: calc(100dvh - 88px) !important;
    min-height: calc(100dvh - 88px) !important;
    max-height: calc(100dvh - 88px) !important;
    border-radius: 22px !important;
  }
  body.app-shell.bn-chat-active .bn-chat-compose {
    padding-bottom: 14px !important;
  }
}

.smart-entity-actions .btn-primary,
.doctor-card-actions .btn-primary {
  color: #fffcf8 !important;
  -webkit-text-fill-color: #fffcf8 !important;
  font-weight: 900 !important;
}

/* Owner story rail always visible for doctor/clinic owners */
body.doctor-profile-owner #profileStoriesSection,
body.clinic-profile-owner #profileStoriesSection,
.bn-profile-page.dp-own-profile #profileStoriesSection {
  display: block !important;
}

body.doctor-profile-owner .profile-stories-rail,
body.clinic-profile-owner .profile-stories-rail,
.bn-profile-page.dp-own-profile .profile-stories-rail {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Keep owner action deck clickable above overlays */
body.doctor-profile-owner .dp-owner-action-deck,
body.clinic-profile-owner .dp-owner-action-deck,
.bn-profile-page.dp-own-profile .dp-owner-action-deck {
  position: relative;
  z-index: 5;
  pointer-events: auto !important;
}

body.doctor-profile-owner .dp-owner-hero-btn,
body.clinic-profile-owner .dp-owner-hero-btn {
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Restore Instagram-style story ring on owner avatar */
body.doctor-profile-owner .dp-owner-avatar-wrap .bn-profile-avatar-ring,
body.doctor-profile-owner .dp-owner-avatar-wrap .dp-avatar-ring {
  display: grid !important;
  place-items: center !important;
  width: 96px !important;
  height: 96px !important;
  padding: 3px !important;
  border-radius: 50% !important;
  background: conic-gradient(from 120deg, #10251d, #c9a45e, #fff1bd, #6f8875, #10251d) !important;
  box-shadow: 0 10px 28px rgba(16, 37, 29, 0.16) !important;
}

body.doctor-profile-owner .dp-owner-avatar-wrap .bn-profile-avatar,
body.doctor-profile-owner .dp-owner-avatar-wrap .dp-owner-hero__avatar {
  width: 90px !important;
  height: 90px !important;
  border-radius: 50% !important;
  border: 3px solid #fffcf8 !important;
  box-shadow: none !important;
}

/* Search result action buttons always visible */
.smart-entity-actions,
.smart-entity-card .doctor-card-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.smart-entity-actions .btn,
.smart-entity-card .doctor-card-actions .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
}

body.app-shell .app-header-icon--create-plus {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  background: rgba(26, 61, 54, 0.08) !important;
  color: #1A3D36 !important;
  border: 1px solid rgba(26, 61, 54, 0.1) !important;
}

body.app-shell .app-header-icon--create-plus:active {
  transform: scale(0.94);
  background: rgba(26, 61, 54, 0.14) !important;
}

body.app-shell .app-header-icon--create-plus[hidden],
body.app-shell .app-header-icon--provider-profile[hidden] {
  display: none !important;
}

[data-theme="dark"] body.app-shell .app-header-icon--create-plus {
  background: rgba(201, 166, 107, 0.14) !important;
  color: #E8D4A8 !important;
  border-color: rgba(232, 212, 168, 0.16) !important;
}
