/* ========================================
   MIDWAY — CSS (Light / Clean / Functional)
   ======================================== */

/* --- Reset & Variables --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Core palette — muted, functional */
  --primary: #4A6CF7;
  --primary-light: #7B93FA;
  --primary-dark: #3A56D4;
  --accent: #0EA5E9;
  --accent-light: #7DD3FC;
  --eco: #10B981;
  --eco-light: #6EE7B7;
  --fairness: #4A6CF7;
  --fairness-light: #7B93FA;
  --warning: #F59E0B;
  --danger: #EF4444;
  --success: #10B981;

  /* Neutrals — white/light */
  --bg: #FFFFFF;
  --bg-card: #F9FAFB;
  --bg-card-hover: #F3F4F6;
  --bg-elevated: #F3F4F6;
  --surface: #F3F4F6;
  --text: #111827;
  --text-muted: #6B7280;
  --text-dim: #9CA3AF;
  --border: #E5E7EB;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* Shadows — subtle */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 0 2px rgba(74, 108, 247, 0.15);

  /* Fonts — Arial, thin weights */
  --font-body: Arial, Helvetica, -apple-system, sans-serif;
  --font-display: Arial, Helvetica, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* --- Layout --- */
.page-content {
  max-width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* --- Navbar --- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-xl);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}

.accent {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  gap: var(--space-sm);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.92rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--surface);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon:hover {
  background: var(--primary-dark);
}

/* --- Sections (unused landing elements removed) --- */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-2xl);
}

/* ========================================
   SETUP SCREEN
   ======================================== */
.setup-container {
  max-width: 900px;
  margin: var(--space-xl) auto;
  padding: 0 var(--space-xl);
}

.setup-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: start;
  margin-bottom: var(--space-lg);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.setup-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.setup-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.gradient-text {
  background: linear-gradient(90deg, #6366F1, #8B5CF6, #EC4899, #6366F1);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s linear infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% center; }
  100% { background-position: -200% center; }
}

.setup-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Mode Toggle */
.mode-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.mode-toggle {
  display: inline-block;
  cursor: pointer;
}

.mode-toggle input {
  display: none;
}

.toggle-track {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  position: relative;
  padding: 2px;
  width: 200px;
}

.toggle-option {
  flex: 1;
  text-align: center;
  padding: 5px 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
  transition: color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
  z-index: 1;
}

.mode-toggle input:checked ~ .toggle-track .toggle-thumb {
  left: calc(50% + 1px);
  background: var(--eco);
}

.mode-toggle input:not(:checked) ~ .toggle-track .fairness-opt {
  color: white;
}

.mode-toggle input:checked ~ .toggle-track .eco-opt {
  color: white;
}

.mode-description {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Location inputs */
.locations-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.locations-panel h3 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
}

.btn-invite-inline {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.btn-invite-inline:hover {
  background: rgba(74, 108, 247, 0.08);
}

.locations-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.location-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.location-row .person-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity 0.15s;
}

.location-row .person-avatar:hover {
  opacity: 0.8;
}

/* Name hint tooltip */
.name-hint {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--text);
  color: var(--bg);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 5;
}

.name-hint::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-left-color: var(--text);
}

.name-hint.show {
  opacity: 1;
}

/* "This is you" highlight ring on own row in a group */
.my-row-highlight {
  position: relative;
  background: rgba(74, 108, 247, 0.06);
  border-radius: var(--radius-md);
  padding: 4px 2px;
  margin: -4px -2px;
  box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.3);
  animation: you-glow 2s ease-in-out;
}

@keyframes you-glow {
  0% { box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.5), 0 0 12px rgba(74, 108, 247, 0.3); }
  50% { box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.4), 0 0 18px rgba(74, 108, 247, 0.2); }
  100% { box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.15); }
}

.location-row .name-input {
  width: 80px;
  flex: none !important;
  font-size: 0.78rem;
  padding: 6px 8px !important;
  border-radius: var(--radius-sm) !important;
  text-align: center;
}

.location-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s;
}

.location-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.1);
}

.location-row input::placeholder {
  color: var(--text-dim);
}

