:root {
  --bg: #f1ece2;
  --panel: #ffffff;
  --ink: #1a1714;
  --muted: #8a8174;
  --accent: #1a1714;
  --border: #e1d9c8;
  --radius: 8px;
  --serif: Georgia, "Times New Roman", Times, serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  flex: 0 0 280px;
  width: 280px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 48px 32px;
  overflow-y: auto;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  width: fit-content;
}
.brand .mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  margin-right: 0.06em;
}
.brand .mark::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}
.sidebar .brand {
  margin-bottom: 16px;
}
.sidebar-explore-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 40px;
}
.sidebar-explore-link:hover { color: var(--ink); }
.sidebar h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 24px 0;
  font-weight: 600;
}
.trip-list { display: flex; flex-direction: column; gap: 12px; }
.trip-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  position: relative;
}
.trip-card:hover {
  border-color: var(--ink);
  background: #fafaf8;
}
.trip-card.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.trip-card.active .trip-meta { color: rgba(255,255,255,0.7); }
.trip-card .trip-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.trip-card .trip-meta { font-size: 12px; color: var(--muted); }
.trip-card .delete-btn {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 18px; line-height: 1; transition: color 0.2s;
  opacity: 0;
}
.trip-card:hover .delete-btn { opacity: 1; }
.trip-card .delete-btn:hover { color: var(--ink); }
.empty-hint { color: var(--muted); font-size: 14px; margin-top: 24px; }

/* Form panel */
.form-panel {
  flex: 1 1 0;
  min-width: 380px;
  padding: 48px 32px;
  background: var(--panel);
  overflow-y: auto;
  height: 100vh;
}
.form-panel h1 {
  font-size: 28px;
  margin: 0 0 8px 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.form-panel > p {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 32px 0;
  line-height: 1.6;
}
form { display: flex; flex-direction: column; gap: 28px; }
label {
  display: flex; flex-direction: column;
  font-size: 14px; font-weight: 600; color: var(--ink);
  gap: 8px;
  letter-spacing: -0.01em;
}
input, select, textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafaf8;
  transition: all 0.15s ease;
}
input:hover, select:hover, textarea:hover {
  border-color: #d4d4d8;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--panel);
  box-shadow: none;
}
fieldset {
  border: none;
  border-top: 1px solid var(--border);
  padding: 28px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: none;
  margin: 0;
}
legend {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 0;
}
.budget-wrapper {
  display: flex; flex-direction: column; gap: 8px;
}
.budget-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.custom-amount {
  display: none;
  flex-direction: column;
  gap: 8px;
}
.custom-amount.visible {
  display: flex;
}
.custom-amount input {
  width: 100%;
}
.reservation-row { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.reservation-row span { font-size: 14px; color: var(--ink); min-width: 60px; }
.reservation-row input { flex: 1; }

button[type="submit"] {
  margin-top: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
}
button[type="submit"]:hover {
  background: #1a1a1a;
}
button[type="submit"]:active {
  transform: scale(0.98);
}

/* Results panel */
.results-panel {
  flex: 1 1 0;
  padding: 48px 32px;
  overflow-y: auto;
  background: var(--bg);
  height: 100vh;
}
.placeholder {
  color: var(--muted);
  font-size: 15px;
  margin-top: 120px;
  text-align: center;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.hidden { display: none; }

.results-header {
  margin-bottom: 32px;
}
.results-header h2 {
  margin: 0 0 14px 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.results-header .meta-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.tag {
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.day-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 40px;
}
.day-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s ease;
}
.day-card:hover {
  border-color: var(--ink);
}
.day-card h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.day-card .day-dest {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 500;
}
.day-card .priority-note {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  background: var(--ink);
  padding: 6px 10px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  display: inline-block;
  letter-spacing: -0.01em;
}
.block { margin-bottom: 14px; }
.block .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.block .value { font-size: 14px; line-height: 1.6; font-weight: 400; }
.activity-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.activity-links a {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
}
.activity-links a:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.activity-links a.booking-link {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}
.activity-links a.booking-link:hover {
  opacity: 0.85;
}
.restaurants {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.restaurants .label {
  color: var(--ink);
  font-weight: 600;
}
.restaurants ul {
  margin: 6px 0 0 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.6;
}
.restaurants li { color: var(--ink); font-weight: 400; }
.reservation-time {
  margin-top: 10px;
  font-size: 12px;
  background: #fef3c7;
  color: #78350f;
  padding: 6px 10px;
  border-radius: var(--radius);
  display: inline-block;
  font-weight: 500;
  border: 1px solid #fcd34d;
}

.side-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.side-section h3 {
  margin: 0 0 14px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  letter-spacing: -0.01em;
}
.side-section ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
  font-weight: 400;
}
.side-section.preferences p {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
  font-weight: 400;
}
.travel-links-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px 0;
}
.travel-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.travel-link-row:first-of-type { border-top: none; padding-top: 0; }
.travel-link-dest {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}
.travel-link-row a {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius);
}
.travel-link-row a:hover { border-color: var(--ink); }

