/**
 * Hair Delivery — Mobile Mini Service Hub CSS
 * Optimized for Mobile First (360x780, 390x844, 412x915)
 * Pure Vanilla CSS - No external dependencies
 */

:root {
  --primary: #e11d48;
  --primary-gradient: linear-gradient(135deg, #e11d48, #be123c);
  --primary-light: #fff1f2;
  --primary-border: #fecdd3;
  --dark: #0f172a;
  --gray-900: #111827;
  --gray-700: #334155;
  --gray-500: #64748b;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50: #f8fafc;
  --white: #ffffff;
  --green: #16a34a;
  --green-light: #dcfce7;
  --orange: #ea580c;
  --orange-light: #ffedd5;
  --blue: #0284c7;
  --blue-light: #e0f2fe;
  --purple: #9333ea;
  --purple-light: #f3e8ff;
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-full: 9999px;
  --nav-height: 64px;
  --header-height: 56px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  background: #ffffff;
}

body.hd-mobile-mini {
  font-family: -apple-system, BlinkMacSystemFont, "Kanit", "Inter", "Segoe UI", Roboto, sans-serif;
  background: #ffffff;
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  display: block;
}

/* Mobile Container Wrapper */
.hd-mobile-wrapper {
  width: 100%;
  max-width: 440px;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

@media (min-width: 600px) {
  body.hd-mobile-mini {
    background: #f1f5f9;
    display: flex;
    justify-content: center;
  }
  .hd-mobile-wrapper {
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
  }
}

/* ----------------------------------------------------
 * APP HEADER
 * ---------------------------------------------------- */
.hd-app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-shrink: 0;
}

.hd-header-left, .hd-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hd-btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.hd-btn-icon:active {
  background: var(--gray-100);
  transform: scale(0.96);
}

.hd-brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.hd-logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(225, 29, 72, 0.35);
}

.hd-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.hd-brand-text strong {
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hd-brand-text strong span {
  color: var(--primary);
}

.hd-brand-text small {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gray-500);
}

.hd-user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 3px 8px 3px 3px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--dark);
  text-decoration: none;
}

.hd-user-pill img, .hd-user-pill .avatar-init {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.hd-user-pill .avatar-init {
  background: var(--primary-gradient);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

/* ----------------------------------------------------
 * SCREEN CONTAINER
 * ---------------------------------------------------- */
.hd-screen-viewport {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.hd-screen-panel {
  display: none !important;
  width: 100%;
}

.hd-screen-panel.active {
  display: block !important;
  animation: hdFadeIn 0.2s ease;
}

.hd-map-screen.active, .hd-chat-screen.active {
  display: flex !important;
  flex-direction: column;
}

@keyframes hdFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------
 * SCREEN 1: SERVICE HOME HUB
 * ---------------------------------------------------- */
.hd-home-screen {
  padding: 12px 14px calc(var(--nav-height) + 16px);
}

.hd-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 5px 6px 5px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  transition: border-color 0.15s ease;
}

.hd-search-bar:focus-within {
  border-color: var(--primary);
}

.hd-search-bar input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
  color: var(--dark);
  font-family: inherit;
}

.hd-search-bar input::placeholder {
  color: var(--gray-500);
}

.hd-btn-search-filter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--gray-100);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Location Bar */
.hd-location-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.hd-location-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hd-location-info .loc-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.hd-btn-change-loc {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.hd-btn-change-loc:active {
  background: var(--primary-light);
}

/* 6 Services Grid */
.hd-service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.hd-service-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}

.hd-service-card:active {
  transform: scale(0.97);
}

