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

:root {
  /* Core palette */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --accent: #8b5cf6;

  /* Module colors */
  --mod-lists: #10b981;
  --mod-calendar: #3b82f6;
  --mod-travel: #f59e0b;
  --mod-notes: #eab308;
  --mod-chat: #8b5cf6;

  /* Surfaces */
  --bg: #f8f9fc;
  --bg-warm: linear-gradient(180deg, #f0f0ff 0%, #f8f9fc 30%);
  --card: #ffffff;
  --card-hover: #fafbff;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);

  /* Text — WCAG 2.1 compliant contrast */
  --text: #1a1a2e;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  /* States */
  --checked: #cbd5e1;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #10b981;
  --border: #e2e8f0;

  /* Shadows — soft, large-blur, low-opacity */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.03);
  --shadow: 0 4px 20px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.03);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --shadow-glow: 0 4px 24px rgba(99, 102, 241, 0.2);

  /* Radii */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-full: 9999px;

  /* Safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 64px;
}

/* === Dark Mode === */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f1a;
    --bg-warm: linear-gradient(180deg, #131328 0%, #0f0f1a 30%);
    --card: #1a1a2e;
    --card-hover: #1f1f35;
    --glass: rgba(26, 26, 46, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text: #e8e8f0;
    --text-secondary: #9ca3b4;
    --text-muted: #7b8194;
    --checked: #3a3e52;
    --border: #2a2a40;
    --primary-light: #1e1b4b;
    --primary-glow: rgba(99, 102, 241, 0.2);
    --danger-light: #2d1515;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.15);
    --shadow: 0 4px 20px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.25);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.3);
  }
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg-warm);
}

.view {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 1rem);
  animation: viewFadeIn 0.25s ease;
}

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

.hidden {
  display: none !important;
}

/* === Bottom Navigation === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--nav-height);
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 50;
}
@media (prefers-color-scheme: dark) {
  .bottom-nav {
    background: rgba(15, 15, 26, 0.7);
    border-top-color: rgba(255, 255, 255, 0.06);
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}

.nav-item-icon {
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-item-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.75;
}

.nav-item-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active .nav-item-icon {
  transform: scale(1.1);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:active {
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-large {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  border-radius: var(--radius);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background 0.2s;
  line-height: 1;
  color: var(--text);
}

.btn-icon:active {
  background: var(--primary-glow);
}

.btn-back {
  font-size: 1.5rem;
  margin-right: 0.25rem;
}

.btn-danger-icon {
  color: var(--danger);
}

/* === Welcome Screen === */
.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
  background: var(--bg-warm);
}

.welcome-logo {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-glow);
  animation: gentle-bounce 3s ease-in-out infinite;
}

.welcome-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: gentle-bounce 3s ease-in-out infinite;
}

@keyframes gentle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.welcome-container h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: -0.03em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.welcome-actions {
  width: 100%;
  max-width: 320px;
  margin-top: 2rem;
}

.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  padding: 0 1rem;
}

.join-form {
  display: flex;
  gap: 0.5rem;
}

.join-form input {
  flex: 1;
}

input[type="text"],
input[type="url"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

input[type="text"]:focus,
input[type="url"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input[type="text"]::placeholder,
input[type="url"]::placeholder {
  color: var(--text-muted);
}

.error-text {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.3em;
}

/* === Share Code === */
.share-code {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding: 1rem 2rem;
  margin: 1.5rem 0 1rem;
  font-family: "SF Mono", "Menlo", monospace;
}

/* === App Header === */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(0.75rem + var(--safe-top)) 1.25rem 0.75rem;
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

/* Home header with pastel gradient */
.home-greeting {
  padding: 1rem 1.25rem 1rem;
  margin: 0 0.75rem 0.5rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 35%, #fce7f3 65%, #dbeafe 100%);
  position: relative;
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .home-greeting {
    background: linear-gradient(135deg, #1e1b4b 0%, #2e1065 35%, #4c1d4e 65%, #172554 100%);
  }
}

.home-greeting-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.home-greeting-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

/* === Today Overview (Dashboard) === */
.today-overview {
  padding: 0 1rem 1rem;
}

.today-dashboard {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* --- Hero Travel Card --- */
.dash-travel-hero {
  position: relative;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
  animation: dashCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-travel-hero::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -15%;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.dash-travel-hero::after {
  content: "";
  position: absolute;
  bottom: -20%;
  right: 10%;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.dash-travel-icon {
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
  display: block;
}

.dash-travel-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  margin-bottom: 0.25rem;
}

.dash-travel-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.15rem;
}

.dash-travel-sub {
  font-size: 0.82rem;
  opacity: 0.9;
}

.dash-travel-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

/* --- Overdue Alert Card --- */
.dash-overdue {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
  animation: dashCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

.dash-overdue-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.dash-overdue-info {
  flex: 1;
}

.dash-overdue-count {
  font-size: 0.95rem;
  font-weight: 700;
}

.dash-overdue-names {
  font-size: 0.78rem;
  opacity: 0.9;
}

/* --- Today Events Card --- */
.dash-events {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: dashCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.dash-events-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}

.dash-events-header-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.dash-event-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  transition: background 0.15s;
}

.dash-event-item:first-of-type {
  border-top: none;
}

.dash-event-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 40px;
  flex-shrink: 0;
}

.dash-event-time-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  flex-shrink: 0;
}

.dash-event-name {
  font-size: 0.88rem;
  color: var(--text);
  flex: 1;
}

.dash-event-assigned {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* --- Tomorrow Preview Card --- */
.dash-tomorrow {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0.75;
  box-shadow: var(--shadow-sm);
  animation: dashCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.dash-tomorrow-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dash-tomorrow-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.dash-tomorrow-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* --- All-Clear Card --- */
.dash-allclear {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.03) 100%);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  animation: dashCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-allclear-icon {
  font-size: 2rem;
  margin-bottom: 0.3rem;
}

.dash-allclear-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--success);
}

.dash-allclear-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* --- Weather Widget --- */
.dash-weather {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  animation: dashCardIn 0.4s ease both;
  animation-delay: 0.3s;
}
@media (prefers-color-scheme: dark) {
  .dash-weather {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
  }
}
.dash-weather-now {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.dash-weather-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.dash-weather-temp {
  font-size: 1.4rem;
  font-weight: 800;
}
.dash-weather-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex: 1;
  text-align: right;
}
.dash-weather-city {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.dash-weather-forecast {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}
.dash-weather-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.dash-weather-day-name {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}
.dash-weather-day-icon {
  font-size: 1.1rem;
}
.dash-weather-day-temp {
  font-size: 0.72rem;
  font-weight: 600;
}
.dash-weather-rain {
  font-size: 0.6rem;
  color: #3b82f6;
}

/* --- Section Label in Dashboard --- */
.dash-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.3rem 0.25rem 0.1rem;
}

.dash-version {
  text-align: center;
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.4;
  padding: 1.5rem 0 0.5rem;
}

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

/* Dark mode adjustments for dashboard cards */
@media (prefers-color-scheme: dark) {
  .dash-travel-hero {
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
  }
  .dash-overdue {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15);
  }
  .dash-allclear {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.04) 100%);
  }
}

