:root {
  --primary: #4A90D9;
  --primary-dark: #2E5C8A;
  --accent: #FF9500;
  --dark: #0f172a;
  --darker: #020617;
  --gray: rgba(255, 255, 255, 0.55);
  --text: #f1f5f9;
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(255, 255, 255, 0.06);
  --danger: #f87171;
  --success: #4ade80;
  --sidebar-width: 240px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

body.app-bg {
  background:
    radial-gradient(ellipse 520px 520px at 8% 12%, rgba(74, 144, 217, 0.18), transparent 70%),
    radial-gradient(ellipse 480px 480px at 92% 78%, rgba(255, 149, 0, 0.1), transparent 72%),
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(74, 144, 217, 0.12), transparent),
    linear-gradient(180deg, #0f172a 0%, #020617 100%);
  background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

[hidden] { display: none !important; }

/* ---- Navigation ---- */
.web-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.web-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  color: white;
  text-decoration: none;
  white-space: nowrap;
}

.web-nav .brand:hover { text-decoration: none; }

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  object-fit: cover;
}

.web-nav .links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.web-nav .nav-link {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
}

.web-nav .nav-link:hover,
.web-nav .nav-link.active {
  color: white;
  background: rgba(74, 144, 217, 0.2);
  text-decoration: none;
}

.web-nav .nav-user {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Layout ---- */
.auth-shell {
  max-width: 440px;
  margin: 48px auto;
  padding: 0 20px 48px;
}

.app-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.75rem;
  margin-bottom: 6px;
  color: white;
}

.page-header p {
  color: var(--gray);
  max-width: 640px;
  word-break: break-word;
}

.page-header__brand {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.dashboard-grid {
  display: grid;
  gap: 20px;
}

.dashboard-split {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .dashboard-split {
    grid-template-columns: 1fr 1fr;
  }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

/* ---- Cards & forms ---- */
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: none;
  border: 1px solid var(--border);
}

.card h1 { font-size: 1.5rem; margin-bottom: 8px; color: white; }
.card h2 { font-size: 1.15rem; margin-bottom: 8px; font-weight: 700; color: white; }

.card .subtitle,
.subtitle {
  color: var(--gray);
  margin-bottom: 16px;
  line-height: 1.55;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.75);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(74, 144, 217, 0.35);
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}

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

.btn-sm {
  width: auto;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

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

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
}

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

.toggle-mode {
  text-align: center;
  margin-top: 20px;
  color: var(--gray);
  font-size: 0.95rem;
}

