html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating>.form-control-plaintext::placeholder,
.form-floating>.form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating>.form-control-plaintext:focus::placeholder,
.form-floating>.form-control:focus::placeholder {
  text-align: start;
}

.timeline-grid {
  --segment-lane-multiplier: 1;
  display: grid;
  grid-template-columns: minmax(160px, 230px) minmax(calc(160px * var(--segment-lane-multiplier, 1)), calc(230px * var(--segment-lane-multiplier, 1))) minmax(320px, 1fr);
  grid-auto-rows: minmax(140px, auto);
  gap: 1.5rem;
  position: relative;
  margin-bottom: 4rem;
}

.timeline-axis {
  grid-column: 1;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border-right: 2px solid #ececec;
  padding-right: 1.5rem;
  position: relative;
}

.timeline-axis-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid #0d6efd;
  background-color: #fff;
  margin-top: 0.25rem;
}

.timeline-day-label {
  font-weight: 600;
}

.timeline-day-weekday {
  font-size: 0.9rem;
  color: var(--bs-secondary-color);
}

.timeline-day-mobile-header {
  display: none;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.timeline-day-mobile-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid #0d6efd;
  background-color: #fff;
  flex-shrink: 0;
}

.timeline-content {
  grid-column: 3;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.timeline-empty {
  font-size: 0.95rem;
}

.timeline-item {
  border: 1px solid #dfe3ea;
  border-left: 4px solid #0d6efd;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  background-color: #fdfdff;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  position: relative;
}

.timeline-item[data-sortable-entry] {
  padding-right: 2.25rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item--segment {
  border-color: rgba(196, 214, 255, 0.9);
  border-left-color: var(--segment-border, #0d6efd);
  background: linear-gradient(135deg, var(--segment-accent, rgba(13, 110, 253, 0.08)), #fff);
}

.timeline-item.is-selected {
  border-color: #0a58ca;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.timeline-item.is-dragging {
  opacity: 0.6;
  cursor: grabbing;
}

.timeline-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.timeline-item-details {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #dfe3ea;
  flex-basis: 100%;
}

.timeline-item.is-selected .timeline-item-details {
  display: block;
}

.timeline-segment-mobile {
  display: none;
  margin-bottom: 0.75rem;
}

.timeline-item-notes {
  white-space: pre-line;
  margin-bottom: 0.75rem;
  color: #495057;
}

.timeline-item-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.timeline-item-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--segment-accent, rgba(13, 110, 253, 0.12));
  color: var(--segment-border, #0d6efd);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}


.timeline-item-title {
  font-weight: 600;
}

.timeline-map-link {
  margin-left: 0.4rem;
  color: #0d6efd;
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
}

.timeline-map-link:hover,
.timeline-map-link:focus-visible {
  color: #0a58ca;
  text-decoration: none;
}

.cost-summary-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cost-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
  padding: 1.25rem;
}

.cost-summary-card-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .cost-summary-card-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.cost-summary-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.cost-summary-card table tbody tr+tr {
  border-top: 1px solid #f0f2f5;
}

.timeline-drag-handle {
  position: absolute;
  top: 50%;
  right: -10px;
  transform: translateY(-50%);
  width: 20px;
  height: 54px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
  color: #7c8ca7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  z-index: 2;
}

.timeline-drag-handle:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.4);
  outline-offset: 2px;
}

.timeline-drag-handle:active {
  cursor: grabbing;
}

.timeline-item.is-selected .timeline-drag-handle,
.timeline-drag-handle:hover {
  color: #0d6efd;
  border-color: rgba(13, 110, 253, 0.35);
  box-shadow: 0 8px 18px rgba(13, 110, 253, 0.18);
}

.timeline-drag-handle .bi {
  font-size: 1.35rem;
}

.timeline-content[data-day-sortable="true"] {
  position: relative;
}

.timeline-content[data-day-sortable="true"].is-saving::after {
  content: "Saving order…";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0d6efd;
  border-radius: 1rem;
  z-index: 1;
  pointer-events: none;
}

.booking-pill {
  border: 1px solid rgba(13, 110, 253, 0.2);
  border-radius: 0.75rem;
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(13, 110, 253, 0.06);
  margin-top: 0.65rem;
}

.booking-pill-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: #fff;
  color: var(--segment-border, #0d6efd);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.booking-pill-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.booking-pill-label {
  font-weight: 600;
  line-height: 1.2;
}

.booking-pill-meta {
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
}

.booking-pill-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.booking-pill-chip {
  border-radius: 999px;
  border: 1px solid rgba(13, 110, 253, 0.25);
  background: #fff;
  padding: 0.2rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0d6efd;
  text-transform: none;
}

.booking-pill-chip--positive {
  border-color: rgba(25, 135, 84, 0.45);
  background: #e7f6ef;
  color: #0f5132;
}

.booking-pill-chip--negative {
  border-color: rgba(220, 53, 69, 0.4);
  background: #fdecec;
  color: #842029;
}

.timeline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  opacity: 0;
  max-height: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, max-height 0.2s ease;
  flex-basis: 100%;
}

