/* ============================================
   ViaCamp — Camping Theme
   ============================================ */

:root {
  --forest-dark: #1a2e0a;
  --forest: #2d5016;
  --forest-light: #3d6b1e;
  --earth: #8b6914;
  --earth-light: #c9a84c;
  --campfire: #e8731a;
  --campfire-glow: #ff9b3d;
  --ember: #d4442a;
  --sky-dark: #0f1d2b;
  --sky: #1a3a4a;
  --cream: #f5f0e1;
  --cream-dark: #e8dcc6;
  --sand: #d4c5a0;
  --bark: #4a3728;
  --bark-light: #6b5442;
  --text: #2c2416;
  --text-light: #7a6e5f;
  --text-muted: #a89e8c;
  --white: #ffffff;
  --danger: #c0392b;
  --success: #27ae60;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.2);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Dark Theme (default)
   ============================================ */

[data-theme="dark"] {
  --cream: #1a1d16;
  --cream-dark: #262a20;
  --sand: #c4b896;
  --text: #e4e0d6;
  --text-light: #bfb8a8;
  --text-muted: #8a8474;
  --white: #222620;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.5);
  /* Dark-only: light text for elements that use --cream as text color in light mode */
  --header-text: #e4e0d6;
}

[data-theme="dark"] .app-page {
  background: var(--cream);
  color: var(--text);
}

/* --- Header --- */
[data-theme="dark"] .app-header {
  background: #0f1a06;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .app-header h1 {
  color: var(--header-text);
}

[data-theme="dark"] .user-name {
  color: var(--sand);
}

/* --- Progress --- */
[data-theme="dark"] .progress-bar-container {
  background: var(--cream);
}

[data-theme="dark"] .progress-bar {
  background: var(--cream-dark);
}

[data-theme="dark"] .progress-text {
  color: var(--text-light);
}

/* --- Tabs --- */
[data-theme="dark"] .tabs {
  background: var(--cream);
  border-bottom-color: var(--cream-dark);
}

[data-theme="dark"] .tab {
  color: var(--text-muted);
}

[data-theme="dark"] .tab.active {
  color: var(--campfire);
}

[data-theme="dark"] .tab:hover {
  color: var(--campfire-glow);
}

[data-theme="dark"] .tab::after {
  background: var(--campfire);
}

/* --- Toolbar --- */
[data-theme="dark"] .toolbar {
  background: var(--cream);
  border-bottom-color: var(--cream-dark);
}

[data-theme="dark"] .search-box input {
  background: #2a2e26;
  border-color: #3a3e36;
  color: var(--text);
}

[data-theme="dark"] .search-box input::placeholder {
  color: var(--text-muted);
}

[data-theme="dark"] .search-box input:focus {
  border-color: var(--campfire);
}

[data-theme="dark"] .filter-select {
  background: #2a2e26;
  border-color: #3a3e36;
  color: var(--text);
}

[data-theme="dark"] .filter-select option {
  background: #2a2e26;
  color: var(--text);
}

[data-theme="dark"] .btn-outline {
  border-color: #3a3e36;
  color: var(--text-light);
}

[data-theme="dark"] .btn-outline:hover {
  border-color: var(--campfire);
  color: var(--campfire);
  background: rgba(232, 115, 26, 0.08);
}

/* --- Category headers --- */
[data-theme="dark"] .category-header {
  background: #1e3410;
  color: var(--header-text);
}

[data-theme="dark"] .category-header:hover {
  background: #264216;
}

[data-theme="dark"] .category-count {
  color: var(--sand);
  background: rgba(245, 240, 225, 0.1);
}

/* --- Checklist items --- */
[data-theme="dark"] .checklist-item {
  background: var(--white);
}

[data-theme="dark"] .checklist-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .item-name {
  color: var(--text);
}

[data-theme="dark"] .checklist-item.checked .item-name {
  color: var(--text-muted);
}

[data-theme="dark"] .check-mark {
  border-color: #5a5e52;
}

[data-theme="dark"] .check-wrapper input:checked + .check-mark {
  background: var(--campfire);
  border-color: var(--campfire);
}

[data-theme="dark"] .btn-delete {
  color: var(--text-muted);
}

[data-theme="dark"] .btn-delete:hover {
  color: #e74c3c;
  background: rgba(192, 57, 43, 0.15);
}

/* --- Tips --- */
[data-theme="dark"] .tip-card {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .tip-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .tip-number {
  color: var(--campfire-glow);
  background: rgba(232, 115, 26, 0.15);
}

[data-theme="dark"] .tip-title {
  color: var(--text);
}

[data-theme="dark"] .tip-text {
  color: var(--text-light);
}

/* --- Modal --- */
[data-theme="dark"] .modal {
  background: #2a2e26;
  border: 1px solid #3a3e36;
}

[data-theme="dark"] .modal h3 {
  color: var(--text);
}

[data-theme="dark"] .modal p {
  color: var(--text-light);
}

[data-theme="dark"] .modal .btn-outline {
  color: #e4e0d6;
  border-color: #4a4e46;
  background: rgba(245, 240, 225, 0.05);
}

[data-theme="dark"] .modal .btn-outline:hover {
  border-color: var(--campfire);
  color: var(--campfire);
}

[data-theme="dark"] .btn-forest {
  color: #f5f0e1;
}

/* --- Empty state --- */
[data-theme="dark"] .empty-state {
  color: var(--text-muted);
}

/* --- Landing page dark overrides --- */
/* Landing page always has dark BG, so text must stay light regardless of theme */
[data-theme="dark"] .landing-hero h1 {
  color: #f5f0e1;
}

[data-theme="dark"] .tagline {
  color: #c4b896;
}

[data-theme="dark"] .feature h3 {
  color: #f5f0e1;
}

[data-theme="dark"] .feature p {
  color: #a89e8c;
}

[data-theme="dark"] .landing-footer {
  color: #8a8474;
}

[data-theme="dark"] .divider {
  color: #8a8474;
}

[data-theme="dark"] .btn-google {
  background: #fff;
  color: #333;
}

[data-theme="dark"] .btn-magic {
  color: #f5f0e1;
}

[data-theme="dark"] .magic-form input[type="email"] {
  color: #f5f0e1;
}

[data-theme="dark"] .magic-form input[type="email"]::placeholder {
  color: #8a8474;
}

/* Theme toggle button */
.btn-theme {
  background: rgba(245, 240, 225, 0.1);
  border: none;
  font-size: 1.2rem;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
  width: auto;
}

.btn-theme:hover {
  background: rgba(245, 240, 225, 0.2);
  transform: scale(1.05);
}

.btn-logout-styled {
  background: rgba(245, 240, 225, 0.08);
  border: 1px solid rgba(245, 240, 225, 0.15);
  color: var(--sand);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
  width: auto;
}

.btn-logout-styled:hover {
  background: rgba(212, 68, 42, 0.15);
  border-color: rgba(212, 68, 42, 0.3);
  color: #e8735a;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   Landing Page
   ============================================ */

.landing {
  background: linear-gradient(170deg, var(--forest-dark) 0%, #0d1f06 40%, var(--sky-dark) 100%);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  position: relative;
}

.landing::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 300px at 20% 80%, rgba(232, 115, 26, 0.06) 0%, transparent 100%),
    radial-gradient(ellipse 400px 400px at 80% 20%, rgba(45, 80, 22, 0.15) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Fireflies */
.fireflies {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.firefly {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--campfire-glow);
  box-shadow: 0 0 8px 2px rgba(255, 155, 61, 0.6);
  animation: firefly-float 8s ease-in-out infinite, firefly-glow 3s ease-in-out infinite alternate;
}

.firefly:nth-child(1) { left: 15%; top: 30%; animation-delay: 0s, 0s; animation-duration: 9s, 2.5s; }
.firefly:nth-child(2) { left: 70%; top: 20%; animation-delay: -2s, -1s; animation-duration: 11s, 3.2s; }
.firefly:nth-child(3) { left: 40%; top: 60%; animation-delay: -4s, -0.5s; animation-duration: 8s, 2.8s; }
.firefly:nth-child(4) { left: 80%; top: 70%; animation-delay: -1s, -2s; animation-duration: 10s, 3.5s; }
.firefly:nth-child(5) { left: 25%; top: 80%; animation-delay: -3s, -1.5s; animation-duration: 12s, 2.2s; }
.firefly:nth-child(6) { left: 60%; top: 45%; animation-delay: -5s, -0.8s; animation-duration: 7s, 3s; }
.firefly:nth-child(7) { left: 90%; top: 50%; animation-delay: -6s, -2.5s; animation-duration: 9s, 2.6s; }
.firefly:nth-child(8) { left: 50%; top: 15%; animation-delay: -7s, -1.2s; animation-duration: 11s, 3.4s; }

@keyframes firefly-float {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(30px, -20px); }
  50% { transform: translate(-15px, 25px); }
  75% { transform: translate(20px, 10px); }
}

@keyframes firefly-glow {
  0% { opacity: 0.2; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

.landing-container {
  position: relative;
  z-index: 2;
  max-width: 640px;
  width: 100%;
  padding: 60px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.landing-hero {
  text-align: center;
  margin-bottom: 40px;
}

.logo-mark {
  font-size: 64px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(232, 115, 26, 0.3));
  animation: gentle-bounce 4s ease-in-out infinite;
}

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

.landing-hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--cream);
  margin-bottom: 8px;
}

.accent {
  color: var(--campfire);
}

.tagline {
  font-size: 1.1rem;
  color: var(--sand);
  line-height: 1.5;
  opacity: 0.9;
}

/* Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 36px;
}

.stat {
  text-align: center;
  padding: 16px 8px;
  background: rgba(245, 240, 225, 0.05);
  border: 1px solid rgba(245, 240, 225, 0.08);
  border-radius: var(--radius);
}

.stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--campfire);
  letter-spacing: -0.5px;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Force light-on-dark for landing page regardless of theme */
.landing, .landing * {
  --landing-text: #f5f0e1;
  --landing-muted: #b8b0a0;
  --landing-border: rgba(245, 240, 225, 0.15);
  --landing-input-bg: rgba(0, 0, 0, 0.25);
}
.landing .auth-card,
.landing .auth-card input,
.landing .auth-card select,
.landing .auth-card textarea,
.landing .auth-card label,
.landing .auth-card .calc-label { color: #f5f0e1; }
.landing .auth-card input,
.landing .auth-card select,
.landing .auth-card textarea {
  background: rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(245, 240, 225, 0.15) !important;
  color: #f5f0e1 !important;
}
.landing .auth-card input::placeholder { color: #8a8070 !important; }
.landing .auth-tab { color: #b8b0a0; }
.landing .auth-tab.active { background: var(--forest) !important; color: #f5f0e1 !important; }
.landing .stat .stat-label { color: #b8b0a0; }
.landing .btn-magic { background: var(--forest); color: #f5f0e1; }
.landing .btn-magic:hover { background: var(--forest-light); }
.landing .divider { color: #8a8070; }
.landing .divider::before, .landing .divider::after { background: rgba(245, 240, 225, 0.15); }

/* Auth headline */
.auth-headline {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f5f0e1;
  margin-bottom: 20px;
}

/* Auth card */
.auth-card {
  width: 100%;
  background: rgba(245, 240, 225, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 240, 225, 0.1);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 24px;
  transition: all var(--transition);
  text-decoration: none;
  width: 100%;
}

.btn-google {
  background: var(--white);
  color: #333;
  box-shadow: var(--shadow);
}

.btn-google:hover {
  background: #f7f7f7;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.google-icon {
  flex-shrink: 0;
}

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

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(245, 240, 225, 0.15);
}

.magic-form .input-group {
  display: flex;
  gap: 8px;
}

.magic-form input[type="email"] {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid rgba(245, 240, 225, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  color: var(--cream);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}

.magic-form input[type="email"]::placeholder {
  color: var(--text-muted);
}

.magic-form input[type="email"]:focus {
  border-color: var(--campfire);
}

.btn-magic {
  background: var(--forest);
  color: var(--cream);
  white-space: nowrap;
  min-width: 140px;
}

.btn-magic:hover {
  background: var(--forest-light);
  transform: translateY(-1px);
}

.magic-msg {
  margin-top: 12px;
  font-size: 0.9rem;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.magic-msg.success {
  color: #a7f3d0;
  background: rgba(39, 174, 96, 0.15);
}

.magic-msg.error {
  color: #fca5a5;
  background: rgba(192, 57, 43, 0.15);
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(245, 240, 225, 0.3);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

.feature {
  text-align: center;
  padding: 20px 12px;
  border-radius: var(--radius);
  background: rgba(245, 240, 225, 0.04);
  border: 1px solid rgba(245, 240, 225, 0.06);
  transition: all var(--transition);
}

.feature:hover {
  background: rgba(245, 240, 225, 0.08);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.feature h3 {
  font-size: 0.95rem;
  color: var(--cream);
  margin-bottom: 4px;
}

.feature p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Landing Sections */
.landing-sections {
  width: 100%;
  margin-bottom: 48px;
}

.landing-section {
  display: flex;
  gap: 16px;
  padding: 20px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: rgba(245, 240, 225, 0.04);
  border: 1px solid rgba(245, 240, 225, 0.06);
  transition: all var(--transition);
}

.landing-section:hover {
  background: rgba(245, 240, 225, 0.08);
  border-color: rgba(232, 115, 26, 0.2);
  transform: translateY(-1px);
}

.section-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
  padding-top: 2px;
}

.section-content h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #f5f0e1;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.section-content p {
  font-size: 0.85rem;
  color: #c4b99a;
  line-height: 1.55;
}

/* Bottom CTA */
.landing-cta {
  width: 100%;
  text-align: center;
  margin-bottom: 40px;
}

.landing-cta .btn-google {
  max-width: 360px;
  margin: 0 auto;
  font-size: 1.05rem;
  padding: 16px 28px;
}

.cta-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.landing-footer {
  position: relative;
  z-index: 2;
  padding: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.landing-footer a {
  color: var(--campfire);
  text-decoration: none;
}

/* ============================================
   App Page
   ============================================ */

.app-page {
  background: var(--cream);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--forest-dark);
  color: var(--cream);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-small {
  font-size: 1.6rem;
}

.app-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--campfire);
}

.user-name {
  font-size: 0.85rem;
  color: var(--sand);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon {
  background: rgba(245, 240, 225, 0.1);
  border: none;
  font-size: 1.2rem;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
  width: auto;
}

.btn-icon:hover {
  background: rgba(245, 240, 225, 0.2);
  transform: scale(1.05);
}

/* Progress bar */
.progress-bar-container {
  padding: 16px 20px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cream);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--cream-dark);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--forest) 0%, var(--success) 100%);
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-light);
  white-space: nowrap;
  min-width: 90px;
  text-align: right;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  background: var(--cream);
  border-bottom: 2px solid var(--cream-dark);
}

.tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  text-align: center;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--forest);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transition: transform var(--transition);
}

.tab.active {
  color: var(--forest);
}

.tab.active::after {
  transform: scaleX(1);
}

.tab:hover {
  color: var(--forest-light);
}

/* Toolbar */
.toolbar {
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: var(--cream);
  position: sticky;
  top: 56px;
  z-index: 50;
  border-bottom: 1px solid var(--cream-dark);
}

.search-box {
  flex: 1;
  min-width: 120px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.search-box input:focus {
  border-color: var(--forest);
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.filter-select {
  padding: 10px 12px;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  cursor: pointer;
  max-width: 180px;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.85rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--cream-dark);
  color: var(--text-light);
  width: auto;
}

.btn-outline:hover {
  border-color: var(--forest);
  color: var(--forest);
  background: rgba(45, 80, 22, 0.05);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border: none;
  width: auto;
}

.btn-danger:hover {
  background: #a93226;
}

/* Checklist */
.content {
  flex: 1;
  padding: 0 20px 40px;
}

.checklist {
  max-width: 720px;
  margin: 0 auto;
}

.category-group {
  margin-bottom: 8px;
}

.category-header {
  position: sticky;
  top: 120px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-top: 16px;
  background: var(--forest-dark);
  color: var(--cream);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
}

.category-header:hover {
  background: var(--forest);
}

.category-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sand);
  background: rgba(245, 240, 225, 0.12);
  padding: 2px 10px;
  border-radius: 12px;
}

.category-items {
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.category-items.collapsed {
  max-height: 0 !important;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-top: 2px;
  background: var(--white);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  animation: item-in 0.3s ease backwards;
}

.checklist-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@keyframes item-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
}

/* Custom checkbox */
.check-wrapper {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.check-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}

.check-mark {
  position: absolute;
  inset: 0;
  border: 2px solid var(--sand);
  border-radius: 6px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-mark::after {
  content: '✓';
  font-size: 14px;
  color: var(--white);
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--transition);
}

.check-wrapper input:checked + .check-mark {
  background: var(--forest);
  border-color: var(--forest);
}

.check-wrapper input:checked + .check-mark::after {
  opacity: 1;
  transform: scale(1);
}

.item-name {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text);
  transition: all var(--transition);
}

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

.btn-delete {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition);
  padding: 4px;
  border-radius: 4px;
  width: auto;
  color: var(--text-muted);
}

.checklist-item:hover .btn-delete {
  opacity: 1;
}

.btn-delete:hover {
  color: var(--danger);
  background: rgba(192, 57, 43, 0.08);
}

/* Delete animation */
.checklist-item.deleting {
  animation: item-out 0.35s ease forwards;
}

@keyframes item-out {
  to {
    opacity: 0;
    transform: translateX(40px);
    max-height: 0;
    padding: 0 16px;
    margin: 0;
  }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 1.1rem;
}

/* ============================================
   Tips
   ============================================ */

.tips-grid {
  max-width: 720px;
  margin: 16px auto 0;
  display: grid;
  gap: 16px;
}

.tip-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border-left: 4px solid var(--campfire);
  transition: all var(--transition);
  animation: tip-in 0.4s ease backwards;
}