/* === Lists Overview === */
.section-label {
  padding: 0.5rem 1.25rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.lists-container {
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.list-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--card);
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
  border: 1px solid var(--border);
}

.list-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.list-card-emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

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

.list-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.list-card-category {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.list-card-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  min-width: 1.2rem;
  height: 1.2rem;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
}

.list-card-arrow {
  color: var(--text-muted);
  font-size: 1rem;
  flex-shrink: 0;
}

/* Favorite list cards */
.list-card-fav {
  border-left: 3px solid #f59e0b;
}

/* Favorite button */
.btn-fav {
  font-size: 1.3rem;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}
.btn-fav.is-fav {
  color: #f59e0b;
  transform: scale(1.1);
}

/* Category Group (expandable) */
.cat-group {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.cat-group.expanded {
  box-shadow: var(--shadow);
}

.cat-group-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.15s ease;
}
.cat-group-header:active {
  background: var(--card-hover);
}

.cat-group-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

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

.cat-group-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.cat-group-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.cat-group-chevron {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.cat-group.expanded .cat-group-chevron {
  transform: rotate(90deg);
}

.cat-group-children {
  border-top: 1px solid var(--border);
}

.list-card-nested {
  border: none;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  padding-left: 1.25rem;
}
.list-card-nested:last-child {
  border-bottom: none;
}

@keyframes catSlideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 500px; }
}
@keyframes catSlideUp {
  from { opacity: 1; max-height: 500px; }
  to { opacity: 0; max-height: 0; }
}

.lists-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.lists-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.lists-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.lists-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.lists-empty-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* === FAB === */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 1rem);
  right: calc(50% - 240px + 1.25rem);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border: none;
  font-size: 1.8rem;
  font-weight: 300;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  line-height: 1;
}

@media (max-width: 480px) {
  .fab {
    right: 1.25rem;
  }
}

.fab:active {
  transform: scale(0.9);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

/* === Modal === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

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

.modal-content {
  position: relative;
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem;
  padding-bottom: calc(1.5rem + var(--safe-bottom));
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 1px solid var(--border);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.modal-content input {
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.modal-actions .btn {
  flex: 1;
}

.settings-version {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.5;
  margin-top: 0.75rem;
  letter-spacing: 0.03em;
}

/* === Emoji Picker === */
.emoji-picker {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.emoji-option {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border-radius: var(--radius-xs);
  border: 2px solid transparent;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
}

.emoji-option:active {
  transform: scale(0.9);
}

.emoji-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* === Category Picker === */
.category-picker {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.category-chip {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.category-chip:active {
  transform: scale(0.95);
}

.category-chip.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.category-chip.new-cat {
  border-style: dashed;
  color: var(--text-muted);
}

.input-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

/* === Add Item Bar === */
.add-item-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
  position: sticky;
  top: calc(3.25rem + var(--safe-top));
  background: var(--bg);
  z-index: 9;
}

.add-item-bar input {
  flex: 1;
}

.btn-add {
  width: 48px;
  height: 48px;
  padding: 0;
  font-size: 1.5rem;
  font-weight: 400;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* === Items === */
.items-container {
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.item-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all 0.25s ease;
  -webkit-user-select: none;
  user-select: none;
}

.item-card.checked {
  opacity: 0.45;
  border-color: transparent;
}

.item-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.75rem;
  color: transparent;
}

.item-checkbox:active {
  transform: scale(0.8);
}

.item-card.checked .item-checkbox {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-color: var(--primary);
  color: white;
  animation: checkBounce 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.item-name {
  font-size: 0.95rem;
  transition: all 0.2s;
  word-break: break-word;
}

.item-card.checked .item-name {
  text-decoration: line-through;
  color: var(--checked);
}

.item-quantity {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.item-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  transition: all 0.15s;
  flex-shrink: 0;
  opacity: 0;
}

.item-card:hover .item-delete,
.item-card:active .item-delete {
  opacity: 1;
}

@media (hover: none) {
  .item-delete {
    opacity: 0.5;
  }
}

.item-delete:active {
  color: var(--danger);
  background: var(--danger-light);
}

/* === Category Headers === */
/* (category headers removed — category shown inline per card) */

/* === Checked Divider === */
.checked-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.checked-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.checked-divider-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.25rem;
}

.checked-divider {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

/* === Search Bar === */
.search-bar {
  padding: 0 1rem 0.5rem;
}
.search-bar input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--card);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* === Pull to Refresh === */
.pull-indicator {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: opacity 0.15s, transform 0.15s;
}

/* === Swipe Item Styles === */
.item-card {
  overflow: hidden;
  will-change: transform;
  touch-action: pan-y;
}

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* === Date/Assignment Rows === */
.add-item-date-row {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
}

.add-item-date-row input[type="date"],
.add-item-date-row input[type="time"],
.add-item-date-row select {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.add-item-date-row input:focus,
.add-item-date-row select:focus {
  border-color: var(--primary);
}

.item-date {
  font-size: 0.75rem;
  color: var(--primary);
  margin-top: 0.15rem;
  font-weight: 500;
}

.item-termin {
  border-left: 3px solid var(--primary);
}

.item-termin.checked {
  border-left-color: var(--checked);
}

.add-item-assign-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
}

.assign-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.add-item-assign-row select {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
}

.assign-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  margin-right: 0.35rem;
  flex-shrink: 0;
}

/* === Notes === */
.notes-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.08) 0%, rgba(234, 179, 8, 0.03) 100%);
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(234, 179, 8, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
  margin-bottom: 0.5rem;
}

.notes-card:active {
  transform: scale(0.98);
}

.notes-card-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.notes-card-info { flex: 1; }

.notes-card-name {
  font-weight: 700;
  font-size: 1rem;
}

.notes-card-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.notes-container {
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.notes-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 0.5rem 0 0.25rem;
}