@media (max-width: 1200px) {
  .app { flex-direction: column; height: auto; }
  .sidebar {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    max-height: 320px;
    border-bottom: 1px solid var(--border);
    border-right: none;
  }
  /* In the stacked layout the panels must size to their content:
     flex: 1 1 0 (from the desktop side-by-side layout) collapses them
     to near-zero height because the column container is height: auto,
     and the 380px min-width forces horizontal overflow on phones. */
  .form-panel {
    flex: none;
    height: auto;
    min-width: 0;
  }
  .results-panel {
    flex: none;
    height: auto;
  }
}

/* Dashboard */
.dashboard {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 32px 80px;
  min-height: 100vh;
}
.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 64px;
}
.dashboard-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); }
.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.dashboard-hero h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px 0;
}
.dashboard-hero p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}
.plan-trip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.plan-trip-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.dashboard-trip-card {
  position: relative;
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all 0.2s ease;
}
.dashboard-trip-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.dashboard-trip-card a {
  display: block;
  text-decoration: none;
  color: var(--ink);
}
.dashboard-trip-card .trip-name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
  padding-right: 20px;
}
.dashboard-trip-card .trip-meta {
  font-size: 13px;
  color: var(--muted);
}
.dashboard-trip-card .delete-btn {
  position: absolute; top: 18px; right: 18px;
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 18px; line-height: 1; transition: color 0.2s;
  opacity: 0;
}
.dashboard-trip-card:hover .delete-btn { opacity: 1; }
.dashboard-trip-card .delete-btn:hover { color: var(--ink); }
.dashboard-empty {
  text-align: center;
  padding: 100px 20px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.dashboard-empty p {
  margin: 0 0 20px 0;
  font-size: 15px;
}

/* Explore */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.explore-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}
.explore-card:hover {
  transform: translateY(-2px);
}
.explore-city {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 10px;
}
.explore-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  transition: border-color 0.2s ease;
}
.explore-card:hover img {
  border-color: var(--ink);
}
.explore-fallback {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--panel);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* Explore detail page */
.explore-back-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 24px;
}
.explore-back-link:hover { color: var(--ink); }
.explore-detail-hero {
  margin-bottom: 24px;
}
.explore-detail-hero h1 {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.explore-detail-blocks {
  max-width: 600px;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.explore-block p {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 16px 0;
}
.explore-block img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
}
.explore-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.explore-photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}
.auth-card .auth-brand {
  margin-bottom: 24px;
}
.auth-card h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px 0;
}
.auth-card > p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px 0;
}
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-card label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
}
.auth-card button[type="submit"] { margin-top: 8px; }
.auth-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-switch {
  margin: 20px 0 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.auth-switch a { color: var(--ink); font-weight: 600; }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 24px;
}

/* Profile menu */
.profile-menu {
  position: relative;
}
.profile-trigger {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}
.profile-trigger::-webkit-details-marker { display: none; }
.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  transition: opacity 0.2s ease;
}
.profile-trigger:hover .profile-avatar { opacity: 0.85; }
.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-width: 190px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 20;
}
.profile-dropdown-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}
.profile-dropdown-email {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  word-break: break-all;
}
.profile-dropdown-logout {
  display: block;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-weight: 600;
}
.profile-dropdown-logout:hover { color: var(--muted); }

/* Error banner */
.error-banner {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
}