.tip-card:nth-child(even) {
  border-left-color: var(--forest);
}

.tip-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

@keyframes tip-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.tip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tip-icon {
  font-size: 1.6rem;
}

.tip-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--campfire);
  background: rgba(232, 115, 26, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.tip-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.tip-text {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fade-in 0.2s ease;
}

.modal-overlay[hidden] {
  display: none !important;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.3s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

.modal h3 {
  color: var(--text);
  margin-bottom: 8px;
}

.modal p {
  color: var(--text-light);
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ============================================
   Reset Modal stacked actions
   ============================================ */

.modal-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-actions-stack .btn {
  width: 100%;
  text-align: center;
}

.btn-forest {
  background: var(--forest);
  color: var(--cream);
  border: none;
  width: auto;
}

[data-theme="dark"] .btn-forest {
  background: #1e3410;
  color: var(--header-text);
}

.btn-forest:hover {
  background: var(--forest-light);
}

/* ============================================
   Onboarding / Travel Type Selection
   ============================================ */

.onboarding-modal {
  max-width: 520px;
}

.onboarding-header {
  text-align: center;
  margin-bottom: 24px;
}

.onboarding-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 8px;
}

.onboarding-header h2 {
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 6px;
}

.onboarding-header p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.travel-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.travel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.travel-card:hover {
  border-color: var(--campfire);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.travel-card:active {
  transform: translateY(0);
}

.travel-emoji {
  font-size: 2.4rem;
}

.travel-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.travel-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

[data-theme="dark"] .travel-card {
  border-color: #3a3e36;
  background: var(--white);
}

[data-theme="dark"] .travel-card:hover {
  border-color: var(--campfire);
  background: #2a2e26;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 600px) {
  .landing-container {
    padding: 40px 16px 32px;
  }

  .landing-hero h1 {
    font-size: 2.2rem;
  }

  .logo-mark {
    font-size: 48px;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .feature {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 12px;
    padding: 14px 16px;
  }

  .feature-icon {
    font-size: 1.6rem;
    margin-bottom: 0;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat {
    padding: 12px 8px;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .landing-section {
    padding: 16px;
  }

  .section-icon {
    font-size: 1.5rem;
    width: 32px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .magic-form .input-group {
    flex-direction: column;
  }

  .btn-magic {
    min-width: unset;
  }

  .app-header {
    padding: 10px 14px;
  }

  .user-name {
    display: none;
  }

  .toolbar {
    top: 52px;
    padding: 12px 14px;
  }

  .toolbar-actions {
    width: 100%;
  }

  .filter-select {
    flex: 1;
  }

  .category-header {
    top: 108px;
  }

  .content {
    padding: 0 14px 32px;
  }

  .btn-delete {
    opacity: 0.6;
  }
}

@media (min-width: 768px) {
  .tips-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   Spots / Map — Responsive Split Layout
   ============================================ */

.spots-content {
  padding: 0 20px 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  /* Prevent body scroll when spots tab is active */
  max-height: calc(100vh - 160px);
}

.spots-content[hidden] { display: none !important; }

.spots-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px 0;
  flex-shrink: 0;
}

.spots-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.spots-filters .filter-select {
  max-width: 120px;
  padding: 8px 8px;
  font-size: 0.82rem;
}

.spots-filters .btn-sm {
  padding: 8px 10px;
  font-size: 0.9rem;
}

.btn-forest {
  background: var(--forest);
  color: #f5f0e1;
  border: none;
  width: auto;
}

[data-theme="dark"] .btn-forest {
  background: #1e3410;
  color: #e4e0d6;
}

.btn-forest:hover {
  background: var(--forest-light);
}

/* Split layout */
.spots-layout {
  display: flex;
  flex: 1;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

.spots-map-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.map-container {
  width: 100%;
  flex: 1;
  min-height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

[data-theme="dark"] .map-container {
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.spots-list-panel {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.spots-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 4px 0;
  flex-shrink: 0;
}

.spots-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  padding-bottom: 16px;
  padding-right: 4px;
}

/* Scrollbar styling */
.spots-list::-webkit-scrollbar { width: 4px; }
.spots-list::-webkit-scrollbar-track { background: transparent; }
.spots-list::-webkit-scrollbar-thumb { background: var(--cream-dark); border-radius: 4px; }

.spot-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: all var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}

.spot-card:hover {
  box-shadow: var(--shadow);
  transform: translateX(2px);
}

.spot-card.active {
  border-left: 3px solid var(--campfire);
}

[data-theme="dark"] .spot-card {
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

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

.spot-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.spot-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
}

.spot-badge-rating {
  background: rgba(232, 115, 26, 0.12);
  color: var(--campfire);
}

.spot-badge-distance {
  background: rgba(45, 80, 22, 0.1);
  color: var(--forest-light);
}

[data-theme="dark"] .spot-badge-distance { color: #7cb35a; }

.spot-badge-category {
  background: rgba(26, 58, 74, 0.1);
  color: var(--sky);
}

[data-theme="dark"] .spot-badge-category {
  color: var(--sand);
  background: rgba(196, 184, 150, 0.1);
}

.spot-amenities {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.spot-amenity { font-size: 0.8rem; opacity: 0.75; }

.spot-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  align-self: stretch;
}

.btn-fav {
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  padding: 4px;
  width: auto;
  line-height: 1;
  display: flex;
  align-items: center;
}

.btn-fav svg { transition: all var(--transition); }

.btn-fav:hover svg { transform: scale(1.15); }

.btn-fav .heart-fill { fill: var(--cream-dark); transition: fill var(--transition); }
[data-theme="dark"] .btn-fav .heart-fill { fill: #3a3e36; }

.btn-fav.active .heart-fill { fill: #e74c3c; }
.btn-fav.active svg { filter: drop-shadow(0 0 4px rgba(231, 76, 60, 0.5)); }

.spot-price {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--success);
}

/* Fullscreen map mode */
.spots-layout.map-fullscreen .spots-list-panel {
  display: none;
}

.spots-layout.map-fullscreen .spots-map-panel {
  flex: 1;
}

/* POI Layer Picker */
.poi-layer-picker {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 0 4px;
}

.poi-layer-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--cream-dark);
  border-radius: 16px;
  background: var(--white);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.poi-layer-btn:hover {
  border-color: var(--text-light);
  color: var(--text);
}

.poi-layer-btn.active {
  color: #fff;
  border-color: transparent;
}

.poi-layer-btn .poi-icon {
  font-size: 0.9rem;
}

.poi-layer-btn .poi-count {
  font-size: 0.65rem;
  opacity: 0.7;
}

[data-theme="dark"] .poi-layer-btn {
  border-color: #3a3e36;
  background: #2a2e26;
}

@media (max-width: 768px) {
  .poi-layer-picker {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 6px 0 2px;
    -webkit-overflow-scrolling: touch;
  }
  .poi-layer-btn { flex-shrink: 0; font-size: 0.7rem; }
}

/* Leaflet popup — clickable */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm) !important;
  cursor: pointer;
}

[data-theme="dark"] .leaflet-popup-content-wrapper {
  background: #2a2e26 !important;
  color: var(--text) !important;
}

[data-theme="dark"] .leaflet-popup-tip {
  background: #2a2e26 !important;
}

.popup-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.popup-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.popup-meta {
  font-size: 0.78rem;
  color: var(--text-light);
}

.popup-arrow {
  font-size: 1.2rem;
  color: var(--campfire);
  flex-shrink: 0;
}

/* Mobile: stack layout */
@media (max-width: 768px) {
  .spots-content { padding: 0 14px; }

  .spots-layout {
    flex-direction: column;
    gap: 8px;
  }

  .spots-map-panel {
    flex: none;
  }

  .map-container {
    height: 45vh;
    min-height: 250px;
    border-radius: var(--radius-sm);
  }

  .spots-list-panel {
    width: 100%;
    max-height: 40vh;
  }

  .spots-layout.map-fullscreen .map-container {
    height: 75vh;
  }

  .spots-layout.map-fullscreen .spots-list-panel {
    display: none;
  }

  .spots-toolbar { padding: 6px 0; gap: 4px; }
  .spots-filters .filter-select { max-width: 100px; font-size: 0.78rem; padding: 6px; }
  .spots-filters .btn-sm { padding: 6px 8px; font-size: 0.82rem; }
  .spot-card { padding: 10px; }
  .spot-name { font-size: 0.85rem; }
}

/* ============================================
   Trips
   ============================================ */

.trips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.trips-list {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.trip-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all var(--transition);
  cursor: pointer;
  border-left: 4px solid var(--forest);
}

.trip-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

[data-theme="dark"] .trip-card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.trip-card-header {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px;
}

.trip-card-name {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
}

.trip-card-dates {
  font-size: 0.8rem; color: var(--text-muted);
}

.trip-card-desc {
  font-size: 0.88rem; color: var(--text-light); margin-bottom: 8px;
}

.trip-card-footer {
  display: flex; gap: 12px; align-items: center; font-size: 0.82rem; color: var(--text-muted);
}

.trip-actions {
  display: flex; gap: 6px; margin-left: auto;
}

.trip-actions .btn-sm { padding: 4px 10px; font-size: 0.78rem; }

/* Trip Detail Modal */
.trip-detail-modal {
  max-width: 600px;
  max-height: 88vh;
  overflow-y: auto;
}

.trip-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.trip-stat {
  background: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  flex: 1;
  min-width: 80px;
}

[data-theme="dark"] .trip-stat { background: #2a2e26; }

.trip-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--campfire);
  line-height: 1;
}

.trip-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Sortable stops list */
.trip-stops-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trip-stop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

[data-theme="dark"] .trip-stop { background: #2a2e26; }


.stop-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stop-reorder {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}

.stop-move {
  background: none;
  border: 1px solid var(--cream-dark);
  color: var(--text-muted);
  font-size: 0.6rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  width: auto;
  transition: all var(--transition);
}

.stop-move:hover {
  background: var(--campfire);
  color: #fff;
  border-color: var(--campfire);
}

[data-theme="dark"] .stop-move {
  border-color: #3a3e36;
}

.stop-move-placeholder {
  display: block;
  height: 18px;
}

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

.stop-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stop-dist {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stop-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  width: auto;
  line-height: 1;
  transition: color var(--transition);
}

.stop-remove:hover { color: var(--danger); }

/* ============================================
   Forms
   ============================================ */

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  margin-bottom: 10px;
  transition: border-color var(--transition);
}

.form-input:focus {
  border-color: var(--campfire);
}

[data-theme="dark"] .form-input {
  background: #2a2e26;
  border-color: #3a3e36;
}

.form-row {
  display: flex; gap: 10px;
}

.form-row .form-input { flex: 1; }

.trip-form { margin-top: 12px; }

/* ============================================
   Spot Detail
   ============================================ */

.spot-detail {
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
}

/* Photo gallery */
.photo-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.photo-gallery:empty {
  display: none;
}

.photo-gallery img {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.photo-gallery img:hover {
  transform: scale(1.03);
}

.photo-upload-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.photo-upload-label {
  cursor: pointer;
  width: auto !important;
}

.photo-upload-status {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Fullscreen photo overlay */
.photo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
}

.spot-detail-header {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px;
}

.spot-detail-header h3 {
  color: var(--text); flex: 1; margin-right: 12px;
}

.btn-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer;
  color: var(--text-muted); line-height: 1; padding: 0; width: auto;
}

.btn-close:hover { color: var(--text); }

.share-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}

.share-bar .btn-sm { width: auto; font-size: 0.82rem; padding: 6px 12px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }

.btn-share-icon { padding: 6px 10px !important; }
.btn-share-icon svg { display: block; }

.trip-add-bar {
  display: flex; gap: 8px; align-items: center; margin-bottom: 14px;
}

.trip-add-bar .filter-select { flex: 1; max-width: none; }

/* Star rating input */
.review-form-section {
  border-top: 1px solid var(--cream-dark);
  padding-top: 14px;
  margin-top: 14px;
  margin-bottom: 14px;
}

.review-form-section h4 {
  color: var(--text); font-size: 0.95rem; margin-bottom: 8px;
}

.star-input {
  display: flex; gap: 4px; margin-bottom: 10px;
}

.star-input .star {
  font-size: 1.8rem; cursor: pointer; color: var(--cream-dark);
  transition: color 0.15s;
}

.star-input .star.active {
  color: var(--campfire);
}

[data-theme="dark"] .star-input .star {
  color: #3a3e36;
}

[data-theme="dark"] .star-input .star.active {
  color: var(--campfire);
}

/* Reviews list */
.reviews-list {
  border-top: 1px solid var(--cream-dark);
  padding-top: 14px;
}

.review-item {
  margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--cream-dark);
}

.review-item:last-child { border-bottom: none; margin-bottom: 0; }

.review-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;
}

.review-author { font-weight: 600; font-size: 0.9rem; color: var(--text); }

.review-stars { font-size: 0.85rem; }

.review-text { font-size: 0.88rem; color: var(--text-light); line-height: 1.5; }

.review-date { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* ============================================
   Add Item Bar
   ============================================ */

.add-item-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 20px 12px;
  max-width: 720px;
  margin: 0 auto;
}

.add-item-bar .form-input {
  margin-bottom: 0;
}

.add-item-bar .btn-sm {
  padding: 10px 16px;
  font-size: 1.1rem;
  line-height: 1;
}

@media (max-width: 600px) {
  .add-item-bar { padding: 0 14px 10px; flex-wrap: wrap; }
  .add-item-bar .filter-select { max-width: none; flex: 1; }
}

/* ============================================
   Stats
   ============================================ */

.stats-container {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}

.stat-card {
  background: var(--white);
  padding: 20px 16px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all var(--transition);
}

[data-theme="dark"] .stat-card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--campfire);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.stats-section {
  margin: 24px 0;
}

.stats-section h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--cream-dark);
}

