/* ============================================================
   CR CRAWLER — "Noir Luxe" Design System
   Dark luxury aesthetic with warm amber accents
   Typography: Syne (display) + Outfit (body)
   ============================================================ */

/* === Custom Properties === */
:root {
  /* Core palette */
  --color-bg: #0c0e14;
  --color-bg-raised: #111320;
  --color-surface: #161923;
  --color-surface-hover: #1c1f2e;
  --color-surface-active: #22253a;

  /* Accent */
  --color-accent: #e8a838;
  --color-accent-hover: #f0bc58;
  --color-accent-glow: rgba(232, 168, 56, 0.15);
  --color-accent-subtle: rgba(232, 168, 56, 0.08);

  /* Text */
  --color-text: #e8e6e3;
  --color-text-secondary: #8b8d97;
  --color-text-muted: #5c5e67;

  /* Borders */
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-hover: rgba(255, 255, 255, 0.12);

  /* Semantic */
  --color-success: #34d399;
  --color-warning: #fbbf24;
  --color-danger: #f87171;
  --color-fav: #ef4444;
  --color-info: #60a5fa;

  /* Layout */
  --sidebar-width: 290px;
  --header-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Shadows */
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--color-accent-glow);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Fonts */
  --font-display: 'Syne', sans-serif;
  --font-body: 'Outfit', sans-serif;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 256px;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--color-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent-hover); }
img { max-width: 100%; display: block; }

/* Selection color */
::selection {
  background: var(--color-accent);
  color: var(--color-bg);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* === Header === */
.header {
  background: rgba(12, 14, 20, 0.85);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--color-border);
  min-height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--color-accent) 0%, #f5d678 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo a {
  color: inherit;
  text-decoration: none;
  -webkit-text-fill-color: inherit;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stats-bar {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 400;
}
.stats-sep { margin: 0 8px; opacity: 0.3; }

/* Tooltip for stats (e.g. last crawl timestamp on hover) */
.has-tooltip {
  position: relative;
  cursor: default;
}
.has-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
}
.has-tooltip:hover::before {
  content: '';
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-bottom-color: var(--color-border);
  z-index: 200;
  pointer-events: none;
}

/* Crawl country select */
.crawl-country-select {
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-body);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  max-width: 150px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.crawl-country-select:hover { border-color: var(--color-border-hover); }
.crawl-country-select:focus { outline: none; border-color: var(--color-accent); }

/* Crawl button */
.btn-crawl {
  padding: 8px 18px;
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-crawl:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.btn-crawl:disabled {
  background: var(--color-text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Crawl Progress */
.crawl-progress {
  padding: 8px 24px 12px;
  max-width: 1480px;
  margin: 0 auto;
}
.crawl-progress-text {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.crawl-progress-bar {
  height: 4px;
  background: var(--color-surface);
  border-radius: 2px;
  overflow: hidden;
}
.crawl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent) 0%, #f5d678 100%);
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
  box-shadow: 0 0 12px var(--color-accent-glow);
}

/* === Main Layout === */
.main-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  max-width: 1480px;
  margin: 0 auto;
  gap: 0;
  min-height: calc(100vh - var(--header-height));
  position: relative;
  z-index: 1;
}

/* === Sidebar === */
.sidebar {
  background: var(--color-bg-raised);
  border-right: 1px solid var(--color-border);
  padding: 24px 20px;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar-toggle {
  display: none;
  width: 100%;
  padding: 12px;
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  margin-bottom: 16px;
  transition: all 0.2s;
}
.sidebar-toggle:hover {
  background: var(--color-accent-hover);
}
.sidebar h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.filter-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  margin: 14px 0 6px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-body);
  background: var(--color-surface);
  color: var(--color-text);
  transition: all 0.2s;
}
.filter-group select:hover,
.filter-group input:hover {
  border-color: var(--color-border-hover);
}
.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}
.filter-group select:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.filter-group select option {
  background: var(--color-surface);
  color: var(--color-text);
}
.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0;
}
.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  margin: 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text-secondary);
  transition: color 0.2s;
}
.checkbox-row label:hover {
  color: var(--color-text);
}
/* Custom checkbox */
.checkbox-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--color-border-hover);
  border-radius: 4px;
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.checkbox-row input[type="checkbox"]:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.checkbox-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid var(--color-bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.hint {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  margin-top: 4px;
  font-weight: 400;
}

/* === Advanced Toggle & Options === */
.advanced-toggle {
  display: block;
  width: 100%;
  padding: 10px 0;
  margin-top: 16px;
  background: none;
  border: none;
  border-top: 1px solid var(--color-border);
  color: var(--color-accent);
  font-size: 0.82rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}
.advanced-toggle:hover { color: var(--color-accent-hover); }
.advanced-options { padding-top: 4px; }

/* === Filter Divider === */
.filter-divider {
  height: 1px;
  background: var(--color-border);
  margin: 16px 0 4px;
}

/* === Age Range Row === */
.age-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.age-range-row input[type="number"] {
  flex: 1;
  min-width: 0;
}
.age-range-sep {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* === Radio Row (Smoker) === */
.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0;
}
.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  margin: 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text-secondary);
  transition: color 0.2s;
}
.radio-row label:hover {
  color: var(--color-text);
}
.radio-row input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--color-border-hover);
  border-radius: 50%;
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.radio-row input[type="radio"]:checked {
  border-color: var(--color-accent);
}
.radio-row input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* === Image Search === */
.image-search-toggle {
  display: block;
  width: 100%;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 0.82rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}