/* Edit mode banner */
.edit-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
}
.edit-mode-banner.hidden { display: none; }
.edit-mode-banner button {
  background: none;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius);
  cursor: pointer;
}
.edit-mode-banner button:hover { border-color: #1e40af; }

/* Loading state */
button[type="submit"][disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Day card actions */
.day-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.regenerate-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
}
.regenerate-btn:hover { border-color: var(--ink); color: var(--ink); }
.regenerate-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.results-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.print-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
}
.print-btn:hover { border-color: var(--ink); }

@media print {
  .sidebar, .form-panel, .topbar, .results-actions, .regenerate-btn {
    display: none !important;
  }
  .app {
    display: block;
  }
  .results-panel {
    padding: 0;
    grid-column: auto;
  }
  .day-card {
    break-inside: avoid;
    box-shadow: none;
  }
  body { background: #fff; }
}

/* Day card actions + weather */
.day-card-actions { display: flex; gap: 6px; align-items: center; }
.day-map-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.day-map-link:hover { border-color: var(--ink); color: var(--ink); }

/* Lazily-loaded activity photos */
.activity-photo {
  display: block;
  width: 100%;
  max-height: 190px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--panel);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.activity-photo.loaded { opacity: 1; }
.weather-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
}
.weather-btn:hover { border-color: var(--ink); color: var(--ink); }
.weather-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.weather-note {
  font-size: 12.5px;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 6px 10px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

/* Crowd hints */
.crowd-hint {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 2px;
}

/* Feedback thumbs */
.feedback-btns { white-space: nowrap; }
.fb-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  opacity: 0.35;
  filter: grayscale(1);
}
.fb-btn:hover { opacity: 0.8; }
.fb-btn.active { opacity: 1; filter: none; }

/* Group voting */
.vote-link-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vote-link-row input {
  flex: 1 1 200px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px 10px;
}
.vote-summary { margin-top: 10px; font-size: 13.5px; }
.vote-summary ul { margin: 6px 0 0 0; padding-left: 18px; line-height: 1.7; }

/* Voting page */
.vote-form { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.vote-city { font-family: var(--serif); font-size: 20px; margin: 10px 0 0 0; }
.vote-options { display: flex; flex-direction: column; gap: 8px; }
.vote-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  flex-direction: row;
}
.vote-option:hover { border-color: var(--ink); }
.vote-option input { width: auto; margin: 0; }
.vote-form button[type="submit"] { max-width: 240px; }

/* Voice planning */
.voice-btn {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 16px;
}
.voice-btn:hover { border-color: var(--ink); }
.voice-btn.hidden { display: none; }
.voice-status {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 16px;
}
.voice-status.hidden { display: none; }

/* Hidden gems toggle */
.gems-toggle { flex-direction: row; align-items: center; gap: 8px; }

/* Trip countdown */
.trip-countdown {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  display: inline-block;
}

/* Swap-one-activity button */
.swap-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.6;
}
.swap-btn:hover { opacity: 1; color: var(--ink); }
.swap-btn[disabled] { opacity: 0.3; cursor: not-allowed; }

