/* ===================== Self-hosted font (Montserrat) ===================== */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/montserrat-latinext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --ink: #f8fbff;
  --muted: rgba(231, 241, 250, 0.72);
  --faint: rgba(231, 241, 250, 0.48);
  --line: rgba(255, 255, 255, 0.18);
  --glass: rgba(5, 24, 42, 0.52);
  --glass-strong: rgba(3, 18, 32, 0.74);
  --field: rgba(255, 255, 255, 0.1);
  --blue: #2d86d9;
  --blue-strong: #1b69b6;
  --cyan: #15c7d9;
  --warm: #f7b955;
  --danger: #ff8b7f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --font-display: "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

/* Ensure [hidden] wins over component display rules (.ghost-button, .primary-button, etc.) */
[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #041525;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background-image: url("assets/travel-hero.png");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

body::after {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(1, 14, 26, 0.9) 0%, rgba(3, 32, 58, 0.66) 42%, rgba(3, 21, 39, 0.42) 100%),
    linear-gradient(180deg, rgba(2, 18, 33, 0.16) 0%, rgba(0, 8, 18, 0.7) 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* Display type — Montserrat for brand, headings and key numerals */
.brand,
.hero-copy h1,
.section-heading h2,
.route-topbar h2,
.report-actions h2,
.destination-heading h2,
.place-card h3,
.timeline-content h3,
.report-output h3,
.empty-state h3,
.stat-card strong,
.auth-brand,
.auth-title,
.budget-breakdown h3,
.timeline-number {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

.hero-copy h1 {
  letter-spacing: -0.03em;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 22px;
  padding: 20px 42px 18px;
  background: var(--glass-strong);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
}

[data-theme="light"] .app-header {
  box-shadow: 0 12px 34px rgba(15, 50, 80, 0.12);
}

.brand,
.header-actions,
.form-actions,
.route-actions,
.report-actions,
.report-actions > div:last-child,
.place-meta,
.social-links,
.card-actions,
.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #061626;
  background: linear-gradient(135deg, #ffd36b, #ff8a3d);
  box-shadow: 0 12px 30px rgba(255, 143, 54, 0.24);
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.tab-button {
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
}

.tab-button.active {
  color: #fff;
}

.tab-button.active::after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: 5px auto 0;
  border-radius: 50%;
  background: #fff;
}

.header-actions {
  justify-content: flex-end;
}

.trip-chip {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 900;
}

.language-field {
  display: inline-flex;
  width: auto;
  gap: 0;
}

.language-field select {
  width: 72px;
  min-height: 40px;
  padding: 8px 28px 8px 12px;
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(560px, 34vw) minmax(0, 1fr);
  gap: clamp(64px, 5vw, 108px);
  align-items: start;
  min-height: calc(100vh - 86px);
  padding: 34px 42px 42px;
}

.side-panel,
.main-panel {
  min-width: 0;
}

.side-panel {
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  min-height: 338px;
  padding: 76px 0 28px 74px;
  overflow: hidden;
}

.hero-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(3.6rem, 4.7vw, 4.85rem);
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: 0;
  max-width: 100%;
}

.hero-copy p {
  max-width: min(100%, 520px);
  margin: 18px 0 28px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.98rem;
  line-height: 1.55;
}

.route-rail {
  position: absolute;
  top: 34px;
  bottom: 32px;
  left: 18px;
  width: 22px;
}

.route-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 42px;
  left: 10px;
  width: 1px;
  background: rgba(255, 255, 255, 0.34);
}

.route-rail span {
  position: absolute;
  left: 6px;
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.05);
}

.route-rail span:nth-child(1) {
  top: 18%;
}

.route-rail span:nth-child(2) {
  top: 45%;
}

.route-rail span:nth-child(3) {
  top: 70%;
}