.location-row .btn-remove {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.location-row .btn-remove:hover {
  background: rgba(225, 112, 85, 0.15);
  color: var(--danger);
}

.btn-add-location {
  margin-top: var(--space-md);
  width: 100%;
  justify-content: center;
  border-style: solid;
}

.invite-subtext {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ---------- Group / Real-time ---------- */
.group-active-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: 8px 12px;
  background: rgba(74, 108, 247, 0.08);
  border: 1px solid rgba(74, 108, 247, 0.2);
  border-radius: var(--radius-md);
}

.group-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-member-count {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.remote-member {
  position: relative;
}

.remote-member input {
  opacity: 0.7;
  font-style: italic;
}

.remote-member input.remote-set {
  opacity: 1;
  font-style: normal;
}

.remote-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
  animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Autocomplete dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 4px;
  z-index: 50;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.autocomplete-item {
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: background 0.1s;
  color: var(--text-muted);
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--surface);
  color: var(--text);
}

.autocomplete-item i {
  color: var(--primary);
  font-size: 0.75rem;
}

/* Category Toggle */
.category-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 3px;
}

.category-btn {
  flex: 1;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  touch-action: manipulation;
}

.category-btn:hover {
  color: var(--text);
}

.category-btn.active {
  background: var(--bg);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.vibe-input-wrap {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.vibe-input-wrap input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s;
}

.vibe-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.1);
}

.vibe-input-wrap input::placeholder {
  color: var(--text-dim);
}

.vibe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.ai-prompt-section {
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.ai-prompt-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}

.vibe-more-options {
  margin-top: var(--space-md);
}

.vibe-preset-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.vibe-more-toggle {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  user-select: none;
}

.vibe-more-toggle::-webkit-details-marker {
  display: none;
}

.vibe-more-toggle .vibe-more-arrow {
  font-size: 0.6rem;
  transition: transform 0.2s;
}

.vibe-more-options[open] .vibe-more-arrow {
  transform: rotate(180deg);
}

.vibe-more-body {
  padding-top: var(--space-sm);
}

.ai-prompt-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.ai-prompt-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.1);
}

.ai-prompt-input::placeholder {
  color: var(--text-dim);
}

.vibe-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
  touch-action: manipulation;
}

.vibe-tag:hover {
  border-color: var(--primary);
  color: var(--text);
}

.vibe-tag.active {
  background: rgba(74, 108, 247, 0.08);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-find {
  display: flex;
  width: 100%;
  justify-content: center;
  font-size: 0.92rem;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.btn-find::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: none;
  pointer-events: none;
}

.btn-find:hover:not(:disabled)::after {
  animation: btnShimmer 0.8s ease forwards;
}

@keyframes btnShimmer {
  0% { left: -100%; }
  100% { left: 150%; }
}

/* More Options */
.more-options-section {
  text-align: left;
  margin-bottom: var(--space-md);
}

.more-options-toggle {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  transition: color 0.15s;
}

.more-options-toggle:hover {
  color: var(--primary);
}

.more-options-arrow {
  font-size: 0.65rem;
  transition: transform 0.2s;
}

.more-options-section.open .more-options-arrow {
  transform: rotate(180deg);
}

.more-options-body {
  padding-top: var(--space-sm);
}

.meeting-time-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  display: block;
  margin-bottom: var(--space-xs);
}

.meeting-time-label i {
  color: var(--primary);
  margin-right: 4px;
}

.meeting-time-inputs {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-start;
}

.custom-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}

.custom-picker:hover {
  border-color: var(--primary-light);
}

.custom-picker i {
  color: var(--primary);
  font-size: 0.78rem;
}

.custom-picker input[type="date"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.custom-picker select {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
}

/* ========================================
   RESULTS (inline below setup)
   ======================================== */
.results-section {
  border-top: 1px solid var(--border);
  margin-top: var(--space-xl);
  padding-bottom: var(--space-md);
}

.results-divider {
  text-align: center;
  padding: var(--space-md) 0 var(--space-xs);
}

.results-divider span {
  background: var(--bg);
  padding: 0 var(--space-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.results-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  padding: var(--space-xs) var(--space-lg) var(--space-xs);
}

.results-top-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.results-summary-bar {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-sm);
}

.results-layout-inline {
  display: grid;
  grid-template-columns: 440px 1fr;
  border-top: 1px solid var(--border);
  position: relative;
}

/* ---------- Full-width Loading Overlay ---------- */
.results-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  gap: 20px;
}

.results-loading-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #6366F1;
  border-right-color: #8B5CF6;
  border-bottom-color: #EC4899;
  animation: loadingSpin 0.9s linear infinite;
  position: relative;
}

.results-loading-spinner::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #EC4899;
  border-right-color: #6366F1;
  animation: loadingSpin 0.6s linear infinite reverse;
}

@keyframes loadingSpin {
  to { transform: rotate(360deg); }
}