.stats-countries {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.country-badge {
  background: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

[data-theme="dark"] .country-badge {
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.country-badge strong {
  color: var(--campfire);
  margin-right: 4px;
}

/* Visited button active state */
.btn-visited-active {
  background: var(--forest) !important;
  color: #fff !important;
  border-color: var(--forest) !important;
}

/* ============================================
   Tools / Calculator
   ============================================ */

.tools-container {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 16px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.calc-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

[data-theme="dark"] .calc-card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.calc-card h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--cream-dark);
}

.calc-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
  margin-top: 8px;
}

.calc-input {
  padding: 8px 12px !important;
  font-size: 0.9rem !important;
  margin-bottom: 0 !important;
}

.calc-result {
  margin-top: 14px;
  padding: 12px;
  background: linear-gradient(135deg, var(--forest-dark), var(--forest));
  border-radius: var(--radius-sm);
  color: #f5f0e1;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
}

/* Fuel markers */
.fuel-marker {
  background: #e8731a;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 12px;
  height: 12px;
}

/* Spot of the Day */
.spot-of-day {
  margin: 0 20px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--forest-dark) 0%, var(--forest) 100%);
  border-radius: var(--radius);
  color: #f5f0e1;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 14px;
}

.spot-of-day:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.spot-of-day-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.spot-of-day-content {
  flex: 1; min-width: 0;
}