.image-search-toggle:hover { color: var(--color-accent-hover); }

.image-search-section { padding-top: 8px; }

.image-upload-area {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-upload-area:hover,
.image-upload-area.drag-over {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}
.image-upload-placeholder {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}
.image-upload-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.image-upload-placeholder small {
  display: block;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  opacity: 0.7;
  margin-top: 2px;
}

.image-preview-wrap {
  position: relative;
  width: 100%;
}
.image-preview-wrap img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-xs);
}
.image-clear-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.image-clear-btn:hover { background: rgba(0, 0, 0, 0.85); }

.btn-image-search {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 9px 0;
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-image-search:hover { background: var(--color-accent-hover); }
.btn-image-search:disabled { opacity: 0.4; cursor: not-allowed; }

.image-search-status {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 6px;
  min-height: 1em;
}

.embeddings-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}
.embeddings-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-generate-embeddings {
  padding: 7px 14px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-generate-embeddings:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.btn-generate-embeddings:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.btn-regenerate-embeddings {
  padding: 7px 14px;
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-regenerate-embeddings:hover {
  border-color: #e8a040;
  color: #e8a040;
}
.btn-regenerate-embeddings:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.embeddings-stat {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.embeddings-progress {
  margin-top: 8px;
}
.embeddings-progress-text {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.embeddings-progress-bar {
  height: 3px;
  background: var(--color-surface);
  border-radius: 2px;
  overflow: hidden;
}
.embeddings-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent) 0%, #f5d678 100%);
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
  box-shadow: 0 0 8px var(--color-accent-glow);
}

.card-similarity-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border: 1px solid rgba(232, 168, 56, 0.2);
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 6px;
}
.card-similarity-badge.face-match {
  background: rgba(56, 232, 120, 0.1);
  color: #38e878;
  border-color: rgba(56, 232, 120, 0.25);
}

/* === Contact Match Badge === */
.card-contact-badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(56, 152, 232, 0.1);
  color: #3898e8;
  border: 1px solid rgba(56, 152, 232, 0.2);
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 6px;
}

/* === Contact Search === */
.contact-search-toggle {
  display: block;
  width: 100%;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 0.82rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}
.contact-search-toggle:hover { color: var(--color-accent-hover); }

.contact-search-section { padding-top: 8px; }

.contact-upload-area {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-upload-area:hover,
.contact-upload-area.drag-over {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}
.contact-upload-placeholder {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}
.contact-upload-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.contact-upload-placeholder small {
  display: block;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  opacity: 0.7;
  margin-top: 2px;
}

.contact-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--color-text);
}
.contact-clear-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.contact-clear-btn:hover { background: rgba(255, 255, 255, 0.2); }

.btn-contact-search {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 9px 0;
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-contact-search:hover { background: var(--color-accent-hover); }
.btn-contact-search:disabled { opacity: 0.4; cursor: not-allowed; }

.contact-search-status {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 6px;
  min-height: 1em;
}

/* === Services Toggle & Section === */
.services-toggle {
  display: block;
  width: 100%;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 0.82rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}
.services-toggle:hover { color: var(--color-accent-hover); }

.services-section {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px 8px;
}
.services-grid .service-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  margin: 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text-secondary);
  transition: color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.services-grid .service-checkbox:hover {
  color: var(--color-text);
}
.services-grid .service-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  min-width: 14px;
  height: 14px;
  border: 1.5px solid var(--color-border-hover);
  border-radius: 3px;
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.services-grid .service-checkbox input[type="checkbox"]:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.services-grid .service-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 7px;
  border: solid var(--color-bg);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.service-count {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* === Filter Reset === */
.filter-reset-row {
  margin-top: 20px;
  text-align: center;
}
.filter-reset-link {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
}
.filter-reset-link:hover {
  color: var(--color-danger);
}

/* === Search Hint Phone Detection === */
#search-hint.phone-detected {
  color: var(--color-success);
  font-weight: 500;
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  margin-top: 16px;
  width: 100%;
  text-align: center;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-glow);
}
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  margin-top: 8px;
}
.btn-secondary:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
}