.results-loading-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  background: linear-gradient(90deg, #6366F1, #8B5CF6, #EC4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.3px;
}

.results-sidebar-inline {
  padding: var(--space-md);
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.results-layout-inline.expanded {
  height: 720px;
}

.results-layout-inline.expanded .results-sidebar-inline {
  overflow-y: auto;
}

.results-map-container-inline {
  position: relative;
  z-index: 0;
}

.results-map-container-inline #map {
  width: 100%;
  height: 100%;
  min-height: 520px;
}

.results-mode-badge {
  background: rgba(74, 108, 247, 0.08);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.results-mode-badge.eco {
  background: rgba(16, 185, 129, 0.08);
  color: var(--eco);
}

/* Fairness Summary */
.results-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: 0;
  display: inline-block;
  width: 100%;
}

.summary-horizontal {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: center;
}

.summary-table {
  border-collapse: collapse;
  font-size: 0.75rem;
}

.summary-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 12px 6px 0;
  white-space: nowrap;
}

.summary-table td {
  padding: 5px 12px 5px 0;
  color: var(--text);
  white-space: nowrap;
}

.summary-table .sp-dot {
  display: inline-block;
}

.summary-averages {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex-shrink: 0;
  min-width: 80px;
  text-align: center;
}

.summary-avg .val {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.summary-avg .label {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 1px;
}

.summary-hero-badge {
  margin-top: var(--space-xs);
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-md);
  font-size: 0.78rem;
  color: #92400E;
  text-align: center;
}

/* Person distance breakdown */
.sp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Venue Cards */
.results-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.venue-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  gap: var(--space-md);
  align-items: center;
  touch-action: manipulation;
}

.venue-photo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.venue-photo-placeholder {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: #6366F1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.venue-photo-placeholder.photo-loading i {
  font-size: 1rem;
  opacity: 0.85;
}

/* AI overlap note */
.venue-overlap-note {
  font-size: 0.7rem;
  color: var(--primary);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-style: italic;
}

.venue-overlap-note i {
  font-size: 0.6rem;
}

/* Find more options button */
.find-more-wrap {
  position: relative;
  padding: var(--space-sm) 0;
  text-align: center;
}

.btn-find-more {
  width: 100%;
  padding: 10px 16px;
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-find-more:hover:not(.locked) {
  background: var(--primary);
  color: white;
}

.btn-find-more.locked {
  border-color: #D1D5DB;
  color: #9CA3AF;
  background: #F3F4F6;
  cursor: default;
  pointer-events: none;
}

.find-more-locked-overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 2;
}

.find-more-locked-overlay:hover::after {
  content: 'Sign in for this feature';
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: white;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

/* Sort controls */
.sort-bar {
  display: flex;
  gap: var(--space-xs);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.sort-btn {
  font-size: 0.72rem;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
  white-space: nowrap;
  touch-action: manipulation;
}

.sort-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.sort-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.venue-card:hover {
  background: var(--surface);
}

.venue-card.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* Animated gradient border — only the #1 card */
.venue-card.active.top-pick {
  border: none;
  position: relative;
  z-index: 1;
  background: var(--bg);
}

.venue-card.active.top-pick::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-md) + 1px);
  background: conic-gradient(
    from var(--gradient-angle, 0deg),
    #4A6CF7, #9B59B6, #E74C8B, #F39C12, #2ECC71, #3498DB, #4A6CF7
  );
  z-index: -2;
  animation: rotate-gradient 3s linear infinite;
}

.venue-card.active.top-pick::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: var(--radius-md);
  background: var(--bg);
  z-index: -1;
}

@property --gradient-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotate-gradient {
  to { --gradient-angle: 360deg; }
}