.timeline-item.is-selected .timeline-actions {
  opacity: 1;
  max-height: 200px;
  pointer-events: auto;
}

.metadata-block+.metadata-block {
  margin-top: 0.75rem;
}

.metadata-block-title {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.metadata-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}

.metadata-list dt {
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--bs-secondary-color);
  margin-bottom: 0.15rem;
}

.metadata-list dd {
  margin: 0 0 0.75rem;
}

.booking-summary {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  background: #f8fafc;
  margin-bottom: 0.75rem;
}

.booking-summary-title {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--bs-secondary-color);
  margin-bottom: 0.5rem;
}

.booking-summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem 1rem;
}

.booking-summary-list dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  margin-bottom: 0.15rem;
}

.booking-summary-list dd {
  margin: 0;
  font-weight: 600;
}

.booking-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.currency-picker {
  position: relative;
  width: 100%;
}

.currency-picker-dropdown {
  position: absolute;
  inset: calc(100% + 0.25rem) 0 auto 0;
  background: #fff;
  border: 1px solid #dfe3ea;
  border-radius: 0.75rem;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.12);
  max-height: 18rem;
  overflow-y: auto;
  z-index: 40;
  display: none;
}

.currency-picker-dropdown.is-open {
  display: block;
}

.currency-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}

.currency-picker-option:last-child {
  border-bottom: none;
}

.currency-picker-option:hover,
.currency-picker-option:focus,
.currency-picker-option.is-highlighted {
  background: #f8fafc;
}

.currency-picker-option-name {
  font-weight: 500;
  margin-right: 0.75rem;
}

.currency-picker-option-code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9rem;
  color: #0d6efd;
}

.timeline-segment {
  grid-column: 2;
  pointer-events: none;
  position: relative;
  --lane-gap: 0.5rem;
  --lane-count: 1;
  --lane-index: 0;
  --lane-size: calc((100% - (var(--lane-count) - 1) * var(--lane-gap)) / var(--lane-count));
  width: var(--lane-size);
  margin-left: calc(var(--lane-index) * (var(--lane-size) + var(--lane-gap)));
  justify-self: start;
  max-width: 100%;
}

.timeline-segment .timeline-item {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.timeline-segment-span {
  position: absolute;
  inset: 0.35rem 0;
  border-radius: 1rem;
  background: var(--segment-accent, rgba(13, 110, 253, 0.1));
  opacity: 0.55;
  z-index: 1;
}

.segment-type-flight,
.segment-type-train,
.segment-type-coach,
.segment-type-ferry,
.segment-type-taxi,
.segment-type-privatecar,
.segment-type-rentalcar,
.segment-type-parking {
  --segment-accent: rgba(13, 110, 253, 0.16);
  --segment-border: #0d6efd;
}

.segment-type-hotel,
.segment-type-flat,
.segment-type-house {
  --segment-accent: rgba(220, 53, 69, 0.14);
  --segment-border: #dc3545;
}

@media (max-width: 991.98px) {
  .timeline-grid {
    grid-template-columns: minmax(110px, 140px) 1fr;
    grid-auto-rows: auto;
    gap: 1.25rem;
  }

  .timeline-axis {
    padding-right: 1rem;
  }

  .timeline-content {
    grid-column: 2;
  }

  .timeline-segment {
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 575.98px) {
  .timeline-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .timeline-axis {
    display: none;
  }

  .timeline-segment {
    display: none;
  }

  .timeline-segment-mobile {
    display: block;
  }

  .timeline-content {
    order: 3;
    width: 100%;
  }

  .timeline-day-mobile-header {
    display: flex;
  }

  .timeline-day-mobile-header .timeline-day-label {
    font-size: 1rem;
  }

  .timeline-day-mobile-header .timeline-day-weekday {
    font-size: 0.85rem;
    margin-top: 0.1rem;
  }
}

.segment-type-tour,
.segment-type-museum,
.segment-type-park {
  --segment-accent: rgba(25, 135, 84, 0.18);
  --segment-border: #198754;
}

.segment-type-dining {
  --segment-accent: rgba(255, 193, 7, 0.18);
  --segment-border: #fd7e14;
}

.segment-type-note {
  --segment-accent: rgba(108, 117, 125, 0.18);
  --segment-border: #6c757d;
}

.segment-type-other {
  --segment-accent: rgba(102, 16, 242, 0.14);
  --segment-border: #6610f2;
}

.booking-detail-list dt {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--bs-secondary-color);

  .booking-detail-flag {
    font-weight: 600;
  }

  .booking-detail-flag--positive {
    color: #198754;
  }

  .booking-detail-flag--negative {
    color: #dc3545;
  }
}

.booking-detail-notes {
  white-space: pre-line;
  min-height: 1.5rem;
}

.route-map-card {
  --route-map-height: clamp(420px, 65vh, 640px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 992px) {
  .route-map-card {
    flex-direction: row;
    align-items: stretch;
  }
}

.route-map-viewport {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #f8fafc;
  min-height: var(--route-map-height);
  height: var(--route-map-height);
  flex: 2;
  overflow: hidden;
}

.route-map-viewport--disabled {
  display: flex;
  align-items: center;
  justify-content: center;
}

.route-map-loading,
.route-map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  padding: 2rem;
}

.route-map-loading {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 249, 252, 0.95));
  color: #0d6efd;
  font-weight: 600;
}