.error {
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-bottom: 16px;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.success {
  background: rgba(74, 222, 128, 0.1);
  color: #bbf7d0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-bottom: 16px;
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.info-banner {
  background: rgba(74, 144, 217, 0.12);
  border: 1px solid rgba(74, 144, 217, 0.25);
  color: #bfdbfe;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}

.stat .label { color: var(--gray); font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.stat .value { font-size: 1.5rem; font-weight: 700; margin-top: 6px; color: white; }

.stat--icon {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}

.stat__icon svg {
  width: 22px;
  height: 22px;
}

.stat__icon--credits {
  background: rgba(255, 149, 0, 0.18);
  color: var(--accent);
}

.stat__icon--trips {
  background: rgba(74, 144, 217, 0.22);
  color: var(--primary);
}

.stat__icon--pending {
  background: rgba(234, 179, 8, 0.18);
  color: #fbbf24;
}

.paywall-banner {
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.25);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.paywall-banner strong { display: block; margin-bottom: 4px; }

.list-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

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

.mono,
.copy-row {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 12px;
  border-radius: 10px;
  word-break: break-all;
  border: 1px solid var(--border);
  color: var(--text);
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.copy-row code {
  flex: 1;
  font-family: inherit;
  font-size: inherit;
}

.stat-row--compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.card--ai {
  border-color: rgba(74, 144, 217, 0.25);
  background: linear-gradient(180deg, rgba(74, 144, 217, 0.08) 0%, var(--card) 120px);
}

.dashboard-grid__full {
  grid-column: 1 / -1;
}

.card--analysis .trip-analysis__intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.trip-analysis__credits {
  font-size: 0.92rem;
  margin: 0;
}

.trip-analysis__loading {
  color: var(--muted);
  padding: 8px 0;
}

.trip-analysis__empty {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.trip-analysis__results {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.trip-analysis__score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.trip-analysis__score {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid currentColor;
  flex-shrink: 0;
}

.trip-analysis__score--good { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.trip-analysis__score--fair { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.trip-analysis__score--warn { color: #fb923c; background: rgba(251, 146, 60, 0.12); }
.trip-analysis__score--poor { color: #f87171; background: rgba(248, 113, 113, 0.12); }

.trip-analysis__grade {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

.trip-analysis__score-num {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.trip-analysis__score-label {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.trip-analysis__all-clear {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #6ee7b7;
}

.trip-analysis__section h3 {
  font-size: 1rem;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trip-analysis__count {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.trip-analysis__gaps,
.trip-analysis__bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trip-analysis__gap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.94rem;
}

.trip-analysis__gap--hotel { border-left: 3px solid #60a5fa; }
.trip-analysis__gap--flight { border-left: 3px solid #fbbf24; }
.trip-analysis__gap--empty { border-left: 3px solid #a78bfa; }

.trip-analysis__gap-icon {
  flex-shrink: 0;
}

.trip-analysis__bullets li {
  padding: 8px 0 8px 16px;
  position: relative;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
  color: var(--text);
}

.trip-analysis__bullets li:last-child { border-bottom: none; }

.trip-analysis__bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
}

.trip-analysis__error { margin-bottom: 12px; }

.card--trips {
  border-color: rgba(74, 144, 217, 0.2);
  background: linear-gradient(180deg, rgba(74, 144, 217, 0.06) 0%, var(--card) 140px);
}

.card--email {
  border-color: rgba(147, 51, 234, 0.2);
}

.card--map {
  border-color: rgba(74, 144, 217, 0.18);
}

.card--highlights {
  border-color: rgba(34, 197, 94, 0.2);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.06) 0%, var(--card) 100px);
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.highlight-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.highlight-card__media {
  aspect-ratio: 16 / 10;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.highlight-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.highlight-card__media--loading {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(74, 144, 217, 0.12));
}

.highlight-card__placeholder {
  font-size: 2rem;
  opacity: 0.7;
}

.highlight-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.highlight-card__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: white;
  line-height: 1.35;
}

.highlight-card__location {
  margin: 0;
  font-size: 0.8rem;
  color: #86efac;
  font-weight: 600;
}

.highlight-card__desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--gray);
  line-height: 1.45;
}

.card--form .subtitle {
  margin-top: -8px;
  margin-bottom: 12px;
}

.card--form .section-head--compact {
  margin-bottom: 8px;
}

.section-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-bottom: 4px;
}

.section-head .subtitle {
  margin-bottom: 0;
}

.section-head--compact {
  align-items: center;
  margin-bottom: 14px;
}

.section-head--compact h2 {
  margin: 0;
}

.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.icon-chip svg {
  width: 20px;
  height: 20px;
}

.icon-chip--brand {
  background: rgba(74, 144, 217, 0.22);
  color: var(--primary);
}

.icon-chip--blue {
  background: rgba(74, 144, 217, 0.22);
  color: var(--primary);
}

.icon-chip--amber {
  background: rgba(234, 179, 8, 0.18);
  color: #fbbf24;
}

.icon-chip--green {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
}

.email-hero {
  text-align: center;
  margin-bottom: 8px;
}

.email-hero__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.18), rgba(74, 144, 217, 0.18));
  color: #7c3aed;
  margin-bottom: 12px;
}

.email-hero__icon svg {
  width: 34px;
  height: 34px;
}

.email-hero h2 {
  margin-bottom: 6px;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray);
  margin: 16px 0 8px;
}

.registered-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 12px;
}

.registered-note svg {
  color: var(--success);
  flex-shrink: 0;
}

.bucket-ai-form,
.bucket-form {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.muted {
  color: var(--gray);
  font-size: 0.9rem;
}

.error-inline {
  color: var(--danger);
  font-size: 0.92rem;
  margin: 0;
}

.list-item-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.country-group {
  margin-bottom: 20px;
}

.country-group:last-child {
  margin-bottom: 0;
}

.country-heading {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.ai-suggestions-panel {
  margin-top: 20px;
}

.ai-suggestion-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.suggestion-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.suggestion-card strong {
  display: block;
  font-size: 1rem;
  color: white;
}

.suggestion-card .muted {
  display: block;
  margin-top: 2px;
}

.suggestion-notes {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--gray);
  line-height: 1.4;
}

.suggestion-card--added {
  opacity: 0.65;
  background: rgba(255, 255, 255, 0.02);
}

.ai-actions {
  margin-top: 14px;
}

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 0;
}

.step {
  display: block;
  padding: 14px 14px 14px 48px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid var(--border);
  position: relative;
}

.step strong { color: white; }

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.step p { color: var(--gray); font-size: 0.92rem; margin-top: 6px; }

.import-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.import-row select {
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--input-bg);
  color: var(--text);
}

.import-row .btn { width: auto; padding: 10px 16px; font-size: 0.9rem; }

.trip-grid {
  display: grid;
  gap: 12px;
}

.trip-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: none;
  transition: background 0.2s, border-color 0.2s;
}

.trip-card:hover {
  background: var(--card-hover);
  border-color: rgba(74, 144, 217, 0.25);
}

.trip-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(74, 144, 217, 0.14);
  color: var(--primary);
  flex-shrink: 0;
}

.trip-card__icon svg {
  width: 22px;
  height: 22px;
}

.trip-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.trip-card__body {
  min-width: 0;
}

.trip-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: white;
}

.trip-card__code {
  font-size: 0.82rem;
  color: var(--gray);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--gray);
  margin: 4px 0 0;
  word-break: break-word;
}

.meta-row__icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--gray);
}