.route-rail strong {
  position: absolute;
  bottom: 0;
  left: -6px;
  color: #fff;
  font-size: 0.78rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel,
.main-panel,
.toolbar,
.stat-card,
.map-panel,
.timeline-panel,
.report-output {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.panel.compact {
  box-shadow: none;
}

.section-heading h2,
.route-topbar h2,
.report-actions h2,
.destination-heading h2 {
  margin: 0;
  color: #fff;
  line-height: 1.1;
}

.place-form,
.panel.compact {
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
}

.auto-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.switch-field {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.switch-field input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
}

.switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  transition: background 180ms ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease;
}

.switch-field input:checked + .switch-track {
  background: var(--blue);
}

.switch-field input:checked + .switch-track::after {
  transform: translateX(18px);
}

.auto-save-status {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  outline: none;
  color: #fff;
  background: var(--field);
}

select option {
  color: #071827;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

input:not([type="checkbox"]):focus,
select:focus,
textarea:focus {
  border-color: rgba(94, 190, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(45, 134, 217, 0.24);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.primary-button:hover {
  box-shadow: 0 16px 34px rgba(45, 134, 217, 0.42);
}

.primary-button {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 28px rgba(45, 134, 217, 0.3);
}

.primary-button:hover {
  background: var(--blue-strong);
}

.hero-button {
  min-width: 188px;
  min-height: 58px;
  font-size: 1.06rem;
}

.ghost-button,
.import-button,
.icon-button {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.11);
}

.ghost-button:hover,
.icon-button:hover,
.import-button:hover {
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.18);
}

.danger-button {
  color: #fff;
  border-color: rgba(255, 139, 127, 0.36);
  background: rgba(180, 35, 24, 0.34);
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.import-button input {
  display: none;
}

.main-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
}

.destination-heading,
.route-topbar,
.report-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.destination-heading h2,
.route-topbar h2,
.report-actions h2 {
  font-size: 2.2rem;
}

.slider-controls {
  display: flex;
  gap: 10px;
}

.slider-controls span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, 180px));
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  box-shadow: none;
}

@media (max-width: 1380px) {
  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 14px;
  box-shadow: none;
}

.stat-card strong {
  display: block;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.place-list {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 0 4px 18px;
  scroll-snap-type: x proximity;
}

.place-list::-webkit-scrollbar {
  height: 8px;
}

.place-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
}

.place-card {
  position: relative;
  display: grid;
  align-content: end;
  gap: 12px;
  min-width: 292px;
  max-width: 292px;
  min-height: 462px;
  padding: 270px 16px 16px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(4, 21, 37, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: box-shadow 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.place-card:hover:not(.dragging) {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.44);
}

.place-card::before,
.place-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.place-card::before {
  top: 0;
  height: 258px;
  background-image: url("assets/travel-hero.png");
  background-size: 760px 428px;
  background-position: center;
}

.place-card:nth-child(2n)::before {
  background-position: 72% 40%;
}

.place-card:nth-child(3n)::before {
  background-position: 28% 50%;
}

.place-card:nth-child(4n)::before {
  background-position: 55% 72%;
}

.place-card::after {
  top: 0;
  height: 258px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 46%, rgba(3, 18, 32, 0.88) 100%),
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.95) 0 23px, transparent 24px);
}

.place-card-header,
.place-notes,
.social-links,
.card-actions {
  position: relative;
  z-index: 1;
}

.place-card-header {
  display: grid;
  gap: 10px;
}

.place-card h3 {
  margin: 0;
  color: #fff;
  font-size: 1.14rem;
  line-height: 1.15;
}

.place-meta {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #fff;
  background: rgba(21, 199, 217, 0.18);
  font-size: 0.74rem;
  font-weight: 900;
}

.tag.priority-high {
  background: rgba(247, 185, 85, 0.28);
}

.tag.priority-medium {
  background: rgba(45, 134, 217, 0.28);
}

.tag.priority-low {
  background: rgba(72, 187, 120, 0.24);
}

.social-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
}

.social-link:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.place-notes {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-actions {
  margin-top: 2px;
}

.route-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.18fr) minmax(280px, 0.82fr);
  gap: 16px;
}

.map-panel {
  min-height: 580px;
  overflow: hidden;
}

.route-map {
  display: block;
  width: 100%;
  height: 540px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    rgba(7, 28, 48, 0.78);
  background-size: 44px 44px;
}

.map-note {
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.timeline-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 16px;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.timeline-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #061626;
  background: #fff;
  font-weight: 950;
}

.timeline-content {
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.timeline-content h3 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 0.96rem;
}