/* === Content === */
.content {
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* === Sort Bar === */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.result-count {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}
.sort-options {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-options label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sort-options select {
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font-body);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 0.2s;
}
.sort-options select:hover { border-color: var(--color-border-hover); }
.sort-options select:focus { outline: none; border-color: var(--color-accent); }
.sort-options select option {
  background: var(--color-surface);
  color: var(--color-text);
}

/* === Card Grid === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* === Card Entrance Animation === */
@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* === Profile Card === */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.35s var(--ease-out);
  cursor: pointer;
  position: relative;
  animation: cardEntrance 0.5s var(--ease-out) both;
}

/* Stagger animation for cards */
.card:nth-child(1) { animation-delay: 0ms; }
.card:nth-child(2) { animation-delay: 40ms; }
.card:nth-child(3) { animation-delay: 80ms; }
.card:nth-child(4) { animation-delay: 120ms; }
.card:nth-child(5) { animation-delay: 160ms; }
.card:nth-child(6) { animation-delay: 200ms; }
.card:nth-child(7) { animation-delay: 240ms; }
.card:nth-child(8) { animation-delay: 280ms; }
.card:nth-child(9) { animation-delay: 320ms; }
.card:nth-child(10) { animation-delay: 360ms; }
.card:nth-child(n+11) { animation-delay: 400ms; }

.card:hover {
  border-color: rgba(232, 168, 56, 0.2);
  box-shadow: var(--shadow-hover), 0 0 30px rgba(232, 168, 56, 0.06);
  transform: translateY(-4px);
}

/* Subtle top accent line on hover */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0;
  transition: opacity 0.35s;
  z-index: 2;
}
.card:hover::before {
  opacity: 1;
}

/* Card Image Wrapper */
.card-image-wrap {
  position: relative;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  background: var(--color-bg);
  cursor: pointer;
  transition: transform 0.5s var(--ease-out);
}
.card:hover .card-image {
  transform: scale(1.04);
}
.card-body {
  padding: 16px;
}
.card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text);
}
.card-headline {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.badge-location {
  background: rgba(96, 165, 250, 0.1);
  color: var(--color-info);
  border: 1px solid rgba(96, 165, 250, 0.15);
}
.badge-rate {
  background: rgba(52, 211, 153, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(52, 211, 153, 0.15);
}
.badge-login {
  background: rgba(251, 191, 36, 0.1);
  color: var(--color-warning);
  border: 1px solid rgba(251, 191, 36, 0.15);
}
.badge-login.recent {
  background: rgba(52, 211, 153, 0.1);
  color: var(--color-success);
  border-color: rgba(52, 211, 153, 0.15);
}

.card-phone {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.card-email {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
  word-break: break-all;
}
.card-rates {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.78rem;
}
.rate-tag {
  padding: 4px 10px;
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.1);
  border-radius: var(--radius-xs);
  color: var(--color-text-secondary);
}
.rate-tag strong { color: var(--color-success); }
.card-images-count {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 8px;
}

/* === Favourite Button === */
.card-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease-out);
  z-index: 2;
  line-height: 1;
}
.card-fav-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  color: var(--color-fav);
  transform: scale(1.15);
}
.card-fav-btn.active {
  color: var(--color-fav);
  background: rgba(239, 68, 68, 0.15);
  backdrop-filter: blur(8px);
}

/* Favourite button in profile modal hero */
.profile-name .card-fav-btn {
  position: static;
  width: 38px;
  height: 38px;
  font-size: 1.3rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}
.profile-name .card-fav-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
}

/* === Keyword Match Badge === */
.card-match-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 12px;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border: 1px solid rgba(232, 168, 56, 0.15);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
}

/* === Video Card Placeholder === */
.card-video-placeholder {
  width: 100%;
  height: 240px;
  background: linear-gradient(135deg, #0f1018 0%, #1a1d2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.card-video-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  transition: all 0.3s var(--ease-out);
}
.card:hover .card-video-icon {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg);
  transform: scale(1.1);
}

/* === Gallery Play Overlay === */
.profile-gallery-thumb-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.profile-gallery-thumb-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.profile-gallery-thumb-wrap:hover .gallery-play-overlay {
  background: rgba(0, 0, 0, 0.6);
}

/* === Profile Modal === */
.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}
.profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.profile-modal-container {
  position: relative;
  width: 100%;
  max-width: 920px;
  margin: 48px auto;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  min-height: 200px;
  z-index: 1;
  padding: 24px;
  animation: modalSlideIn 0.4s var(--ease-out) both;
}
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.profile-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.profile-modal-close:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
}
.profile-modal-body {
  padding-top: 8px;
}