.venue-rank {
  width: 28px;
  height: 28px;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.venue-card.active .venue-rank {
  background: var(--primary);
  color: white;
}

.venue-info {
  flex: 1;
  min-width: 0;
}

.venue-name {
  font-weight: 500;
  font-size: 0.88rem;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.venue-type {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.venue-meta {
  display: flex;
  gap: var(--space-md);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.venue-meta span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.venue-meta .stars {
  color: var(--warning);
}

.venue-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.venue-actions .btn-tiny {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: var(--font-body);
}

.venue-actions .btn-tiny:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.venue-actions .btn-tiny.book {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.venue-actions .btn-tiny.book:hover {
  background: var(--primary-dark);
}

/* Leaflet custom */
.leaflet-container {
  background: #f8fafc !important;
}

.custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
}

.center-marker {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  box-shadow: 0 2px 10px rgba(74, 108, 247, 0.3);
  border: 2px solid white;
}

.venue-marker {
  width: 26px;
  height: 26px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
}

/* ========================================
   SHARE MODAL
   ======================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 420px;
  width: 90%;
  position: relative;
  animation: modalIn 0.2s ease;
  box-shadow: var(--shadow-lg);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

/* ---------- Quota Exceeded Modal ---------- */
.quota-modal {
  text-align: center;
  max-width: 340px;
}
.quota-modal-icon {
  font-size: 2.4rem;
  margin-bottom: var(--space-sm);
}
.quota-modal-text {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}
.quota-modal-ok {
  width: 100%;
}

.fairness-card-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.fairness-card-preview .fc-empty {
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
}

/* Hero: photo left + name & actions right */
.fairness-card-preview .fc-hero {
  display: flex;
  gap: 0;
}

.fairness-card-preview .fc-photo {
  width: 120px;
  min-height: 110px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 1.8rem;
}

.fairness-card-preview .fc-hero-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-md) var(--space-lg);
  gap: var(--space-sm);
}

.fairness-card-preview .fc-venue-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.fairness-card-preview .fc-hero-actions {
  display: flex;
  gap: var(--space-xs);
  margin-top: 2px;
}

/* Details: rating, price, status */
.fairness-card-preview .fc-details {
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--border);
}

.fairness-card-preview .fc-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.82rem;
}

.fairness-card-preview .fc-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #F59E0B;
}

.fairness-card-preview .fc-stars b {
  color: var(--text);
  margin-left: 4px;
  font-size: 0.82rem;
}

.fairness-card-preview .fc-price {
  color: var(--text-muted);
  font-weight: 600;
}

.fairness-card-preview .fc-status {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  margin-left: auto;
}