.timeline-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.report-output {
  display: grid;
  gap: 16px;
  padding: 20px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.report-output h3 {
  margin: 0;
  color: #fff;
}

.report-output ul {
  margin: 0;
  padding-left: 18px;
}

.empty-state {
  width: 100%;
  min-width: 280px;
  padding: 28px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: #fff;
}

.empty-state p {
  margin: 0;
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  z-index: 40;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #fff;
  background: rgba(3, 18, 32, 0.92);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 22px 24px 8px;
  }

  .tabs,
  .header-actions {
    justify-content: flex-start;
  }

  .app-shell,
  .route-layout {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .side-panel {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    align-items: start;
    overflow: visible;
  }

  .hero-copy {
    min-height: 300px;
  }

  .toolbar,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-header {
    gap: 14px;
    padding: 18px 16px 8px;
  }

  .tabs {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    overflow-x: auto;
  }

  .header-actions {
    width: 100%;
  }

  .trip-chip {
    display: none;
  }

  .app-shell {
    padding: 18px 16px 34px;
  }

  .side-panel,
  .toolbar,
  .stats-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .header-actions .primary-button,
  .header-actions .ghost-button {
    flex: 1 1 150px;
  }

  .hero-copy {
    min-height: 280px;
    padding: 50px 0 24px 48px;
  }

  .hero-copy h1 {
    font-size: clamp(3rem, 15vw, 4rem);
  }

  .hero-copy p {
    font-size: 0.92rem;
  }

  .route-rail {
    left: 8px;
  }

  .destination-heading,
  .route-topbar,
  .report-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .destination-heading h2,
  .route-topbar h2,
  .report-actions h2 {
    font-size: 1.7rem;
  }

  .place-card {
    min-width: 82vw;
    max-width: 82vw;
  }

  .map-panel {
    min-height: 460px;
  }

  .route-map {
    height: 420px;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  body::before,
  body::after,
  .app-header,
  .side-panel,
  .toolbar,
  .stats-grid,
  .destination-heading,
  .place-list,
  .route-topbar,
  .route-layout,
  .report-actions button,
  .import-button,
  .toast {
    display: none !important;
  }

  .app-shell,
  .main-panel {
    display: block;
    padding: 0;
    box-shadow: none;
    border: 0;
  }

  .tab-view {
    display: none;
  }

  #reportTab {
    display: block;
  }

  .report-output {
    color: #111;
    background: #fff;
    border: 0;
    box-shadow: none;
  }

  .report-output h3 {
    color: #111;
  }

  .budget-breakdown .bar-track,
  .budget-breakdown .bar-fill {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ===================== New feature components ===================== */

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.theme-toggle {
  width: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.trip-chip {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.coords-actions {
  display: grid;
  gap: 8px;
}

.geocode-button {
  justify-self: start;
}

.geocode-button.is-loading {
  opacity: 0.7;
  cursor: progress;
}

.field-help {
  margin: 0;
  color: var(--faint);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.4;
}

/* Drag & drop */
.place-card[draggable="true"] {
  cursor: grab;
}

.drag-handle {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: #fff;
  background: rgba(3, 18, 32, 0.55);
  font-size: 0.85rem;
  letter-spacing: -2px;
  opacity: 0;
  cursor: grab;
  transition: opacity 160ms ease;
}

.place-card:hover .drag-handle,
.place-card:focus-within .drag-handle {
  opacity: 1;
}

.place-card.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.place-card.drag-over {
  outline: 2px dashed var(--cyan);
  outline-offset: 4px;
}

/* Timeline leg distance */
.timeline-leg {
  margin-left: 15px;
  padding: 3px 0 3px 20px;
  border-left: 2px dotted rgba(255, 255, 255, 0.28);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Budget breakdown bars */
.budget-breakdown {
  display: grid;
  gap: 10px;
}

.budget-breakdown h3 {
  margin: 8px 0 0;
  font-size: 1rem;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.bar-fill {
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}

/* Toast with undo action */
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toast-action {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.8rem;
  font-weight: 900;
}

.toast-action:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Interactive Leaflet map */
.route-leaflet {
  width: 100%;
  height: 540px;
  border-radius: 8px;
  background: rgba(7, 28, 48, 0.78);
}

.route-leaflet[hidden] {
  display: none;
}

.leaflet-container {
  font: inherit;
}

.route-pin {
  background: transparent;
  border: 0;
}

.route-pin span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  font-weight: 900;
}

@media (max-width: 760px) {
  .route-leaflet {
    height: 420px;
  }
}

/* ===================== Light theme ===================== */

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #0f2233;
  --muted: rgba(15, 34, 51, 0.72);
  --faint: rgba(15, 34, 51, 0.5);
  --line: rgba(15, 34, 51, 0.14);
  --glass: rgba(255, 255, 255, 0.82);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --field: rgba(15, 34, 51, 0.05);
  --shadow: 0 20px 50px rgba(15, 50, 80, 0.16);
}

[data-theme="light"] body {
  background: #e9eef4;
}

[data-theme="light"] body::after {
  background:
    linear-gradient(90deg, rgba(233, 238, 244, 0.9) 0%, rgba(233, 238, 244, 0.66) 42%, rgba(233, 238, 244, 0.44) 100%),
    linear-gradient(180deg, rgba(233, 238, 244, 0.34) 0%, rgba(233, 238, 244, 0.78) 100%);
}

[data-theme="light"] .brand,
[data-theme="light"] .hero-copy h1,
[data-theme="light"] .section-heading h2,
[data-theme="light"] .route-topbar h2,
[data-theme="light"] .report-actions h2,
[data-theme="light"] .destination-heading h2,
[data-theme="light"] .tab-button.active,
[data-theme="light"] .stat-card strong,
[data-theme="light"] .timeline-content h3,
[data-theme="light"] .report-output h3,
[data-theme="light"] .empty-state h3,
[data-theme="light"] .bar-label {
  color: var(--ink);
}

[data-theme="light"] .eyebrow {
  color: rgba(15, 34, 51, 0.72);
}

[data-theme="light"] .hero-copy p {
  color: rgba(15, 34, 51, 0.82);
}

[data-theme="light"] .tab-button {
  color: rgba(15, 34, 51, 0.6);
}

[data-theme="light"] .tab-button.active::after {
  background: var(--ink);
}

[data-theme="light"] label,
[data-theme="light"] .switch-field {
  color: rgba(15, 34, 51, 0.78);
}

[data-theme="light"] input:not([type="checkbox"]),
[data-theme="light"] select,
[data-theme="light"] textarea {
  color: var(--ink);
  border-color: rgba(15, 34, 51, 0.18);
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: rgba(15, 34, 51, 0.45);
}

[data-theme="light"] select option {
  color: #0f2233;
}

[data-theme="light"] .auto-save-row {
  border-color: rgba(15, 34, 51, 0.12);
  background: rgba(15, 34, 51, 0.04);
}

[data-theme="light"] .auto-save-status {
  color: rgba(15, 34, 51, 0.7);
}

[data-theme="light"] .trip-chip {
  color: var(--ink);
  border-color: rgba(15, 34, 51, 0.16);
  background: rgba(15, 34, 51, 0.05);
}

[data-theme="light"] .ghost-button,
[data-theme="light"] .import-button,
[data-theme="light"] .icon-button,
[data-theme="light"] .language-field select {
  color: var(--ink);
  border-color: rgba(15, 34, 51, 0.18);
  background: rgba(15, 34, 51, 0.05);
}

[data-theme="light"] .ghost-button:hover,
[data-theme="light"] .icon-button:hover,
[data-theme="light"] .import-button:hover {
  border-color: rgba(15, 34, 51, 0.4);
  background: rgba(15, 34, 51, 0.1);
}

[data-theme="light"] .slider-controls span {
  color: var(--ink);
  background: rgba(15, 34, 51, 0.08);
}

[data-theme="light"] .timeline-number {
  color: #fff;
  background: var(--blue);
}

[data-theme="light"] .timeline-content {
  border-color: rgba(15, 34, 51, 0.12);
  background: rgba(15, 34, 51, 0.04);
}

[data-theme="light"] .timeline-content p,
[data-theme="light"] .timeline-leg {
  color: var(--muted);
}

[data-theme="light"] .timeline-leg {
  border-color: rgba(15, 34, 51, 0.28);
}

[data-theme="light"] .report-output {
  color: var(--muted);
}

[data-theme="light"] .empty-state {
  border-color: rgba(15, 34, 51, 0.2);
  background: rgba(15, 34, 51, 0.04);
}

[data-theme="light"] .bar-track {
  background: rgba(15, 34, 51, 0.1);
}

[data-theme="light"] .route-rail::before {
  background: rgba(15, 34, 51, 0.34);
}

[data-theme="light"] .route-rail span {
  background: rgba(15, 34, 51, 0.5);
  box-shadow: 0 0 0 8px rgba(15, 34, 51, 0.05);
}

[data-theme="light"] .route-rail strong {
  color: var(--ink);
}

/* Google Places search (new PlaceAutocompleteElement) */
.google-search {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(45, 134, 217, 0.35);
  border-radius: 8px;
  background: rgba(45, 134, 217, 0.1);
}

.field-label-lite {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
}

#googlePlaceBox {
  display: block;
}

#googlePlaceBox gmp-place-autocomplete {
  width: 100%;
  display: block;
}

.google-key-status {
  color: var(--cyan);
  font-weight: 800;
}

.google-key-status.error {
  color: var(--danger);
}

[data-theme="light"] .field-label-lite {
  color: rgba(15, 34, 51, 0.78);
}

/* ===================== Accounts / auth ===================== */

.account-chip {
  max-width: 200px;
  overflow: hidden;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  background: rgba(21, 199, 217, 0.18);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

[data-theme="light"] .account-chip {
  color: var(--ink);
  border-color: rgba(15, 34, 51, 0.16);
  background: rgba(21, 199, 217, 0.2);
}

body.auth-open {
  overflow: hidden;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 12, 22, 0.72);
  backdrop-filter: blur(10px);
}

.auth-overlay[hidden] {
  display: none;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 30px 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 900;
}

[data-theme="light"] .auth-brand {
  color: var(--ink);
}

.auth-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.auth-title {
  margin: 4px 0 0;
  color: #fff;
  font-size: 1.5rem;
}

[data-theme="light"] .auth-title {
  color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form .primary-button {
  margin-top: 4px;
  width: 100%;
  min-height: 46px;
}

.auth-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
}

.auth-switch,
.auth-local {
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.auth-switch {
  color: var(--cyan);
}

.auth-switch:hover,
.auth-local:hover {
  text-decoration: underline;
}

.auth-local {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 2px;
}