.note-card {
  background: var(--card);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.note-card:active { transform: scale(0.98); }

.note-card.note-pinned {
  border-left: 3px solid var(--mod-notes);
}

.note-card-content { flex: 1; min-width: 0; }

.note-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.note-card-preview {
  font-size: 0.82rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-card-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.note-toolbar {
  padding: 0 1rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.note-format-btns {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.btn-format {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-format:active {
  background: var(--primary);
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  border-radius: var(--radius-xs);
}

.note-editor {
  padding: 0 1rem;
}

.note-editor textarea {
  width: 100%;
  min-height: calc(100vh - 10rem);
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: transparent;
  padding: 0.5rem 0;
}

/* === Calendar === */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 1rem 0.75rem;
}

.cal-month-label {
  font-size: 1.05rem;
  font-weight: 700;
  min-width: 160px;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.01em;
}

.cal-arrow {
  font-size: 1rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.cal-arrow:active {
  background: var(--primary-light);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding: 0 0.5rem 1rem;
}

.cal-weekday {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cal-days-container {
  display: contents;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.25rem 0.1rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px;
}

.cal-day:hover { background: var(--primary-glow); }

.cal-day-number {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}

.cal-day.other-month .cal-day-number {
  color: var(--text-muted);
  opacity: 0.35;
}

.cal-day.today {
  background: var(--primary-glow);
}

.cal-day.today .cal-day-number {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
}

.cal-dots {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2px;
  max-width: 100%;
}

.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.cal-day-travel {
  background: rgba(245, 158, 11, 0.06);
}

.cal-travel-indicator {
  font-size: 0.55rem;
  line-height: 1;
  text-align: center;
}

.day-detail-items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 60vh;
  overflow-y: auto;
}

.day-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-xs);
  border-left: 3px solid var(--primary);
}

.day-item-time {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 40px;
}

.day-item-name {
  font-size: 0.82rem;
  flex: 1;
}

.day-item-list {
  font-size: 0.62rem;
  color: var(--text-secondary);
}

.day-item-travel {
  background: rgba(245, 158, 11, 0.06);
  border-radius: var(--radius-xs);
  padding: 0.5rem;
  margin-bottom: 0.25rem;
}

/* === Chat === */
#view-chat {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

#view-chat.view:not(.hidden) {
  display: flex;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-bottom: calc(80px + var(--nav-height));
}

.chat-bubble {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: 18px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble .chat-time {
  font-size: 0.58rem;
  opacity: 0.55;
  margin-top: 0.25rem;
  display: block;
}

.chat-bubble.system {
  align-self: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
  padding: 0.25rem;
}

.chat-input-row {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--glass-border);
  z-index: 10;
}

.chat-input-row input {
  flex: 1;
  font-size: 0.9rem;
}

.btn-chat-send {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.1rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.75rem 1rem;
  align-self: flex-start;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* === Settings === */
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.setting-label {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.lang-select {
  background: var(--card-bg, rgba(255,255,255,0.06));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 1.8rem;
}
.lang-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.15);
}
.lang-select option {
  background: #1a1a2e;
  color: #fff;
}

.setting-value {
  font-weight: 700;
  font-family: "SF Mono", "Menlo", monospace;
  letter-spacing: 0.15rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.setting-section {
  margin: 1rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}
.setting-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  line-height: 1.3;
}

.members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.6rem 0.4rem 0.8rem;
  font-size: 0.88rem;
}

.member-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.member-name { font-weight: 500; }

.member-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
}

.member-remove:active { color: var(--danger); }

.members-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.25rem 0;
}

.family-name-row,
.add-member-row {
  display: flex;
  gap: 0.5rem;
}

.family-name-row input,
.add-member-row input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
}

.btn-add-member {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.3rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* === Visibility Toggles === */
.visibility-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.25rem;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.toggle-label {
  font-size: 0.92rem;
}

/* === Travel === */
.travel-container {
  padding: 0 1rem;
}

.travel-next {
  padding: 0 1rem;
  margin-bottom: 0.75rem;
}

.travel-next-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.03) 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-left: 4px solid var(--mod-travel);
  border-radius: var(--radius);
  padding: 1rem;
}

.travel-next-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.travel-countdown-badge {
  background: linear-gradient(135deg, var(--mod-travel) 0%, #d97706 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.travel-next-member {
  font-size: 0.82rem;
  font-weight: 600;
}

.travel-next-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.travel-next-location,
.travel-card-location {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.1rem;
}

.travel-next-dates {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.travel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--mod-travel);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.4rem;
}

.travel-past { opacity: 0.4; }

.travel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}

.travel-card-dates {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.travel-card-member {
  font-size: 0.78rem;
  font-weight: 600;
}

.travel-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.travel-feeds-section {
  padding: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

.travel-feeds-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.travel-feed-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

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

.travel-feed-member {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}

.travel-feed-url {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.travel-feed-edit-btn,
.travel-feed-delete {
  font-size: 1rem;
  padding: 0.2rem;
  flex-shrink: 0;
}

.input-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.3;
}

.input-select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.input-select:focus {
  border-color: var(--primary);
}

/* === Sync Indicator === */
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  margin-left: 0.5rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

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

/* === Share Link === */
.share-link-box {
  background: var(--bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 0.82rem;
  color: var(--primary);
  word-break: break-all;
  text-align: center;
  font-weight: 600;
}

/* === Konfetti === */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0;
  animation: confettiFall 2.5s ease-out forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg) scale(0.3); }
}

/* === Progress Bar on List Cards === */
.list-card-progress {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  margin-top: 0.35rem;
  overflow: hidden;
}
.list-card-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
}
.list-card-progress-fill.complete {
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* === Undo Snackbar === */
.undo-snackbar {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: white;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 210;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.undo-snackbar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.undo-snackbar-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* === Auto-Complete Suggestions === */
.autocomplete-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  display: none;
}
.autocomplete-dropdown.visible {
  display: block;
}
.autocomplete-item {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.autocomplete-item:hover,
.autocomplete-item.active {
  background: rgba(255,255,255,0.06);
}
.autocomplete-item-freq {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* === Avatar Badges on Home Cards === */
.list-card-avatars {
  display: flex;
  gap: -4px;
  margin-left: auto;
  margin-right: 0.25rem;
  flex-shrink: 0;
}
.list-card-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
  border: 2px solid var(--bg);
  margin-left: -6px;
}
.list-card-avatar:first-child {
  margin-left: 0;
}

/* === Quick-Add FAB Menu === */
.fab-menu {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 4.5rem);
  right: 1.25rem;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.fab-menu.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  animation: fabItemIn 0.2s ease backwards;
}
.fab-menu-label {
  background: var(--card);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}
.fab-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: none;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}
@keyframes fabItemIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Quick-Add Inline === */
.quick-add-inline {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-top: 0.5rem;
  display: none;
  animation: slideDown 0.2s ease;
}
.quick-add-inline.visible {
  display: block;
}
.quick-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.quick-add-select {
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  flex: 1;
}
.quick-add-input {
  flex: 2;
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.quick-add-btn {
  background: var(--primary);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 200px; }
}

/* === Drag Reorder === */
.item-card.dragging {
  opacity: 0.5;
  background: rgba(168, 85, 247, 0.1) !important;
  border: 1px dashed var(--primary);
}
.item-card.drag-over {
  border-top: 2px solid var(--primary);
}
.drag-handle {
  cursor: grab;
  padding: 0 0.25rem;
  font-size: 1rem;
  color: var(--text-muted);
  opacity: 0.5;
  touch-action: none;
  user-select: none;
  display: flex;
  align-items: center;
}
.drag-handle:active {
  cursor: grabbing;
  opacity: 1;
}