/* === Skeleton Loading === */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.skeleton-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  height: 380px;
  position: relative;
  overflow: hidden;
}
.skeleton-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.02), transparent);
  animation: shimmer 1.8s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  padding: 24px 0;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0 10px;
}
.page-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.page-btn.active {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
  font-weight: 600;
}
.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.page-ellipsis {
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* === Image/Video Modal === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-image-wrap,
#modal-media-wrap {
  max-width: 80vw;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
#modal-media-wrap img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.4s var(--ease-out);
  border-radius: var(--radius-sm);
}
#modal-media-wrap img.zoomed {
  cursor: zoom-out;
  transform: scale(1.8);
}
#modal-media-wrap video {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-sm);
}
.modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
}
.modal-close:hover { color: white; }
.modal-nav {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 2.2rem;
  padding: 12px 16px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: all 0.2s;
}
.modal-nav:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}
.modal-counter {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* === Profile Page (inside modal) === */
.profile-hero {
  display: flex;
  gap: 28px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.profile-hero-image {
  flex-shrink: 0;
  width: 280px;
}
.profile-hero-image img,
.profile-hero-img {
  width: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  max-height: 360px;
}
.profile-hero-info {
  flex: 1;
  min-width: 0;
}
.profile-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  letter-spacing: -0.01em;
}
.profile-age {
  font-weight: 400;
  font-family: var(--font-body);
  color: var(--color-text-muted);
}
.profile-online-dot {
  width: 10px;
  height: 10px;
  background: var(--color-success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.profile-phone {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.profile-email {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  word-break: break-all;
}
.profile-rating {
  font-size: 0.88rem;
  color: var(--color-warning);
  margin-bottom: 8px;
}
.profile-headline {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  line-height: 1.7;
  white-space: pre-line;
}
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Gallery */
.profile-gallery {
  margin-bottom: 20px;
}
.profile-gallery-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
}
.profile-gallery-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.profile-gallery-thumb:hover {
  border-color: var(--color-accent);
}

/* Sections */
.profile-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.profile-section h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  letter-spacing: 0.02em;
}

/* About */
.profile-about {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 18px;
  font-size: 0.9rem;
  line-height: 1.8;
  white-space: pre-line;
  color: var(--color-text-secondary);
}

/* Details Grid */
.profile-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.profile-detail-cell {
  background: var(--color-surface);
  padding: 14px;
  text-align: center;
}
.profile-detail-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.profile-detail-value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text);
}

/* Rates Table */
.profile-rates-currency {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--color-text-muted);
}
.profile-rates-table {
  width: 100%;
  border-collapse: collapse;
}
.profile-rates-table th,
.profile-rates-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.88rem;
}
.profile-rates-table th {
  background: var(--color-bg);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 600;
}
.profile-rates-table td:nth-child(2),
.profile-rates-table td:nth-child(3) {
  color: var(--color-success);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Services Tags */
.profile-services,
.profile-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-service-tag {
  padding: 7px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  transition: all 0.2s;
}
.profile-service-tag:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Profile Loading */
.profile-loading {
  padding: 20px 0;
}
.profile-not-found {
  text-align: center;
  padding: 80px 20px;
  color: var(--color-text-muted);
}
.profile-not-found h2 {
  margin-bottom: 8px;
  color: var(--color-text);
  font-family: var(--font-display);
}

/* === Gallery Grid (Profile Modal) === */
.profile-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.profile-gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}
.profile-gallery-item img,
.profile-gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease-out);
}
.profile-gallery-item:hover img,
.profile-gallery-item:hover video {
  transform: scale(1.08);
}
.profile-gallery-video .gallery-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  border-radius: var(--radius-sm);
  pointer-events: none;
  transition: background 0.2s;
}
.profile-gallery-item:hover .gallery-play-overlay {
  background: rgba(0, 0, 0, 0.55);
}

/* === Reviews === */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.review-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: border-color 0.2s;
}
.review-card:hover {
  border-color: var(--color-border-hover);
}
.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.review-author {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-text);
}
.review-stars {
  color: var(--color-warning);
  font-size: 0.88rem;
  letter-spacing: 2px;
}
.review-date {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.review-text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--color-text);
  white-space: pre-line;
}
.review-text strong {
  color: var(--color-accent);
  font-weight: 600;
}

/* === Safe Mode Toggle === */
.btn-safe-mode {
  padding: 7px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-body);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-safe-mode:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-secondary);
}
.btn-safe-mode.active {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}