.hd-service-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.hd-service-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.hd-service-icon-box.pink { background: #ffe4e6; color: #e11d48; }
.hd-service-icon-box.orange { background: #ffedd5; color: #ea580c; }
.hd-service-icon-box.blue { background: #e0f2fe; color: #0284c7; }
.hd-service-icon-box.green { background: #dcfce7; color: #16a34a; }
.hd-service-icon-box.purple { background: #f3e8ff; color: #9333ea; }
.hd-service-icon-box.slate { background: #f1f5f9; color: #475569; }

.hd-service-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 2px;
  display: block;
}

.hd-service-desc {
  font-size: 10.5px;
  color: var(--gray-500);
  line-height: 1.35;
  font-weight: 500;
}

/* Hair Delivery Promo Showcase */
.hd-promo-banner {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-xl);
  padding: 12px;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: center;
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.09);
  margin-bottom: 18px;
}

.hd-promo-image {
  width: 84px;
  height: 112px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fecdd3;
  flex-shrink: 0;
}

.hd-promo-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hd-promo-content {
  min-width: 0;
}

.hd-promo-headline {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  font-weight: 900;
  color: #9f1239;
  margin-bottom: 6px;
}

.hd-promo-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-700);
  line-height: 1.5;
}

.hd-promo-checklist li {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hd-promo-checklist .check-icon {
  color: var(--green);
  font-weight: 900;
}

.hd-btn-promo-book {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-gradient);
  color: var(--white) !important;
  font-size: 11.5px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 3px 8px rgba(225, 29, 72, 0.3);
  text-decoration: none;
}

/* Featured Stylists Section */
.hd-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.hd-section-header h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--dark);
}

.hd-section-header a {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.hd-stylists-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.hd-stylists-scroll::-webkit-scrollbar { display: none; }

.hd-mini-stylist-card {
  flex: 0 0 130px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.hd-mini-stylist-card:active {
  transform: scale(0.96);
}

.hd-mini-stylist-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 6px;
  display: block;
  border: 1.5px solid var(--gray-200);
}

.hd-mini-stylist-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.hd-mini-stylist-rating {
  font-size: 10.5px;
  font-weight: 700;
  color: #d97706;
  margin-bottom: 4px;
}

.hd-mini-stylist-area {
  font-size: 9.5px;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----------------------------------------------------
 * SCREEN 2: LIVEMAP SCREEN
 * ---------------------------------------------------- */
.hd-map-screen {
  display: none;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - var(--nav-height));
  height: calc(100dvh - var(--header-height) - var(--nav-height));
  max-height: calc(100dvh - var(--header-height) - var(--nav-height));
  position: relative;
  overflow: hidden;
}

.hd-map-screen.active {
  display: flex !important;
}

.hd-map-controls-row {
  flex-shrink: 0;
  padding: 8px 12px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  z-index: 10;
}

.hd-category-chips {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 12px 8px;
  background: var(--white);
  scrollbar-width: none;
  border-bottom: 1px solid var(--gray-200);
  z-index: 10;
}

.hd-category-chips::-webkit-scrollbar { display: none; }

.hd-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
  flex-shrink: 0;
}

.hd-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

#hdMiniMap {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  position: relative;
  z-index: 1;
  background: #e5e7eb;
}

#hdMiniMap .leaflet-top.leaflet-left {
  top: 10px;
  left: 10px;
}

/* Category Empty State Overlay */
.hd-map-empty-overlay {
  display: none;
  position: absolute;
  top: 120px;
  left: 20px;
  right: 20px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-xl);
  padding: 24px 18px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

.hd-map-empty-overlay.show {
  display: block;
  animation: hdFadeIn 0.2s ease;
}

.hd-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.hd-map-empty-overlay h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 4px;
}

.hd-map-empty-overlay p {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 14px;
}

.hd-btn-empty-return {
  border: 0;
  background: var(--primary-gradient);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

/* Selected Stylist Bottom Card */
.hd-selected-stylist-card {
  display: none;
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 550;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  animation: hdSlideUp 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.hd-selected-stylist-card.visible {
  display: block;
}

@keyframes hdSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.btn-close-selected {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selected-card-top {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.selected-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
}

.selected-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-meta {
  min-width: 0;
}

.selected-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.selected-stylist-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--green-light);
  color: #15803d;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.status-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.selected-rating-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--gray-500);
}

.selected-rating-row .stars {
  color: #d97706;
  font-weight: 800;
}

.selected-dist-row {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 1px;
}

.selected-skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.skill-pill {
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.selected-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-card-chat {
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 800;
  padding: 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-card-book {
  border: 0;
  background: var(--primary-gradient);
  color: var(--white) !important;
  font-size: 12px;
  font-weight: 900;
  padding: 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(225, 29, 72, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ----------------------------------------------------
 * SCREEN 3: CHAT SCREEN
 * ---------------------------------------------------- */
.hd-chat-screen {
  display: none;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - var(--nav-height));
  height: calc(100dvh - var(--header-height) - var(--nav-height));
  max-height: calc(100dvh - var(--header-height) - var(--nav-height));
  background: #f8fafc;
  position: relative;
  overflow: hidden;
}

.hd-chat-screen.active {
  display: flex !important;
}

.hd-chat-header-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  z-index: 10;
}

.hd-btn-chat-back {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hd-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--gray-200);
  flex-shrink: 0;
}

.hd-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hd-chat-stylist-meta {
  flex: 1;
  min-width: 0;
}

.hd-chat-stylist-meta strong {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--dark);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hd-chat-stylist-meta .status-live {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 3px;
}

.hd-btn-chat-call {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}

/* Chat Pinned Info Card */
.hd-chat-info-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin: 8px 12px 4px;
  box-shadow: var(--shadow-sm);
}

.hd-chat-info-card img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.hd-info-meta {
  flex: 1;
  min-width: 0;
}

.hd-info-meta strong {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--dark);
  display: block;
}