.spot-of-day-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  margin-bottom: 2px;
}

.spot-of-day-name {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spot-of-day-meta {
  font-size: 0.82rem;
  opacity: 0.8;
  margin-top: 2px;
}

@media (max-width: 600px) {
  .spot-of-day { margin: 0 14px; }
}

/* Sun times info */
.sun-info {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--text-light);
  border-bottom: 1px solid var(--cream-dark);
}

.sun-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Emergency info — collapsible */
.emergency-info {
  margin-bottom: 12px;
  border: 1px solid rgba(212, 68, 42, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-light);
  overflow: hidden;
}

[data-theme="dark"] .emergency-info {
  border-color: rgba(212, 68, 42, 0.2);
}

.emergency-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(212, 68, 42, 0.06);
  cursor: pointer;
  user-select: none;
}

[data-theme="dark"] .emergency-toggle {
  background: rgba(212, 68, 42, 0.08);
}

.emergency-toggle:hover { opacity: 0.85; }

.emergency-title {
  font-weight: 700;
  color: var(--ember);
  font-size: 0.82rem;
}

.emergency-chevron {
  font-size: 0.9rem;
  color: var(--ember);
  transition: transform var(--transition);
}

.emergency-info.open .emergency-chevron { transform: rotate(180deg); }

.emergency-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 14px;
}