/* === Color Picker Popup === */
.color-picker-popup {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 100;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s;
  border: 1px solid var(--border);
}
.color-picker-popup.visible {
  opacity: 1;
  transform: translateY(0);
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.color-swatch:hover {
  transform: scale(1.2);
}
.color-swatch.selected {
  border-color: var(--text);
  transform: scale(1.15);
}
.member-chip {
  position: relative;
}
.member-color-pick {
  cursor: pointer;
  transition: transform 0.15s;
}
.member-color-pick:hover {
  transform: scale(1.3);
}

/* === Inline Edit Input === */
.inline-edit-input {
  font-size: 0.95rem;
  padding: 4px 8px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-xs);
  background: var(--card);
  color: var(--text);
  width: 100%;
  outline: none;
  animation: inlineEditPulse 0.3s ease;
}
@keyframes inlineEditPulse {
  0% { border-color: transparent; }
  100% { border-color: var(--primary); }
}

/* === Offline Banner === */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.offline-banner.visible {
  transform: translateY(0);
}

/* === Pinned Notes on Dashboard === */
.dash-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: var(--shadow);
}
.dash-note-item {
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.15s;
}
.dash-note-item:hover {
  background: var(--card-hover);
}
.dash-note-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.dash-note-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Items Toolbar (Sort + Batch) === */
.items-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.sort-select {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.sort-select:focus {
  border-color: var(--primary);
}
.batch-btn {
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.batch-btn:hover {
  background: var(--card-hover);
  border-color: var(--primary);
}
.batch-btn:active {
  transform: scale(0.96);
}
.batch-check-all {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #22c55e;
}
.batch-check-all:hover {
  background: rgba(34, 197, 94, 0.2);
}

/* === Swipe Hint Overlay === */
.swipe-hint-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
.swipe-hint-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  max-width: 320px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.swipe-hint-card h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text);
}
.swipe-hint-anim {
  font-size: 2.4rem;
  margin-bottom: 12px;
  animation: swipeLeftRight 2s ease-in-out infinite;
}
@keyframes swipeLeftRight {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-20px); }
  75% { transform: translateX(20px); }
}
.swipe-hint-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}
.swipe-hint-dismiss {
  padding: 8px 24px;
  border-radius: var(--radius-xs);
  border: none;
  background: var(--primary);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* === Theme Toggle === */
.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.theme-toggle-label {
  font-size: 0.92rem;
  color: var(--text);
}
.theme-switch {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}
.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.theme-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 26px;
  transition: background 0.3s;
}
.theme-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
.theme-switch input:checked + .theme-slider {
  background: var(--primary);
}
.theme-switch input:checked + .theme-slider::before {
  transform: translateX(22px);
}

/* Light theme overrides */
[data-theme="light"] {
  --bg: #f5f5f7;
  --card: #ffffff;
  --card-hover: #f0f0f2;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.65);
  border-top-color: rgba(255, 255, 255, 0.4);
}
[data-theme="light"] .modal-content {
  background: #ffffff;
}
[data-theme="light"] .search-input,
[data-theme="light"] .sort-select,
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #f5f5f7;
  color: #1a1a2e;
}

/* === Birthday Reminder === */
.birthday-banner {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  animation: birthdayPulse 2s ease-in-out infinite;
}
@keyframes birthdayPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(236, 72, 153, 0); }
}
.birthday-emoji {
  font-size: 1.5rem;
}
.birthday-info {
  flex: 1;
}
.birthday-name {
  font-weight: 600;
  font-size: 0.92rem;
}
.birthday-date {
  font-size: 0.78rem;
  opacity: 0.85;
}

/* === List Stats === */
.stats-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stats-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.stats-row:last-child {
  border-bottom: none;
}
.stats-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.stats-name {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
}
.stats-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
}
.stats-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  flex: 1;
  max-width: 100px;
  overflow: hidden;
}
.stats-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* === Swipe Action Indicators === */
.item-card-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.swipe-action-left, .swipe-action-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.15s;
}
.swipe-action-left {
  left: 0;
  background: #22c55e;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.swipe-action-right {
  right: 0;
  background: #ef4444;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.swipe-action-left.visible, .swipe-action-right.visible {
  opacity: 1;
}
.item-card-wrapper .item-card {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

/* === Quantity Stepper === */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
}
.qty-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}
.qty-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.qty-btn:active {
  transform: scale(0.9);
}
.qty-stepper .item-quantity {
  min-width: 20px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* === Global Search === */
.global-search-bar {
  position: relative;
  margin-bottom: 12px;
}
.global-search-bar .search-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.global-search-bar .search-input:focus {
  border-color: var(--primary);
}
.global-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 4px;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.search-result:last-child {
  border-bottom: none;
}
.search-result:hover {
  background: var(--card-hover);
}
.search-result-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.search-result-info {
  flex: 1;
  min-width: 0;
}
.search-result-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.search-no-results {
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* === List Templates === */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 12px 0;
}
.template-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border);
}
.template-card:hover {
  border-color: var(--primary);
  background: var(--card-hover);
}
.template-card:active {
  transform: scale(0.96);
}
.template-emoji {
  font-size: 2rem;
  margin-bottom: 6px;
}
.template-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.template-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === Member Avatars === */
.member-avatar {
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}
.member-avatar-btn {
  background: none;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
  padding: 0 2px;
}
.member-avatar-btn:hover {
  opacity: 1;
}
.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 200px;
}
.avatar-swatch {
  font-size: 1.3rem !important;
  width: auto !important;
  height: auto !important;
  padding: 4px !important;
  background: none !important;
  cursor: pointer;
}
.avatar-swatch:hover {
  background: var(--card-hover) !important;
  border-radius: 4px;
}
.avatar-clear {
  font-size: 0.7rem !important;
  color: var(--text-muted);
  padding: 4px 8px !important;
  width: 100% !important;
  text-align: center;
}
.assign-badge-emoji {
  background: none !important;
  font-size: 1.1rem;
}
.member-dot {
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Empty State Illustration === */
.empty-state-illustration {
  text-align: center;
  padding: 40px 20px;
}
.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  opacity: 0.6;
}
.empty-state-illustration h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-state-illustration p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.empty-state-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* === Item Detail Form === */
.item-detail-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.item-detail-form .input-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: -4px;
}
.item-detail-form input,
.item-detail-form select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}
.item-detail-form input:focus,
.item-detail-form select:focus {
  border-color: var(--primary);
}
.qty-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.unit-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.unit-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.unit-chip:active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* === Week Overview === */
.cal-week-overview {
  margin-top: 16px;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
}
.week-overview-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.week-day-row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.week-day-row:last-child {
  border-bottom: none;
}
.week-day-label {
  min-width: 65px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 2px;
}
.week-day-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.week-event {
  font-size: 0.82rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}
.week-event-travel {
  color: var(--mod-travel);
  font-weight: 500;
}
.week-event-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 38px;
}
.week-event-more {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}
.week-empty {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 12px;
}

/* === Micro-Interactions & Polish === */
@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.list-card, .item-card-wrapper, .special-card {
  animation: cardSlideIn 0.3s ease forwards;
}
.list-card:nth-child(2) { animation-delay: 0.03s; }
.list-card:nth-child(3) { animation-delay: 0.06s; }
.list-card:nth-child(4) { animation-delay: 0.09s; }
.list-card:nth-child(5) { animation-delay: 0.12s; }
.item-card-wrapper:nth-child(2) { animation-delay: 0.02s; }
.item-card-wrapper:nth-child(3) { animation-delay: 0.04s; }
.item-card-wrapper:nth-child(4) { animation-delay: 0.06s; }
.item-card-wrapper:nth-child(5) { animation-delay: 0.08s; }