.hd-info-meta .stars {
  font-size: 10.5px;
  font-weight: 700;
  color: #d97706;
}

.hd-info-meta small {
  display: block;
  font-size: 10px;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chat Messages Thread */
.hd-chat-messages-box {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hd-chat-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0;
}

.hd-chat-divider span {
  background: #e2e8f0;
  color: var(--gray-700);
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.hd-msg-group {
  display: flex;
  gap: 8px;
  max-width: 85%;
}

.hd-msg-group.incoming {
  align-self: flex-start;
}

.hd-msg-group.outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.hd-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.hd-msg-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hd-msg-sender {
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-700);
}

.hd-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.hd-msg-group.incoming .hd-msg-bubble {
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--gray-200);
  border-top-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.hd-msg-group.outgoing .hd-msg-bubble {
  background: var(--primary-gradient);
  color: var(--white);
  border-top-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
}

/* Medium Emoji Message in Chat */
.hd-msg-group.emoji-only .hd-msg-bubble {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 6px !important;
  width: fit-content;
}

.hd-msg-group.emoji-only .emoji-msg {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 2px;
  display: inline-block;
  user-select: none;
}

@media (max-width: 600px) {
  .hd-msg-group.emoji-only .emoji-msg {
    font-size: 26px;
  }
}

.hd-msg-time {
  font-size: 9.5px;
  color: var(--gray-500);
  align-self: flex-end;
}

/* Quick Action Chips */
.hd-chat-quick-actions {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 12px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  scrollbar-width: none;
  z-index: 10;
}

.hd-chat-quick-actions::-webkit-scrollbar { display: none; }

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  min-height: 30px;
  flex-shrink: 0;
}

.quick-pill:active { background: var(--gray-100); }

/* Transparent Emoji Quick Pack (Glassmorphism Popover) */
.hd-emoji-picker {
  position: absolute;
  bottom: 56px;
  left: 8px;
  right: 8px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  color: #ffffff;
  max-height: 230px;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hd-emoji-picker.hidden {
  display: none !important;
}

/* Category Ambient Tints */
.hd-emoji-picker.tint-emoji { background: rgba(225, 29, 72, 0.26); }
.hd-emoji-picker.tint-beauty { background: rgba(168, 85, 247, 0.26); }
.hd-emoji-picker.tint-dispatch { background: rgba(245, 158, 11, 0.26); }
.hd-emoji-picker.tint-arrived { background: rgba(16, 185, 129, 0.26); }
.hd-emoji-picker.tint-urgent { background: rgba(239, 68, 68, 0.28); }
.hd-emoji-picker.tint-booked { background: rgba(59, 130, 246, 0.26); }
.hd-emoji-picker.tint-greeting { background: rgba(236, 72, 153, 0.26); }
.hd-emoji-picker.tint-other { background: rgba(100, 116, 139, 0.26); }

.hd-quickpack-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  gap: 6px;
}

.hd-quickpack-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}

.hd-quickpack-tabs::-webkit-scrollbar { display: none; }