/* Safe Mode: blur images and redact text */
.safe-mode .card-image,
.safe-mode .card-video-placeholder,
.safe-mode .profile-hero-img,
.safe-mode .profile-hero-image img,
.safe-mode .profile-hero-image video,
.safe-mode .profile-gallery-thumb,
.safe-mode .profile-gallery-item img,
.safe-mode .profile-gallery-item video,
.safe-mode .profile-gallery-thumb-wrap img,
.safe-mode .profile-gallery-thumb-wrap video,
.safe-mode #modal-media-wrap img,
.safe-mode #modal-media-wrap video,
.safe-mode .dash-conv-img {
  filter: blur(20px) brightness(0.6);
  pointer-events: none;
}

.safe-mode .card-name,
.safe-mode .card-headline,
.safe-mode .card-phone,
.safe-mode .card-email,
.safe-mode .card-rates,
.safe-mode .card-rates *,
.safe-mode .profile-name,
.safe-mode .profile-phone,
.safe-mode .profile-email,
.safe-mode .profile-headline,
.safe-mode .profile-about,
.safe-mode .profile-service-tag,
.safe-mode .profile-rates-table td,
.safe-mode .profile-rates-table td *,
.safe-mode .profile-rating,
.safe-mode .review-author,
.safe-mode .review-text,
.safe-mode .review-stars,
.safe-mode .profile-detail-value,
.safe-mode .dash-conv-last,
.safe-mode .dash-msg-text,
.safe-mode .dash-msg-name {
  color: transparent !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
  user-select: none;
}

/* === Utility === */
.hidden { display: none !important; }

/* === Responsive === */

/* --- Tablet (900px) --- */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 16px 20px;
  }
  .sidebar-toggle { display: block; }
  .sidebar-content { display: none; }
  .sidebar-content.open { display: block; }
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  .profile-hero { flex-direction: column; }
  .profile-hero-image { width: 100%; }
  .profile-hero-image img,
  .profile-hero-img { max-height: 400px; width: 100%; }
  .profile-details-grid { grid-template-columns: repeat(2, 1fr); }

  .profile-modal-container {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 100%;
    border: none;
    padding: 16px;
  }
  .profile-modal-close {
    top: 12px;
    right: 12px;
  }

  /* Header: wrap controls */
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-height);
    padding: 10px 16px;
    gap: 8px;
  }
  .header-right {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Image modal: larger touch targets */
  .modal-nav {
    padding: 16px 12px;
    font-size: 1.8rem;
  }
}

/* --- Mobile (600px) --- */
@media (max-width: 600px) {
  :root {
    --header-height: 56px;
  }

  .header-inner {
    padding: 8px 12px;
    gap: 6px;
  }
  .logo { font-size: 1.1rem; }
  .header-right {
    gap: 6px;
    flex-wrap: wrap;
  }
  .stats-bar { display: none; }
  .crawl-country-select { max-width: 120px; font-size: 0.75rem; padding: 6px 8px; }
  .btn-crawl { padding: 6px 12px; font-size: 0.78rem; }
  .btn-safe-mode { padding: 6px 10px; font-size: 0.72rem; }

  .content { padding: 12px; }

  /* Sidebar mobile */
  .sidebar { padding: 12px; }
  .sidebar-toggle { padding: 10px; font-size: 0.85rem; }
  .services-grid { grid-template-columns: 1fr 1fr; }

  /* Card grid */
  .card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .card-image,
  .card-video-placeholder { height: 160px; }
  .card-body { padding: 10px; }
  .card-name { font-size: 0.88rem; }
  .card-headline { font-size: 0.75rem; margin-bottom: 6px; }
  .card-meta { gap: 4px; margin-bottom: 6px; }
  .badge { padding: 2px 7px; font-size: 0.65rem; }
  .card-rates { gap: 4px; margin-top: 6px; font-size: 0.72rem; }
  .rate-tag { padding: 3px 7px; }
  .card-phone { font-size: 0.72rem; }
  .card-email { font-size: 0.68rem; }
  .card-images-count { font-size: 0.68rem; }
  .card-fav-btn { width: 30px; height: 30px; font-size: 0.95rem; top: 6px; right: 6px; }

  /* Sort bar */
  .sort-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .sort-options { flex-wrap: wrap; gap: 6px; }
  .sort-options select { font-size: 0.78rem; padding: 6px 8px; }
  .result-count { font-size: 0.85rem; }

  /* Pagination */
  .pagination { gap: 4px; margin-top: 24px; padding: 16px 0; }
  .page-btn { min-width: 34px; height: 34px; font-size: 0.8rem; padding: 0 8px; }
  .page-ellipsis { min-width: 28px; height: 34px; }

  /* Profile modal */
  .profile-modal-container { padding: 12px; }
  .profile-hero { padding: 16px; gap: 16px; }
  .profile-name { font-size: 1.2rem; gap: 6px; }
  .profile-phone { font-size: 0.85rem; }
  .profile-headline { font-size: 0.82rem; }
  .profile-section { padding: 16px; margin-bottom: 12px; }
  .profile-section h2 { font-size: 0.95rem; margin-bottom: 14px; }
  .profile-about { padding: 14px; font-size: 0.85rem; }
  .profile-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
  }
  .profile-service-tag { padding: 5px 12px; font-size: 0.78rem; }
  .profile-services, .profile-languages { gap: 6px; }

  /* Rates table: scrollable */
  .profile-rates-table { font-size: 0.82rem; }
  .profile-rates-table th,
  .profile-rates-table td { padding: 10px 12px; }

  /* Reviews */
  .review-card { padding: 12px; }
  .review-header { gap: 6px; }
  .review-text { font-size: 0.82rem; }

  /* Image modal: full-width, swipe-friendly */
  .modal-content { max-width: 100vw; flex-direction: column; gap: 8px; padding: 0 4px; }
  .modal-image-wrap,
  #modal-media-wrap { max-width: 100vw; max-height: 75vh; border-radius: 0; }
  .modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    padding: 20px 10px;
    font-size: 1.6rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: var(--radius-xs);
    z-index: 10;
  }
  .modal-prev { left: 4px; }
  .modal-next { right: 4px; }
  .modal-close {
    position: fixed;
    top: 12px;
    right: 12px;
    font-size: 1.6rem;
    z-index: 20;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .modal-counter { bottom: -24px; font-size: 0.75rem; }

  /* Skeleton */
  .skeleton-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .skeleton-card { height: 260px; }

  /* Empty state */
  .empty-state { padding: 48px 16px; }
}