.route-map-placeholder {
  background: rgba(248, 249, 252, 0.95);
  color: #6c757d;
  font-weight: 600;
}

.route-stop-panel {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  min-height: var(--route-map-height);
  height: var(--route-map-height);
  max-height: var(--route-map-height);
  overflow: hidden;
}

.route-stop-panel-header {
  padding: 1.25rem;
  border-bottom: 1px solid #f0f2f5;
}

.route-stop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.route-stop {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f0f2f5;
  align-items: flex-start;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.route-stop:last-child {
  border-bottom: none;
}

.route-stop:hover,
.route-stop:focus-visible {
  background: #f3f6ff;
}

.route-stop:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.35);
  outline-offset: 2px;
}

.route-stop.is-active {
  background: #e8f1ff;
  box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.12);
}

.route-stop-sequence {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 25px rgba(13, 110, 253, 0.25);
  flex-shrink: 0;
}

.route-stop-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.route-stop-label {
  font-weight: 600;
}

.route-stop-meta {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #6c757d;
  letter-spacing: 0.08em;
}

.route-stop-date {
  font-size: 0.9rem;
  color: #495057;
}

.route-marker-info {
  max-width: 240px;
  font-size: 0.9rem;
}

.route-marker-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.route-marker-address {
  font-size: 0.85rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

.route-marker-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #6c757d;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.route-marker-date {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.route-marker-details {
  font-size: 0.85rem;
  color: #495057;
  border-top: 1px dashed #e5e7eb;
  padding-top: 0.35rem;
  white-space: pre-wrap;
}

.fab-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  z-index: 1030;
}

.fab-main {
  width: 3.5rem;
  height: 3.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 15px 25px rgba(13, 110, 253, 0.35);
}

.fab-icon {
  line-height: 1;
  transform: translateY(-1px);
}

.entry-metadata-section {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  background-color: #fff;
  margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
  .fab-container {
    left: 1rem;
  }
}

.place-picker-control .btn {
  min-width: 3rem;
}

.place-picker-map {
  min-height: 320px;
  border-radius: 0.75rem;
  border: 1px solid #dee2e6;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  overflow: hidden;
  position: relative;
}

.place-picker-map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--bs-secondary-color);
  padding: 1rem;
  text-align: center;
}

.place-picker-preview {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  background: #fdfdff;
  min-height: 100%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.place-picker-selection-name {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.place-picker-selection-address {
  font-size: 0.95rem;
}

.place-picker-selection-id {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.3rem 0.5rem;
  border-radius: 0.5rem;
  background: #eef2ff;
  color: #1d39c4;
  word-break: break-all;
  font-size: 0.85rem;
}

.place-picker-preview [data-place-picker-status] {
  font-size: 0.85rem;
}

/* Keep Google Maps autocomplete suggestions visible above Bootstrap modals */
.pac-container {
  z-index: 2000 !important;
}