/* ============================================
   YOU PICK — Design System & Styles
   ============================================ */

/* --- Fonts --- */
@import url('https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@400,500,700,800&f[]=satoshi@300,400,500,700&display=swap');

/* --- Design Tokens --- */
:root {
  /* Type Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', sans-serif;
  --font-body: 'Satoshi', sans-serif;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Transition */
  --transition: 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Mode */
:root,
[data-theme='light'] {
  --color-bg: #FFF8F0;
  --color-surface: #FFFFFF;
  --color-surface-2: #FFF4E8;
  --color-surface-offset: #FBEDE0;
  --color-divider: #F0E4D4;
  --color-border: #E5D6C2;

  --color-text: #2B1D10;
  --color-text-muted: #7A6651;
  --color-text-faint: #B5A48F;

  --color-primary: #E85D2F;
  --color-primary-hover: #D14A1E;
  --color-primary-active: #B83E15;
  --color-primary-light: #FDEDE6;

  --color-success: #2D9B6B;
  --color-success-light: #E6F5EE;
  --color-warning: #E6A817;
  --color-error: #D6483F;
  --color-info: #4A8FF7;

  --shadow-sm: 0 1px 3px rgba(43, 29, 16, 0.06);
  --shadow-md: 0 4px 16px rgba(43, 29, 16, 0.08);
  --shadow-lg: 0 12px 40px rgba(43, 29, 16, 0.14);
  --shadow-glow: 0 0 24px rgba(232, 93, 47, 0.25);
}

/* Dark Mode */
[data-theme='dark'] {
  --color-bg: #1A1510;
  --color-surface: #241E17;
  --color-surface-2: #2D2620;
  --color-surface-offset: #2A241D;
  --color-divider: #332B23;
  --color-border: #3D342A;

  --color-text: #F5EBE0;
  --color-text-muted: #A8957F;
  --color-text-faint: #6B5D4D;

  --color-primary: #FF7A4A;
  --color-primary-hover: #FF6B38;
  --color-primary-active: #E85D2F;
  --color-primary-light: #3A2820;

  --color-success: #4FBF7E;
  --color-success-light: #1A3328;
  --color-warning: #F5C043;
  --color-error: #F5675E;
  --color-info: #6BA8FF;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(255, 122, 74, 0.2);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  text-wrap: balance;
  line-height: 1.2;
}

a, button, input, textarea, select {
  transition: color var(--transition), background var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              opacity var(--transition);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--color-primary);
  color: #fff;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- App Shell --- */
.app-shell {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  position: relative;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .app-shell {
    max-width: 480px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin: var(--space-6) auto;
    min-height: calc(100dvh - 3rem);
  }
}

/* --- Header --- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.app-logo svg {
  flex-shrink: 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
}

.theme-toggle:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* --- Main Content --- */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: var(--space-5);
  animation: slideIn 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.screen.active {
  display: flex;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Step Progress --- */
.step-progress {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.step-dot {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  transition: background var(--transition);
}

.step-dot.active {
  background: var(--color-primary);
}

.step-dot.completed {
  background: var(--color-primary);
  opacity: 0.5;
}

/* --- Typography --- */
.screen-title {
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--space-1);
  letter-spacing: -0.02em;
}

.screen-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}

/* --- Form Elements --- */
.text-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--text-base);
  color: var(--color-text);
}

.text-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.text-input::placeholder {
  color: var(--color-text-faint);
}

/* --- Chip / Toggle Buttons --- */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  user-select: none;
}

.chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.chip.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.chip .chip-icon {
  font-size: 1.1em;
}

/* --- Avatar --- */
.avatar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.avatar-option {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: #fff;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition);
}

.avatar-option.selected {
  border-color: var(--color-text);
  transform: scale(1.1);
}

/* --- Member Cards --- */
.member-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  margin-bottom: var(--space-2);
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: #fff;
  flex-shrink: 0;
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-name {
  font-weight: 600;
  font-size: var(--text-sm);
}