/* Smooth checkbox animation */
.item-checkbox {
  transition: background 0.2s, transform 0.2s;
}
.item-card:not(.checked) .item-checkbox:active {
  transform: scale(0.85);
}
.item-card.checked .item-checkbox {
  animation: checkPop 0.3s ease;
}
@keyframes checkPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* FAB animation */
.fab {
  transition: transform 0.2s, box-shadow 0.2s;
}
.fab:hover {
  transform: scale(1.08);
}
.fab:active {
  transform: scale(0.92);
}

/* Button press effect */
.btn:active {
  transform: scale(0.97);
}
.btn-icon:active {
  transform: scale(0.9);
}

/* Smooth view transitions */
.view {
  transition: opacity 0.2s ease;
}
.view.hidden {
  display: none !important;
}

/* Toast slide-in polish */
@keyframes toastSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.toast {
  animation: toastSlideUp 0.25s ease;
}

/* Bottom nav active indicator animation */
.nav-btn.active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
  animation: navDot 0.3s ease;
}
@keyframes navDot {
  from { width: 0; opacity: 0; }
  to { width: 20px; opacity: 1; }
}
.nav-btn {
  position: relative;
}

/* Drag handle visibility on hover/active */
.drag-handle {
  opacity: 0.3;
  transition: opacity 0.2s;
}
.item-card:hover .drag-handle,
.item-card.dragging .drag-handle {
  opacity: 0.8;
}

/* Smooth scroll for containers */
.lists-container, #items-container {
  scroll-behavior: smooth;
}

/* === Quick Access Grid === */
.qa-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.5rem 1rem 0.25rem;
}
.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0 1rem;
  margin-bottom: 0.5rem;
}
.qa-secondary {
  grid-template-columns: repeat(3, 1fr);
}
.qa-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.qa-card.qa-primary {
  border-color: var(--primary-glow);
  box-shadow: var(--shadow-sm);
}
.qa-card:active {
  transform: scale(0.95);
  box-shadow: var(--shadow);
}
.qa-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.qa-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.75;
  color: var(--primary);
}
.qa-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.qa-more-toggle {
  display: block;
  width: 100%;
  padding: 0.4rem 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
}

/* === Today Dashboard ("Heute bei euch") === */
.today-dashboard {
  margin: 0.5rem 1rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 1rem);
  overflow: hidden;
}
.today-header {
  padding: 0.6rem 0.75rem 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}
.today-weekday {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.today-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  gap: 0.5rem;
  cursor: pointer;
  border-top: 1px solid var(--border);
  transition: background 0.15s;
}
.today-row:active {
  background: var(--card-hover);
}
.today-row-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.today-row-content {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.today-row-content strong {
  color: var(--text);
}
.today-meal {
  display: inline;
}
.today-row-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* === Budget === */
.budget-summary {
  padding: 1rem;
}
.budget-total {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border);
}
.budget-total-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.budget-total-of {
  font-size: 0.9rem;
  opacity: 0.6;
}
.budget-total-remaining {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
.budget-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  margin-top: 0.5rem;
  overflow: hidden;
}
.budget-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.budget-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem;
  font-weight: 600;
}
.budget-list {
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.budget-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.budget-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.budget-card-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.budget-card-amounts {
  font-size: 0.8rem;
  opacity: 0.7;
}
.expenses-list {
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.expense-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.expense-desc {
  font-weight: 500;
  font-size: 0.85rem;
}
.expense-meta {
  font-size: 0.72rem;
  opacity: 0.6;
}
.expense-amount {
  font-weight: 700;
  color: #ef4444;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* === Kanban Board === */
.kanban-board {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-height: calc(100vh - 8rem);
}
.kanban-col {
  min-width: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.kanban-col-header {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}
.kanban-count {
  background: var(--primary);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-size: 0.7rem;
  margin-left: 0.25rem;
}
.kanban-col-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ticket-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.ticket-card:active {
  box-shadow: var(--shadow);
}
.ticket-header {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}
.ticket-desc {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}
.ticket-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  opacity: 0.6;
}
.ticket-status-btns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}
.kanban-empty {
  font-size: 0.8rem;
  opacity: 0.5;
  text-align: center;
  padding: 1rem;
}

/* === Ticket Attachments === */
.ticket-attachments-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ticket-attachment-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
}
.att-icon { font-size: 1.1rem; flex-shrink: 0; }
.att-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { font-size: 0.75rem; opacity: 0.5; flex-shrink: 0; }
.att-download, .att-delete { font-size: 0.9rem; padding: 0.25rem; }

/* === Habits === */
.habits-list { padding: 0 1rem; }
.habits-member-section { margin-bottom: 1.5rem; }
.habits-member-header {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.habit-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--card);
  border-radius: var(--radius-xs);
  margin-bottom: 0.4rem;
}
.habit-info {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  min-width: 0;
}
.habit-emoji { font-size: 1.1rem; }
.habit-name { font-size: 0.9rem; font-weight: 500; }
.habit-streak {
  font-size: 0.75rem;
  color: #f97316;
  font-weight: 600;
}
.habit-best {
  font-size: 0.7rem;
  opacity: 0.5;
}
.habit-week {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}
.habit-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 1.6rem;
  font-size: 0.6rem;
  opacity: 0.5;
}
.habit-day.habit-done {
  opacity: 1;
}
.habit-day.habit-today {
  opacity: 1;
  font-weight: 700;
  cursor: pointer;
}
.habit-day-label { font-size: 0.55rem; text-transform: uppercase; }
.habit-day-dot { font-size: 0.85rem; margin-top: 0.1rem; }
.habit-del { font-size: 0.8rem; opacity: 0.4; }