/* --- Small phones (400px) --- */
@media (max-width: 400px) {
  .card-grid { grid-template-columns: 1fr; }
  .card-image,
  .card-video-placeholder { height: 200px; }
  .card-body { padding: 12px; }
  .profile-details-grid { grid-template-columns: 1fr; }
  .profile-hero { padding: 12px; }
  .profile-section { padding: 12px; }
  .services-grid { grid-template-columns: 1fr; }

  /* Header: stack controls below */
  .header-right { width: 100%; justify-content: flex-end; }
  .logo { font-size: 1rem; }
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.btn-back {
  padding: 8px 18px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-body);
  text-decoration: none;
  transition: all 0.2s;
}
.btn-back:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

.dash-status-bar {
  display: flex;
  gap: 24px;
  padding: 14px 24px;
  max-width: 1480px;
  margin: 0 auto;
  background: var(--color-bg-raised);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.dash-status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.dash-status-item strong {
  color: var(--color-text);
}
.dash-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex-shrink: 0;
}
.dash-status-dot.green {
  background: var(--color-success);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}
.dash-status-dot.red {
  background: var(--color-danger);
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.4);
}

.dash-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}
.dash-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.dash-section h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
}
.dash-filter-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 400;
  font-family: var(--font-body);
}
.dash-clear-filter {
  font-size: 0.78rem;
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.dash-clear-filter:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
}

.dash-empty {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  padding: 16px 0;
}