.member-prefs {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-remove {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
  background: var(--color-surface-offset);
  flex-shrink: 0;
}

.member-remove:hover {
  color: var(--color-error);
  background: rgba(214, 72, 63, 0.1);
}

/* --- Sliders --- */
.slider-container {
  margin-bottom: var(--space-6);
}

.slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.slider-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-primary);
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  cursor: pointer;
  border: 3px solid var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  cursor: pointer;
  border: 3px solid var(--color-surface);
  box-shadow: var(--shadow-sm);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  background: var(--color-primary-active);
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--color-surface-offset);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
}

.btn-ghost {
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  color: var(--color-primary);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* --- Footer / Nav --- */
.app-footer {
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  display: flex;
  gap: var(--space-3);
}

.app-footer.hidden {
  display: none;
}

/* --- Restaurant Card --- */
.restaurant-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--color-divider);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
}

.restaurant-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--color-surface-offset);
}

.restaurant-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.restaurant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.restaurant-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.favorite-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-faint);
  cursor: pointer;
  transition: all 0.2s ease;
}

.favorite-btn:hover {
  color: var(--color-warning);
  background: rgba(243, 156, 18, 0.1);
}

.favorite-btn.active {
  color: #E8552F;
}

.diabetic-notes {
  background: rgba(45, 155, 107, 0.08);
  border: 1px solid rgba(45, 155, 107, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

[data-theme='dark'] .diabetic-notes {
  background: rgba(45, 155, 107, 0.12);
  border-color: rgba(45, 155, 107, 0.25);
}

.diabetic-notes-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.diabetic-icon {
  font-size: var(--text-base);
}

.diabetic-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #2D9B6B;
}

.diabetic-notes-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

.diabetic-disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.4;
  margin: var(--space-1) 0 0;
  font-style: italic;
}

.location-section {
  margin-top: var(--space-6);
  text-align: center;
}

.location-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: var(--text-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.location-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

.location-btn.active {
  background: var(--color-success);
}

.location-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.location-status {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-2);
  line-height: 1.4;
}

.restaurant-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}

.restaurant-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.restaurant-rating .star {
  color: var(--color-warning);
}

.restaurant-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.restaurant-address {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin: var(--space-2) 0;
  line-height: 1.4;
}

.restaurant-address svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.data-disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-style: italic;
  margin: var(--space-2) 0;
  line-height: 1.4;
  opacity: 0.8;
}

.report-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) 0;
  margin-top: var(--space-2);
  transition: color 0.15s ease;
}

.report-btn:hover {
  color: var(--color-error);
}

.restaurant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
}

.meta-tag.price {
  font-family: var(--font-display);
}

/* --- Match Score --- */
.match-section {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.match-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.match-ring svg {
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
}

.match-ring .ring-bg {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 6;
}

.match-ring .ring-fg {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.match-ring .ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-base);
}

.match-details {
  flex: 1;
  min-width: 0;
}

.match-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-1);
}

.match-reasons {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.match-reason {
  display: flex;
  align-items: center;
  gap: 4px;
}

.match-reason .check {
  color: var(--color-success);
  font-weight: 700;
}

.match-reason .x {
  color: var(--color-text-faint);
}

/* --- Action Buttons Row --- */
.action-row {
  display: flex;
  gap: var(--space-2);
}

.action-row .btn {
  flex: 1;
}

/* --- Empty State --- */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 280px;
}

/* --- Learning Dashboard --- */
.learning-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary);
  margin-bottom: var(--space-5);
}

.learning-banner .pulse {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.learning-banner-text {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

.learning-banner-text strong {
  color: var(--color-primary);
}

.signal-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.signal-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
}

.signal-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.signal-icon.positive { background: var(--color-success-light); color: var(--color-success); }
.signal-icon.negative { background: rgba(214,72,63,0.1); color: var(--color-error); }
.signal-icon.strong-positive { background: var(--color-success-light); color: var(--color-success); }
.signal-icon.strong-negative { background: rgba(214,72,63,0.15); color: var(--color-error); }

.signal-info {
  flex: 1;
  min-width: 0;
}

.signal-restaurant {
  font-weight: 600;
  font-size: var(--text-sm);
}

.signal-type {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--space-5);
  animation: fadeIn 200ms ease;
}

.modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6) var(--space-6);
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: slideUp 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.modal-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  background: var(--color-text);
  color: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Loading Spinner --- */
.loading-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- Group Member Form --- */
.add-member-form {
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.member-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.member-chip-grid .chip {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
}

/* --- Saved List --- */
.saved-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  margin-bottom: var(--space-2);
}

.saved-card.favorite-card {
  border-color: rgba(243, 156, 18, 0.3);
  background: rgba(243, 156, 18, 0.05);
}

[data-theme='dark'] .saved-card.favorite-card {
  background: rgba(243, 156, 18, 0.1);
}

.saved-card-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-faint);
  cursor: pointer;
  transition: all 0.15s ease;
}

.saved-card-remove:hover {
  background: var(--color-error);
  color: #fff;
}

.saved-card-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.saved-card-info {
  flex: 1;
  min-width: 0;
}

.saved-card-name {
  font-weight: 600;
  font-size: var(--text-sm);
}

.saved-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* --- Utility --- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

/* --- View Toggle --- */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  padding: 3px;
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  transition: all var(--transition);
}

.view-toggle-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* --- Map --- */
#map-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

#map {
  width: 100%;
  height: 380px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--color-divider);
  z-index: 1;
}

.leaflet-container {
  background: var(--color-surface-offset);
  font-family: var(--font-body);
}

.leaflet-popup-content-wrapper {
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
  margin: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}

.leaflet-popup-tip {
  background: var(--color-surface);
}

.user-location-marker {
  font-size: 24px;
  text-align: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  color: #fff;
  border: 3px solid var(--color-surface);
  box-shadow: var(--shadow-md);
}

.custom-marker.current {
  width: 44px;
  height: 44px;
  font-size: 13px;
  border-color: var(--color-primary);
  border-width: 4px;
  z-index: 1000;
}

.map-popup-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-divider);
  box-shadow: var(--shadow-md);
  padding: var(--space-4);
}

.map-popup-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.map-popup-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.map-popup-actions {
  display: flex;
  gap: var(--space-2);
}

.map-popup-actions .btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

/* --- Saved Profile Cards --- */
.profile-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 2px solid var(--color-divider);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--transition);
}

.profile-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.profile-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: #fff;
  flex-shrink: 0;
}

.profile-card-info {
  flex: 1;
  min-width: 0;
}

.profile-card-name {
  font-weight: 600;
  font-size: var(--text-sm);
}

.profile-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.profile-card-delete {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
  background: var(--color-surface-offset);
  flex-shrink: 0;
}

.profile-card-delete:hover {
  color: var(--color-error);
  background: rgba(214, 72, 63, 0.1);
}

/* --- Settings Screen --- */
.settings-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-divider);
  padding: var(--space-4);
}

.settings-profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.settings-profile-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
}

.settings-profile-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.settings-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.settings-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
}

.settings-stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.settings-stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-primary);
}

.settings-storage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  font-size: var(--text-sm);
}

.settings-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-badge.online {
  background: var(--color-success-light);
  color: var(--color-success);
}

.settings-badge.offline {
  background: var(--color-surface-offset);
  color: var(--color-text-faint);
}

/* ============================================
   Position Indicator
   ============================================ */
.position-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.position-indicator.visible {
  display: flex;
}

.position-indicator .pos-dots {
  display: flex;
  gap: 3px;
}

.position-indicator .pos-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background 0.2s;
}

.position-indicator .pos-dot.active {
  background: var(--color-primary);
}

.position-indicator .pos-arrow {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.position-indicator .pos-arrow:hover {
  background: var(--color-surface-offset);
  color: var(--color-primary);
}

.position-indicator .pos-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ============================================
   All Matches List
   ============================================ */
.all-matches-section {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}

.all-matches-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  font-family: var(--font-display);
  transition: background 0.15s;
}

.all-matches-toggle:hover {
  background: var(--color-surface-2);
}

.all-matches-toggle strong {
  color: var(--color-primary);
}

.all-matches-chevron {
  transition: transform 0.25s ease;
}