.hd-quickpack-tab {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.hd-quickpack-tab:hover {
  background: rgba(255, 255, 255, 0.22);
}

.hd-quickpack-tab.active {
  background: linear-gradient(135deg, #ff1b26, #e11d48);
  color: #ffffff;
  border-color: #ff4d6d;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.45);
}

.hd-quickpack-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.hd-quickpack-close:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: #ef4444;
}

.hd-quickpack-panels {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 8px;
}

.hd-quickpack-panel {
  display: none;
}

.hd-quickpack-panel.active {
  display: block;
}

.hd-glass-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px 2px;
  align-items: center;
  justify-items: center;
}

@media (max-width: 400px) {
  .hd-glass-emoji-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px 2px;
  }
}

@media (max-width: 360px) {
  .hd-glass-emoji-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px 2px;
  }
}

.hd-glass-emoji-btn {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-size: 28px;
  line-height: 1;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.hd-glass-emoji-btn:hover {
  transform: scale(1.22);
}

.hd-glass-emoji-btn:active {
  transform: scale(0.9);
}

@keyframes hdEmojiTap {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.hd-glass-emoji-btn.tapped {
  animation: hdEmojiTap 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hd-glass-emoji-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 8px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hd-glass-nav-arrow {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.hd-glass-nav-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hd-glass-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.hd-glass-dots .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.2s;
}

.hd-glass-dots .dot.active {
  width: 7px;
  height: 7px;
  background: #ff1b26;
  box-shadow: 0 0 6px rgba(255, 27, 38, 0.8);
}

/* Chat Composer - 1-Row Locked Layout */
.hd-chat-image-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f8fafc;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}
.hd-chat-image-preview.hidden {
  display: none !important;
}
.hd-chat-image-preview img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--gray-300);
}
.hd-preview-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hd-preview-info span#hdPreviewName {
  font-size: 11px;
  color: var(--dark);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hd-preview-tag {
  font-size: 9px;
  font-weight: 700;
  color: #e11d48;
  letter-spacing: 0.5px;
}
#hdBtnCancelImage {
  border: 0;
  background: transparent;
  font-size: 18px;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.hd-chat-composer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3px;
  padding: 6px 6px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  z-index: 10;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.hd-btn-composer-tool {
  border: 0;
  background: transparent;
  font-size: 15px;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0;
  width: 25px;
  height: 30px;
  flex: 0 0 25px;
  min-width: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s, transform 0.1s;
}

.hd-btn-composer-tool:hover {
  background: var(--gray-100);
}
.hd-btn-composer-tool:active {
  transform: scale(0.92);
}

.hd-chat-input-box {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: 0 !important;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 4px 8px;
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  height: 32px;
  box-sizing: border-box;
  overflow: hidden;
}

.hd-chat-input-box textarea {
  resize: none;
  height: 22px;
  line-height: 20px;
  padding: 0;
  width: 100% !important;
  min-width: 0 !important;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
  font-family: inherit;
  color: var(--dark);
}

.hd-btn-composer-send {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  min-width: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--primary-gradient);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.3);
  transition: transform 0.15s ease;
  padding: 0;
  margin-left: 2px;
}

.hd-btn-composer-send:hover {
  transform: scale(1.05);
}

.hd-btn-composer-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Location Message Card Bubble */
.hd-msg-group .hd-bubble-location {
  padding: 10px 12px;
  max-width: 270px;
  background: #ffffff;
  border: 1px solid var(--gray-200);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-radius: 14px;
}
.hd-msg-group.outgoing .hd-bubble-location {
  background: #fff1f2;
  border-color: #fecdd3;
}
.hd-loc-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12.5px;
  color: #0f172a;
  margin-bottom: 4px;
}
.hd-loc-card-coords {
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 8px;
}
.hd-btn-open-map {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #e11d48;
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}
.hd-btn-open-map:hover {
  opacity: 0.9;
}

@media (min-width: 768px) {
  .hd-chat-composer {
    gap: 6px;
    padding: 10px 14px;
  }
  .hd-btn-composer-tool {
    width: 32px;
    height: 36px;
    flex: 0 0 32px;
    font-size: 18px;
  }
  .hd-chat-input-box {
    height: 36px;
    padding: 6px 14px;
  }
  .hd-btn-composer-send {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }
}

/* ----------------------------------------------------
 * BOTTOM NAVIGATION (5 ITEMS)
 * ---------------------------------------------------- */
.hd-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.05);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 600px) {
  .hd-bottom-nav {
    left: 50%;
    transform: translateX(-50%);
    max-width: 440px;
    border-left: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-200);
  }
}

