/*
 * TravelHaze - Application Styles
 * WCAG AA compliant color palette from UX wireframes
 */

:root {
  --color-primary: #1976D2;
  --color-primary-hover: #1565C0;
  --color-success: #4CAF50;
  --color-error: #D32F2F;
  --color-text: #222;
  --color-text-light: #666;
  --color-text-lighter: #777;
  --color-border: #DDD;
  --color-bg: #F5F5F5;
  --color-white: #fff;
}

/* Category colors (used by context strips, action badges, onboarding icons) */
:root {
  --cat-travel: #1565C0;
  --cat-hotel: #7B1FA2;
  --cat-dining: #E65100;
  --cat-activity: #2E7D32;
  --cat-travel-bg: #E3F2FD;
  --cat-hotel-bg: #F3E5F5;
  --cat-dining-bg: #FFF3E0;
  --cat-activity-bg: #E8F5E9;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

/* Layout */
.nav {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-actions { display: flex; gap: 1rem; align-items: center; }
.nav-user {
  color: var(--color-text-light);
  font-size: 0.875rem;
  text-decoration: none;
}
.nav-user:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Auth */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 1rem;
}

.auth-card {
  background: var(--color-white);
  border-radius: 8px;
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.auth-instructions {
  color: var(--color-text-lighter);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.auth-actions { margin-top: 1rem; }

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--color-text-lighter);
  font-size: 0.8125rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.auth-divider span {
  padding: 0 0.75rem;
}

.password-wrapper {
  position: relative;
}
.password-wrapper .form-input {
  padding-right: 2.75rem;
}
.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-lighter);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.password-toggle:hover {
  color: var(--color-text);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text-light);
}
.auth-footer a {
  color: var(--color-primary);
  font-weight: 600;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
  margin-top: 0.25rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  color: var(--color-text);
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  width: 100%;
}

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

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

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

.btn-danger {
  background: transparent;
  color: var(--color-error);
  border: 1px solid var(--color-error);
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
}

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

/* Flash messages */
.flash-alert {
  background: #fef2f2;
  border: 1px solid var(--color-error);
  color: var(--color-error);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.flash-notice {
  background: #f0fdf4;
  border: 1px solid var(--color-success);
  color: #166534;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* Trips */
.trips-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.trips-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.trips-header h1 { font-size: 1.5rem; }

.empty-state {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--color-text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 0;
  color: var(--color-text);
}

.empty-state p {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.empty-state .btn {
  margin-top: 0.5rem;
}

.trip-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}

.trip-card h2 { font-size: 1.125rem; margin-bottom: 0.25rem; }
.trip-dates { color: var(--color-text-lighter); font-size: 0.875rem; }
.trip-dates-location { color: var(--color-text-light); }

/* CTA Buttons */
.btn-cta {
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  padding: 0.625rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  font-size: 0.9375rem;
  transition: background 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.btn-cta:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.btn-cta-lg {
  padding: 0.875rem 2rem;
  font-size: 1.0625rem;
}

/* Trip card as link */
a.trip-card {
  display: block;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

a.trip-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.trip-description {
  color: var(--color-text-light);
  font-size: 0.875rem;
  margin-top: 0.375rem;
}

.trip-event-count {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-lighter);
}

/* Trip detail */
.trip-detail {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.trip-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.trip-detail-header h1 { font-size: 1.75rem; margin-bottom: 0.25rem; }

.trip-detail-actions { display: flex; gap: 0.5rem; align-items: center; }

.trip-detail-description {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

/* Add event bar */
.trip-add-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.add-event-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.add-event-btn:hover {
  background: var(--color-bg);
}

.email-forward-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-light);
}
.email-forward-hint code {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  user-select: all;
}

/* Category cards (collapsible) */
.category-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.category-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}
.category-card[open] {
  border-color: var(--color-border);
}
.category-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  font-size: 0.9375rem;
  list-style: none;
}
.category-card-header::-webkit-details-marker { display: none; }
.category-card-header:hover {
  background: var(--color-bg);
}
.category-card-icon {
  font-size: 1.125rem;
}
.category-card-label {
  flex: 1;
}
.category-card-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-light);
  background: var(--color-bg);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  min-width: 1.5rem;
  text-align: center;
}
.category-card-chevron {
  color: var(--color-text-lighter);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.category-card[open] .category-card-chevron {
  transform: rotate(180deg);
}
.category-card-body {
  padding: 0 1rem 0.75rem;
}
.category-card-empty {
  color: var(--color-text-light);
  font-size: 0.875rem;
  padding: 0.5rem 0;
}
html.dark .category-card {
  background: var(--color-surface);
}

/* Trip sections (stacked layout) */
.trip-section {
  margin-bottom: 2rem;
}
.trip-section-heading {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  transition: background 0.15s;
}
.section-action-link:hover {
  background: var(--color-bg);
}
.section-empty-state {
  padding: 1.5rem;
  text-align: center;
  color: var(--color-text-light);
}

/* Event type picker (new event form) */
.event-type-picker {
  margin-bottom: 1.5rem;
}
.event-type-picker .form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.event-type-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.event-type-option {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 2px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.event-type-option:hover {
  border-color: var(--color-primary);
  background: var(--color-bg);
}
.event-type-option:active { transform: scale(0.97); }
.event-type-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}
.event-type-icon {
  font-size: 1.125rem;
}
html.dark .event-type-option {
  background: var(--color-surface);
  border-color: var(--color-border);
}
html.dark .event-type-option:hover {
  border-color: var(--color-primary);
  background: var(--color-bg);
}
html.dark .event-type-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

/* Itinerary summary */
.itinerary-summary {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.itinerary-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-lighter);
  margin-bottom: 0.5rem;
}

.itinerary-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.itinerary-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
}

.itinerary-loc-name {
  font-weight: 600;
  color: var(--color-text);
}