/* Packing checkboxes */
.packing-list { list-style: none; padding-left: 0 !important; margin: 0; }
.packing-list li { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.packing-list input { width: auto; margin: 0; }
.packing-list li.done span { text-decoration: line-through; color: var(--muted); }

/* Per-day notes */
.day-note-wrap { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.day-note-display { font-size: 13.5px; color: var(--ink); white-space: pre-wrap; }
.day-note-edit-btn {
  background: none; border: none; color: var(--muted);
  font-size: 12px; font-weight: 600; cursor: pointer; padding: 0;
}
.day-note-edit-btn:hover { color: var(--ink); }
.day-note-input {
  width: 100%; min-height: 60px; font-size: 13.5px; margin-top: 6px;
}
.day-note-actions { display: flex; gap: 8px; margin-top: 6px; }
.day-note-actions button {
  font-size: 12px; font-weight: 600; padding: 5px 12px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel); color: var(--ink); cursor: pointer;
}
.day-note-actions button.save { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ------------------------------------------------------------------ */
/* Dark mode: variable overrides + the handful of hardcoded light      */
/* backgrounds that need explicit dark treatment.                      */
/* ------------------------------------------------------------------ */
[data-theme="dark"] {
  --bg: #191613;
  --panel: #241f1b;
  --ink: #ece5da;
  --muted: #9c9285;
  --accent: #ece5da;
  --border: #3a332c;
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #1d1915;
  color: var(--ink);
}
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  background: #241f1b;
}
[data-theme="dark"] .trip-card:hover { background: #2b2620; }
[data-theme="dark"] .trip-card.active { background: var(--ink); color: #191613; }
[data-theme="dark"] .trip-card.active .trip-name { color: #191613; }
[data-theme="dark"] .trip-card.active .trip-meta { color: rgba(25,22,19,0.7); }
[data-theme="dark"] button[type="submit"],
[data-theme="dark"] .plan-trip-btn,
[data-theme="dark"] .priority-note,
[data-theme="dark"] .activity-links a.booking-link,
[data-theme="dark"] .profile-avatar {
  background: var(--ink);
  color: #191613;
  border-color: var(--ink);
}
[data-theme="dark"] button[type="submit"]:hover { background: #fff; }
[data-theme="dark"] .error-banner,
[data-theme="dark"] .auth-error { background: #3a1f1f; color: #f4b8b8; border-color: #5c2e2e; }
[data-theme="dark"] .edit-mode-banner,
[data-theme="dark"] .weather-note { background: #1d2733; color: #a8c7ee; border-color: #2e415c; }
[data-theme="dark"] .edit-mode-banner button { border-color: #2e415c; color: #a8c7ee; }
[data-theme="dark"] .reservation-time { background: #33290f; color: #eed9a0; border-color: #5c4c1d; }
[data-theme="dark"] .voice-status { background: #1d1915; }
[data-theme="dark"] .day-note-actions button.save { background: var(--ink); color: #191613; }

/* Theme toggle button in the profile dropdown */
.theme-toggle-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  padding: 10px 0 0 0;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle-btn:hover { color: var(--muted); }

/* API key box (top bar) */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.api-key-form,
.api-key-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.api-key-form[hidden],
.api-key-status[hidden] { display: none; }
.api-key-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  cursor: help;
}
.api-key-form input {
  width: 190px;
  padding: 7px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
}
.api-key-form input:focus {
  outline: none;
  border-color: var(--ink);
}
.api-key-form button {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
}
.api-key-status {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 8px 7px 14px;
  white-space: nowrap;
}
.api-key-hint { color: var(--muted); font-weight: 500; }
.api-key-help {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.api-key-help:hover { color: var(--ink); }
.api-key-status button {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.api-key-status button:hover { color: var(--ink); }
@media (max-width: 720px) {
  .api-key-form input { width: 120px; }
  .api-key-label { display: none; }
}

/* ---------------------------------------------------------------------------
   Motion — scroll-reveal entrances, hero fade-in, hover lifts, button feedback.
   All gated behind prefers-reduced-motion so it fully no-ops for users who opt
   out. .reveal is added by animations.js (progressive enhancement) — if JS is
   off or fails, no content is ever hidden.
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
  }
  .reveal.in {
    opacity: 1;
    transform: none;
  }

  @keyframes wayvoFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
  }
  .brand,
  .dashboard-hero,
  .form-panel > h1,
  .form-panel > p,
  .auth-card,
  .explore-header {
    animation: wayvoFadeUp 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
  .dashboard-hero { animation-delay: 0.05s; }

  /* Card hover lift */
  .dashboard-trip-card,
  .explore-card,
  .day-card,
  .trip-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .dashboard-trip-card:hover,
  .explore-card:hover,
  .day-card:hover,
  .trip-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(26, 23, 20, 0.13);
  }

  /* Explore photos: subtle zoom on hover */
  .explore-card { overflow: hidden; }
  .explore-card img { transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1); }
  .explore-card:hover img { transform: scale(1.05); }

  /* Buttons — hover raise + click press */
  button,
  .plan-trip-btn {
    transition: transform 0.12s ease, box-shadow 0.2s ease,
                background-color 0.2s ease, color 0.2s ease;
  }
  button:hover,
  .plan-trip-btn:hover { transform: translateY(-1px); }
  button:active { transform: translateY(1px) scale(0.99); }
}

/* Empty-state actions (first-run: sample trip + plan) */
.empty-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.plan-trip-btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}
.plan-trip-btn.secondary:hover { border-color: var(--ink); }

/* Restaurant finder */
.rf-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 28px;
}
.rf-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.rf-form select,
.rf-form input {
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  min-width: 150px;
}
.rf-form input[type="number"] { min-width: 90px; }
.rf-form button {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
}
.rf-results > h2 { font-size: 18px; margin: 0 0 16px; }
.rf-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.rf-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.rf-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.rf-tier {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}
.rf-tier-backpacker { color: #2e7d52; }
.rf-tier-luxury { color: #8a6d1f; }
.rf-vibes { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.rf-vibe {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
}
.rf-links {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}
.rf-links-label { color: var(--muted); font-weight: 600; }
.rf-links a {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}
.rf-links a:hover { border-color: var(--ink); }
.rf-links .rf-map { color: var(--muted); }
.rf-links .rf-michelin { color: #a11a2a; border-color: #a11a2a; font-weight: 600; }
.rf-links .rf-michelin:hover { background: #a11a2a; color: #fff; }
.rf-empty { color: var(--muted); }
.rf-note { color: var(--muted); font-size: 12px; margin-top: 18px; }
.rf-relaxed {
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 0 14px 0;
}
.rf-launchpad {
  display: inline-block;
  margin: 0 0 18px 0;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.rf-launchpad:hover { opacity: 0.88; }

/* Reservation / availability */
.rf-reserve {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.rf-reserve.visible { display: flex; }
.rf-reserve-row {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 10px;
}
.rf-reserve-row label { gap: 4px; font-size: 13px; }
.rf-reserve-note { color: var(--muted); font-size: 12px; margin: 0; line-height: 1.5; }
.rf-avail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.rf-avail-btn {
  display: inline-block;
  align-self: flex-start;
  padding: 11px 18px;
  border-radius: 999px;
  background: #2e7d52;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.rf-avail-btn:hover { opacity: 0.9; }
.rf-avail-sub { color: var(--muted); font-size: 12px; }
.rf-reserve-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid #2e7d52;
  border-radius: 999px;
  color: #2e7d52;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.rf-reserve-btn:hover { background: #2e7d52; color: #fff; }
@media (prefers-color-scheme: dark) {
  .rf-avail-btn { background: #3fae74; color: #10231a; }
  .rf-reserve-btn { color: #6fd39c; border-color: #6fd39c; }
  .rf-reserve-btn:hover { background: #3fae74; color: #10231a; }
}
@media (max-width: 640px) {
  .rf-reserve-row { grid-template-columns: 1fr; }
}

/* Metrics page */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}
.metric-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.metric-num { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.metric-label { color: var(--muted); font-size: 13px; text-transform: capitalize; margin-top: 4px; }
.metrics-h2 { font-size: 18px; margin: 28px 0 12px; }
.metrics-bars { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.metric-bar-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.metric-bar-label { width: 130px; color: var(--ink); text-align: right; }
.metric-bar-track { flex: 1; height: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.metric-bar-fill { display: block; height: 100%; background: var(--ink); }
.metric-bar-val { width: 40px; color: var(--muted); }

/* Error pages */
.error-page {
  max-width: 460px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}
.error-page .brand { margin: 0 auto 40px; }
.error-code {
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: -0.02em;
}
.error-page h1 { font-size: 24px; margin: 8px 0 12px; }
.error-page p { color: var(--muted); margin: 0 0 28px; line-height: 1.6; }

/* Keyboard-focus ring for accessibility (doesn't show on mouse click). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Bib Gourmand filter + badge */
.rf-bib-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}
.rf-bib-toggle span { font-weight: 600; }
.rf-bib-hint {
  color: var(--muted);
  font-size: 13px;
  margin: -18px 0 20px 0;
}
.rf-card-bib { border-color: #a11a2a; }
.rf-bib-badge {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #a11a2a;
  background: rgba(161, 26, 42, 0.08);
  border: 1px solid rgba(161, 26, 42, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
}
@media (prefers-color-scheme: dark) {
  .rf-links .rf-michelin { color: #ff8a94; border-color: #ff8a94; }
  .rf-links .rf-michelin:hover { background: #ff8a94; color: #1a1a1a; }
  .rf-card-bib { border-color: #ff8a94; }
  .rf-bib-badge { color: #ff8a94; background: rgba(255, 138, 148, 0.10); border-color: rgba(255, 138, 148, 0.4); }
}