.hd-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 48px;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 700;
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease;
}

.hd-nav-item.active {
  color: var(--primary);
}

.hd-nav-item svg {
  display: block;
  margin-bottom: 2px;
}

.hd-nav-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(12px);
  background: var(--primary);
  color: var(--white);
  font-size: 9.5px;
  font-weight: 900;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid var(--white);
}

.hd-nav-center {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: var(--white) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: -18px;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.4);
  border: 3px solid var(--white);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
  text-decoration: none;
}

.hd-nav-center:active {
  transform: scale(1.06);
}

.hd-nav-center span {
  font-size: 8.5px;
  font-weight: 800;
  margin-top: -1px;
}

/* ----------------------------------------------------
 * MODALS & OVERLAYS
 * ---------------------------------------------------- */
.hd-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hd-modal-backdrop.show {
  display: flex;
  animation: hdFadeIn 0.2s ease;
}

.hd-modal-card {
  width: 100%;
  max-width: 330px;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  animation: hdPopIn 0.24s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes hdPopIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.hd-modal-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hd-modal-icon-circle.orange {
  background: var(--orange-light);
  color: var(--orange);
}

.hd-modal-icon-circle.blue {
  background: var(--blue-light);
  color: var(--blue);
}

.hd-modal-icon-circle.green {
  background: var(--green-light);
  color: var(--green);
}

.hd-modal-icon-circle.purple {
  background: var(--purple-light);
  color: var(--purple);
}

.hd-modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 8px;
}

.hd-modal-desc {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.45;
  margin-bottom: 22px;
}

.hd-btn-modal-action {
  width: 100%;
  border: 0;
  background: var(--primary-gradient);
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
  padding: 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
  transition: transform 0.15s ease;
}

.hd-btn-modal-action:active {
  transform: scale(0.98);
}

/* Location Selection Modal (Bottom Sheet) */
.hd-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: flex-end;
  justify-content: center;
}

.hd-sheet-backdrop.show {
  display: flex;
  animation: hdFadeIn 0.2s ease;
}

.hd-sheet-card {
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  animation: hdSlideUp 0.24s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.hd-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hd-sheet-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--dark);
}

.hd-sheet-district-list {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px 0 16px;
}

.hd-btn-district-item {
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--dark);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.hd-btn-district-item:hover, .hd-btn-district-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Sidebar Drawer */
.hd-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 2000;
}

.hd-drawer-backdrop.show {
  display: block;
}

.hd-drawer-panel {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 280px;
  max-width: 80vw;
  background: var(--white);
  z-index: 2100;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px 16px;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.hd-drawer-panel.show {
  display: flex;
  transform: translateX(0);
}

.hd-btn-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.15s ease;
}

.hd-btn-drawer-close:active {
  background: var(--gray-200);
  transform: scale(0.95);
}

body.hd-body-lock {
  overflow: hidden !important;
  touch-action: none;
}

.hd-drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.hd-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.hd-drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--dark);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.15s ease;
}

.hd-drawer-link:hover, .hd-drawer-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* Map Custom Markers */
.hd-map-stylist-pin {
  background: transparent;
  border: 0;
}

.hd-pin-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #10b981;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.2), 0 8px 18px rgba(0,0,0,0.25);
  background: #111;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.hd-pin-circle:hover {
  transform: scale(1.1);
}

.hd-pin-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hd-pin-circle.busy {
  border-color: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.2), 0 8px 18px rgba(0,0,0,0.25);
}

.hd-pin-circle.booking {
  border-color: #e11d48;
  box-shadow: 0 0 0 5px rgba(225, 29, 72, 0.25), 0 8px 18px rgba(0,0,0,0.25);
  background: #e11d48;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* Chat-only containment; map geometry remains unchanged. */
#hdChatStatus { flex-shrink: 0; padding: 4px 8px; font-size: 12px; overflow-wrap: anywhere; }
#hdChatStatus[hidden] { display: none; }
#hdMiniPhotoBtn[aria-disabled="true"] { opacity: .45; }
#hdChatMessages .hd-msg-body { min-width: 0; }
#hdChatMessages .hd-msg-bubble { overflow-wrap: anywhere; }
.hd-chat-empty { padding: 12px; font-size: 13px; }