/* Conversation cards */
.dash-conv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-conv-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  align-items: flex-start;
}
.dash-conv-card:hover {
  border-color: var(--color-border-hover);
  background: var(--color-bg-raised);
}
.dash-conv-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.dash-conv-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.dash-conv-info { flex: 1; min-width: 0; }
.dash-conv-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.dash-conv-mode {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  text-transform: capitalize;
  font-weight: 500;
}
.dash-conv-count {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}
.dash-conv-last {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.dash-conv-summary {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 4px;
}
.dash-conv-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-conv-ago {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.dash-stop-btn {
  padding: 4px 14px;
  font-size: 0.75rem;
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-danger);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.dash-stop-btn:hover {
  background: var(--color-danger);
  color: white;
}
.dash-stop-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Message log */
.dash-message-log {
  max-height: 420px;
  overflow-y: auto;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.82rem;
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  line-height: 1.7;
}
.dash-msg { padding: 2px 0; }
.dash-msg.outgoing .dash-msg-arrow { color: var(--color-info); }
.dash-msg.incoming .dash-msg-arrow { color: var(--color-success); }
.dash-msg-time {
  color: var(--color-text-muted);
  margin-right: 6px;
}
.dash-msg-arrow { margin-right: 4px; font-weight: 600; }
.dash-msg-name { font-weight: 600; color: var(--color-text-secondary); }
.dash-msg-text { color: var(--color-text-secondary); }

@media (max-width: 600px) {
  .dash-status-bar { gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
  .dash-status-item { font-size: 0.78rem; }
  .dash-container { padding: 12px; }
  .dash-section { padding: 14px; margin-bottom: 12px; }
  .dash-section h2 { font-size: 0.95rem; gap: 6px; }
  .dash-message-log { max-height: 280px; font-size: 0.72rem; padding: 10px; }
  .dash-conv-card { padding: 10px; gap: 10px; }
  .dash-conv-img { width: 40px; height: 40px; }
  .dash-conv-header { gap: 4px; }
  .dash-conv-last { font-size: 0.78rem; }
  .dash-conv-footer { flex-wrap: wrap; gap: 6px; }
}

/* ============================================================
   DATA MANAGEMENT BAR
   ============================================================ */

.data-mgmt-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 24px;
  background: var(--color-bg-raised);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}
.data-stat strong {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.data-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--color-border);
  white-space: nowrap;
}
.data-btn-icon { font-size: 1rem; }
.data-btn--download {
  background: var(--color-surface);
  color: var(--color-text);
}
.data-btn--download:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.data-btn--upload {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border-color: rgba(232, 168, 56, 0.25);
}
.data-btn--upload:hover {
  background: rgba(232, 168, 56, 0.15);
  border-color: var(--color-accent);
}
.data-btn--cancel {
  background: var(--color-surface);
  color: var(--color-text-secondary);
}
.data-btn--cancel:hover {
  border-color: var(--color-text-muted);
}
.data-btn--confirm {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
  font-weight: 600;
}
.data-btn--confirm:hover {
  background: var(--color-accent-hover);
}
.data-btn--confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Upload Modal */
.data-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pg-fade-in 0.2s ease;
}
.data-modal-overlay[hidden] { display: none; }
.data-modal {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 460px;
  max-width: 92vw;
  box-shadow: var(--shadow-hover);
  animation: pg-bubble-in 0.25s var(--ease-spring);
}
.data-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.data-modal-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}
.data-modal-body {
  padding: 20px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}
.data-modal-body strong { color: var(--color-text); }
.data-modal-body .merge-stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}
.data-modal-body .merge-stat:last-child { border-bottom: none; }
.data-modal-body .merge-stat-label { color: var(--color-text-secondary); }
.data-modal-body .merge-stat-value { font-weight: 600; color: var(--color-text); font-variant-numeric: tabular-nums; }
.data-modal-body .merge-stat-value.new { color: var(--color-success); }
.data-modal-body .merge-stat-value.update { color: var(--color-accent); }
.data-modal-body .merge-fields {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}
.data-modal-body .merge-fields strong { color: var(--color-text-secondary); }
.data-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 20px;
}

@media (max-width: 600px) {
  .data-mgmt-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 12px; }
  .data-mgmt-stats { gap: 12px; flex-wrap: wrap; font-size: 0.75rem; }
  .data-mgmt-actions { justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
  .data-btn { padding: 6px 12px; font-size: 0.75rem; }
}

/* ============================================================
   PLAYGROUND
   ============================================================ */

/* Header controls */
.pg-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}
.pg-toggle input[type="checkbox"] {
  accent-color: var(--color-accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.pg-toggle-label { user-select: none; }
.pg-reset-btn {
  padding: 6px 16px;
  font-size: 0.82rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.pg-reset-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.pg-reset-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Escort Quick-Start Bar */
.pg-escort-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--color-bg-raised);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}
.pg-escort-bar-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.pg-escort-bar-cards {
  display: flex;
  gap: 10px;
}
.pg-escort-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  white-space: nowrap;
  font-family: var(--font-body);
  color: var(--color-text);
}
.pg-escort-card:hover {
  border-color: var(--color-accent);
  background: var(--color-surface-hover);
  box-shadow: var(--shadow-glow);
}
.pg-escort-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.pg-escort-card-name {
  font-weight: 600;
  font-size: 0.85rem;
}
.pg-escort-card-loc {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

/* Two-Panel Grid */
.pg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: calc(100vh - var(--header-height) - 58px);
  min-height: 400px;
}

/* Panel */
.pg-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
  min-height: 0;
  overflow: hidden;
}
.pg-panel:last-child { border-right: none; }

.pg-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--color-bg-raised);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.pg-panel-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #2aabee;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.pg-panel-icon--wa { background: #25d366; }
.pg-panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
}
.pg-panel-status {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: color 0.2s;
}
.pg-status--busy { color: var(--color-warning); }

/* Chat area */
.pg-chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Bubbles */
.pg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: pg-bubble-in 0.25s var(--ease-spring);
}
@keyframes pg-bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* TG panel: user = right/accent, bot = left/surface */
.pg-bubble--user {
  align-self: flex-end;
  background: var(--color-accent);
  color: var(--color-bg);
  border-bottom-right-radius: 4px;
}
.pg-bubble--user .pg-bubble-sender { color: rgba(0,0,0,0.5); }
.pg-bubble--user .pg-bubble-time { color: rgba(0,0,0,0.4); }