.itinerary-loc-dates {
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.itinerary-separator {
  color: var(--color-text-lighter);
  font-size: 0.875rem;
  padding: 0 0.125rem;
}

.itinerary-loc-undated {
  color: var(--color-text-lighter);
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .itinerary-items {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .itinerary-separator {
    display: none;
  }
  .email-forward-hint { flex-wrap: wrap; }
  .event-type-options { gap: 0.375rem; }
  .event-type-option { font-size: 0.8125rem; padding: 0.5rem 0.75rem; }
}

/* Events section */
.events-section { margin-top: 1rem; }

.events-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.events-header h2 { font-size: 1.25rem; }

/* Event card */
a.event-card {
  display: flex;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.625rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  gap: 1.25rem;
  align-items: flex-start;
}

a.event-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.event-card-time {
  min-width: 70px;
  text-align: center;
  flex-shrink: 0;
}

.event-date { display: block; font-weight: 700; font-size: 0.875rem; color: var(--color-primary); }
.event-time { display: block; font-size: 0.75rem; color: var(--color-text-lighter); }

.event-card-body { flex: 1; min-width: 0; }
.event-card-body h3 { font-size: 1rem; margin-bottom: 0.125rem; }
.event-location { color: var(--color-text-light); font-size: 0.8125rem; }
.event-description { color: var(--color-text-lighter); font-size: 0.8125rem; margin-top: 0.25rem; }

.event-card-status { flex-shrink: 0; align-self: center; }

/* Draft event cards */
.event-card-wrapper { position: relative; }

.event-draft a.event-card {
  border-style: dashed;
  border-color: var(--warning, #f59e0b);
  background: var(--draft-bg, #fffbeb);
  opacity: 0.9;
}

.event-draft a.event-card:hover {
  border-color: var(--warning-dark, #d97706);
  opacity: 1;
}

.draft-badge {
  position: absolute;
  top: -0.4rem;
  right: 0.75rem;
  background: var(--warning, #f59e0b);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  z-index: 1;
}

.draft-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem 0.75rem;
  border-top: 1px dashed var(--warning, #f59e0b);
}

html.dark .event-draft a.event-card {
  background: #1c1a00;
  border-color: #6d5200;
}

html.dark .draft-badge {
  background: #b45309;
}

/* Event detail */
.event-detail {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.event-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.event-detail-header h1 { font-size: 1.75rem; margin-bottom: 0.25rem; }
.event-detail-trip { margin-bottom: 0.25rem; font-size: 0.875rem; }
.event-detail-trip a { color: var(--color-primary); text-decoration: none; }
.event-detail-actions { flex-shrink: 0; align-self: center; }
.event-detail-trip a:hover { text-decoration: underline; }

.event-detail-actions { display: flex; gap: 0.5rem; align-items: center; }

/* Desktop: show inline actions, hide overflow menu */
.event-actions-inline { display: flex; gap: 0.5rem; align-items: center; }
.overflow-menu { display: none; }

/* Overflow menu dropdown */
.overflow-menu {
  position: relative;
}
.overflow-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 0.5rem;
}
.overflow-menu summary::-webkit-details-marker { display: none; }
.overflow-menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 160px;
  z-index: 20;
  overflow: hidden;
}
html.dark .overflow-menu-dropdown {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.overflow-menu-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.9375rem;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
}
.overflow-menu-item:last-child { border-bottom: none; }
.overflow-menu-item:hover, .overflow-menu-item:focus {
  background: var(--color-bg);
}
.overflow-menu-item-danger {
  color: var(--color-error);
}

/* Duplicate banner */
.duplicate-banner {
  background: var(--color-primary-light, #e3f2fd);
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
html.dark .duplicate-banner {
  background: rgba(66, 165, 245, 0.15);
}

.event-detail-body {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.event-detail-meta { display: flex; gap: 2rem; margin-bottom: 1rem; flex-wrap: wrap; }
.meta-item { min-width: 120px; }
.meta-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-lighter); margin-bottom: 0.25rem; }
.meta-detail { font-size: 0.8125rem; color: var(--color-text-light); margin-top: 0.25rem; }

.event-detail-description { border-top: 1px solid var(--color-border); padding-top: 1rem; }

/* Forms */
.form-container {
  max-width: 560px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.form-container h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-group-half { flex: 1; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

.form-errors {
  background: #fef2f2;
  border: 1px solid var(--color-error);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: var(--color-error);
  font-size: 0.875rem;
}

.form-errors h2 { font-size: 0.875rem; margin-bottom: 0.5rem; }
.form-errors ul { margin-left: 1.25rem; }

/* Back link */
.back-link {
  margin-top: 2rem;
  font-size: 0.875rem;
}

.back-link a {
  color: var(--color-primary);
  text-decoration: none;
}

.back-link a:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-lighter);
  font-size: 0.8125rem;
  margin-top: 3rem;
  border-top: 1px solid var(--color-border);
}

/* Focus styles (WCAG AA) */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Skip to main content (accessibility) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: var(--color-white);
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* Trip Invitations */
.trip-invitations-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--color-white);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.invitations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.invitations-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.invitations-list {
  margin-bottom: 2rem;
}

.invitations-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.invitation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--color-bg);
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

.invitation-email {
  font-weight: 500;
  color: var(--color-text);
}

.invitation-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.invitation-status.status-pending {
  background: #FFF3CD;
  color: #856404;
}

.invitation-status.status-accepted {
  background: #D4EDDA;
  color: #155724;
}

.invitation-status.status-declined {
  background: #F8D7DA;
  color: #721C24;
}

.empty-text {
  color: var(--color-text-light);
  font-style: italic;
  margin: 1rem 0;
}

.invite-form-container {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
}

.invite-form-container h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.invite-form {
  max-width: 400px;
}

.invite-form .form-group {
  margin-bottom: 1rem;
}

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

/* === Category Sections === */
.category-section {
  border-radius: 8px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.section-divider {
  border: none;
  border-top: 2px solid var(--color-border);
  margin: 1.25rem 0;
}

.cat-travel { border-left: 4px solid var(--cat-travel); }
.cat-hotel { border-left: 4px solid var(--cat-hotel); }
.cat-dining { border-left: 4px solid var(--cat-dining); }
.cat-activity { border-left: 4px solid var(--cat-activity); }

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

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

.category-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.category-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  background: var(--color-bg);
}

.category-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cat-travel .category-title { color: var(--cat-travel); }
.cat-hotel .category-title { color: var(--cat-hotel); }
.cat-dining .category-title { color: var(--cat-dining); }
.cat-activity .category-title { color: var(--cat-activity); }

.category-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-lighter);
  background: var(--color-bg);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
}

.category-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-sm {
  font-size: 0.8125rem;
  padding: 0.3125rem 0.75rem;
}

.chevron {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
  transition: transform 0.2s;
}

.category-body {
  padding: 0 1.25rem 1rem;
}

.collapsed .category-body { display: none; }
.collapsed .chevron { transform: rotate(-90deg); }

.empty-section {
  padding: 1.25rem;
  text-align: center;
  color: var(--color-text-lighter);
  font-size: 0.875rem;
}

.empty-section a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.empty-section a:hover { text-decoration: underline; }

/* === Upload Zone === */
.upload-zone {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border: 2px dashed var(--color-border);
  border-radius: 8px;
  background: var(--color-white);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1.5rem;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--color-primary);
  background: #EBF5FB;
}

.upload-zone.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* Page-wide drop target feedback */
.trip-detail.page-drag-over {
  outline: 3px dashed var(--color-primary);
  outline-offset: -3px;
  border-radius: 8px;
  background: rgba(25, 118, 210, 0.03);
}

html.dark .trip-detail.page-drag-over {
  background: rgba(66, 165, 245, 0.05);
}

.upload-icon { font-size: 1.25rem; }

.upload-zone-text {
  font-size: 0.875rem;
  color: var(--color-text-light);
  line-height: 1.4;
}

.upload-browse {
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.upload-formats {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
}

/* === Paste Email Section === */
.paste-section {
  margin-top: 0.75rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
}

.paste-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--card-bg, #f9fafb);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text, #374151);
  text-align: left;
}

.paste-toggle:hover {
  background: var(--hover-bg, #f3f4f6);
}

.paste-toggle-icon {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.paste-body {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
}

.paste-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 100px;
  background: var(--input-bg, #fff);
  color: var(--text, #1a1a1a);
  box-sizing: border-box;
}

.paste-textarea:focus {
  outline: none;
  border-color: var(--primary, #4f46e5);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.paste-textarea::placeholder {
  color: var(--text-muted, #9ca3af);
}

.paste-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* === Import Divider === */
.import-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--color-text-lighter, #9ca3af);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.import-divider::before,
.import-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--color-border, #e5e7eb);
}

/* === People Tab === */
.people-tab {
  padding: 0.5rem 0;
}
.people-invite-bar {
  margin-bottom: 1rem;
}
.people-invite-bar .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.people-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.invite-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-white);
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}
.invite-heading {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}
.invite-form { margin: 0; }
.invite-input-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.invite-email-input { flex: 1; min-width: 180px; }
.invite-role-toggle {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
}
.role-option {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  color: var(--color-text-light);
}
.role-option input[type="radio"] { margin: 0; }
.pending-role {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
}
.people-section {
  margin-bottom: 1.5rem;
}
.people-section-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-lighter);
  margin: 0 0 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--color-border);
}
.pending-invites { margin-top: 0.75rem; }
.pending-label {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0 0.25rem;
}
.pending-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pending-item {
  font-size: 0.85rem;
  color: #888;
  padding: 0.2rem 0;
}
html.dark .invite-section {
  background: #1e1e1e;
  border-color: #444;
}
html.dark .pending-label { color: #aaa; }
html.dark .pending-item { color: #999; }
@media (prefers-color-scheme: dark) {
  .invite-section { background: #1e1e1e; border-color: #444; }
  .pending-label { color: #aaa; }
  .pending-item { color: #999; }
}

.person-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1rem;
}

.person-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.person-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.person-avatar-pending {
  background: #999;
  opacity: 0.7;
}
.person-card-pending {
  opacity: 0.75;
}
.status-badge.status-pending {
  background: #f59e0b;
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
html.dark .status-badge.status-pending {
  background: #d97706;
}
@media (prefers-color-scheme: dark) {
  .status-badge.status-pending { background: #d97706; }
}

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

.person-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.person-email {
  font-size: 0.8rem;
  color: var(--color-text-lighter);
  margin: 0;
}

.person-role {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
  margin: 0.125rem 0 0;
}

.person-events {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.person-events-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin: 0 0 0.5rem;
}

.person-event-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.person-event-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.person-event-category {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--color-text-lighter);
}

.person-event-category svg {
  width: 16px;
  height: 16px;
}

.person-event-item a {
  color: var(--color-primary);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-event-item a:hover {
  text-decoration: underline;
}

.person-event-date {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
  flex-shrink: 0;
}

.person-no-events {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-lighter);
  font-style: italic;
}

.person-remove-btn,
.person-remove-delete-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
}

.person-remove-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-shrink: 0;
  margin-left: auto;
}

.person-card-header .btn-sm {
  flex-shrink: 0;
  margin-left: auto;
}
.person-delete-btn {
  background: none;
  border: none;
  padding: 0.375rem;
  cursor: pointer;
  color: var(--color-text-lighter);
  border-radius: 6px;
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.person-delete-btn:hover {
  color: var(--color-error);
  background: rgba(239, 83, 80, 0.1);
}

.person-card-pending .person-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

html.dark .person-card {
  background: #1e1e1e;
  border-color: #333;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

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

/* === Progress Tracker === */
.progress-container {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: opacity 0.5s;
}

.progress-item.progress-fade {
  opacity: 0;
}

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

.progress-file-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.progress-status {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
  font-weight: 500;
}

.progress-done .progress-status { color: #166534; }
.progress-error .progress-status { color: var(--color-error); }
html.dark .progress-done .progress-status { color: #66BB6A; }

.progress-bar-track {
  height: 6px;
  background: var(--color-bg);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-bar-fill.indeterminate {
  width: 100% !important;
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    rgba(25, 118, 210, 0.3) 50%,
    var(--color-primary) 100%
  );
  background-size: 200% 100%;
  animation: indeterminate 1.5s ease-in-out infinite;
}

html.dark .progress-bar-fill.indeterminate {
  background: linear-gradient(
    90deg,
    #42A5F5 0%,
    rgba(66, 165, 245, 0.3) 50%,
    #42A5F5 100%
  );
  background-size: 200% 100%;
}

.progress-bar-fill.done {
  background: var(--color-success);
}

.progress-bar-fill.error {
  background: var(--color-error);
}

@keyframes indeterminate {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Duplicate Warning === */
.duplicate-warning {
  background: #FFF3CD;
  border: 1px solid #FFCA28;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: #856404;
  line-height: 1.4;
}

html.dark .duplicate-warning {
  background: #3d3000;
  border-color: #6d5200;
  color: #FFD54F;
}

/* === Passenger List (in modal) === */
.passenger-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.passenger-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.passenger-matched {
  background: var(--success-bg, #ecfdf5);
  cursor: pointer;
}

.passenger-matched:hover {
  background: var(--success-bg-hover, #d1fae5);
}

.passenger-unmatched {
  background: var(--muted-bg, #f3f4f6);
}

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

.passenger-match-badge {
  font-size: 0.75rem;
  color: var(--success-text, #065f46);
  margin-left: auto;
}

.passenger-unmatched-badge {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  margin-left: auto;
  font-style: italic;
}

.passenger-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary, #4f46e5);
}

html.dark .passenger-matched {
  background: #064e3b;
}

html.dark .passenger-matched:hover {
  background: #065f46;
}

html.dark .passenger-unmatched {
  background: #1f2937;
}

html.dark .passenger-match-badge {
  color: #6ee7b7;
}

/* === Confirmation Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal {
  background: var(--color-white);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
  font-size: 1.125rem;
  margin: 0;
}

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

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

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
}

.modal-category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: white;
}

.cat-badge-travel { background: var(--cat-travel); }
.cat-badge-hotel { background: var(--cat-hotel); }
.cat-badge-dining { background: var(--cat-dining); }
.cat-badge-activity { background: var(--cat-activity); }

/* === Participant Avatars === */
.participant-avatars {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.participant-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.625rem;
  font-weight: 700;
  color: white;
  background: var(--color-primary);
}

.participant-overflow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--color-text-lighter);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

/* === Toast Notification === */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: toastIn 0.3s ease;
}

.toast.success {
  background: #166534;
  color: white;
}

.toast.error {
  background: var(--color-error);
  color: white;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

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

/* === Trip Onboarding === */
.onboarding {
  margin-top: 1rem;
}

.onboarding-welcome {
  text-align: center;
  margin-bottom: 1.5rem;
}

.onboarding-welcome h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.onboarding-welcome p {
  color: var(--color-text-light);
  font-size: 0.9375rem;
}

.onboarding-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .onboarding-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

.onboarding-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.25rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.onboarding-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 12px rgba(25, 118, 210, 0.1);
}

.onboarding-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.onboarding-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboarding-card-icon svg {
  width: 22px;
  height: 22px;
}

.onboarding-card-icon.flights { background: #E3F2FD; color: #1565C0; }
.onboarding-card-icon.hotels { background: #F3E5F5; color: #7B1FA2; }
.onboarding-card-icon.dining { background: #FFF3E0; color: #E65100; }
.onboarding-card-icon.activities { background: #E8F5E9; color: #2E7D32; }

.onboarding-card-title {
  font-size: 1rem;
  font-weight: 700;
}

.onboarding-card-desc {
  color: var(--color-text-light);
  font-size: 0.875rem;
  margin-bottom: 0.875rem;
  line-height: 1.4;
}

.onboarding-card-cta { margin-bottom: 0.75rem; }
.onboarding-card-cta .btn-cta { font-size: 0.875rem; padding: 0.5rem 1.25rem; }

.onboarding-card-cta-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.onboarding-card-cta-group .btn-cta { font-size: 0.8125rem; padding: 0.5rem 1rem; }
.btn-cta-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-cta-secondary:hover { background: var(--color-primary); color: #fff; }

.affiliate-placeholder {
  border-top: 1px dashed var(--color-border);
  padding-top: 0.625rem;
  font-size: 0.8125rem;
  color: var(--color-text-lighter);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.affiliate-placeholder svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Completed card state */
.onboarding-card.completed { padding: 0.875rem 1.25rem; }

.onboarding-card-completed-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.onboarding-card-completed-header .onboarding-card-completed-text { flex: 1; }

.onboarding-card-completed-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboarding-card-completed-check svg { width: 14px; height: 14px; }
.onboarding-card-completed-text { font-size: 0.9375rem; font-weight: 600; }


.onboarding-card-event-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.75rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary, #6b7280);
}
.dark .onboarding-card-event-list { color: #9ca3af; }
.onboarding-card-event-list li {
  padding: 0.2rem 0;
}

/* Footer */
.onboarding-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.onboarding-progress {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
}

.onboarding-progress strong { color: var(--color-success); }

.onboarding-skip {
  color: var(--color-text-lighter);
  font-size: 0.8125rem;
  text-decoration: none;
}
.onboarding-skip:hover {
  color: var(--color-text-light);
  text-decoration: underline;
}

/* Invited context */
.invited-context {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.invited-context-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #E3F2FD;
  color: #1565C0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.invited-context-icon svg { width: 22px; height: 22px; }

.invited-context-text h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.invited-context-text p {
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.invited-context-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.375rem;
}

.invited-context-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-text-lighter);
  font-size: 0.8125rem;
}

.invited-context-meta-item svg { width: 14px; height: 14px; opacity: 0.6; }

.invited-add-intro {
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

/* Member banner */
.member-banner {
  background: #E3F2FD;
  border: 1px solid #BBDEFB;
  border-radius: 8px;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.member-banner-text {
  font-size: 0.875rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.member-banner-text svg {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.member-banner .btn-cta {
  font-size: 0.8125rem;
  padding: 0.375rem 1rem;
  white-space: nowrap;
}

/* Onboarding dark mode */
html.dark .onboarding-card:hover {
  box-shadow: 0 2px 12px rgba(66, 165, 245, 0.1);
}
html.dark .onboarding-card-icon.flights { background: #1a2a3a; color: #64B5F6; }
html.dark .onboarding-card-icon.hotels { background: #2a1a3a; color: #CE93D8; }
html.dark .onboarding-card-icon.dining { background: #3a2a1a; color: #FFB74D; }
html.dark .onboarding-card-icon.activities { background: #1a3a1a; color: #81C784; }
html.dark .invited-context-icon { background: #1a2a3a; color: #64B5F6; }
html.dark .member-banner { background: #1a2a3a; border-color: #2a3a4a; }

@media (prefers-color-scheme: dark) {
  .onboarding-card-icon.flights { background: #1a2a3a; color: #64B5F6; }
  .onboarding-card-icon.hotels { background: #2a1a3a; color: #CE93D8; }
  .onboarding-card-icon.dining { background: #3a2a1a; color: #FFB74D; }
  .onboarding-card-icon.activities { background: #1a3a1a; color: #81C784; }
  .invited-context-icon { background: #1a2a3a; color: #64B5F6; }
  .member-banner { background: #1a2a3a; border-color: #2a3a4a; }
}

/* === Dark Mode === */
html.dark {
  --color-primary: #42A5F5;
  --color-primary-hover: #64B5F6;
  --color-success: #66BB6A;
  --color-error: #EF5350;
  --color-text: #E0E0E0;
  --color-text-light: #BDBDBD;
  --color-text-lighter: #9E9E9E;
  --color-border: #424242;
  --color-bg: #121212;
  --color-white: #1E1E1E;
}

html.dark body {
  background: #121212;
}

html.dark .nav {
  background: #1E1E1E;
  border-bottom-color: #333;
}

html.dark .upload-zone:hover,
html.dark .upload-zone.drag-over {
  background: #1a2a3a;
}

html.dark .section-divider {
  border-top-color: #4b5563;
}

html.dark .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

html.dark .modal {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

html.dark .form-input {
  background: #2a2a2a;
  color: #E0E0E0;
  border-color: #424242;
}

html.dark .form-input:focus {
  border-color: #42A5F5;
  box-shadow: 0 0 0 2px rgba(66, 165, 245, 0.2);
}

html.dark .invitation-item {
  background: #2a2a2a;
}

html.dark .btn-danger:hover { background: #2d1a1a; }
html.dark .flash-alert { background: #2d1a1a; }
html.dark .flash-notice { background: #1a2d1a; }
html.dark .form-errors { background: #2d1a1a; }

/* === Theme Switcher === */
.theme-switcher-container {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.theme-switcher {
  display: inline-flex;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.25rem;
  gap: 0.125rem;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-lighter);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.theme-btn.active {
  background: var(--color-white);
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

html.dark .theme-btn.active {
  background: #3a3a3a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.theme-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* === Responsive === */
@media (max-width: 600px) {
  .form-row { flex-direction: column; gap: 0; }
  .trip-detail-header { flex-direction: column; }
  .trips-header { flex-wrap: wrap; gap: 0.5rem; }
  .events-header { flex-direction: column; gap: 0.75rem; align-items: flex-start; }

  .invitation-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .invitation-status {
    margin-top: 0.5rem;
  }

  .modal {
    max-height: 85vh;
    margin: 0;
    border-radius: 12px 12px 0 0;
    align-self: flex-end;
  }

  .upload-zone {
    flex-direction: column;
    text-align: center;
  }

  .category-header-right .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

/* ── Processing Overlay ── */
.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.processing-overlay-content {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 3rem 4rem;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  max-width: 420px;
  width: 90%;
}

.processing-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.5rem;
  border: 5px solid var(--border, #e0e0e0);
  border-top-color: var(--primary, #4f46e5);
  border-radius: 50%;
  animation: processing-spin 0.8s linear infinite;
}

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

.processing-file-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text, #1a1a1a);
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.processing-step {
  font-size: 1rem;
  color: var(--text-muted, #666);
  margin-bottom: 0.5rem;
}

.processing-counter {
  font-size: 0.85rem;
  color: var(--text-muted, #666);
  margin-top: 0.5rem;
}

/* ── Mail.app Hint Banner ── */
.mail-app-hint {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  max-width: 520px;
  width: 90%;
  animation: mail-hint-slide-in 0.3s ease-out;
}

.mail-app-hint-content {
  position: relative;
  background: var(--card-bg, #fff);
  border: 2px solid var(--warning, #f59e0b);
  border-radius: 12px;
  padding: 1.25rem 2.5rem 1.25rem 1.25rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text, #1a1a1a);
}

.mail-app-hint-content strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.mail-app-hint-content p {
  margin: 0.25rem 0 0.5rem;
}

.mail-app-hint-content ol {
  margin: 0;
  padding-left: 1.25rem;
}

.mail-app-hint-content li {
  margin-bottom: 0.35rem;
}

.mail-app-hint-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted, #666);
  line-height: 1;
  padding: 0.25rem;
}

.mail-app-hint-fade {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

@keyframes mail-hint-slide-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-1rem); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===================================================================
   TRIP PIVOT VIEWS
   View switcher, filter bar, grid views, compact cards, status badges
   =================================================================== */

/* Category Color Variables */
:root {
  --color-cat-travel: #3B82F6;
  --color-cat-hotel: #8B5CF6;
  --color-cat-dining: #F59E0B;
  --color-cat-activity: #10B981;
  --color-status-idea: #94A3B8;
  --color-status-tentative: #F59E0B;
  --color-status-confirmed: #10B981;
  --color-status-cancelled: #EF4444;
}

html.dark {
  --color-cat-travel: #60A5FA;
  --color-cat-hotel: #A78BFA;
  --color-cat-dining: #FBBF24;
  --color-cat-activity: #34D399;
  --color-status-idea: #64748B;
  --color-status-tentative: #FBBF24;
  --color-status-confirmed: #34D399;
  --color-status-cancelled: #F87171;
}

/* === View Switcher === */
.view-switcher {
  display: flex;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0.75rem;
}

.view-tab {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-light);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.view-tab:hover {
  background: rgba(25, 118, 210, 0.08);
  color: var(--color-text);
}

.view-tab.active {
  background: var(--color-primary);
  color: #fff;
}

.view-tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.view-tab-icon { font-size: 1rem; line-height: 1; }

html.dark .view-switcher {
  background: #1E1E1E;
}

html.dark .view-tab:hover {
  background: rgba(66, 165, 245, 0.12);
}

/* === Filter Bar === */
.filter-bar {
  margin-bottom: 1rem;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--color-text-light);
  padding: 0.375rem 0;
}

.filter-toggle:hover { color: var(--color-text); }

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.filter-chevron {
  font-size: 0.625rem;
  transition: transform 0.2s;
}

.filter-groups {
  display: none;
  gap: 1.5rem;
  padding: 0.75rem 0;
  flex-wrap: wrap;
}

.filter-groups.expanded {
  display: flex;
}

.filter-group label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-lighter);
  margin-bottom: 0.375rem;
}

.filter-pills {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--color-text-light);
  transition: all 0.15s;
}

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

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

.filter-pill.cat-travel.active { background: var(--color-cat-travel); border-color: var(--color-cat-travel); }
.filter-pill.cat-hotel.active { background: var(--color-cat-hotel); border-color: var(--color-cat-hotel); }
.filter-pill.cat-dining.active { background: var(--color-cat-dining); border-color: var(--color-cat-dining); }
.filter-pill.cat-activity.active { background: var(--color-cat-activity); border-color: var(--color-cat-activity); }

.filter-pill-person {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.filter-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.5rem;
  font-weight: 600;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
}

/* === View Panels === */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: viewFadeIn 0.15s ease;
}

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

/* === Calendar View === */
.calendar-day {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.calendar-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 1rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 0.9375rem;
}

.calendar-day-count {
  color: var(--color-text-lighter);
  font-weight: 400;
  font-size: 0.8125rem;
}

.calendar-day-body {
  padding: 0.5rem;
}

.calendar-empty {
  padding: 0.75rem 1rem;
  color: var(--color-text-lighter);
  font-size: 0.875rem;
  font-style: italic;
  text-align: center;
}

.calendar-add-link {
  color: var(--color-primary);
  text-decoration: none;
  font-style: normal;
  font-size: 0.8125rem;
}

.calendar-add-link:hover { text-decoration: underline; }

html.dark .calendar-day {
  background: #1E1E1E;
}

html.dark .calendar-day-header {
  background: #252525;
}

/* === Grid Views (shared) === */
.grid-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-white);
}

.grid-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.grid-table th,
.grid-table td {
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  vertical-align: top;
  min-width: 160px;
}

.grid-table th {
  background: var(--color-bg);
  font-weight: 600;
  font-size: 0.8125rem;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.grid-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 90px;
}

.grid-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--color-white);
  min-width: 90px;
}

/* Zebra striping */
.grid-table tbody tr:nth-child(even) td {
  background: var(--color-bg);
}
.grid-table tbody tr:nth-child(even) td:first-child {
  background: var(--color-bg);
}

.grid-row-label {
  font-weight: 600;
  font-size: 0.8125rem;
}

.grid-date-label {
  text-align: center;
}

.grid-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.5625rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  margin-right: 4px;
  vertical-align: middle;
}

html.dark .grid-scroll {
  background: #1E1E1E;
}

html.dark .grid-table th {
  background: #252525;
}

html.dark .grid-table td:first-child {
  background: #1E1E1E;
}

html.dark .grid-table tbody tr:nth-child(even) td {
  background: #252525;
}

html.dark .grid-table tbody tr:nth-child(even) td:first-child {
  background: #252525;
}

/* Category dot */
.cat-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.cat-dot.travel { background: var(--color-cat-travel); }
.cat-dot.hotel { background: var(--color-cat-hotel); }
.cat-dot.dining { background: var(--color-cat-dining); }
.cat-dot.activity { background: var(--color-cat-activity); }

/* === Compact Event Cards === */
.compact-card {
  display: block;
  padding: 0.375rem 0.5rem;
  border-left: 3px solid transparent;
  border-radius: 4px;
  margin-bottom: 0.375rem;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.8125rem;
  transition: box-shadow 0.15s;
  position: relative;
  background: var(--color-white);
  cursor: pointer;
}

.compact-card:last-child { margin-bottom: 0; }

.compact-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 10;
}

.compact-card.cat-travel { border-left-color: var(--color-cat-travel); }
.compact-card.cat-hotel { border-left-color: var(--color-cat-hotel); }
.compact-card.cat-dining { border-left-color: var(--color-cat-dining); }
.compact-card.cat-activity { border-left-color: var(--color-cat-activity); }

.compact-card.cancelled { opacity: 0.6; }
.compact-card.cancelled .cc-title { text-decoration: line-through; }

.cc-title {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-time {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-text-light);
}

.cc-status {
  display: inline-block;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.625rem;
  font-weight: 600;
  margin-top: 2px;
}

.cc-status.idea { background: #F1F5F9; color: var(--color-status-idea); }
.cc-status.tentative { background: #FFFBEB; color: #92400E; }
.cc-status.cancelled { background: #FEF2F2; color: var(--color-status-cancelled); }

html.dark .cc-status.idea { background: rgba(148,163,184,0.15); }
html.dark .cc-status.tentative { background: rgba(251,191,36,0.15); color: var(--color-status-tentative); }
html.dark .cc-status.cancelled { background: rgba(248,113,113,0.15); }

/* Hover expand */
.cc-expand {
  display: none;
  padding-top: 0.375rem;
  font-size: 0.75rem;
}

.compact-card.expanded .cc-expand {
  display: block;
}

.cc-location {
  display: block;
  color: var(--color-text-light);
}

.cc-time-range {
  display: block;
  color: var(--color-text-lighter);
  font-size: 0.6875rem;
}

.cc-participants {
  display: flex;
  gap: 3px;
  margin-top: 0.25rem;
}

.mini-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.5rem;
  font-weight: 600;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
}

.mini-avatar-overflow {
  font-size: 0.5rem;
  color: var(--color-text-lighter);
  line-height: 18px;
}

html.dark .compact-card {
  background: #1E1E1E;
}

html.dark .compact-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Shared event badge */
.shared-badge {
  font-size: 0.625rem;
  color: var(--color-text-lighter);
  margin-top: 2px;
}

/* Empty cell in grid views */
.empty-cell {
  color: var(--color-text-lighter);
  font-size: 0.75rem;
  font-style: italic;
  padding: 0.5rem 0;
  text-align: center;
}

.empty-cell .add-link {
  display: block;
  margin-top: 0.25rem;
  color: var(--color-primary);
  text-decoration: none;
  font-style: normal;
  font-size: 0.6875rem;
  opacity: 0;
  transition: opacity 0.15s;
}

td:hover .empty-cell .add-link,
.empty-cell:hover .add-link {
  opacity: 1;
}

/* Cell overflow */
.cell-overflow {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-primary);
  cursor: pointer;
  padding-top: 0.25rem;
}

/* === Status Badges (full event cards) === */
.status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.status-idea { background: #F1F5F9; color: var(--color-status-idea); border: 1px solid var(--color-status-idea); }
.status-tentative { background: #FFFBEB; color: #92400E; border: 1px solid var(--color-status-tentative); }
.status-confirmed { background: #F0FDF4; color: var(--color-status-confirmed); border: 1px solid var(--color-status-confirmed); }
.status-cancelled { background: #FEF2F2; color: var(--color-status-cancelled); border: 1px solid var(--color-status-cancelled); }

html.dark .status-idea { background: rgba(148,163,184,0.15); }
html.dark .status-tentative { background: rgba(251,191,36,0.15); color: var(--color-status-tentative); }
html.dark .status-confirmed { background: rgba(52,211,153,0.15); }
html.dark .status-cancelled { background: rgba(248,113,113,0.15); }

.status-switcher { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.status-switcher-btn { all: unset; cursor: pointer; }
.status-badge.status-inactive { opacity: 0.4; transition: opacity 0.15s; }
.status-switcher-btn:hover .status-badge.status-inactive { opacity: 0.85; }
.status-badge.status-active { opacity: 1; box-shadow: 0 0 0 2px var(--color-primary); }

.event-card-wrapper.event-cancelled { opacity: 0.6; }
.event-card-wrapper.event-cancelled h3 { text-decoration: line-through; }

/* === Empty State (no events) === */
.empty-state-views {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-light);
}

.empty-state-views .empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state-views h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.empty-state-views p {
  margin-bottom: 1rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  .view-tab { padding: 0.4rem 0.625rem; font-size: 0.75rem; }
  .view-tab-label { display: none; }
  .filter-groups { flex-direction: column; gap: 0.75rem; }
  .grid-table th, .grid-table td { min-width: 140px; padding: 0.375rem; }

  /* On mobile: always show compact card expand content (no hover) */
  .cc-expand { display: block; }

  /* Always show add links on mobile */
  .empty-cell .add-link { opacity: 1; }
}

/* === Out-of-Range Events === */
.out-of-range-section {
  border-left: 3px dashed var(--color-border);
  padding-left: 0.75rem;
  margin-bottom: 1rem;
  opacity: 0.85;
}

.out-of-range-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  padding: 0.5rem 0;
  margin-bottom: 0.25rem;
}

.calendar-day-out-of-range {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(0, 0, 0, 0.02) 10px,
    rgba(0, 0, 0, 0.02) 20px
  );
}

.out-of-range-label {
  color: var(--color-text-light) !important;
  font-style: italic;
}

.out-of-range-divider .range-divider-cell {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  padding: 0.5rem;
  background: var(--color-bg, #f8f9fa);
  border-top: 2px dashed var(--color-border);
  border-bottom: 2px dashed var(--color-border);
}

.filter-pill.filter-range {
  border-style: dashed;
}

html.dark .calendar-day-out-of-range {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.02) 10px,
    rgba(255, 255, 255, 0.02) 20px
  );
}

html.dark .out-of-range-divider .range-divider-cell {
  background: #1a1a1a;
}

/* === Out-of-Range Import Banner === */
.out-of-range-banner {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: 480px;
  width: 90%;
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: bannerSlideIn 0.3s ease;
}

@keyframes bannerSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.out-of-range-banner-fade {
  opacity: 0;
  transition: opacity 0.3s;
}

.out-of-range-banner-content {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #92400e;
}

.out-of-range-banner-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

html.dark .out-of-range-banner {
  background: #3d2e00;
  border-color: #b45309;
}

html.dark .out-of-range-banner-content {
  color: #fcd34d;
}

/* ============================================================
   TAB NAVIGATION — Bottom (mobile) + Top (desktop)
   ============================================================ */

/* --- Mobile bottom tab bar --- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  padding: 0.25rem 0;
  padding-bottom: calc(0.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.375rem 0.25rem;
  text-decoration: none;
  color: var(--color-text-lighter);
  font-size: 0.625rem;
  font-weight: 500;
  position: relative;
  touch-action: manipulation;
  transition: color 0.15s;
  min-width: 0;
  flex: 1;
}

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

.tab-item:hover {
  color: var(--color-primary);
}

.tab-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-icon svg {
  width: 100%;
  height: 100%;
}

.tab-label {
  line-height: 1;
}

.tab-badge {
  position: absolute;
  top: 0;
  right: 0.25rem;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 700;
  min-width: 1rem;
  height: 1rem;
  line-height: 1rem;
  text-align: center;
  border-radius: 0.5rem;
  padding: 0 0.25rem;
}

/* --- Desktop top tab bar --- */
.desktop-tab-bar {
  display: none;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.25rem;
  user-select: none;
}

.desktop-tab {
  padding: 0.625rem 1.25rem;
  text-decoration: none;
  color: var(--color-text-light);
  font-weight: 600;
  font-size: 0.9375rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  position: relative;
}

.desktop-tab:hover {
  color: var(--color-primary);
}

.desktop-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.desktop-tab .tab-badge {
  position: static;
  display: inline-block;
  margin-left: 0.375rem;
  vertical-align: middle;
  font-size: 0.6875rem;
  min-width: 1.125rem;
  height: 1.125rem;
  line-height: 1.125rem;
}

/* --- Person filter dropdown --- */
.person-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.person-filter-label {
  font-size: 0.8125rem;
  color: var(--color-text-light);
  white-space: nowrap;
}

.person-filter-select {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-white);
  min-width: 10rem;
}

/* --- Today tab --- */
/* Itinerary day groupings (pre-trip chronological view) */
.itinerary-day { margin-bottom: 1.5rem; }
.itinerary-day:last-child { margin-bottom: 0; }
.itinerary-day-header {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--color-border);
}

.today-header {
  margin-bottom: 1rem;
}

.today-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.today-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.today-nav-btn:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.today-date {
  text-align: center;
}

.today-date h2 {
  font-size: 1.125rem;
  margin: 0;
}

.today-badge {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Date group headers (category tabs) --- */
.date-group {
  margin-bottom: 1.25rem;
}

.date-header {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-light);
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Tab empty states --- */
.tab-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-light);
}

.tab-empty-state p {
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* --- FAB (Floating Action Button) --- */
.fab {
  position: fixed;
  bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
  right: 1.25rem;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
  z-index: 99;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.fab:hover {
  background: var(--color-primary-hover);
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(25, 118, 210, 0.5);
}

.fab:active {
  transform: scale(0.95);
}

/* --- Desktop only / Mobile only utilities --- */
.desktop-only {
  display: block;
}

/* --- Category icon in event detail --- */
.category-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  vertical-align: middle;
  margin-right: 0.25rem;
}

.category-icon svg {
  width: 100%;
  height: 100%;
}

.category-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* --- Status toggle on event detail --- */
.event-detail-status {
  margin-top: 1.5rem;
}

.status-toggle {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.375rem;
}

.status-toggle-form {
  display: inline;
}

.status-pill {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  transition: background 0.15s, border-color 0.15s;
  touch-action: manipulation;
}

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

.status-pill.active {
  cursor: default;
}

.status-pill.status-idea.active {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #475569;
}

.status-pill.status-tentative.active {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
}

.status-pill.status-confirmed.active {
  background: #d1fae5;
  border-color: #34d399;
  color: #065f46;
}

.status-pill.status-cancelled.active {
  background: #fee2e2;
  border-color: #f87171;
  color: #991b1b;
}

/* --- Event detail extra meta --- */
.event-detail-meta-extra {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.event-detail-participants {
  margin-top: 1.5rem;
}

.participant-avatars-lg .participant-avatar {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.75rem;
}

/* Participant list (event detail) */
.participant-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.5rem;
}
.participant-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
}
.participant-name {
  flex: 1;
  font-size: 0.875rem;
}
.participant-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-lighter);
  background: var(--color-bg);
  padding: 0.0625rem 0.375rem;
  border-radius: 4px;
  margin-left: 0.25rem;
}
.participant-email {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-lighter);
}
.participant-remove-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--color-text-lighter);
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.participant-remove-btn:hover {
  color: var(--color-error);
  background: rgba(239, 83, 80, 0.1);
}
.participant-empty {
  color: var(--color-text-lighter);
  font-size: 0.875rem;
  padding: 0.25rem 0;
}

/* Participant add section */
.participant-add-section {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.participant-add-form {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.participant-add-guest {
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}
.participant-invite-toggle {
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
}
.form-input-sm {
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
}

/* Participant toggles (event form) */
.participant-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.participant-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
}
.participant-toggle:hover {
  background: var(--color-bg);
}
.participant-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.participant-toggle-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.625rem;
  font-weight: 700;
  color: white;
  background: var(--color-primary);
}
.participant-toggle-name {
  flex: 1;
}

/* Guest entry rows (event form) */
.guest-entries {
  margin-top: 0.5rem;
}
.guest-entry {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
}
.guest-entry .form-input-sm {
  flex: 1;
}
.guest-remove-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--color-text-lighter);
  cursor: pointer;
  padding: 0 0.375rem;
  line-height: 1;
}
.guest-remove-btn:hover {
  color: var(--color-error);
}
.btn-add-guest {
  background: none;
  border: 1px dashed var(--color-border);
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-primary);
  cursor: pointer;
  margin-top: 0.375rem;
}
.btn-add-guest:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
}

/* --- PWA / Touch polish --- */
body {
  overscroll-behavior: none;
}

button, a, [role="tab"], [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button, a {
  touch-action: manipulation;
}

nav[role="tablist"] {
  user-select: none;
}

/* Bottom tab bar spacing — add padding so content isn't hidden behind it */
.trip-detail {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

/* ============================================================
   RESPONSIVE: Mobile (<768px) vs Desktop (>=768px)
   ============================================================ */

@media (max-width: 767px) {
  .desktop-tab-bar { display: none !important; }
  .desktop-only { display: none !important; }
  .tab-bar { display: flex; }

  .trip-detail-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .trip-detail-actions {
    align-self: flex-start;
  }

  .trip-detail {
    max-width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .event-detail,
  .form-container {
    padding-bottom: 5rem;
  }

  /* Mobile sticky header */
  .event-detail-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--color-bg);
    padding: 0.75rem 1rem;
    margin: 0 -0.75rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .event-detail-header.is-stuck {
    border-bottom-color: var(--color-border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }

  html.dark .event-detail-header.is-stuck {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  }

  .event-detail-header h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100vw - 80px);
    font-size: 1.25rem;
  }

  /* Hide inline actions, show overflow menu on mobile */
  .event-actions-inline { display: none; }
  .overflow-menu { display: block; }
}

@media (min-width: 768px) {
  .tab-bar { display: none !important; }
  .desktop-tab-bar { display: flex; }

  .fab {
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
  }

  .trip-detail {
    padding-bottom: 2rem;
  }
}

/* ============================================================
   DARK MODE — Tab navigation + new components
   ============================================================ */

html.dark .tab-bar {
  background: #1e1e1e;
  border-top-color: #333;
}

html.dark .tab-item {
  color: #888;
}

html.dark .tab-item.active {
  color: #64b5f6;
}

html.dark .tab-badge {
  background: #1565c0;
}

html.dark .itinerary-summary {
  background: var(--color-white);
  border-color: var(--color-border);
}

html.dark .desktop-tab-bar {
  border-bottom-color: #333;
}

html.dark .desktop-tab {
  color: #888;
}

html.dark .desktop-tab:hover {
  color: #64b5f6;
}

html.dark .desktop-tab.active {
  color: #64b5f6;
  border-bottom-color: #64b5f6;
}

html.dark .person-filter-select {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

html.dark .today-nav-btn {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

html.dark .today-nav-btn:hover {
  background: #333;
  border-color: #64b5f6;
  color: #64b5f6;
}

html.dark .date-header {
  color: #aaa;
  border-bottom-color: #333;
}

html.dark .fab {
  background: #1565c0;
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.5);
}

html.dark .fab:hover {
  background: #0d47a1;
  box-shadow: 0 6px 16px rgba(21, 101, 192, 0.6);
}

html.dark .status-pill {
  background: #2a2a2a;
  border-color: #444;
  color: #ccc;
}

html.dark .status-pill:hover {
  border-color: #64b5f6;
}

html.dark .status-pill.status-idea.active {
  background: rgba(148, 163, 184, 0.2);
  border-color: #64748b;
  color: #94a3b8;
}

html.dark .status-pill.status-tentative.active {
  background: rgba(251, 191, 36, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
}

html.dark .status-pill.status-confirmed.active {
  background: rgba(52, 211, 153, 0.2);
  border-color: #10b981;
  color: #34d399;
}

html.dark .status-pill.status-cancelled.active {
  background: rgba(248, 113, 113, 0.2);
  border-color: #ef4444;
  color: #f87171;
}

/* ============================================================
   VIEW TRANSITIONS
   ============================================================ */

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.2s;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

/* --- Landing: Nav --- */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}
.landing-nav.scrolled {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
html.dark .landing-nav.scrolled {
  background: rgba(15,17,23,0.85);
}
.landing-nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.landing-nav.scrolled .landing-nav-logo { color: var(--color-primary); }
.landing-nav-links { display: flex; gap: 2rem; align-items: center; }
.landing-nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.landing-nav.scrolled .landing-nav-links a { color: var(--color-text-light); }
.landing-nav-links a:hover { color: #fff; }
.landing-nav.scrolled .landing-nav-links a:hover { color: var(--color-text); }
.landing-nav-cta {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 600 !important;
  transition: background 0.2s !important;
  border: 1px solid rgba(255,255,255,0.2);
}
.landing-nav-cta:hover { background: rgba(255,255,255,0.25) !important; }
.landing-nav.scrolled .landing-nav-cta {
  background: var(--color-primary) !important;
  color: #fff !important;
  border-color: var(--color-primary) !important;
}

/* --- Landing: Hero --- */
.landing-hero {
  background: linear-gradient(135deg, #0D1B3E 0%, #1A3A6B 40%, #2563EB 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
html.dark .landing-hero {
  background: linear-gradient(135deg, #0A0E1A 0%, #111827 40%, #1E3A5F 100%);
}
.landing-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(59,130,246,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, rgba(139,92,246,0.1) 0%, transparent 50%);
  animation: landing-drift 20s ease-in-out infinite;
}
@keyframes landing-drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-3%, 2%); }
}
.landing-hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}
.landing-hero-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.landing-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.landing-gradient-text {
  background: linear-gradient(135deg, #60A5FA, #A78BFA, #F472B6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-hero-story {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.8;
}
.landing-hero-story strong { color: rgba(255,255,255,0.95); }
.landing-hero-story + .landing-hero-story { margin-top: 1rem; }
.landing-hero-punchline {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  margin-top: 1.5rem;
}
.landing-hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}
.landing-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: #fff;
  color: #1A1A2E;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.landing-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.2); }
.landing-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: transparent;
  color: rgba(255,255,255,0.9);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  text-decoration: none;
}
.landing-btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.4); }
.landing-hero-sub {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* --- Landing: Section Shared --- */
.landing-page section { padding: 5rem 2rem; }
.landing-section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3.5rem;
}
.landing-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2563EB;
  margin-bottom: 0.75rem;
}
html.dark .landing-label { color: #3B82F6; }
.landing-section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--color-text);
}
html.dark .landing-section-header h2 { color: #E8EAF0; }
.landing-section-header p {
  font-size: 1.05rem;
  color: var(--color-text-light);
  line-height: 1.7;
}
html.dark .landing-section-header p { color: #9CA3B4; }

/* --- Landing: Before/After --- */
.landing-before-after { background: var(--color-bg); }
html.dark .landing-before-after { background: #0F1117; }
.landing-ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  max-width: 900px;
  margin: 0 auto;
}
.landing-ba-col h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-border);
}
.landing-ba-before h3 { color: #DC2626; border-color: #FCA5A5 !important; }
.landing-ba-after h3 { color: #059669; border-color: #6EE7B7 !important; }
html.dark .landing-ba-before h3 { color: #EF4444; border-color: rgba(239,68,68,0.3) !important; }
html.dark .landing-ba-after h3 { color: #10B981; border-color: rgba(16,185,129,0.3) !important; }
.landing-ba-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}
.landing-ba-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.15rem;
}
.landing-ba-icon-bad { background: #FEE2E2; color: #DC2626; }
.landing-ba-icon-good { background: #D1FAE5; color: #059669; }
html.dark .landing-ba-icon-bad { background: rgba(239,68,68,0.12); color: #EF4444; }
html.dark .landing-ba-icon-good { background: rgba(16,185,129,0.12); color: #10B981; }
.landing-ba-item p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.6;
}
html.dark .landing-ba-item p { color: #9CA3B4; }
.landing-ba-item strong { color: var(--color-text); }
html.dark .landing-ba-item strong { color: #E8EAF0; }

/* --- Landing: How It Works --- */
.landing-how { background: #F0F1F3; }
html.dark .landing-how { background: #13151F; }
.landing-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  max-width: 960px;
  margin: 0 auto;
}
.landing-step { text-align: center; position: relative; }
.landing-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 1.75rem;
  right: -1.25rem;
  width: 2.5rem;
  height: 2px;
  background: var(--color-border);
}
.landing-step-number {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #2563EB;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
html.dark .landing-step-number { background: #3B82F6; }
.landing-step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}
html.dark .landing-step h3 { color: #E8EAF0; }
.landing-step p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.6;
  max-width: 260px;
  margin: 0 auto;
}
html.dark .landing-step p { color: #9CA3B4; }

/* --- Landing: Features --- */
.landing-features { background: #F4F6F9; }
html.dark .landing-features { background: #13151F; }
.landing-panels {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.landing-panel {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1.5rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.3s, transform 0.3s;
  align-items: start;
}
html.dark .landing-panel {
  background: #1A1D27;
  border-color: #2A2D3A;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.landing-panel:hover {
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
html.dark .landing-panel:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.4); }
.landing-panel-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(37,99,235,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
html.dark .landing-panel-icon { background: rgba(59,130,246,0.12); }
.landing-panel h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}
html.dark .landing-panel h3 { color: #E8EAF0; }
.landing-panel p {
  font-size: 0.93rem;
  color: var(--color-text-light);
  line-height: 1.65;
}
html.dark .landing-panel p { color: #9CA3B4; }

/* --- Landing: Empathy --- */
.landing-empathy {
  background: linear-gradient(135deg, #0D1B3E 0%, #1A3A6B 40%, #2563EB 100%);
  text-align: center;
  padding: 5rem 2rem;
  position: relative;
  overflow: hidden;
}
html.dark .landing-empathy {
  background: linear-gradient(135deg, #0A0E1A 0%, #111827 40%, #1E3A5F 100%);
}
.landing-empathy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(139,92,246,0.1) 0%, transparent 70%);
}
.landing-empathy-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}
.landing-empathy-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.landing-empathy h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.landing-empathy p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.8;
  margin-bottom: 1rem;
}
.landing-highlight-pill {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.75rem;
}

/* --- Landing: CTA --- */
.landing-cta {
  background: var(--color-bg);
  text-align: center;
  padding: 6rem 2rem;
}
html.dark .landing-cta { background: #0F1117; }
.landing-cta h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  color: var(--color-text);
}
html.dark .landing-cta h2 { color: #E8EAF0; }
.landing-cta p {
  font-size: 1.05rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
html.dark .landing-cta p { color: #9CA3B4; }
.landing-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2.5rem;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.landing-cta-btn:hover { background: #1D4ED8; transform: translateY(-1px); }
html.dark .landing-cta-btn { background: #3B82F6; }
html.dark .landing-cta-btn:hover { background: #60A5FA; }

/* --- Landing: Footer --- */
.landing-footer {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 2rem;
  text-align: center;
}
html.dark .landing-footer {
  background: #1A1D27;
  border-color: #2A2D3A;
}
.landing-footer-content { max-width: 960px; margin: 0 auto; }
.landing-footer-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: #2563EB;
  margin-bottom: 0.5rem;
}
html.dark .landing-footer-brand { color: #3B82F6; }
.landing-footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.landing-footer-links a {
  color: var(--color-text-lighter);
  text-decoration: none;
  font-size: 0.85rem;
}
.landing-footer-links a:hover { color: var(--color-text); }
html.dark .landing-footer-links a { color: #6B7280; }
html.dark .landing-footer-links a:hover { color: #E8EAF0; }
.landing-footer-copy {
  font-size: 0.8rem;
  color: var(--color-text-lighter);
}
html.dark .landing-footer-copy { color: #6B7280; }

/* --- Landing: Responsive --- */
@media (max-width: 768px) {
  .landing-nav-links a:not(.landing-nav-cta) { display: none; }
  .landing-ba-grid { grid-template-columns: 1fr; }
  .landing-steps { grid-template-columns: 1fr; gap: 2rem; }
  .landing-step:not(:last-child)::after { display: none; }
  .landing-panel { grid-template-columns: 1fr; }
  .landing-panel-icon { width: 44px; height: 44px; font-size: 1.25rem; }
}

/* === Admin Dashboard === */
.admin-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-header h1 { font-size: 1.5rem; }
.admin-meta { color: var(--color-text-lighter); font-size: 0.875rem; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--color-white);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-lighter);
  margin-bottom: 0.375rem;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
}

.metric-value.metric-success { color: var(--color-success); }
.metric-value.metric-error { color: var(--color-error); }
.metric-value.metric-muted { color: var(--color-text-lighter); }

.metric-sub {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
  margin-top: 0.25rem;
}

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

.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.activity-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-lighter);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.activity-table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.activity-table tr:last-child td { border-bottom: none; }

.status-badge.status-authenticated { background: #e8f5e9; color: #2e7d32; }
html.dark .status-badge.status-authenticated { background: #1a2d1a; color: #66BB6A; }

.status-badge.status-expired { background: #fef2f2; color: #c62828; }
html.dark .status-badge.status-expired { background: #2d1a1a; color: #EF5350; }

.email-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

@media (max-width: 600px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-container { padding: 1rem; }
}

@media (max-width: 400px) {
  .metrics-grid { grid-template-columns: 1fr; }
}

/* --- Event Type Details --- */

/* Confirmation number highlight */
.confirmation-highlight {
  background: #EEF5FF;
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}
html.dark .confirmation-highlight {
  background: #1E293B;
  border-left-color: #60A5FA;
}
.confirmation-number {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Mono", monospace;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
html.dark .confirmation-number {
  color: #60A5FA;
}
.copy-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: var(--color-text-light);
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  transition: all 0.15s ease;
}
.copy-btn:hover {
  background: var(--color-bg);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
html.dark .copy-btn {
  border-color: #4B5563;
  color: #9CA3AF;
}
html.dark .copy-btn:hover {
  background: #374151;
  color: #60A5FA;
  border-color: #60A5FA;
}
.copy-btn-success {
  color: var(--color-success) !important;
  border-color: var(--color-success) !important;
}

.copy-icon-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--color-text-lighter);
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.copy-icon-btn:hover {
  color: var(--color-primary);
  background: var(--color-bg);
}

/* Calendar subscribe */
.calendar-subscribe {
  margin-bottom: 1rem;
}
.calendar-subscribe-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-white);
  cursor: pointer;
  font-family: inherit;
}
.calendar-subscribe-btn:hover {
  background: var(--color-bg);
}
.calendar-popover {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  max-width: 540px;
}
.calendar-popover-desc {
  font-size: 0.8125rem;
  color: var(--color-text-light);
  margin-bottom: 0.625rem;
}
.calendar-url-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.calendar-url-input {
  flex: 1;
  font-family: monospace;
  font-size: 0.75rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  min-width: 0;
}
.calendar-url-input:focus {
  border-color: var(--color-primary);
}
.calendar-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.calendar-open-btn:hover {
  background: var(--color-primary-hover);
}
.calendar-popover-footer {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-light);
}
html.dark .calendar-popover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
@media (prefers-color-scheme: dark) {
  .calendar-popover { box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
}
@media (max-width: 480px) {
  .calendar-url-row { flex-wrap: wrap; }
  .calendar-url-input { width: 100%; }
}

/* Type-specific detail section on show view */
.event-detail-type {
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
  margin-bottom: 0.5rem;
}
html.dark .event-detail-type {
  border-top-color: #374151;
}

/* Detail list (dl/dt/dd) */
.detail-list {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.95rem;
}
.detail-list dt {
  color: var(--color-text-light);
  font-weight: 500;
}
.detail-list dd {
  color: var(--color-text);
  font-weight: 400;
}
html.dark .detail-list dt { color: #9CA3AF; }
html.dark .detail-list dd { color: #E5E7EB; }

@media (max-width: 480px) {
  .detail-list {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .detail-list dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
  }
  .detail-list dt:first-child { margin-top: 0; }
}

/* Route visual (airport codes with arrow) */
.route-visual {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.airport-code {
  display: inline-block;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Mono", monospace;
  font-weight: 600;
  font-size: 0.9rem;
}
html.dark .airport-code {
  background: #1F2937;
  border-color: #4B5563;
  color: #E5E7EB;
}
.route-arrow {
  color: var(--color-text-light);
}

/* Detail fieldset in forms */
.detail-fieldset {
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
html.dark .detail-fieldset {
  border-color: #374151;
}
.detail-fieldset legend {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0 0.5rem;
  color: var(--color-text);
}
html.dark .detail-fieldset legend {
  color: #E5E7EB;
}

/* New event notification banner */
.new-event-notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  margin: 0 1rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  animation: slideDown 0.3s ease-out;
}
.new-event-notification-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  min-width: 0;
}
.new-event-notification-content span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.new-event-notification-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.new-event-notification .btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}
.new-event-notification .btn-primary {
  background: #fff;
  color: var(--color-primary);
  font-weight: 600;
}
.new-event-notification .btn-primary:hover {
  background: #f0f0f0;
}
.new-event-notification .btn-dismiss {
  background: transparent;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}
.new-event-notification .btn-dismiss:hover {
  opacity: 0.7;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* All-day event toggle */
.all-day-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
}
.all-day-toggle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary);
}

/* All-day time label on event cards */
.event-time-allday {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
html.dark .event-time-allday {
  color: #60A5FA;
}

/* Remove member dialog */
.btn-error {
  background: var(--color-error);
  color: #fff;
  border-color: var(--color-error);
}
.btn-error:hover {
  background: #B71C1C;
  border-color: #B71C1C;
}

.remove-member-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 480px;
  width: calc(100% - 2rem);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  background: var(--color-white);
  color: var(--color-text);
}
.remove-member-dialog::backdrop {
  background: rgba(0,0,0,0.5);
}
.dialog-header {
  padding: 1.25rem 1.5rem 0.75rem;
}
.dialog-header h2 {
  font-size: 1.125rem;
  margin: 0;
}
.dialog-body {
  padding: 0 1.5rem;
}
.dialog-body p {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
}
.event-list {
  list-style: none;
  margin-bottom: 1rem;
}
.event-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg);
  border-radius: 6px;
  font-size: 0.8125rem;
  margin-bottom: 0.375rem;
}
.event-category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-text-light);
}
.event-category-dot--travel { background: #1976D2; }
.event-category-dot--hotel { background: #7B1FA2; }
.event-category-dot--dining { background: #E65100; }
.event-category-dot--activity { background: #2E7D32; }
.event-list-title {
  font-weight: 500;
}
.event-list-meta {
  font-size: 0.6875rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dialog-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem 1.25rem;
  flex-wrap: wrap;
}

html.dark .remove-member-dialog {
  background: #1E1E1E;
}
html.dark .event-list li {
  background: #2a2a2a;
}
html.dark .btn-error:hover {
  background: #E53935;
  border-color: #E53935;
}
@media (prefers-color-scheme: dark) {
  .remove-member-dialog { background: #1E1E1E; }
  .event-list li { background: #2a2a2a; }
  .btn-error:hover { background: #E53935; border-color: #E53935; }
}

/* === Context Strips (continuation indicators for multi-day events) === */
.continuation-section {
  margin-bottom: 0.75rem;
}

.continuation-strip {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 1rem;
  background: var(--color-bg);
  border-radius: 4px;
  border-left: 3px solid var(--color-text-lighter);
  text-decoration: none;
  color: var(--color-text-light);
  font-size: 0.8125rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
  transition: background 0.15s ease;
}

.continuation-strip:last-child {
  margin-bottom: 0;
}

.continuation-strip:hover {
  background: var(--color-border);
}

.continuation-strip:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Category-specific left borders */
.continuation-strip--travel { border-left-color: var(--cat-travel); }
.continuation-strip--hotel  { border-left-color: var(--cat-hotel); }
.continuation-strip--dining { border-left-color: var(--cat-dining); }
.continuation-strip--activity { border-left-color: var(--cat-activity); }

/* Category-specific hover backgrounds */
.continuation-strip--travel:hover { background: var(--cat-travel-bg); }
.continuation-strip--hotel:hover  { background: var(--cat-hotel-bg); }
.continuation-strip--dining:hover { background: var(--cat-dining-bg); }
.continuation-strip--activity:hover { background: var(--cat-activity-bg); }

.continuation-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
}

.continuation-icon svg {
  width: 16px;
  height: 16px;
}

.continuation-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continuation-chevron {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-left: 0.5rem;
  color: var(--color-text-lighter);
}

.continuation-chevron svg {
  width: 12px;
  height: 12px;
}

/* Cancelled/draft status on context strips */
.continuation-strip.event-cancelled {
  opacity: 0.6;
}

.continuation-strip.event-cancelled .continuation-text {
  text-decoration: line-through;
}

.continuation-strip.event-draft {
  border-left-style: dashed;
  opacity: 0.9;
}

/* === Action Badges (CHECK-IN, DEPARTURE, etc. on multi-day event cards) === */
.action-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.25rem;
}

.action-badge--travel {
  background: rgba(21, 101, 192, 0.15);
  color: var(--cat-travel);
}

.action-badge--hotel {
  background: rgba(123, 31, 162, 0.15);
  color: var(--cat-hotel);
}

.action-badge--dining {
  background: rgba(230, 81, 0, 0.15);
  color: var(--cat-dining);
}

.action-badge--activity {
  background: rgba(46, 125, 50, 0.15);
  color: var(--cat-activity);
}

/* Flight connection line (e.g., "from Miami, Tue 11p") */
.event-card-connection {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
  margin-top: 0.125rem;
}

/* Dark mode: category colors and badge overrides */
html.dark {
  --cat-travel: #64B5F6;
  --cat-hotel: #CE93D8;
  --cat-dining: #FFB74D;
  --cat-activity: #81C784;
  --cat-travel-bg: #1a2a3a;
  --cat-hotel-bg: #2a1a3a;
  --cat-dining-bg: #3a2a1a;
  --cat-activity-bg: #1a3a1a;
}

html.dark .action-badge--travel {
  background: rgba(100, 181, 246, 0.15);
}
html.dark .action-badge--hotel {
  background: rgba(206, 147, 216, 0.15);
}
html.dark .action-badge--dining {
  background: rgba(255, 183, 77, 0.15);
}
html.dark .action-badge--activity {
  background: rgba(129, 199, 132, 0.15);
}

@media (prefers-color-scheme: dark) {
  :root {
    --cat-travel: #64B5F6;
    --cat-hotel: #CE93D8;
    --cat-dining: #FFB74D;
    --cat-activity: #81C784;
    --cat-travel-bg: #1a2a3a;
    --cat-hotel-bg: #2a1a3a;
    --cat-dining-bg: #3a2a1a;
    --cat-activity-bg: #1a3a1a;
  }
  .action-badge--travel { background: rgba(100, 181, 246, 0.15); }
  .action-badge--hotel { background: rgba(206, 147, 216, 0.15); }
  .action-badge--dining { background: rgba(255, 183, 77, 0.15); }
  .action-badge--activity { background: rgba(129, 199, 132, 0.15); }
}

/* === First-Time User Onboarding (Empty State) === */
.onboarding-empty-state {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

/* Staggered fade-in animation */
.onboarding-empty-state > * {
  opacity: 0;
  transform: translateY(12px);
  animation: onboarding-es-fade-in 0.4s ease forwards;
}
.onboarding-empty-state > *:nth-child(1) { animation-delay: 0s; }
.onboarding-empty-state > *:nth-child(2) { animation-delay: 0.1s; }
.onboarding-empty-state > *:nth-child(3) { animation-delay: 0.15s; }
.onboarding-empty-state > *:nth-child(4) { animation-delay: 0.25s; }
.onboarding-empty-state > *:nth-child(5) { animation-delay: 0.35s; }

@keyframes onboarding-es-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-empty-state > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* --- Welcome --- */
.onboarding-es-welcome {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.onboarding-es-welcome h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.onboarding-es-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-light);
  max-width: 480px;
  margin: 0 auto;
}

/* --- Steps --- */
.onboarding-es-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  list-style: none;
  padding: 1.5rem 0;
  max-width: 660px;
  margin: 0 auto;
}

.onboarding-es-step {
  text-align: center;
  position: relative;
}

.onboarding-es-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 22px;
  left: calc(50% + 30px);
  width: calc(100% - 60px);
  height: 2px;
  background: var(--color-border);
}

.onboarding-es-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 auto 0.75rem;
}

.onboarding-es-step h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.onboarding-es-step p {
  font-size: 0.85rem;
  color: var(--color-text-light);
  max-width: 220px;
  margin: 0 auto;
}

/* --- CTA --- */
.onboarding-es-cta {
  text-align: center;
  padding: 1.5rem 0 2rem;
}

.onboarding-es-cta-sub {
  font-size: 0.8125rem;
  color: var(--color-text-lighter);
  margin-top: 0.5rem;
}

/* --- Preview --- */
.onboarding-es-preview {
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
  padding: 1.5rem;
  opacity: 0.85;
  pointer-events: none;
  position: relative;
}

.onboarding-es-preview-header {
  margin-bottom: 1rem;
}

.onboarding-es-example-badge {
  display: inline-block;
  background: var(--color-text-lighter);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.onboarding-es-preview-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.onboarding-es-members-label {
  font-size: 0.8125rem;
  color: var(--color-text-lighter);
  margin-left: 0.25rem;
}

/* Use real .event-card layout but as div (non-clickable) */
.onboarding-es-preview .event-card {
  display: flex;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.625rem;
  gap: 1.25rem;
  align-items: flex-start;
}

/* Remove hover effects in preview */
.onboarding-es-preview .event-card:hover {
  border-color: var(--color-border);
  box-shadow: none;
}

/* --- Invitation Note --- */
.onboarding-es-invite-note {
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-lighter);
  padding: 1.5rem 0 2rem;
}

/* --- Dark Mode --- */
html.dark .onboarding-es-step-number { background: #3B82F6; }
html.dark .onboarding-es-welcome h2 { color: #E8EAF0; }
html.dark .onboarding-es-step h2 { color: #E8EAF0; }
html.dark .onboarding-es-step p { color: #9CA3B4; }
html.dark .onboarding-es-example-badge { background: #6B7280; }

@media (prefers-color-scheme: dark) {
  html:not(.light) .onboarding-es-step-number { background: #3B82F6; }
  html:not(.light) .onboarding-es-welcome h2 { color: #E8EAF0; }
  html:not(.light) .onboarding-es-step h2 { color: #E8EAF0; }
  html:not(.light) .onboarding-es-step p { color: #9CA3B4; }
  html:not(.light) .onboarding-es-example-badge { background: #6B7280; }
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .onboarding-es-welcome h2 { font-size: 1.5rem; }
  .onboarding-es-steps { grid-template-columns: 1fr; gap: 1.25rem; }
  .onboarding-es-step:not(:last-child)::after { display: none; }
  .onboarding-es-step-number { width: 40px; height: 40px; font-size: 0.9rem; }
  .onboarding-es-preview {
    margin: 0 -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

@media (max-width: 480px) {
  .onboarding-es-cta .btn-cta-lg { width: 100%; }
}

/* ============================================================
   iOS-NATIVE MOBILE STYLES
   Apple HIG: full-width content, SF Pro typography, flat lists,
   grouped inset sections, generous touch targets, hairline separators.
   Desktop layout is completely unchanged.
   ============================================================ */

@media (max-width: 767px) {

  /* --- iOS System Font Stack & Base Typography --- */
  body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
    font-size: 1.0625rem; /* 17px — iOS Body */
    line-height: 1.47; /* iOS default line height */
    -webkit-text-size-adjust: 100%;
  }

  /* --- iOS Large Title (h1) --- */
  .trips-header h1,
  .trip-detail-header h1,
  .form-container h1 {
    font-size: 2.125rem; /* 34px — iOS Large Title */
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.15;
  }

  .event-detail-header h1 {
    font-size: 1.375rem; /* 22px — iOS Title 2 (fits sticky header) */
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: normal;
    max-width: none;
  }

  /* --- iOS Title 2 (h2 section headings) --- */
  .events-header h2,
  .trip-section-heading,
  .onboarding-welcome h2,
  .invitations-header h2,
  .category-title {
    font-size: 1.375rem; /* 22px — iOS Title 2 */
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  /* --- iOS Caption / Section Headers (meta labels) --- */
  .meta-label {
    font-size: 0.8125rem; /* 13px — iOS Caption 1 */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-lighter);
  }

  /* --- iOS Body text --- */
  .event-detail-body p,
  .event-detail-description p,
  .trip-detail-description p,
  .trip-description,
  .dialog-body p {
    font-size: 1.0625rem; /* 17px — iOS Body */
    line-height: 1.47;
  }

  /* --- Full-Width Containers (remove max-width, edge-to-edge) --- */
  .trips-container {
    max-width: 100%;
    margin: 0;
    padding: 1rem;
  }

  .trip-detail {
    max-width: 100%;
    margin: 0;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .event-detail {
    max-width: 100%;
    margin: 0;
    padding: 0 1rem 5rem; /* 5rem bottom for tab bar */
  }

  .form-container {
    max-width: 100%;
    margin: 0;
    padding: 1rem 1rem 5rem; /* 5rem bottom for tab bar */
  }

  .admin-container {
    max-width: 100%;
    padding: 1rem;
  }

  /* --- Trip List: Flat rows with hairline separators --- */
  .trips-header {
    margin-bottom: 1rem;
    padding: 0;
  }

  .trips-list {
    background: var(--color-white);
    border-radius: 10px;
    overflow: hidden;
  }

  a.trip-card {
    border: none;
    border-radius: 0;
    border-bottom: 0.5px solid var(--color-border);
    margin-bottom: 0;
    padding: 0.875rem 1rem;
    box-shadow: none;
  }

  a.trip-card:last-child {
    border-bottom: none;
  }

  a.trip-card:hover {
    border-color: var(--color-border);
    box-shadow: none;
  }

  a.trip-card:active {
    background: var(--color-bg);
  }

  .trip-card h2 {
    font-size: 1.0625rem; /* 17px iOS Body */
    font-weight: 600;
  }

  .trip-dates {
    font-size: 0.9375rem; /* 15px iOS Subhead */
    color: var(--color-text-light);
  }

  .trip-event-count {
    font-size: 0.8125rem; /* 13px iOS Caption */
  }

  /* --- Trip Detail Header --- */
  .trip-detail-header {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
  }

  .trip-detail-header h1 {
    margin-bottom: 0.125rem;
  }

  .trip-detail-description {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0 0 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 0.5px solid var(--color-border);
  }

  /* --- Itinerary Summary: grouped inset style --- */
  .itinerary-summary {
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
  }

  /* --- Event Cards: flat rows, no cards --- */
  a.event-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0.75rem 0;
    margin-bottom: 0;
    gap: 1rem;
    border-bottom: 0.5px solid var(--color-border);
  }

  a.event-card:hover {
    border-color: var(--color-border);
    box-shadow: none;
  }

  a.event-card:active {
    background: var(--color-bg);
  }

  .event-card-wrapper:last-child a.event-card {
    border-bottom: none;
  }

  .event-card-body h3 {
    font-size: 1.0625rem; /* 17px iOS Body */
    font-weight: 600;
  }

  .event-location {
    font-size: 0.9375rem; /* 15px iOS Subhead */
  }

  .event-description {
    font-size: 0.9375rem;
  }

  .event-date {
    font-size: 0.9375rem; /* 15px */
    font-weight: 700;
  }

  .event-time {
    font-size: 0.8125rem; /* 13px iOS Caption */
  }

  .event-card-time {
    min-width: 60px;
  }

  /* Draft event card: keep dashed but flat */
  .event-draft a.event-card {
    border-radius: 0;
    box-shadow: none;
  }

  /* --- Category Cards (collapsible sections): grouped inset --- */
  .category-card {
    border-radius: 10px;
    margin-bottom: 0.5rem;
  }

  .category-cards {
    gap: 0.625rem;
  }

  .category-card-header {
    min-height: 44px; /* iOS touch target */
    padding: 0.75rem 1rem;
  }

  /* --- Category Sections --- */
  .category-section {
    border-radius: 10px;
    margin-bottom: 0.625rem;
  }

  .category-header {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }

  /* --- Event Detail: Remove card borders, flat sections --- */
  .event-detail-body {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
  }

  .event-detail-meta {
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
  }

  .event-detail-meta .meta-item {
    padding: 1rem 0;
    border-bottom: 0.5px solid var(--color-border);
    min-width: 0;
  }

  .event-detail-meta .meta-item:last-child {
    border-bottom: none;
  }

  .event-detail-meta .meta-item p {
    font-size: 1.0625rem; /* 17px */
  }

  .event-detail-description {
    border-top: 0.5px solid var(--color-border);
    padding-top: 1rem;
    margin-top: 0.5rem;
  }

  /* --- Confirmation Number: keep highlight but rounded --- */
  .confirmation-highlight {
    border-radius: 10px;
    padding: 1rem;
  }

  .confirmation-number {
    font-size: 1.25rem;
  }

  /* --- Event Detail Participants: flat list --- */
  .event-detail-participants {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 0.5px solid var(--color-border);
  }

  .participant-list {
    gap: 0;
  }

  .participant-item {
    padding: 0.625rem 0;
    border-bottom: 0.5px solid var(--color-border);
    min-height: 44px; /* iOS touch target */
  }

  .participant-item:last-child {
    border-bottom: none;
  }

  .participant-name {
    font-size: 1.0625rem;
  }

  .participant-add-form {
    margin-top: 0.75rem;
  }

  .participant-add-form .form-input {
    min-height: 44px;
    font-size: 1.0625rem;
  }

  /* --- Event Detail Meta Extra: stacked flat --- */
  .event-detail-meta-extra {
    flex-direction: column;
    gap: 0;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 0.5px solid var(--color-border);
  }

  .event-detail-meta-extra .meta-item {
    padding: 0.875rem 0;
    border-bottom: 0.5px solid var(--color-border);
  }

  .event-detail-meta-extra .meta-item:last-child {
    border-bottom: none;
  }

  .event-detail-meta-extra .meta-item p {
    font-size: 1.0625rem;
  }

  /* --- Status Switcher: larger touch targets --- */
  .status-switcher {
    gap: 0.5rem;
  }

  .status-badge {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  .status-switcher-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* --- Event Detail Sticky Header: full-width flush --- */
  .event-detail-header {
    margin: 0 -1rem;
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .event-detail-header > div:first-child {
    flex: 1;
    min-width: 0;
  }

  .event-detail-trip {
    font-size: 0.8125rem; /* iOS Caption */
  }

  .event-detail-actions {
    flex-shrink: 0;
  }

  /* Overflow menu: larger touch target */
  .overflow-menu summary {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* --- Forms: full-width, iOS-style inputs --- */
  .form-group label {
    font-size: 0.9375rem; /* 15px iOS Subhead */
    font-weight: 600;
  }

  .form-input {
    font-size: 1.0625rem; /* 17px — prevents iOS zoom on focus */
    padding: 0.75rem;
    min-height: 44px; /* iOS touch target */
    border-radius: 10px;
  }

  .form-input:focus {
    border-radius: 10px;
  }

  select.form-input {
    font-size: 1.0625rem;
    min-height: 44px;
  }

  textarea.form-input,
  .form-textarea {
    font-size: 1.0625rem;
    min-height: 88px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-actions .btn {
    width: 100%;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .form-container h1 {
    margin-bottom: 1.25rem;
  }

  /* --- Buttons: iOS-sized touch targets --- */
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.0625rem;
  }

  .btn-sm {
    min-height: 36px;
    font-size: 0.9375rem;
  }

  .btn-cta {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-cta-lg {
    min-height: 50px;
    font-size: 1.0625rem;
  }

  .btn-primary {
    border-radius: 10px;
    min-height: 50px;
    font-size: 1.0625rem;
  }

  .btn-secondary {
    border-radius: 10px;
  }

  .btn-danger {
    min-height: 44px;
    font-size: 0.9375rem;
    padding: 0.5rem 1rem;
  }

  /* --- Auth Pages: full-width card --- */
  .auth-container {
    padding: 1.5rem 1rem;
    align-items: flex-start;
  }

  .auth-card {
    max-width: 100%;
    padding: 1.5rem;
    border-radius: 0;
    box-shadow: none;
    border: none;
    background: var(--color-bg);
  }

  .auth-card h1 {
    font-size: 2.125rem; /* 34px iOS Large Title */
    font-weight: 700;
  }

  .auth-subtitle {
    font-size: 1.0625rem;
  }

  .auth-footer {
    font-size: 0.9375rem;
  }

  /* --- Navigation: tighter mobile nav --- */
  .nav {
    padding: 0.5rem 1rem;
  }

  .nav-brand {
    font-size: 1.0625rem; /* 17px */
  }

  .nav-user {
    font-size: 0.8125rem; /* 13px iOS Caption */
  }

  .nav-actions {
    gap: 0.5rem;
  }

  .nav-actions .btn-danger {
    font-size: 0.8125rem;
    padding: 0.375rem 0.625rem;
    min-height: 36px;
  }

  /* --- Flash Messages: full-width, rounded --- */
  .flash-notice,
  .flash-alert {
    border-radius: 10px;
    margin: 0 0 0.75rem 0;
    font-size: 0.9375rem;
    padding: 0.875rem 1rem;
  }

  /* --- People Tab: flat list --- */
  .person-card {
    border-radius: 10px;
    padding: 0.875rem 1rem;
  }

  .person-name {
    font-size: 1.0625rem;
  }

  .person-email {
    font-size: 0.8125rem; /* iOS Caption */
  }

  .person-event-item {
    min-height: 44px;
    font-size: 0.9375rem;
    align-items: center;
  }

  .invite-section {
    border-radius: 10px;
  }

  .invite-input-group {
    gap: 0.625rem;
  }

  .invite-email-input {
    min-height: 44px;
    font-size: 1.0625rem;
  }

  /* --- Upload Zone --- */
  .upload-zone {
    border-radius: 10px;
    padding: 1rem;
    min-height: 56px;
  }

  .upload-zone-text {
    font-size: 0.9375rem; /* 15px */
  }

  /* --- Calendar Subscribe --- */
  .calendar-subscribe-btn {
    min-height: 44px;
    font-size: 0.9375rem;
    border-radius: 10px;
  }

  .calendar-popover {
    border-radius: 10px;
  }

  /* --- Add Event Bar --- */
  .trip-add-bar {
    margin-bottom: 0.75rem;
    gap: 0.75rem;
  }

  .add-event-btn {
    font-size: 0.9375rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
  }

  .email-forward-hint {
    font-size: 0.8125rem;
  }

  /* --- Date Headers (itinerary) --- */
  .date-header {
    font-size: 1.0625rem; /* 17px */
    font-weight: 600;
    padding: 0.75rem 0 0.5rem;
  }

  /* --- Type-specific detail sections --- */
  .event-detail-type {
    border-top: 0.5px solid var(--color-border);
  }

  .detail-list {
    font-size: 1.0625rem;
  }

  .detail-list dt {
    font-size: 0.8125rem; /* 13px iOS Caption */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-lighter);
  }

  .detail-list dd {
    font-size: 1.0625rem;
  }

  /* --- Modal: full-width bottom sheet feel --- */
  .modal {
    border-radius: 14px 14px 0 0;
    max-width: 100%;
    align-self: flex-end;
    margin-bottom: 0;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-header h2 {
    font-size: 1.0625rem;
    font-weight: 600;
  }

  .modal-body {
    padding: 1.25rem 1rem;
  }

  .modal-footer .btn {
    min-height: 44px;
  }

  /* --- Footer --- */
  .site-footer {
    margin-top: 2rem;
    padding: 1.5rem 1rem;
    font-size: 0.8125rem; /* 13px iOS Caption */
  }

  /* --- Back Link --- */
  .back-link {
    font-size: 0.9375rem; /* 15px */
    padding: 0.75rem 0;
  }

  /* --- Empty States --- */
  .empty-state {
    padding: 3rem 1rem;
  }

  .empty-state h2 {
    font-size: 1.375rem; /* 22px iOS Title 2 */
  }

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

  /* --- Onboarding Empty State --- */
  .onboarding-es-welcome h2 {
    font-size: 2.125rem; /* 34px iOS Large Title */
  }

  .onboarding-es-subtitle {
    font-size: 1.0625rem;
  }

  /* --- Section spacing: generous between, compact within --- */
  .trip-section {
    margin-bottom: 1.5rem;
  }

  .trip-section-heading {
    font-size: 1.0625rem;
    padding-bottom: 0.375rem;
    margin-bottom: 0.5rem;
    border-bottom: 0.5px solid var(--color-border);
  }

  /* --- Grouped content: iOS inset grouped style --- */
  .trip-invitations-section {
    border-radius: 10px;
    padding: 1rem;
  }

  .invitation-item {
    border-radius: 0;
    border: none;
    border-bottom: 0.5px solid var(--color-border);
    padding: 0.75rem 0;
    min-height: 44px;
    background: transparent;
  }

  .invitation-item:last-child {
    border-bottom: none;
  }

  /* --- Event Type Picker: larger tappable options --- */
  .event-type-option {
    min-height: 44px;
    font-size: 0.9375rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
  }

  /* --- Table on mobile: grouped rows --- */
  .activity-table td,
  .activity-table th {
    font-size: 0.9375rem;
    padding: 0.75rem 0.75rem;
  }

  /* --- FAB: standard iOS size --- */
  .fab {
    width: 3.5rem;
    height: 3.5rem;
  }

  /* --- Paste Section --- */
  .paste-toggle {
    min-height: 44px;
    font-size: 0.9375rem;
  }

  .paste-textarea {
    font-size: 1.0625rem;
    min-height: 120px;
  }

  /* --- Remove Member Dialog --- */
  .remove-member-dialog {
    border-radius: 14px 14px 0 0;
  }

  .dialog-body p {
    font-size: 0.9375rem;
  }

  .dialog-footer .btn {
    min-height: 44px;
    font-size: 1.0625rem;
  }

  /* --- Detail Fieldset in Forms --- */
  .detail-fieldset {
    border-radius: 10px;
    padding: 0.875rem 1rem;
  }

  .detail-fieldset legend {
    font-size: 1.0625rem;
  }

  /* --- Progress Items --- */
  .progress-item {
    border-radius: 10px;
    padding: 0.875rem 1rem;
  }

  /* --- New Event Notification --- */
  .new-event-notification {
    border-radius: 10px;
    margin: 0 0 0.75rem 0;
    padding: 0.875rem 1rem;
  }

  /* --- Out-of-range Banner --- */
  .out-of-range-banner {
    border-radius: 10px;
  }

  /* --- Duplicate Warning / Banner --- */
  .duplicate-warning {
    border-radius: 10px;
  }

  .duplicate-banner {
    border-radius: 10px;
  }

  /* --- Continuation Strips: proper touch size --- */
  .continuation-strip {
    min-height: 44px;
    font-size: 0.9375rem;
    border-radius: 6px;
  }

  /* --- Grid/Table View (pivot views) --- */
  .grid-table th,
  .grid-table td {
    font-size: 0.8125rem;
    min-width: 120px;
  }

  /* --- View tabs: larger touch targets --- */
  .view-tab {
    min-height: 36px;
    font-size: 0.8125rem;
  }

  /* --- All-day toggle --- */
  .all-day-toggle {
    min-height: 44px;
    font-size: 1.0625rem;
  }

  .all-day-toggle input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
  }

  /* --- Confirmation and category labels --- */
  .category-label {
    font-size: 1.0625rem;
  }

  /* --- Email forward hint code --- */
  .email-forward-hint code {
    font-size: 0.75rem;
  }

  /* --- Checkbox & radio touch targets --- */
  input[type="checkbox"],
  input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
  }

  /* --- Select inputs --- */
  select {
    font-size: 1.0625rem; /* Prevent iOS zoom */
    min-height: 44px;
  }
}