.meta-row__icon--pin {
  color: #ef4444;
}

.meta-row__icon svg {
  width: 16px;
  height: 16px;
}

.trip-card__cta {
  align-self: center;
  white-space: nowrap;
}

.import-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  box-shadow: none;
  margin-bottom: 10px;
}

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

.import-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
}

.import-card--blue .import-card__icon { background: rgba(74, 144, 217, 0.18); }
.import-card--purple .import-card__icon { background: rgba(147, 51, 234, 0.18); }
.import-card--green .import-card__icon { background: rgba(74, 222, 128, 0.15); }

.import-card__title {
  display: block;
  margin: 6px 0 2px;
  font-size: 0.98rem;
  color: white;
}

.import-booking-summary {
  margin: 6px 0 10px;
  font-size: 0.92rem;
  color: #93c5fd;
}

.import-hint {
  margin-top: 8px;
}

.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--gray);
}

.empty-state__icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 10px;
}

.empty-state strong {
  display: block;
  color: white;
  font-size: 1rem;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.92rem;
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
}

.trip-map--compact {
  height: min(280px, 40vh);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.timeline-date {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.timeline-day + .timeline-day {
  margin-top: 24px;
}

.timeline-day__items {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.timeline-item__media {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.timeline-item__icon-fallback {
  font-size: 1.6rem;
  line-height: 1;
}

.timeline-item--activity .timeline-item__media--loading {
  background: rgba(239, 68, 68, 0.12);
}

.timeline-item--hotel .timeline-item__media--loading {
  background: rgba(147, 51, 234, 0.12);
}

.timeline-item--transport .timeline-item__media--loading {
  background: rgba(74, 144, 217, 0.12);
}

.timeline-item__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}

.timeline-item__icon-wrap--activity {
  background: rgba(239, 68, 68, 0.15);
}

.timeline-item__icon-wrap--hotel {
  background: rgba(74, 144, 217, 0.18);
}

.timeline-item__icon-wrap--transport {
  background: rgba(255, 149, 0, 0.18);
}

.timeline-item__icon {
  font-size: 1.2rem;
  line-height: 1;
}

.timeline-item__body {
  flex: 1;
  min-width: 0;
}

.timeline-item__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.timeline-type {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
}

.timeline-type--activity {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.timeline-type--hotel {
  background: rgba(74, 144, 217, 0.2);
  color: #93c5fd;
}

.timeline-type--transport {
  background: rgba(255, 149, 0, 0.18);
  color: #fdba74;
}

.timeline-type--car {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.timeline-type--train {
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
}

.timeline-type--bus {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.timeline-item__head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.timeline-item__delete {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.timeline-item__delete:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}

.timeline-item__delete:disabled {
  opacity: 0.55;
  cursor: wait;
}

.timeline-time {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.timeline-item__title {
  font-size: 1.02rem;
  font-weight: 700;
  color: white;
  margin: 0 0 6px;
  line-height: 1.35;
}

.timeline-item__location {
  font-size: 0.88rem;
  color: var(--gray);
  margin: 0 0 8px;
  line-height: 1.45;
}

.timeline-item__details {
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
}

.timeline-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.86rem;
}

.timeline-detail dt {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}

.timeline-detail dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}

.timeline-item__notes {
  font-size: 0.88rem;
  color: var(--gray);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-item__link {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.timeline-item__link:hover {
  text-decoration: underline;
}

.card--timeline {
  border-color: rgba(255, 149, 0, 0.18);
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .trip-card {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .trip-card__cta {
    grid-column: 1 / -1;
    width: 100%;
  }

  .page-header__brand {
    flex-direction: column;
    gap: 10px;
  }
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--pending { background: rgba(234, 179, 8, 0.2); color: #fbbf24; }
.badge--imported { background: rgba(74, 222, 128, 0.15); color: #86efac; }
.badge--owner { background: rgba(74, 144, 217, 0.22); color: #93c5fd; }
.badge--member { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.65); }
.badge--past { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.6); }
.badge--current { background: rgba(255, 149, 0, 0.2); color: #fdba74; }
.badge--upcoming { background: rgba(74, 144, 217, 0.22); color: #93c5fd; }

.trip-map {
  height: min(420px, 55vh);
  min-height: 280px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #1e293b;
  position: relative;
}

.trip-map > .trip-map-root {
  height: 100%;
  width: 100%;
}

.trip-map .empty-state {
  padding: 48px 16px;
}

.trip-map-pin-wrap {
  background: transparent;
  border: none;
}

.trip-map-pin {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}

.trip-map-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.trip-map-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.trip-map-note {
  margin-top: 10px;
  font-size: 0.85rem;
}

.trip-map-popup strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.trip-map-popup__status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
  margin-bottom: 6px;
}

.trip-map-popup p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--gray);
}

.trip-card--highlight {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.app-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.92rem;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  max-width: min(90vw, 420px);
}

.app-toast--success { background: #166534; }
.app-toast--error { background: #991b1b; }

.ad-slot { display: none; }

/* ---- Trips page ---- */
.app-shell--wide {
  max-width: 1120px;
}

.page-header--trips {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.trips-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trips-stats {
  margin-bottom: 20px;
}

.stat--pill {
  text-align: center;
}

.stat--pill.stat--current { border-color: rgba(255, 149, 0, 0.25); }
.stat--pill.stat--upcoming { border-color: rgba(74, 144, 217, 0.25); }
.stat--pill.stat--past { border-color: rgba(255, 255, 255, 0.12); }

.trips-layout {
  gap: 24px;
}

.trips-map-card {
  order: -1;
}

.trips-sections {
  display: grid;
  gap: 20px;
}

.trips-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.trips-section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.trips-section__head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: white;
}

.trips-section__count {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 999px;
}

.trip-card--rich {
  grid-template-columns: auto 1fr auto;
}

.trip-card__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  flex-shrink: 0;
}

.trip-card__icon-wrap--current {
  background: rgba(255, 149, 0, 0.18);
}

.trip-card__icon-wrap--upcoming {
  background: rgba(74, 144, 217, 0.2);
}

.trip-card__icon-wrap--past,
.trip-card__icon-wrap--unknown {
  background: rgba(255, 255, 255, 0.08);
}

.trip-card__emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.trip-card__meta {
  font-size: 0.88rem;
  color: var(--gray);
  margin: 4px 0 0;
  line-height: 1.45;
}

.trip-card__meta--dates {
  color: rgba(255, 255, 255, 0.65);
}

.trips-empty {
  text-align: center;
  padding: 32px 20px;
}

.section-head .panel-close {
  margin-left: auto;
  font-size: 0.85rem;
}

.new-trip-inline {
  margin: 12px 0;
  padding: 14px;
  border-radius: 12px;
  background: rgba(74, 144, 217, 0.08);
  border: 1px dashed rgba(74, 144, 217, 0.35);
}

.import-assign {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.import-assign select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--input-bg);
  color: var(--text);
}

.import-assign .import-btn {
  width: auto;
  justify-self: start;
}

@media (min-width: 900px) {
  .trips-map-card {
    order: 0;
  }

  .trips-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .web-nav { padding: 12px 16px; flex-wrap: wrap; }

  .nav-toggle { display: inline-flex; margin-left: auto; }

  .web-nav .links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: 8px;
  }

  .web-nav .links.open { display: flex; }

  .web-nav .nav-link,
  .web-nav .btn { width: 100%; text-align: center; }

  .web-nav .nav-user {
    max-width: none;
    text-align: center;
    padding: 4px 0;
  }

  .paywall-banner { flex-direction: column; align-items: stretch; }
  .copy-row { flex-direction: column; align-items: stretch; }

  .page-header--trips {
    flex-direction: column;
  }

  .trips-toolbar {
    width: 100%;
  }

  .trips-toolbar .btn {
    flex: 1;
  }
}