.pg-bubble--bot {
  align-self: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

/* WA panel: incoming = left/green-tint, outgoing = right/surface */
.pg-bubble--incoming {
  align-self: flex-start;
  background: #1a3a2a;
  border: 1px solid rgba(37, 211, 102, 0.15);
  border-bottom-left-radius: 4px;
}
.pg-bubble--outgoing {
  align-self: flex-end;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-bottom-right-radius: 4px;
}

/* Photo bubbles */
.pg-bubble--photo {
  padding: 0;
  overflow: hidden;
  max-width: 300px;
}
.pg-bubble--photo .pg-bubble-text {
  padding: 8px 14px;
}
.pg-bubble--photo .pg-inline-btns {
  padding: 0 14px 10px;
}
.pg-bubble-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

.pg-bubble-sender {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.pg-bubble-text { word-break: break-word; }
.pg-bubble-time {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  text-align: right;
  margin-top: 4px;
}

/* Inline buttons */
.pg-inline-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.pg-inline-btn {
  padding: 6px 14px;
  font-size: 0.78rem;
  border: 1px solid rgba(42, 171, 238, 0.3);
  border-radius: var(--radius-xs);
  background: rgba(42, 171, 238, 0.08);
  color: #2aabee;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.pg-inline-btn:hover {
  background: rgba(42, 171, 238, 0.18);
  border-color: rgba(42, 171, 238, 0.5);
}

/* Notifications */
.pg-notification {
  align-self: center;
  padding: 6px 14px;
  font-size: 0.78rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 90%;
  animation: pg-bubble-in 0.25s var(--ease-spring);
}

/* System messages */
.pg-system-msg {
  align-self: center;
  padding: 8px 16px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
}

/* Input bar */
.pg-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-bg-raised);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}
.pg-input {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}
.pg-input:focus { border-color: var(--color-accent); }
.pg-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pg-send-btn {
  padding: 10px 20px;
  font-size: 0.82rem;
  border: none;
  border-radius: 20px;
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.pg-send-btn:hover { background: var(--color-accent-hover); }
.pg-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Settings button */
.pg-settings-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-settings-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Settings overlay */
.pg-settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pg-fade-in 0.2s ease;
}
.pg-settings-overlay[hidden] { display: none; }
@keyframes pg-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.pg-settings-panel {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--shadow-hover);
  animation: pg-bubble-in 0.25s var(--ease-spring);
}
.pg-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.pg-settings-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}
.pg-settings-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.pg-settings-close:hover { color: var(--color-text); }
.pg-settings-body {
  padding: 20px;
}
.pg-settings-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}
.pg-settings-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 8px;
  line-height: 1.4;
}
.pg-settings-footer {
  padding: 12px 20px 20px;
  display: flex;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
  .pg-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    height: calc(100vh - 56px - 58px);
    height: calc(100dvh - 56px - 58px);
  }
  .pg-panel { border-right: none; border-bottom: 1px solid var(--color-border); }
  .pg-panel:last-child { border-bottom: none; }
  .pg-escort-bar { padding: 10px 12px; gap: 8px; }
  .pg-escort-card { padding: 6px 10px; gap: 8px; }
  .pg-escort-card-avatar { width: 28px; height: 28px; font-size: 0.8rem; }
  .pg-escort-card-name { font-size: 0.78rem; }
  .pg-escort-card-loc { font-size: 0.65rem; }
  .pg-panel-header { padding: 10px 12px; }
  .pg-chat { padding: 12px; }
  .pg-input-bar { padding: 10px 12px; }
  .pg-input { padding: 8px 14px; font-size: 0.82rem; }
  .pg-send-btn { padding: 8px 16px; font-size: 0.78rem; }

  /* Playground header controls */
  .pg-toggle-label { font-size: 0.75rem; }
  .pg-reset-btn { padding: 5px 12px; font-size: 0.78rem; }
  .btn-back { padding: 6px 12px; font-size: 0.78rem; }
  .pg-bubble { max-width: 85%; font-size: 0.82rem; }
  .pg-bubble--photo { max-width: 250px; }
}
@media (max-width: 480px) {
  .pg-grid {
    grid-template-rows: 1fr 1fr;
    height: calc(100vh - 56px - 50px);
    height: calc(100dvh - 56px - 50px);
  }
  .pg-escort-bar-label { display: none; }
  .pg-escort-bar { padding: 8px 10px; }
  .pg-bubble { max-width: 90%; }
}