.all-matches-toggle.expanded .all-matches-chevron {
  transform: rotate(180deg);
}

.all-matches-list {
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 400px;
  overflow-y: auto;
}

.all-matches-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.all-matches-item:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-offset);
}

.all-matches-item.current {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.all-matches-rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  min-width: 24px;
  text-align: center;
}

.all-matches-item.current .all-matches-rank {
  color: var(--color-primary);
}

.all-matches-info {
  flex: 1;
  min-width: 0;
}

.all-matches-name {
  font-weight: 600;
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.all-matches-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.all-matches-score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-base);
  min-width: 40px;
  text-align: right;
}

/* ============================================
   Match Breakdown Bars
   ============================================ */
.match-breakdown {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.match-breakdown-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.match-breakdown-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  min-width: 64px;
  font-weight: 600;
}

.match-breakdown-bar-track {
  flex: 1;
  height: 6px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.match-breakdown-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.match-breakdown-bar-fill.cuisine { background: var(--color-primary); }
.match-breakdown-bar-fill.budget { background: var(--color-success); }
.match-breakdown-bar-fill.distance { background: #4A6CF7; }
.match-breakdown-bar-fill.rating { background: #F39C12; }
.match-breakdown-bar-fill.dietary { background: #9B59D0; }
.match-breakdown-bar-fill.meal-type { background: #E67E22; }
.match-breakdown-bar-fill.meal-time { background: #E74C8B; }

.meal-time-tag {
  background: rgba(231, 76, 139, 0.1);
  color: #E74C8B;
  border: 1px solid rgba(231, 76, 139, 0.2);
}

.meal-type-tag {
  background: rgba(230, 126, 34, 0.1);
  color: #E67E22;
  border: 1px solid rgba(230, 126, 34, 0.2);
}

[data-theme='dark'] .meal-time-tag {
  background: rgba(231, 76, 139, 0.15);
  color: #f06ba5;
}

[data-theme='dark'] .meal-type-tag {
  background: rgba(230, 126, 34, 0.15);
  color: #f0a050;
}

/* ============================================
   Map Filter Bar
   ============================================ */
.map-filter-bar {
  padding: var(--space-3) var(--space-3) var(--space-2);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
}

.map-filter-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-1);
}

.map-filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.map-filter-chips::-webkit-scrollbar {
  display: none;
}

.map-filter-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1.5px solid var(--color-divider);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.map-filter-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.map-filter-chip.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.map-filter-chip.open-now-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-filter-chip.open-now-toggle.active {
  border-color: #2D9B6B;
  background: #2D9B6B;
  color: #fff;
}

.map-filter-chip.open-now-toggle.active .open-now-dot {
  background: #fff;
}

.open-now-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.map-filter-chip.open-now-toggle:not(.active) .open-now-dot {
  background: #ccc;
}

.open-badge {
  background: rgba(45, 155, 107, 0.1);
  color: #2D9B6B;
  border: 1px solid rgba(45, 155, 107, 0.2);
}

.closed-badge {
  background: rgba(214, 72, 63, 0.08);
  color: #999;
  border: 1px solid rgba(214, 72, 63, 0.15);
}

[data-theme='dark'] .open-badge {
  background: rgba(45, 155, 107, 0.15);
  color: #4cc488;
}

[data-theme='dark'] .closed-badge {
  background: rgba(214, 72, 63, 0.1);
  color: #777;
}

.match-breakdown-value {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  min-width: 28px;
  text-align: right;
  font-family: var(--font-display);
}

/* ============================================
   Card Slide Animation
   ============================================ */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes cardSlideInReverse {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.restaurant-card.slide-in {
  animation: cardSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.restaurant-card.slide-in-reverse {
  animation: cardSlideInReverse 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ============================================
   Dark Mode Map Tiles
   ============================================ */
[data-theme='dark'] .leaflet-tile {
  filter: brightness(0.7) invert(0.92) contrast(0.85) hue-rotate(180deg) saturate(0.4);
}

[data-theme='dark'] .leaflet-container {
  background: #1a1a2e;
}

[data-theme='dark'] .leaflet-popup-content-wrapper {
  background: #2a2a3e;
  color: #e8e8f0;
}

[data-theme='dark'] .leaflet-popup-tip {
  background: #2a2a3e;
}

[data-theme='dark'] .leaflet-control-zoom a {
  background: #2a2a3e;
  color: #e8e8f0;
  border-color: #3a3a4e;
}

[data-theme='dark'] .leaflet-control-zoom a:hover {
  background: #3a3a4e;
}

[data-theme='dark'] .leaflet-control-attribution {
  background: rgba(42, 42, 62, 0.8);
  color: #888;
}

[data-theme='dark'] .leaflet-control-attribution a {
  color: #aaa;
}

/* ============================================
   Privacy Notice
   ============================================ */
.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-align: center;
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-3);
}

.privacy-note svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.privacy-notice {
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.privacy-notice-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-family: var(--font-display);
}

.privacy-notice-header svg {
  flex-shrink: 0;
  color: var(--color-primary);
}

.privacy-notice-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.privacy-notice-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.privacy-notice-list li {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding-left: var(--space-4);
  position: relative;
  line-height: 1.5;
}

.privacy-notice-list li::before {
  content: '•';
  position: absolute;
  left: var(--space-1);
  color: var(--color-primary);
  font-weight: 700;
}

/* ============================================
   Meal Type Selector
   ============================================ */
.meal-type-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.meal-type-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 2px solid var(--color-divider);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.meal-type-option:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.meal-type-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.meal-type-icon {
  font-size: 1.3em;
  line-height: 1;
}

.meal-type-label {
  flex: 1;
}

/* ============================================
   Meal Time Selector
   ============================================ */
.meal-time-row {
  display: flex;
  gap: var(--space-2);
}

.meal-time-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-2);
  background: var(--color-surface);
  border: 2px solid var(--color-divider);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
}

.meal-time-option:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.meal-time-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.meal-time-icon {
  font-size: 1.5em;
  line-height: 1;
}

/* --- Accounts: Sign in with Apple / Google --- */
.auth-block { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-6); }
.btn-auth {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 50px; padding: 0 var(--space-4);
  border-radius: 12px; font: inherit; font-size: var(--text-base); font-weight: 600;
  cursor: pointer; transition: transform .12s ease, opacity .12s ease;
}
.btn-auth:active { transform: scale(.98); }
.btn-auth:disabled { opacity: .6; cursor: wait; }
.btn-auth-apple { background: #000; color: #fff; border: 1px solid #000; }
[data-theme="dark"] .btn-auth-apple { background: #fff; color: #000; border-color: #fff; }
.btn-auth-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
[data-theme="dark"] .btn-auth-google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
.auth-divider { display: flex; align-items: center; gap: var(--space-3); color: var(--color-text-faint); font-size: var(--text-xs); margin-top: var(--space-2); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-divider); }
.auth-signed-in {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-6);
  border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface);
}
.auth-signed-in-title { font-weight: 600; color: var(--color-text); }
.auth-signed-in-meta { font-size: var(--text-xs); color: var(--color-text-muted); word-break: break-all; }
.privacy-note span { max-width: 32ch; }

/* --- Group: saved people, choose who's eating tonight --- */
.group-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.group-count { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 600; }
.group-hint { font-size: var(--text-xs); color: var(--color-text-faint); margin: 0 0 var(--space-3); }
#group-saved-section { margin-bottom: var(--space-5); }
.member-card.selectable { cursor: pointer; transition: opacity .15s ease, border-color .15s ease, background .15s ease; }
.member-card.selectable.is-in { border-color: var(--color-primary); }
.member-card.selectable.is-out { opacity: .55; }
.member-check {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--color-border); color: transparent;
}
.member-card.is-in .member-check { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* --- Invite links --- */
.invite-card {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4); margin-bottom: var(--space-3);
  border-radius: var(--radius-lg); background: var(--color-primary-light);
  border: 1px solid var(--color-divider);
}
.invite-title { font-weight: 700; color: var(--color-text); }
.invite-sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.invite-card .btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; }
.invite-link-box { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); }
.invite-link-box .text-input { flex: 1; min-width: 0; font-size: var(--text-xs); }
.member-badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; vertical-align: middle;
  background: var(--color-success-light); color: var(--color-success);
}
.join-modal { text-align: center; }
.join-people { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: var(--space-3) 0 var(--space-4); }
.join-person { padding: 4px 10px; border-radius: 999px; background: var(--color-surface-offset); font-size: var(--text-xs); color: var(--color-text); }
.join-actions { display: flex; flex-direction: column; gap: var(--space-2); }