.emergency-info.open .emergency-body {
  max-height: 300px;
  padding: 10px 14px;
}

/* Clickable detail links */
.detail-link {
  color: var(--text-light);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
  transition: color var(--transition);
}

.detail-link:hover {
  color: var(--campfire);
}

/* Profile form */
.profile-form .calc-label:first-child { margin-top: 0; }
.profile-form .form-input { margin-bottom: 8px; }

.emergency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 4px 12px;
}

.emergency-item {
  display: flex;
  justify-content: space-between;
}

.emergency-label {
  color: var(--text-muted);
}

.emergency-value {
  font-weight: 600;
  color: var(--text);
}

.emergency-rules {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(212, 68, 42, 0.1);
  font-style: italic;
  color: var(--text-muted);
}

/* Weather widget */
.weather-widget {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 0;
  margin-bottom: 12px;
  border-top: 1px solid var(--cream-dark);
  border-bottom: 1px solid var(--cream-dark);
}

.weather-day {
  flex-shrink: 0;
  text-align: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--white);
  min-width: 80px;
}

.weather-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.weather-icon {
  width: 36px;
  height: 36px;
}

.weather-temp {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.weather-temp-min {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.weather-desc {
  font-size: 0.68rem;
  color: var(--text-light);
  margin-top: 2px;
}

.weather-wind {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Marker cluster theme */
.marker-cluster-small {
  background-color: rgba(45, 80, 22, 0.5);
}
.marker-cluster-small div {
  background-color: rgba(45, 80, 22, 0.8);
}
.marker-cluster-medium {
  background-color: rgba(232, 115, 26, 0.5);
}
.marker-cluster-medium div {
  background-color: rgba(232, 115, 26, 0.8);
}
.marker-cluster-large {
  background-color: rgba(212, 68, 42, 0.5);
}
.marker-cluster-large div {
  background-color: rgba(212, 68, 42, 0.8);
}
.marker-cluster div {
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

/* ============================================
   Print styles
   ============================================ */

@media print {
  .app-header, .toolbar, .tabs, .btn-delete, .progress-bar-container {
    display: none !important;
  }

  .content {
    padding: 0;
  }

  .checklist-item {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #eee;
  }

  .category-header {
    position: static;
    color: #000;
    background: #eee;
  }
}