/* === Documents === */
.docs-list {
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.doc-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.doc-card.doc-expired {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}
.doc-card.doc-warning {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}
.doc-icon {
  font-size: 1.3rem;
}
.doc-type {
  font-weight: 600;
  font-size: 0.9rem;
}
.doc-member {
  font-size: 0.8rem;
  opacity: 0.7;
}
.doc-expiry {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 0.15rem;
}
.dash-doc-alert {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.dash-doc-expired {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.dash-doc-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* === Invoices === */
.invoice-filters {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  overflow-x: auto;
}
.inv-filter {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.inv-filter.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.invoices-list {
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.invoice-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
}
.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.inv-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.inv-amount {
  font-weight: 700;
  color: var(--primary);
}
.inv-meta {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}
.inv-status {
  font-weight: 600;
}
.inv-assigned, .inv-paid {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.15rem;
}

/* === Messenger === */
.msg-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  height: calc(100vh - 10rem);
}
.msg-empty {
  text-align: center;
  opacity: 0.6;
  padding: 3rem 1rem;
  font-size: 0.9rem;
}
.msg-date {
  text-align: center;
  font-size: 0.72rem;
  opacity: 0.5;
  margin: 0.75rem 0 0.25rem;
}
.msg-bubble {
  display: flex;
  gap: 0.5rem;
  max-width: 85%;
  align-items: flex-end;
}
.msg-mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-other {
  align-self: flex-start;
}
.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
  flex-shrink: 0;
}
.msg-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}
.msg-mine .msg-content {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.msg-sender {
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.msg-text {
  font-size: 0.85rem;
  word-break: break-word;
}
.msg-time {
  font-size: 0.65rem;
  opacity: 0.5;
  text-align: right;
  margin-top: 0.1rem;
}
.msg-input-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--card);
  border-top: 1px solid var(--border);
  align-items: center;
}
.msg-sender-select {
  width: 100px;
  padding: 0.4rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.75rem;
}
.msg-input-bar input {
  flex: 1;
}

/* === Empty Hints === */
.empty-hint {
  text-align: center;
  padding: 2rem 1rem;
  opacity: 0.6;
  font-size: 0.85rem;
}
.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === Meals / Essensplan === */
.meals-week-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 1rem; gap: 0.5rem;
}
.meals-week-label { font-weight: 600; font-size: 0.95rem; }
.meals-container { padding: 0 0.75rem 5rem; }
.meal-day {
  background: var(--card); border-radius: var(--radius);
  margin-bottom: 0.5rem; overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.meal-day-today { border-left: 3px solid var(--primary); }
.meal-day-header {
  font-weight: 600; font-size: 0.82rem; padding: 0.5rem 0.75rem;
  background: var(--primary-light); color: var(--primary-dark);
}
.meal-day-items { padding: 0.25rem 0.75rem 0.5rem; }
.meal-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0; font-size: 0.88rem;
}
.meal-type-icon { font-size: 1rem; }
.meal-type-label { font-size: 0.75rem; color: var(--text-muted); min-width: 3rem; }
.meal-name { flex: 1; }
.meal-link { font-size: 0.8rem; text-decoration: none; }
.meal-del {
  background: none; border: none; font-size: 1rem; cursor: pointer;
  opacity: 0.4; padding: 0 0.25rem;
}
.meal-del:hover { opacity: 1; }
.meal-empty { font-size: 0.8rem; color: var(--text-muted); padding: 0.25rem 0; }
.meal-url-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: -0.25rem;
  padding: 0 0.25rem 0.25rem;
  line-height: 1.3;
}

/* === Chores / Putzplan === */
.chores-list { padding: 0.5rem 0.75rem 5rem; }
.chore-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: var(--radius);
  padding: 0.75rem; margin-bottom: 0.5rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.chore-overdue { border-left: 3px solid var(--danger); }
.chore-today { border-left: 3px solid var(--primary); }
.chore-info { flex: 1; min-width: 0; }
.chore-name { font-weight: 600; font-size: 0.9rem; }
.chore-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.chore-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

/* === Rewards / Belohnungen === */
.rewards-points { padding: 0.5rem 0.75rem; }
.reward-member-card {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--card); border-radius: var(--radius);
  padding: 0.75rem; margin-bottom: 0.4rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.reward-avatar {
  width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.85rem;
}
.reward-member-name { flex: 1; font-weight: 600; }
.reward-member-points { font-weight: 700; color: var(--primary); font-size: 1.1rem; }
.rewards-goals { padding: 0 0.75rem; }
.reward-goal-card {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  background: var(--card); border-radius: var(--radius);
  padding: 0.6rem 0.75rem; margin-bottom: 0.4rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.reward-goal-emoji { font-size: 1.3rem; }
.reward-goal-name { flex: 1; font-weight: 500; }
.reward-goal-points { font-size: 0.82rem; color: var(--text-muted); }
.reward-redeem { font-size: 0.72rem !important; padding: 0.2rem 0.5rem !important; }
.rewards-activity { padding: 0 0.75rem 5rem; }
.reward-activity-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0; font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.reward-act-points { font-weight: 700; min-width: 2.5rem; color: var(--success); }
.reward-negative { color: var(--danger); }
.reward-act-name { font-weight: 500; }
.reward-act-reason { color: var(--text-muted); flex: 1; text-align: right; font-size: 0.78rem; }

/* === Challenges === */
.challenges-list { padding-bottom: 0.5rem; }
.challenge-card {
  background: var(--card); border-radius: var(--radius);
  padding: 0.85rem; margin-bottom: 0.6rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.challenge-card.challenge-completed {
  opacity: 0.7; border-color: var(--success);
}
.challenge-card.challenge-expired {
  opacity: 0.6; border-color: var(--warning);
}
.challenge-header {
  display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem;
}
.challenge-emoji { font-size: 1.5rem; line-height: 1; }
.challenge-info { flex: 1; min-width: 0; }
.challenge-title { font-weight: 700; font-size: 0.95rem; line-height: 1.2; }
.challenge-meta {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem;
  font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem;
}
.challenge-meta span { white-space: nowrap; }
.challenge-progress-bar {
  width: 100%; height: 0.5rem; background: var(--border);
  border-radius: 99px; overflow: hidden; margin: 0.5rem 0 0.35rem;
}
.challenge-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 99px; transition: width 0.4s ease;
}
.challenge-progress-text {
  font-size: 0.72rem; color: var(--text-muted); text-align: right;
}
.challenge-reward-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: rgba(168, 85, 247, 0.12); color: var(--primary);
  padding: 0.2rem 0.5rem; border-radius: 99px;
  font-size: 0.72rem; font-weight: 600; margin-top: 0.35rem;
}
.challenge-tasks-list { margin-top: 0.5rem; }
.challenge-task-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.challenge-task-item:last-child { border-bottom: none; }
.challenge-task-check {
  width: 1.3rem; height: 1.3rem; border-radius: 50%;
  border: 2px solid var(--border); background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: transparent; transition: all 0.2s;
  flex-shrink: 0; padding: 0;
}
.challenge-task-check.done {
  background: var(--success); border-color: var(--success); color: #fff;
}
.challenge-task-name { flex: 1; }
.challenge-task-name.done { text-decoration: line-through; opacity: 0.6; }
.challenge-task-pts { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }
.challenge-actions {
  display: flex; gap: 0.35rem; margin-top: 0.5rem; justify-content: flex-end;
}
.challenge-actions .btn { font-size: 0.68rem !important; padding: 0.15rem 0.4rem !important; }
.ch-tasks-builder { display: flex; flex-direction: column; gap: 0.35rem; }
.ch-task-row {
  display: flex; gap: 0.35rem; align-items: center;
}
.ch-task-row input:first-child { flex: 1; }
.ch-task-row input:nth-child(2) { width: 3.5rem; text-align: center; }
.ch-task-row button {
  background: none; border: none; color: var(--danger);
  cursor: pointer; font-size: 1rem; padding: 0 0.3rem;
}
.challenges-completed-toggle summary { list-style: none; }
.challenges-completed-toggle summary::-webkit-details-marker { display: none; }
.challenges-completed-toggle summary::before { content: "▸ "; }
.challenges-completed-toggle[open] summary::before { content: "▾ "; }