.fairness-card-preview .fc-status.open {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.fairness-card-preview .fc-status.closing {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.fairness-card-preview .fc-status.closed {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

/* Stats row: people, avg distance, avg drive */
.fairness-card-preview .fc-stats {
  display: flex;
  justify-content: space-around;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  text-align: center;
}

.fairness-card-preview .fc-stat-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.fairness-card-preview .fc-stat-val i {
  font-size: 0.72rem;
  color: var(--primary);
}

.fairness-card-preview .fc-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.share-buttons {
  display: flex;
  gap: var(--space-sm);
}

.btn-share {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  transition: all 0.2s;
  color: white;
}

.btn-share.whatsapp { background: #25D366; }
.btn-share.whatsapp:hover { background: #1ebe5a; }
.btn-share.twitter { background: #1DA1F2; }
.btn-share.twitter:hover { background: #0d8dec; }
.btn-share.copy { background: var(--primary); color: white; }
.btn-share.copy:hover { background: #3b5bdb; }

/* Share preview */
.share-preview {
  margin-top: var(--space-sm);
  animation: fadeSlideDown 0.25s ease;
}

.share-preview-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.share-preview-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   TOAST
   ======================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  z-index: 99999;
  transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ========================================
   WEATHER WIDGET
   ======================================== */
.weather-widget {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 8px 10px 6px;
  text-align: center;
  min-width: 52px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.weather-icon-wrap {
  width: 36px;
  height: 36px;
  margin: 0 auto 2px;
  position: relative;
}

.weather-temp {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

/* Sun */
.w-sun { position: relative; width: 36px; height: 36px; }
.w-sun-core {
  position: absolute; top: 10px; left: 10px;
  width: 16px; height: 16px;
  background: #F59E0B; border-radius: 50%;
}
.w-sun-rays {
  position: absolute; inset: 0;
  animation: spin-sun 8s linear infinite;
}
.w-sun-rays::before,
.w-sun-rays::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 32px; height: 2px;
  background: #F59E0B;
  transform-origin: center;
}
.w-sun-rays::before {
  transform: translate(-50%, -50%) rotate(0deg);
}
.w-sun-rays::after {
  transform: translate(-50%, -50%) rotate(45deg);
}
@keyframes spin-sun { to { transform: rotate(360deg); } }

/* Cloud */
.w-cloud { position: relative; width: 36px; height: 36px; }
.w-cloud-body {
  position: absolute; bottom: 6px; left: 4px;
  width: 28px; height: 14px;
  background: #94A3B8;
  border-radius: 14px;
  animation: drift-cloud 3s ease-in-out infinite alternate;
}
.w-cloud-body::before {
  content: ''; position: absolute;
  width: 14px; height: 14px; background: #94A3B8;
  border-radius: 50%; top: -8px; left: 6px;
}
.w-cloud-body::after {
  content: ''; position: absolute;
  width: 10px; height: 10px; background: #94A3B8;
  border-radius: 50%; top: -5px; left: 16px;
}
.w-cloud-body.small { transform: scale(0.85); left: 5px; bottom: 14px; }
@keyframes drift-cloud { from { transform: translateX(-2px); } to { transform: translateX(2px); } }

/* Rain */
.w-rain { position: relative; width: 36px; height: 36px; }
.w-drops { position: absolute; bottom: 2px; left: 8px; width: 20px; height: 14px; }
.w-drops i {
  position: absolute; width: 2px; height: 6px;
  background: #60A5FA; border-radius: 1px;
  animation: fall-drop 0.8s linear infinite;
}
.w-drops i:nth-child(1) { left: 2px; animation-delay: 0s; }
.w-drops i:nth-child(2) { left: 9px; animation-delay: 0.25s; }
.w-drops i:nth-child(3) { left: 16px; animation-delay: 0.5s; }
@keyframes fall-drop {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(10px); }
}

/* Snow */
.w-snow { position: relative; width: 36px; height: 36px; }
.w-flakes { position: absolute; bottom: 2px; left: 8px; width: 20px; height: 14px; }
.w-flakes i {
  position: absolute; width: 4px; height: 4px;
  background: #CBD5E1; border-radius: 50%;
  animation: fall-flake 1.4s linear infinite;
}
.w-flakes i:nth-child(1) { left: 2px; animation-delay: 0s; }
.w-flakes i:nth-child(2) { left: 9px; animation-delay: 0.4s; }
.w-flakes i:nth-child(3) { left: 16px; animation-delay: 0.8s; }
@keyframes fall-flake {
  0% { opacity: 0; transform: translateY(0) rotate(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(12px) rotate(180deg); }
}

/* Storm */
.w-storm { position: relative; width: 36px; height: 36px; }
.w-bolt {
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  font-size: 16px; line-height: 1;
  animation: flash-bolt 1.5s ease-in-out infinite;
}
@keyframes flash-bolt {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Moon */
.w-moon { position: relative; width: 36px; height: 36px; }
.w-moon-body {
  position: absolute; top: 6px; left: 10px;
  width: 18px; height: 18px;
  background: transparent;
  border-radius: 50%;
  box-shadow: -6px 0 0 0 #CBD5E1;
  animation: glow-moon 3s ease-in-out infinite alternate;
}
@keyframes glow-moon {
  from { box-shadow: -6px 0 0 0 #CBD5E1; }
  to { box-shadow: -6px 0 4px 1px #E2E8F0; }
}
.w-moon-stars { position: absolute; inset: 0; }
.w-moon-stars i {
  position: absolute;
  width: 3px; height: 3px;
  background: #CBD5E1; border-radius: 50%;
  animation: twinkle 1.6s ease-in-out infinite alternate;
}
.w-moon-stars i:nth-child(1) { top: 4px; right: 4px; animation-delay: 0s; }
.w-moon-stars i:nth-child(2) { top: 14px; right: 2px; animation-delay: 0.5s; }
.w-moon-stars i:nth-child(3) { bottom: 6px; right: 8px; animation-delay: 1s; }
@keyframes twinkle {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.2); }
}

.weather-icon-wrap[title] {
  cursor: default;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* --- Tablet and below (≤900px) --- */
@media (max-width: 900px) {
  .results-layout-inline {
    grid-template-columns: 1fr;
    height: auto !important;
  }

  .results-sidebar-inline {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 40vh;
    overflow-y: auto;
  }

  .results-map-container-inline #map {
    min-height: 350px;
  }
}

/* --- Mobile (≤600px) — primary phone breakpoint --- */
@media (max-width: 600px) {

  /* Safe-area insets for notched phones */
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  /* --- Navbar --- */
  .navbar {
    padding: var(--space-sm) var(--space-md);
  }

  .logo-text {
    font-size: 1rem;
  }

  #shareBtn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  #shareBtn .fa-share-nodes + span,
  #shareBtn::after {
    content: none;
  }

  /* Google Places autocomplete dropdown — wider tap targets on mobile */
  .pac-container {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }

  .pac-item {
    padding: 12px 14px;
    font-size: 0.88rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .pac-icon {
    margin-right: 10px;
  }

  .pac-item-query {
    font-size: inherit;
  }

  /* --- Setup Container --- */
  .setup-container {
    padding: 0 var(--space-md);
    margin-top: var(--space-md);
  }

  .setup-header {
    margin-bottom: var(--space-md);
  }

  .setup-header h2 {
    font-size: 1.3rem;
  }

  .setup-header p {
    font-size: 0.84rem;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
  }

  .setup-columns {
    gap: var(--space-md);
  }

  /* --- Location Panel --- */
  .locations-panel {
    padding: var(--space-md);
  }

  .location-row {
    gap: 6px;
  }

  /* Bigger touch target for person avatar */
  .location-row .person-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.7rem;
  }

  /* Address input: 16px font prevents iOS auto-zoom on focus */
  .location-row input {
    padding: 12px 12px;
    font-size: 16px;
    min-height: 44px;
  }

  .location-row .name-input {
    width: 64px;
    padding: 8px 6px !important;
    font-size: 16px;
    min-height: 44px;
  }

  /* Reposition name-hint tooltip above avatar on mobile */
  .name-hint {
    right: auto;
    top: auto;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
  }

  .name-hint::after {
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text);
    border-left-color: transparent;
  }

  /* Touch-safe remove button */
  .location-row .btn-remove {
    width: 44px;
    height: 44px;
    font-size: 0.9rem;
  }

  /* Touch-safe geolocate button */
  .btn-geolocate {
    width: 44px;
    height: 44px;
    font-size: 0.88rem;
  }

  /* Touch-safe save/friend buttons */
  .btn-save-loc,
  .btn-save-friend {
    width: 36px;
    height: 36px;
    font-size: 0.78rem;
  }

  .btn-add-location {
    padding: 12px;
    font-size: 0.85rem;
    min-height: 44px;
    border-width: 2px;
  }

  /* --- Vibe Panel (now inside locations panel) --- */
  .category-toggle {
    gap: 4px;
    padding: 3px;
  }

  .category-btn {
    padding: 4px 8px;
    font-size: 0.78rem;
    min-height: 32px;
  }

  /* Bigger vibe tags for touch */
  .vibe-tag {
    padding: 8px 14px;
    font-size: 0.82rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
  }

  .vibe-tags {
    gap: 8px;
  }

  .ai-prompt-input {
    padding: 12px 14px;
    font-size: 16px;
    min-height: 44px;
  }

  .ai-prompt-label {
    font-size: 0.8rem;
  }

  /* --- Mode Toggle --- */
  .mode-toggle-container {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .toggle-track {
    width: 220px;
  }

  .toggle-option {
    padding: 8px 0;
    font-size: 0.78rem;
  }

  .mode-description {
    font-size: 0.72rem;
    text-align: center;
  }

  /* --- Find Button --- */
  .btn-find {
    padding: 16px;
    font-size: 0.95rem;
    min-height: 52px;
    border-radius: var(--radius-lg);
  }

  /* --- More Options --- */
  .more-options-toggle {
    font-size: 0.85rem;
    padding: 8px 0;
    min-height: 44px;
  }

  .custom-picker {
    padding: 10px 14px;
    font-size: 0.85rem;
    min-height: 44px;
  }

  .meeting-time-inputs {
    flex-wrap: wrap;
  }

  /* --- Results Section --- */
  .results-section {
    margin-top: var(--space-md);
  }

  .results-top-header {
    padding: var(--space-sm) var(--space-md);
  }

  .results-top-header h3 {
    font-size: 1rem;
  }

  /* On mobile, show map first, then list */
  .results-layout-inline {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column-reverse;
  }

  .results-sidebar-inline {
    border-right: none;
    border-top: 1px solid var(--border);
    border-bottom: none;
    max-height: none;
    overflow-y: visible;
    padding: var(--space-sm) var(--space-md);
  }

  .results-map-container-inline #map {
    min-height: 280px;
    height: 45vh;
  }

  /* Venue cards — more touch-friendly */
  .venue-card {
    padding: var(--space-md);
    gap: var(--space-sm);
    min-height: 64px;
  }

  .venue-photo,
  .venue-photo-placeholder {
    width: 48px;
    height: 48px;
  }

  .venue-name {
    font-size: 0.88rem;
  }

  .venue-type {
    font-size: 0.75rem;
  }

  .venue-meta {
    font-size: 0.75rem;
    gap: var(--space-sm);
    flex-wrap: wrap;
  }

  .venue-rank {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
  }

  .venue-actions {
    gap: 6px;
  }

  .venue-actions .btn-tiny {
    font-size: 0.72rem;
    padding: 6px 10px;
    min-height: 32px;
  }

  /* Sort bar — horizontal scroll */
  .sort-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: var(--space-sm);
  }

  .sort-bar::-webkit-scrollbar {
    display: none;
  }

  .sort-btn {
    font-size: 0.72rem;
    padding: 6px 14px;
    min-height: 32px;
  }

  /* Find More Options button */
  .btn-find-more {
    padding: 14px 16px;
    font-size: 0.88rem;
    min-height: 48px;
  }

  /* --- Summary --- */
  .results-summary-bar {
    padding: 0 var(--space-md) var(--space-sm);
  }

  .results-summary {
    padding: var(--space-sm) var(--space-sm);
  }

  .summary-horizontal {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .summary-table {
    font-size: 0.72rem;
    width: 100%;
  }

  .summary-table th {
    font-size: 0.65rem;
    padding: 2px 8px 4px 0;
  }

  .summary-table td {
    padding: 4px 8px 4px 0;
  }

  .summary-averages {
    flex-direction: row;
    gap: var(--space-md);
    justify-content: center;
  }

  .summary-hero-badge {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  /* --- Share Modal --- */
  .modal {
    padding: var(--space-lg);
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .share-buttons {
    flex-direction: column;
  }

  .btn-share {
    min-height: 48px;
    font-size: 0.88rem;
  }

  .fairness-card-preview .fc-hero {
    flex-direction: column;
  }

  .fairness-card-preview .fc-photo {
    width: 100%;
    min-height: 140px;
  }

  .fairness-card-preview .fc-hero-info {
    padding: var(--space-md);
  }

  .fairness-card-preview .fc-stats {
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
  }

  .fairness-card-preview .fc-stat-val {
    font-size: 0.82rem;
  }

  .fairness-card-preview .fc-stat-label {
    font-size: 0.62rem;
  }

  /* --- Side Panel (full-width on mobile) --- */
  .side-panel {
    width: 100%;
    right: -100%;
  }

  .side-panel-header {
    padding: var(--space-md);
    padding-top: calc(var(--space-md) + env(safe-area-inset-top));
  }

  .side-panel-body {
    padding: var(--space-md);
    padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
  }

  .sp-card {
    padding: var(--space-sm) var(--space-md);
    min-height: 48px;
  }

  .sp-card-actions .btn-tiny {
    padding: 6px 10px;
    min-height: 32px;
  }

  /* --- Toast --- */
  .toast {
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: var(--space-md);
    right: var(--space-md);
    transform: translateY(100px);
    text-align: center;
    font-size: 0.85rem;
  }

  .toast.show {
    transform: translateY(0);
  }

  /* --- Auth --- */
  .btn-google-signin {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .user-avatar-btn {
    width: 36px;
    height: 36px;
  }

  .user-dropdown {
    right: -8px;
    min-width: 220px;
  }

  /* Shrink emojis in toggle & badge */
  .toggle-option,
  .results-mode-badge {
    font-size: 0.72rem;
  }

  /* Shrink heart emoji in footer */
  .site-footer .heart {
    font-size: 0.7rem;
  }

  /* --- Footer --- */
  .site-footer {
    padding: var(--space-sm) var(--space-md);
    padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
    font-size: 0.78rem;
    margin-top: var(--space-sm);
  }

  /* --- Weather widget on map --- */
  .weather-widget {
    padding: 6px 8px 4px;
    min-width: 46px;
  }

  .weather-icon-wrap {
    width: 30px;
    height: 30px;
  }

  .weather-temp {
    font-size: 0.75rem;
  }
}

/* --- Very small phones (≤380px) --- */
@media (max-width: 380px) {
  .setup-container {
    padding: 0 var(--space-sm);
  }

  .locations-panel {
    padding: var(--space-sm) var(--space-md);
  }

  .location-row .name-input {
    width: 52px;
    font-size: 0.7rem;
  }

  .setup-header h2 {
    font-size: 1.15rem;
  }

  .toggle-track {
    width: 190px;
  }

  .btn-find {
    font-size: 0.88rem;
    padding: 14px;
  }

  .venue-card {
    gap: var(--space-xs);
    padding: var(--space-sm);
  }

  .venue-photo,
  .venue-photo-placeholder {
    width: 40px;
    height: 40px;
  }

  .venue-name {
    font-size: 0.82rem;
  }
}

/* --- Geolocation Button --- */
.btn-geolocate {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  font-size: 0.82rem;
}

.btn-geolocate:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(74, 108, 247, 0.04);
}

.btn-geolocate.locating {
  color: var(--primary);
  border: 2px solid transparent;
  border-top-color: var(--primary);
  animation: geolocateSpin 0.7s linear infinite;
}

@keyframes geolocateSpin {
  to { transform: rotate(360deg); }
}

/* Google Places autocomplete overrides */
.pac-container {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-top: 4px;
}

.pac-item {
  padding: 8px 12px;
  cursor: pointer;
  border-top: 1px solid #f0f0f0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pac-item-query {
  font-size: inherit;
  font-weight: 500;
  color: var(--text);
}

.pac-item:first-child {
  border-top: none;
}

.pac-item:hover {
  background: var(--surface);
}

/* --- Loading Animation --- */
.loading-dots {
  display: inline-flex;
  gap: 4px;
}
.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* ========================================
   AUTH UI
   ======================================== */
.auth-area {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-google-signin {
  background: #4285F4;
  color: white;
  border: 1px solid #4285F4;
  border-radius: var(--radius-md);
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  font-family: var(--font-body);
}

.btn-google-signin:hover {
  background: #3367D6;
  border-color: #3367D6;
}

.btn-google-signin i {
  color: white;
}

/* User menu */
.user-menu {
  position: relative;
}

.user-avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: border-color 0.15s;
}

.user-avatar-btn:hover {
  border-color: var(--primary);
}

.user-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  animation: modalIn 0.15s ease;
  overflow: hidden;
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.user-dropdown-header img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.user-dropdown-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.user-dropdown-email {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 10px var(--space-md);
  border: none;
  background: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.1s;
  text-align: left;
}

.user-dropdown-item:hover {
  background: var(--surface);
}

.user-dropdown-item i {
  width: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.user-dropdown-item.signout {
  color: var(--danger);
}

.user-dropdown-item.signout i {
  color: var(--danger);
}

/* ========================================
   SIDE PANEL (saved locations, friends, favs)
   ======================================== */
.side-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 180;
}

.side-panel-overlay.open {
  display: block;
}

.side-panel {
  position: fixed;
  top: 0;
  right: -360px;
  width: 340px;
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 190;
  transition: right 0.25s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
}

.side-panel.open {
  right: 0;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.side-panel-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

/* Side panel cards */
.sp-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: background 0.1s;
}

.sp-card:hover {
  background: var(--surface);
}

.sp-card-info {
  flex: 1;
  min-width: 0;
}

.sp-card-name {
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-card-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-card-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.sp-card-actions .btn-tiny {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
}

.sp-card-actions .btn-tiny:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.sp-card-actions .btn-tiny.book {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.sp-card-actions .btn-tiny.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.sp-card-actions .btn-tiny.fav-active {
  color: #EF4444;
  border-color: #EF4444;
}

.sp-loading {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-dim);
}

.sp-empty {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--text-dim);
}

.sp-empty i {
  font-size: 1.8rem;
  margin-bottom: var(--space-sm);
  display: block;
}

.sp-empty p {
  font-size: 0.85rem;
  margin-bottom: var(--space-xs);
}

.sp-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ========================================
   SAVE / FRIEND BUTTONS ON LOCATION ROWS
   ======================================== */
.btn-save-loc,
.btn-save-friend {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.72rem;
  transition: all 0.15s;
}

.btn-save-loc:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(74, 108, 247, 0.04);
}

.btn-save-friend:hover {
  border-color: var(--eco);
  color: var(--eco);
  background: rgba(16, 185, 129, 0.04);
}

/* Favorite button on venue cards */
.fav-btn {
  border-color: var(--border) !important;
  color: var(--text-dim) !important;
}

.fav-btn:hover {
  border-color: #EF4444 !important;
  color: #EF4444 !important;
}

.fav-btn.fav-active {
  border-color: #EF4444 !important;
  color: #EF4444 !important;
  background: rgba(239, 68, 68, 0.06) !important;
}

/* ========================================
   AI PROMPT LOCK (sign-up gated)
   ======================================== */


.ai-prompt-wrap {
  position: relative;
  border-radius: var(--radius-md);
}



@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotateBorder {
  to { --border-angle: 360deg; }
}

/* Footer */
.site-footer {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  margin-top: var(--space-xl);
}

.site-footer .heart {
  color: #EF4444;
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover {
  text-decoration: underline;
}