/* --- Brand logo --- */
.app-logo-img { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.welcome-logo { display: block; width: 136px; height: 136px; margin: 0 auto var(--space-4); border-radius: 30px; box-shadow: 0 10px 30px rgba(5, 38, 92, .25); }
.join-logo { display: block; width: 64px; height: 64px; margin: 0 auto var(--space-3); border-radius: 14px; }

/* --- Saved: directions button --- */
.saved-card { align-items: center; }
.saved-card-go { flex-shrink: 0; padding: 6px 10px; font-size: var(--text-xs); color: var(--color-primary); font-weight: 600; }

/* --- Group voting --- */
.start-vote-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: var(--space-3); }
.vote-banner {
  display: flex; align-items: center; gap: 10px; width: calc(100% - 2 * var(--space-5)); margin: var(--space-3) var(--space-5) 0;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--color-primary);
  background: var(--color-primary-light); color: var(--color-text); font: inherit; font-size: var(--text-sm); font-weight: 600;
  text-align: left; cursor: pointer;
}
.vote-banner.hidden { display: none; }
.vote-banner span:nth-child(2) { flex: 1; }
.vote-banner-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-primary); animation: vote-pulse 1.4s ease-in-out infinite; flex-shrink: 0; }
@keyframes vote-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.vote-status { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-4); }
.vote-option {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--color-text);
  padding: var(--space-4); margin-bottom: var(--space-3); border-radius: var(--radius-lg);
  background: var(--color-surface); border: 2px solid var(--color-divider); cursor: pointer;
  transition: border-color .15s ease, transform .1s ease;
}
.vote-option:active:not([disabled]) { transform: scale(.99); }
.vote-option[disabled] { cursor: default; }
.vote-option.is-mine { border-color: var(--color-primary); background: var(--color-primary-light); }
.vote-option.is-winner { border-color: var(--color-success); }
.vote-option-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.vote-option-name { font-weight: 700; font-size: var(--text-base); }
.vote-option-match { font-size: var(--text-xs); font-weight: 700; color: var(--color-primary); white-space: nowrap; }
.vote-option-addr { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.vote-bar { height: 8px; border-radius: 999px; background: var(--color-surface-offset); margin: var(--space-3) 0 6px; overflow: hidden; }
.vote-bar span { display: block; height: 100%; background: var(--color-primary); border-radius: 999px; transition: width .3s ease; }
.vote-option.is-winner .vote-bar span { background: var(--color-success); }
.vote-option-votes { font-size: var(--text-xs); color: var(--color-text-muted); }
.vote-winner { text-align: center; padding: var(--space-5); margin: var(--space-2) 0 var(--space-4); border-radius: var(--radius-lg); background: var(--color-success-light); }
.vote-winner.hidden { display: none; }
.vote-winner-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--color-success); }
.vote-winner-name { font-size: var(--text-xl); font-weight: 800; margin: 4px 0; color: var(--color-text); }
.vote-winner-meta { font-size: var(--text-sm); color: var(--color-text-muted); }
.vote-actions { display: flex; flex-direction: column; gap: var(--space-2); }

/* --- Privacy links --- */
.legal-line { font-size: var(--text-xs); color: var(--color-text-muted); text-align: center; margin: var(--space-3) 0 0; }
.legal-line a, .privacy-link { color: var(--color-primary); font-weight: 600; }
.privacy-link { display: inline-block; margin-top: var(--space-3); font-size: var(--text-sm); }
.invite-reset { font-size: var(--text-xs); padding: 6px 0; margin: 0 0 var(--space-3); color: var(--color-text-muted); }