/* === Contacts / Kontakte === */
.contacts-list { padding: 0.5rem 0.75rem 5rem; }
.contact-cat-header {
  font-size: 0.78rem; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.75rem 0 0.25rem; margin-top: 0.5rem;
}
.contact-card {
  display: flex; align-items: flex-start; justify-content: space-between;
  background: var(--card); border-radius: var(--radius);
  padding: 0.75rem; margin-bottom: 0.4rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.contact-emergency { border-left: 3px solid var(--danger); }
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-weight: 600; font-size: 0.9rem; }
.contact-phone, .contact-email {
  display: block; font-size: 0.82rem; color: var(--primary);
  text-decoration: none; margin-top: 0.15rem;
}
.contact-notes { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

/* === Medications / Medikamente === */
.meds-list { padding: 0.5rem 0.75rem 5rem; }
.med-member-header {
  font-size: 0.82rem; font-weight: 700; color: var(--text-secondary);
  padding: 0.75rem 0.5rem 0.25rem; margin-top: 0.5rem;
}
.med-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: var(--radius);
  padding: 0.75rem; margin-bottom: 0.4rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.med-taken { opacity: 0.6; }
.med-low-stock { border-left: 3px solid #f59e0b; }
.med-info { flex: 1; min-width: 0; }
.med-name { font-weight: 600; font-size: 0.9rem; }
.med-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }
.med-warning { font-size: 0.78rem; color: #f59e0b; margin-top: 0.15rem; }
.med-actions { display: flex; gap: 0.35rem; flex-shrink: 0; align-items: center; }
.med-done-badge { font-size: 1.1rem; padding: 0 0.25rem; }

/* === Mental Load Balancer === */
.ml-alert {
  margin: 0.75rem; padding: 0.75rem 1rem; border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 500;
}
.ml-alert-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.ml-alert-ok { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.ml-chart { padding: 0.75rem; }
.ml-bar-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.ml-bar-label { min-width: 5rem; font-size: 0.85rem; font-weight: 500; text-align: right; }
.ml-bar-track {
  flex: 1; height: 1.5rem; background: var(--border); border-radius: 0.75rem; overflow: hidden;
}
.ml-bar-fill {
  height: 100%; border-radius: 0.75rem; transition: width 0.5s ease;
  min-width: 4px;
}
.ml-bar-value { min-width: 4.5rem; font-size: 0.82rem; color: var(--text-secondary); }
.ml-details { padding: 0 0.75rem 5rem; }
.ml-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.5rem; }
.ml-detail-card {
  background: var(--card); border-radius: var(--radius); padding: 0.6rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.ml-detail-title { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; }
.ml-detail-row { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 0.1rem 0; }
.ml-period {
  display: flex; justify-content: center; gap: 0.5rem;
  padding: 1rem; position: sticky; bottom: 4rem;
}
.ml-period-btn {
  padding: 0.4rem 1rem; border-radius: 1rem; border: 1px solid var(--border);
  background: var(--card); font-size: 0.82rem; cursor: pointer;
}
.ml-period-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* === Wishlist / Gift Coordination === */
.wish-filter-row { padding: 0.5rem 0.75rem; }
.wish-filter-select { width: 100%; padding: 0.5rem; border-radius: var(--radius); border: 1px solid var(--border); }
.wishes-list { padding: 0 0.75rem 5rem; }
.wish-member-section { margin-bottom: 1rem; }
.wish-member-header {
  font-size: 0.82rem; font-weight: 700; color: var(--text-secondary);
  padding: 0.5rem; margin-bottom: 0.25rem;
}
.wish-card {
  display: flex; align-items: flex-start; justify-content: space-between;
  background: var(--card); border-radius: var(--radius);
  padding: 0.75rem; margin-bottom: 0.4rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.wish-reserved { background: #fefce8; border-color: #fde68a; }
.wish-bought { opacity: 0.5; }
.wish-bought .wish-title { text-decoration: line-through; }
.wish-info { flex: 1; min-width: 0; }
.wish-title { font-weight: 600; font-size: 0.9rem; }
.wish-desc { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.15rem; }
.wish-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }
.wish-meta a { color: var(--primary); text-decoration: none; }
.wish-reserved-badge { font-size: 0.75rem; color: #92400e; margin-top: 0.2rem; font-weight: 500; }
.wish-bought-badge { font-size: 0.75rem; color: var(--success); margin-top: 0.2rem; font-weight: 500; }
.wish-actions { display: flex; gap: 0.25rem; flex-shrink: 0; flex-direction: column; }

/* === Dashboard Chores Widget === */
.dash-chores {
  background: var(--card); border-radius: var(--radius); padding: 0.75rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.dash-chores-header { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; }
.dash-chores-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.dash-chore-item {
  font-size: 0.78rem; padding: 0.2rem 0.5rem; border-radius: 0.75rem;
  background: var(--primary-light); color: var(--primary-dark);
}
.dash-chore-overdue { background: #fef2f2; color: var(--danger); }

/* === Calendar Conflict Detection === */
.cal-conflict-alert {
  background: #fef3c7; border: 1px solid #fcd34d; border-radius: var(--radius);
  padding: 0.6rem 0.75rem; margin-bottom: 0.75rem; font-size: 0.82rem; color: #92400e;
}
.cal-conflict-alert ul { margin: 0.25rem 0 0 1.2rem; padding: 0; }
.cal-conflict-alert li { margin-bottom: 0.15rem; }
.day-item-conflict { background: #fefce8 !important; border-color: #fcd34d !important; }

/* === Swipe-Back Navigation === */
.swipe-back-hint {
  position: fixed; top: 50%; left: 0; z-index: 10000;
  width: 36px; height: 36px; border-radius: 0 50% 50% 0;
  background: var(--primary); color: #fff; display: flex;
  align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; opacity: 0;
  transform: translateY(-50%); pointer-events: none;
  box-shadow: var(--shadow-md);
}

/* === Activity Feed === */
.dash-activity {
  background: var(--card); border-radius: var(--radius); padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.dash-activity-header {
  font-weight: 600; font-size: 0.85rem; margin-bottom: 0.6rem;
  color: var(--text-secondary);
}
.dash-activity-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.dash-activity-item:last-child { border-bottom: none; }
.dash-activity-icon { font-size: 1rem; flex-shrink: 0; }
.dash-activity-info { flex: 1; min-width: 0; }
.dash-activity-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.dash-activity-extra {
  display: block; font-size: 0.75rem; color: var(--text-muted);
}
.dash-activity-time {
  flex-shrink: 0; font-size: 0.72rem; color: var(--text-muted);
}

/* === Grocery Smart-Sort Groups === */
.grocery-group-header {
  font-size: 0.78rem; font-weight: 600; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 0.6rem 0 0.25rem; margin-top: 0.3rem;
  border-bottom: 1px solid var(--border);
}

/* === Rate App === */
.rate-stars {
  display: flex; justify-content: center; gap: 0.5rem; font-size: 2rem;
}
.rate-star { cursor: pointer; color: var(--text-muted); transition: color 0.15s; }
.rate-star.active { color: #f59e0b; }
.rate-star:hover { color: #f59e0b; }

/* === Onboarding === */
.onboarding-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.6); pointer-events: auto;
}
.onboarding-spotlight {
  position: absolute; border: 3px solid var(--primary);
  border-radius: var(--radius); box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  pointer-events: none;
}
.onboarding-tooltip {
  position: absolute; background: var(--card); border-radius: var(--radius);
  padding: 1rem 1.25rem; text-align: center;
  box-shadow: var(--shadow-lg); max-width: 280px; width: max-content;
}
.onboarding-text {
  font-size: 0.9rem; color: var(--text); margin-bottom: 0.75rem;
  font-weight: 500;
}
.onboarding-next { min-width: 100px; }
.onboarding-step {
  font-size: 0.72rem; color: var(--text-muted); margin-top: 0.5rem;
}

/* === Meal to List Button === */
.meal-to-list-btn {
  font-size: 0.9rem !important;
}

/* === Desktop Responsive Layout === */
@media (min-width: 768px) {
  #app {
    max-width: 720px;
  }
  .quick-access-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .qa-secondary {
    grid-template-columns: repeat(5, 1fr);
  }
  .modal-content {
    max-width: 500px;
  }
}

@media (min-width: 1024px) {
  body {
    background: #e8eaf0;
  }
  @media (prefers-color-scheme: dark) {
    body { background: #0a0a14; }
  }
  #app {
    max-width: 960px;
    box-shadow: var(--shadow-lg);
    border-radius: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    min-height: calc(100vh - 2rem);
    margin-left: calc(50% - 480px + 40px);
    padding-left: 72px;
    position: relative;
  }
  .quick-access-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }
  .qa-secondary {
    grid-template-columns: repeat(5, 1fr);
  }
  /* Desktop: bottom-nav becomes sidebar */
  .bottom-nav {
    position: fixed;
    left: calc(50% - 480px + 40px);
    top: 1rem;
    bottom: 1rem;
    width: 72px;
    height: auto;
    max-width: none;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 1.5rem 0;
    padding-bottom: 0;
    border-radius: 1.5rem 0 0 1.5rem;
    border-top: none;
    border-right: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    transform: none;
    z-index: 60;
  }
  .bottom-nav .nav-item {
    padding: 10px 8px;
  }
  .bottom-nav .nav-item-icon svg {
    width: 20px;
    height: 20px;
  }
  .bottom-nav .nav-item-label {
    font-size: 0.58rem;
  }
  .bottom-nav .nav-item.active {
    background: var(--primary-light);
    border-radius: var(--radius-xs);
    margin: 0 6px;
    padding: 10px 2px;
  }
}
@media (min-width: 1024px) and (prefers-color-scheme: dark) {
  .bottom-nav {
    background: rgba(15, 15, 26, 0.85);
    border-right-color: rgba(255, 255, 255, 0.06);
  }
}

/* === Skeleton Loading === */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}
.skeleton-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
.skeleton-text {
  height: 14px;
  border-radius: 6px;
  background: var(--border);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton-text-short { width: 40%; }
.skeleton-text-medium { width: 65%; }
.skeleton-text-long { width: 85%; }
.skeleton-row:nth-child(2) .skeleton-check,
.skeleton-row:nth-child(2) .skeleton-text { animation-delay: 0.15s; }
.skeleton-row:nth-child(3) .skeleton-check,
.skeleton-row:nth-child(3) .skeleton-text { animation-delay: 0.3s; }
.skeleton-row:nth-child(4) .skeleton-check,
.skeleton-row:nth-child(4) .skeleton-text { animation-delay: 0.45s; }
.skeleton-row:nth-child(5) .skeleton-check,
.skeleton-row:nth-child(5) .skeleton-text { animation-delay: 0.6s; }

/* === Swipe Item Gestures === */
.item-row {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}
.swipe-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.swipe-bg-right {
  left: 0;
  right: 50%;
  background: #22c55e;
  justify-content: flex-start;
}
.swipe-bg-left {
  right: 0;
  left: 50%;
  background: #ef4444;
  justify-content: flex-end;
}
.item-row.swiping .swipe-bg { opacity: 1; }
.item-content {
  position: relative;
  z-index: 1;
  background: var(--card);
  transition: transform 0.15s ease;
}

/* === Undo Toast === */
.undo-toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 200;
  font-size: 0.85rem;
  animation: slide-up 0.25s ease;
}
@keyframes slide-up {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.undo-toast-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}
.undo-toast-btn:active {
  background: rgba(99, 102, 241, 0.15);
}

/* === Utility === */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* ═══ FAMILY MAP ═══ */
#map-container {
  width: 100%;
  height: calc(100vh - 64px - 120px);
  z-index: 1;
}

#map-container .leaflet-tile-pane { filter: brightness(0.85) contrast(1.1) saturate(0.8); }

@media (prefers-color-scheme: dark) {
  #map-container .leaflet-tile-pane { filter: brightness(0.6) invert(1) contrast(1.3) hue-rotate(200deg) saturate(0.3); }
}

#map-members-bar {
  position: fixed;
  bottom: 72px;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  overflow-x: auto;
  z-index: 1000;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#map-members-bar::-webkit-scrollbar { display: none; }

.map-member-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(26, 26, 46, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 160px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.map-member-card:active { transform: scale(0.97); }
.map-member-card.active { border-color: var(--primary); box-shadow: 0 0 12px rgba(99,102,241,0.3); }

.map-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.map-member-info { display: flex; flex-direction: column; gap: 2px; }
.map-member-name { font-weight: 600; font-size: 0.85rem; color: var(--text); }
.map-member-time { font-size: 0.72rem; color: rgba(255,255,255,0.45); }
.map-member-distance { font-size: 0.72rem; color: var(--primary); font-weight: 500; }

.map-member-marker {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.3s;
}
.map-member-marker.pulse { animation: markerPulse 2s infinite; }

@keyframes markerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(99,102,241,0); }
}

#map-sharing-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 14px 20px;
  z-index: 1001;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

#map-sharing-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 26px;
  transition: 0.3s;
}
.toggle-slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }

.map-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: rgba(255,255,255,0.4);
  text-align: center;
  padding: 40px;
}
.map-empty-state .map-empty-icon { font-size: 3rem; }
.map-empty-state h3 { font-size: 1.1rem; color: var(--text); }
.map-empty-state p { font-size: 0.85rem; max-width: 280px; }

/* Leaflet overrides for dark theme */
.leaflet-control-zoom a {
  background: rgba(26, 26, 46, 0.9) !important;
  color: var(--text) !important;
  border-color: rgba(255,255,255,0.1) !important;
}
.leaflet-control-attribution {
  background: rgba(26, 26, 46, 0.7) !important;
  color: rgba(255,255,255,0.3) !important;
  font-size: 0.6rem !important;
}
.leaflet-control-attribution a { color: rgba(255,255,255,0.4) !important; }
