.page-planner { overflow-x: hidden; background: #100b08; }

.planner-main {
  --map-zoom: 1;
  position: relative;
  min-height: max(100svh, min(56.25vw, 941px));
  overflow: hidden;
  isolation: isolate;
  background: #3b2415;
}

.planner-backdrop {
  position: absolute;
  z-index: -3;
  inset: 0;
  background: url("../../assets/backgrounds/planner-jordan-map.jpg") center/cover no-repeat;
  transform: scale(var(--map-zoom));
  transition: transform 700ms var(--ease), filter 400ms ease;
}

.planner-vignette {
  position: absolute;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6,4,3,.48), transparent 35%, transparent 75%, rgba(5,3,2,.2)),
    linear-gradient(0deg, rgba(6,4,3,.42), transparent 38%, rgba(4,3,2,.2));
}

.page-planner .site-header { background: linear-gradient(rgba(5,3,2,.58), transparent); }
.page-planner .nav-shell { width: min(86vw, 1440px); border-bottom: 0; }
.planner-glass { border: 1px solid rgba(255,255,255,.16); background: linear-gradient(145deg,rgba(255,255,255,.07),transparent 30%),rgba(12,13,13,.88); box-shadow: 0 25px 65px rgba(0,0,0,.45); backdrop-filter: blur(18px) saturate(115%); }

.planner-heading {
  position: absolute;
  z-index: 7;
  top: 68px;
  left: 35.8vw;
  color: #fff;
}

.planner-heading h1 { margin: 0; font: 500 clamp(2.1rem,2.6vw,2.9rem)/1 var(--serif); letter-spacing: -.035em; text-shadow: 0 6px 25px rgba(0,0,0,.48); }
.planner-heading > p { margin: 5px 0 0; font-size: .86rem; text-shadow: 0 3px 14px rgba(0,0,0,.7); }

.planner-heading-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  max-width: 95vw;
}

.view-toggle {
  width: 160px;
  height: 40px;
  margin-top: 0;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 27px;
  background: rgba(10,13,13,.86);
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
  flex-shrink: 0;
}
.view-toggle button { border-radius: 24px; background: transparent; color: rgba(255,255,255,.65); font-size: .74rem; font-weight: 600; cursor: pointer; transition: background 240ms ease,color 240ms ease,transform 240ms var(--ease); }
.view-toggle button.is-active { background: linear-gradient(145deg,#f9dc9b,#efb95e); color: #1e160e; box-shadow: 0 5px 15px rgba(0,0,0,.22); }

/* Itinerary */
.trip-panel {
  position: absolute;
  z-index: 10;
  top: 174px;
  bottom: 40px;
  left: 2.65vw;
  width: min(23vw, 360px);
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 300ms ease, opacity 300ms ease;
}

.panel-collapse-btn {
  position: absolute;
  top: 20px;
  right: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(18, 14, 11, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f3d79e;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1), background 180ms ease, border-color 180ms ease;
  z-index: 15;
}
.panel-collapse-btn:hover {
  background: rgba(32, 23, 17, 0.98);
  border-color: rgba(243, 215, 158, 0.7);
  transform: scale(1.08);
}
.panel-collapse-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1);
}

.trip-panel.is-collapsed {
  transform: translateX(calc(-100% - 2.65vw));
  box-shadow: none;
}
.trip-panel.is-collapsed .panel-collapse-icon {
  transform: rotate(180deg);
}
.trip-panel.is-collapsed .panel-collapse-btn {
  right: -52px;
  transform: scale(1.05);
}
.trip-panel.is-collapsed .panel-collapse-btn:hover {
  transform: scale(1.15);
}

.trip-panel__heading { min-height: 80px; display: flex; align-items: flex-start; justify-content: space-between; padding: 0 4px 14px; border-bottom: 1px solid rgba(255,255,255,.15); }
.trip-panel__heading h2 { margin: 0; font: 500 1.6rem var(--serif); }
.trip-panel__heading p { margin: 5px 0 0; color: rgba(255,255,255,.72); font-size: .85rem; }
.trip-panel__heading i { margin-inline: 10px; font-style: normal; }
.round-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: rgba(255,255,255,.05); cursor: pointer; transition: transform 180ms var(--ease),background 180ms ease; }
.round-button:hover { transform: rotate(20deg); background: rgba(255,255,255,.1); }
.round-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.itinerary-list { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 0 3px 0 40px; scrollbar-width: thin; scrollbar-color: rgba(230,190,115,.4) transparent; }
.itinerary-list::before { content: ""; position: absolute; left: 18px; top: 40px; bottom: 40px; width: 2px; background: linear-gradient(#f0c575,rgba(255,255,255,.24)); }
.itinerary-item { position: relative; min-height: 92px; display: grid; grid-template-columns: 84px minmax(0,1fr) 26px; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.13); cursor: pointer; transition: background 180ms ease,transform 220ms var(--ease),opacity 180ms ease; }
.itinerary-item:hover,.itinerary-item.is-active { background: linear-gradient(90deg,rgba(224,174,91,.08),transparent); }
.itinerary-item.is-dragging { opacity: .45; transform: scale(.98); }
.itinerary-item.is-drop-target { box-shadow: inset 0 2px var(--gold-bright); }
.day-number { position: absolute; left: -22px; top: 50%; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: #f3d79e; color: #20160e; font-weight: 600; font-size: .72rem; transform: translate(-50%,-50%); z-index: 2; }
.itinerary-thumb { width: 84px; height: 72px; object-fit: cover; border-radius: 10px; }
.itinerary-copy small { color: rgba(255,255,255,.6); font-size: .67rem; }
.itinerary-copy h3 { margin: 2px 0 0; color: #fff; font-size: .85rem; font-weight: 500; }
.itinerary-copy p { margin: 2px 0 0; color: rgba(255,255,255,.55); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-tools { display: grid; justify-items: center; gap: 4px; }
.drag-handle,.remove-stop { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: transparent; color: rgba(255,255,255,.48); cursor: grab; }
.drag-handle { font-size: 1.2rem; letter-spacing: -3px; }
.remove-stop { font-size: 1rem; cursor: pointer; opacity: 0; transition: opacity 180ms ease,background 180ms ease; }
.itinerary-item:hover .remove-stop,.itinerary-item:focus-within .remove-stop { opacity: 1; }
.remove-stop:hover { background: rgba(184,75,54,.24); color: #ffc2ad; }
.add-place-button { min-height: 52px; margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 14px; background: linear-gradient(145deg,#f8dc9e,#eeb75d); color: #21170e; font-size: .86rem; font-weight: 600; cursor: pointer; transition: transform 180ms var(--ease),filter 180ms ease; }
.add-place-button:hover { transform: translateY(-2px); filter: brightness(1.04); }
.add-place-button span { font-size: 1.3rem; font-weight: 400; }

/* Map */
.route-stage { position: absolute; z-index: 3; inset: 0; pointer-events: none; transform: scale(var(--map-zoom)); transform-origin: 61% 56%; transition: transform 700ms var(--ease),opacity 300ms ease; }

/* Region Filter Bar */
.region-filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 0;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(22, 16, 12, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-width: 95vw;
  overflow-x: auto;
}
.region-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
}
.region-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.region-chip.is-active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.region-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f2c87e;
  box-shadow: 0 0 8px currentColor;
  flex-shrink: 0;
}
.region-chip--north .region-chip__dot { background: #34d399; }
.region-chip--central .region-chip__dot { background: #38bdf8; }
.region-chip--south .region-chip__dot { background: #f43f5e; }
.region-chip.is-active.region-chip--north {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}
.region-chip.is-active.region-chip--central {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}
.region-chip.is-active.region-chip--south {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

/* Route SVG & Pathing */
.route-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.route-path-glow {
  fill: none;
  stroke: rgba(245, 159, 25, 0.4);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#route-glow-filter);
  transition: d 550ms cubic-bezier(0.4, 0, 0.2, 1);
}
.route-path-main {
  fill: none;
  stroke: url(#route-gradient);
  stroke-width: 0.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2.2 1.4;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.85));
  transition: d 550ms cubic-bezier(0.4, 0, 0.2, 1);
  animation: routeDashFlow 24s linear infinite;
}
.route-user-connection {
  fill: none;
  stroke-width: 0.5;
  stroke-linecap: round;
  stroke-dasharray: 1.2 1.2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
  animation: routeDashFlow 10s linear infinite reverse;
}
@keyframes routeDashFlow {
  to { stroke-dashoffset: -100; }
}

/* Map Markers */
.map-markers { position: absolute; inset: 0; pointer-events: none; }
.map-marker {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: auto;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  outline: none;
  animation: marker-in 550ms var(--ease) both;
  animation-delay: calc(var(--marker-index) * 60ms);
  transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms ease, filter 240ms ease;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.5));
}
.map-marker.is-dimmed {
  opacity: 0.22;
  filter: grayscale(0.85) blur(0.5px);
  pointer-events: none;
}
.map-marker__pin {
  position: absolute;
  left: -19px;
  top: -46px;
  z-index: 4;
  width: 38px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 7px;
  clip-path: path("M19 0C8.5 0 0 8.5 0 19c0 13 19 27 19 27s19-14 19-27C38 8.5 29.5 0 19 0Z");
  background: var(--pin, #d85c32);
  background-image: linear-gradient(145deg, rgba(255,255,255,.45) 0%, transparent 60%, rgba(0,0,0,.3) 100%);
  color: #fff;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.45));
  transition: transform 220ms ease;
}
.map-marker__num {
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
}
.map-marker:hover .map-marker__pin {
  transform: scale(1.12) translateY(-2px);
}
.map-marker.is-active .map-marker__pin {
  transform: scale(1.18) translateY(-4px);
  filter: drop-shadow(0 0 12px var(--gold-bright, #f2c87e)) drop-shadow(0 6px 10px rgba(0,0,0,0.7));
}

/* Label on right side */
.map-marker--side-right .map-marker__label {
  position: absolute;
  left: 9px;
  top: -42px;
  z-index: 2;
  height: 38px;
  padding: 3px 14px 3px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 0 20px 20px 0;
  background: linear-gradient(135deg, rgba(255,252,247,.97), rgba(245,238,228,.95));
  color: #1a120b;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.9);
  border-left: none;
  transition: all 220ms var(--ease);
}

/* Label on left side */
.map-marker--side-left .map-marker__label {
  position: absolute;
  right: 9px;
  top: -42px;
  z-index: 2;
  height: 38px;
  padding: 3px 12px 3px 14px;
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
  border-radius: 20px 0 0 20px;
  background: linear-gradient(135deg, rgba(255,252,247,.97), rgba(245,238,228,.95));
  color: #1a120b;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.9);
  border-right: none;
  transition: all 220ms var(--ease);
}

.map-marker:hover .map-marker__label,
.map-marker.is-active .map-marker__label {
  background: #ffffff;
  color: #000;
  box-shadow: 0 8px 24px rgba(0,0,0,.38);
}
.map-marker.is-active .map-marker__label {
  border-color: var(--gold-bright, #f2c87e);
}

.map-marker__label img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.25);
  flex-shrink: 0;
}
.map-marker__name {
  line-height: 1;
}
.map-marker__badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  color: #555;
  letter-spacing: 0;
}
.region--north .map-marker__badge {
  background: rgba(52, 211, 153, 0.16);
  color: #047857;
}
.region--central .map-marker__badge {
  background: rgba(56, 189, 248, 0.16);
  color: #0369a1;
}
.region--south .map-marker__badge {
  background: rgba(244, 63, 94, 0.16);
  color: #be123c;
}

/* User Live Location Marker */
.user-live-marker {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 15;
  pointer-events: auto;
  transition: left 600ms var(--ease), top 600ms var(--ease);
}
.user-live-dot {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 14px #38bdf8, 0 3px 8px rgba(0,0,0,0.5);
  z-index: 3;
}
.user-live-radar {
  position: absolute;
  left: -28px;
  top: -28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,0.38) 0%, rgba(56,189,248,0.06) 65%, transparent 70%);
  border: 1px solid rgba(56,189,248,0.55);
  animation: liveRadar 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  z-index: 1;
}
.user-live-radar--delay {
  animation-delay: 1.2s;
}
@keyframes liveRadar {
  0% { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
.user-live-card {
  position: absolute;
  left: 14px;
  top: -20px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 14px rgba(56,189,248,0.25);
  color: #fff;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}
.user-live-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulseDot 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}
.user-live-details {
  display: flex;
  flex-direction: column;
}
.user-live-details strong {
  font-size: 0.74rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.1;
}
.user-live-details span {
  font-size: 0.64rem;
  color: #94a3b8;
  line-height: 1.1;
}

/* Map Controls */
.map-controls {
  pointer-events: auto;
  position: absolute;
  z-index: 12;
  top: 106px;
  right: 3.7vw;
  width: 53px;
  overflow: hidden;
  border-radius: 27px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  transform: scale(calc(1 / var(--map-zoom, 1)));
  transform-origin: top right;
}
.map-controls button {
  width: 53px;
  height: 48px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}
.map-controls button:first-child { height: 52px; }
.map-controls button:last-child { border-bottom: 0; }
.map-controls button:hover {
  background: rgba(255,255,255,.12);
  color: #f2c87e;
}
.map-controls button.is-active {
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
}
.map-controls svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Details */
.place-detail { position: absolute; z-index: 10; top: 263px; right: 2.65vw; width: min(25.8vw, 433px); min-height: 490px; padding: 25px 27px 22px; border-radius: 22px; transition: opacity 300ms ease,transform 350ms var(--ease); }
.place-detail.is-collapsed { opacity: 0; pointer-events: none; transform: translateX(35px); }
.detail-close { position: absolute; top: 22px; right: 22px; width: 47px; height: 47px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(255,255,255,.035); color: #fff; font-size: 1.6rem; cursor: pointer; }
.place-detail > p:first-of-type { margin: 0; color: rgba(255,255,255,.65); font-size: .9rem; }
.place-detail h2 { margin: 2px 0 15px; font: 500 2rem var(--serif); }
.detail-gallery { display: grid; grid-template-columns: 1.28fr 1fr .82fr; gap: 10px; }
.detail-gallery img { width: 100%; height: 132px; object-fit: cover; border-radius: 11px; }
.detail-meta { margin-top: 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: rgba(255,255,255,.74); }
.detail-meta span { display: inline-flex; align-items: center; gap: 7px; font-size: .7rem; }
.detail-meta svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.detail-meta b { font-weight: 400; white-space: nowrap; }
.detail-description { min-height: 62px; margin: 19px 0; color: rgba(255,255,255,.72); font-size: .76rem; line-height: 1.65; }
.detail-action { width: 100%; min-height: 60px; display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: 15px; background: linear-gradient(145deg,#f8dc9e,#eeb75d); color: #21170e; font-size: .83rem; font-weight: 600; cursor: pointer; }
.detail-action.is-remove { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.detail-link { width: fit-content; display: block; margin: 13px auto 0; color: var(--sand-light); font-size: .66rem; }

.trip-preview-card { position: absolute; z-index: 11; right: 2.65vw; bottom: 33px; width: min(21.5vw, 355px); min-height: 95px; padding: 12px 14px; display: grid; grid-template-columns: 70px 1fr 46px; align-items: center; gap: 14px; border-radius: 19px; color: #fff; text-align: left; cursor: pointer; transition: transform 200ms var(--ease),background 200ms ease; }
.trip-preview-card:hover { transform: translateY(-3px); background-color: rgba(26,24,21,.94); }
.trip-preview-card img { width: 70px; height: 65px; object-fit: cover; border-radius: 9px; }
.trip-preview-card span { display: grid; gap: 6px; }
.trip-preview-card strong { font-size: .83rem; }
.trip-preview-card small { color: rgba(255,255,255,.6); font-size: .69rem; }
.trip-preview-card > b { width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; font-size: 1.25rem; }

/* List view */
.planner-list-view { position: absolute; z-index: 8; top: 286px; left: 36vw; right: 30vw; bottom: 72px; overflow-y: auto; padding: 22px; border-radius: 20px; }
.planner-list-view[hidden] { display: none; }
.list-view-item { display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 14px; padding: 12px; border-bottom: 1px solid rgba(255,255,255,.12); cursor: pointer; animation: list-in 420ms var(--ease) both; animation-delay: calc(var(--item-index) * 60ms); }
.list-view-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; }
.list-view-item h3 { margin: 0; font-size: .82rem; }.list-view-item p{margin:3px 0 0;color:var(--muted);font-size:.65rem}.list-view-item b{color:var(--sand-light);font-size:.65rem}
.planner-main.is-list-view .route-stage { opacity: 0; pointer-events: none; }
.list-view-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 2px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.13); }
.list-view-heading p { margin: 0 0 4px; color: var(--sand-light); font-size: .58rem; letter-spacing: .15em; }
.list-view-heading h2 { margin: 0; font: 500 1.45rem var(--serif); }
.list-view-heading > span { color: rgba(255,255,255,.58); font-size: .62rem; white-space: nowrap; }
.list-view-item.is-active { background: rgba(236,184,94,.1); }
.trip-empty { min-height: 220px; display: grid; align-content: center; justify-items: center; gap: 7px; color: rgba(255,255,255,.55); text-align: center; }
.trip-empty strong { color: #fff; font-family: var(--serif); font-size: 1.2rem; }
.trip-empty span { max-width: 240px; font-size: .7rem; line-height: 1.5; }
.planner-main.is-optimizing .route-stage { opacity: .45; filter: blur(2px); }
.planner-main.is-optimizing .planner-backdrop { filter: saturate(.75) brightness(.85); }

/* Dialogs */
.planner-dialog { width: min(92vw, 590px); max-height: 88vh; overflow-y: auto; padding: 32px; border: 1px solid rgba(255,255,255,.18); border-radius: 22px; background: linear-gradient(145deg,rgba(255,255,255,.04),transparent),#111312; color: #fff; box-shadow: 0 35px 110px rgba(0,0,0,.75); }
.planner-dialog::backdrop { background: rgba(4,3,2,.74); backdrop-filter: blur(9px); }
.dialog-x {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  inset-inline-start: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}
.dialog-x:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}
.dialog-kicker {
  margin: 0;
  color: var(--sand-light);
  font-size: .61rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding-inline-end: 48px;
}
.planner-dialog h2 {
  margin: 7px 0 24px;
  font: 500 2.25rem var(--serif);
  padding-inline-end: 48px;
}
.planner-field { display: grid; gap: 9px; margin: 18px 0; color: rgba(255,255,255,.78); font-size: .72rem; }
.planner-field > span { display: grid; grid-template-columns: 1fr 70px; align-items: center; gap: 14px; }
.planner-field input[type="range"] { width: 100%; accent-color: var(--gold-bright); }
.planner-field output { padding: 8px; border-radius: 18px; background: rgba(255,255,255,.08); text-align: center; color: #fff; }
.planner-field select,.place-search input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid rgba(255,255,255,.17); border-radius: 10px; background: #181b19; color: #fff; }
.interest-field { margin: 20px 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 9px; }
.interest-field legend { width: 100%; margin-bottom: 10px; color: rgba(255,255,255,.78); font-size: .72rem; }
.interest-field input { position: absolute; opacity: 0; }
.interest-field span { display: block; padding: 8px 13px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; color: var(--muted); font-size: .66rem; cursor: pointer; }
.interest-field input:checked + span { border-color: var(--gold-bright); background: rgba(205,150,71,.17); color: #f5d69a; }
.planner-primary,.planner-secondary { min-height: 50px; padding: 0 20px; border-radius: 11px; font-size: .73rem; font-weight: 600; cursor: pointer; }
.planner-primary { width: 100%; background: linear-gradient(145deg,#f8dc9e,#eeb75d); color: #21170e; }
.planner-secondary { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); color: #fff; }
.place-picker-dialog {
  width: min(94vw, 700px);
}

.place-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.place-search-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: rgba(244, 237, 223, 0.45);
  stroke-width: 2;
  pointer-events: none;
}
html[dir="rtl"] .place-search-icon {
  left: auto;
  right: 14px;
}
.place-search-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 42px;
  border: 1px solid rgba(215, 179, 114, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.85rem;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.place-search-wrap input:focus {
  outline: none;
  border-color: #f3d391;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 16px rgba(215, 179, 114, 0.25);
}
.place-search-clear {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}
html[dir="rtl"] .place-search-clear {
  right: auto;
  left: 12px;
}
.place-search-clear:hover {
  background: rgba(255, 255, 255, 0.25);
}

.place-filter-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.place-filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 237, 223, 0.7);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}
.filter-chip:hover {
  border-color: rgba(215, 179, 114, 0.45);
  color: #fff;
}
.filter-chip.is-active {
  background: linear-gradient(135deg, rgba(215, 179, 114, 0.25), rgba(172, 121, 58, 0.25));
  border-color: #f3d391;
  color: #f3d391;
  font-weight: 600;
}

.place-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 11px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}
html[dir="rtl"] .place-picker-grid {
  padding-right: 0;
  padding-left: 4px;
}

.place-option {
  position: relative;
  display: grid;
  grid-template-columns: 68px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.place-option:hover {
  border-color: rgba(215, 179, 114, 0.5);
  background: rgba(215, 179, 114, 0.08);
  transform: translateY(-1px);
}
.place-option.is-added {
  border-color: rgba(114, 215, 150, 0.35);
  background: rgba(114, 215, 150, 0.06);
}
.place-option.is-added:hover {
  border-color: rgba(114, 215, 150, 0.6);
  background: rgba(114, 215, 150, 0.1);
}
.place-option img {
  width: 68px;
  height: 60px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}
.place-option-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
html[dir="rtl"] .place-option-info {
  text-align: right;
}
.place-option-info strong {
  font-size: 0.84rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.place-option-info span {
  font-size: 0.72rem;
  color: rgba(244, 237, 223, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.place-option-info small {
  font-size: 0.65rem;
  color: var(--gold-bright, #dba653);
  margin-top: 1px;
}

.place-option-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 18px;
  border: 1px solid rgba(215, 179, 114, 0.4);
  background: rgba(215, 179, 114, 0.12);
  color: #f3d391;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.place-option:hover .place-option-action {
  background: linear-gradient(135deg, #f3d391, #dba653);
  color: #1a1109;
  border-color: transparent;
}
.place-option.is-added .place-option-action {
  border-color: rgba(114, 215, 150, 0.45);
  background: rgba(114, 215, 150, 0.15);
  color: #8ce6ad;
}
.place-option.is-added:hover .place-option-action {
  background: rgba(255, 90, 90, 0.18);
  border-color: rgba(255, 90, 90, 0.45);
  color: #ff9b9b;
}

.picker-empty {
  padding: 32px 16px;
  text-align: center;
  color: rgba(244, 237, 223, 0.6);
  font-size: 0.85rem;
  grid-column: 1 / -1;
}

.place-picker-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.picker-count {
  font-size: 0.78rem;
  color: rgba(244, 237, 223, 0.7);
  font-weight: 500;
}
.picker-done-btn {
  width: auto;
  min-height: 40px;
  padding: 0 24px;
}
.preview-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-bottom: 21px; }
.preview-stats article { padding: 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: rgba(255,255,255,.035); }
.preview-stats strong { display: block; font: 500 1.45rem var(--serif); color: var(--sand-light); }.preview-stats span{font-size:.58rem;color:var(--muted)}
.preview-timeline { display: grid; gap: 7px; }
.preview-day { display: grid; grid-template-columns: 45px 1fr; gap: 12px; padding: 10px; border-bottom: 1px solid rgba(255,255,255,.1); }
.preview-day b { color: var(--sand-light); font-size: .64rem; }.preview-day span{font-size:.7rem}
.preview-actions { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.planner-live-link { grid-column: 1 / -1; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 9px; border-radius: 11px; background: linear-gradient(145deg,#f8dc9e,#eeb75d); color: #21170e; font-size: .73rem; font-weight: 600; }

@keyframes marker-in { from { opacity:0; transform:translate(-22px,-35%) scale(.75); } to { opacity:1; transform:translate(-22px,-50%) scale(1); } }
@keyframes route-draw { from { stroke-dashoffset: 18; opacity:0; } to { stroke-dashoffset:0; opacity:1; } }
@keyframes list-in { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }

@media (min-width: 1051px) and (max-height: 820px) {
  .planner-heading { top: 96px; }
  .planner-heading h1 { font-size: 2.65rem; }
  .planner-heading > p { margin-top: 7px; }
  .view-toggle { margin-top: 18px; }
  .trip-panel { top: 145px; bottom: 24px; }
  .place-detail { top: 210px; min-height: 420px; padding-block: 20px 16px; }
  .place-detail h2 { margin-bottom: 10px; }
  .detail-gallery img { height: 94px; }
  .detail-meta { margin-top: 12px; }
  .detail-description { min-height: 48px; margin: 12px 0; line-height: 1.48; }
  .detail-action { min-height: 50px; }
  .detail-link { margin-top: 8px; }
  .map-controls { top: 86px; transform: scale(.82); transform-origin: top center; }
  .trip-preview-card { bottom: 18px; min-height: 82px; }
}

.trip-build-button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
}
.trip-build-button:hover {
  background: rgba(255,255,255,.16);
  border-color: var(--gold-bright);
}
.mobile-route-label { display: none; }

/* Responsive Mobile & Tablet Layout */
@media (max-width: 1050px) {
  .planner-heading {
    position: relative;
    top: auto;
    left: auto;
    width: min(92vw, 680px);
    margin: calc(var(--header-height) + 16px) auto 16px;
    text-align: center;
  }
  .planner-heading h1 {
    font-size: clamp(2.2rem, 5.5vw, 3rem);
  }
  .view-toggle {
    display: inline-grid;
    margin: 18px auto 0;
  }

  .planner-main {
    min-height: 100svh;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 50px;
  }

  .planner-backdrop {
    position: fixed;
    inset: 0;
    opacity: 0.35;
  }

  /* MAP VIEW (Default when NOT in list mode) */
  .planner-main:not(.is-list-view) .trip-panel {
    display: none;
  }
  .planner-main:not(.is-list-view) .planner-list-view {
    display: none;
  }

  .route-stage {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: min(94vw, 680px);
    height: clamp(380px, 50vh, 500px);
    margin: 10px auto 0;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    background: #3b2415 url("../../assets/backgrounds/planner-jordan-map.jpg") center/cover no-repeat;
    transform: none;
  }

  .mobile-route-label {
    position: absolute;
    z-index: 8;
    top: 14px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 14px;
    background: rgba(14, 11, 8, 0.78);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--gold-bright, #f2c87e);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
  }

  .map-marker {
    transform: translate(-15px, -50%) scale(0.82);
    transform-origin: left center;
  }
  .map-marker:hover, .map-marker.is-active {
    transform: translate(-15px, -55%) scale(0.92);
  }

  .place-detail {
    position: relative;
    top: auto;
    right: auto;
    width: min(94vw, 680px);
    min-height: auto;
    margin: 16px auto 0;
    padding: 22px 20px 18px;
    border-radius: 22px;
  }
  .place-detail.is-collapsed {
    display: none;
  }

  .trip-preview-card {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: min(94vw, 680px);
    margin: 16px auto 0;
    min-height: 80px;
  }

  /* LIST VIEW (When .is-list-view is active) */
  .planner-main.is-list-view .route-stage {
    display: none;
  }
  .planner-main.is-list-view .place-detail {
    display: none;
  }
  .planner-main.is-list-view .trip-preview-card {
    display: none;
  }
  .planner-main.is-list-view .trip-panel {
    display: flex;
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    width: min(94vw, 680px);
    height: auto;
    min-height: 480px;
    max-height: none;
    margin: 10px auto 0;
    padding: 22px 20px;
    border-radius: 22px;
  }
  .planner-main.is-list-view .itinerary-list {
    overflow-y: visible;
    max-height: none;
    padding-left: 40px;
    padding-right: 0;
  }
  .planner-main.is-list-view .planner-list-view {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: min(94vw, 680px);
    margin: 16px auto 0;
  }

  .itinerary-item {
    min-height: 88px;
    grid-template-columns: 80px minmax(0, 1fr) 28px;
    gap: 12px;
  }
  .itinerary-thumb {
    width: 80px;
    height: 70px;
  }
  .remove-stop {
    opacity: 1;
  }
}

@media (min-width: 1001px) {
  html[dir="rtl"] .planner-heading { left:auto; right:35.8vw; }
  html[dir="rtl"] .trip-panel { left:auto; right:2.65vw; }
  html[dir="rtl"] .place-detail { right:auto; left:2.65vw; }
  html[dir="rtl"] .trip-preview-card { right:auto; left:2.65vw; text-align:right; }
  html[dir="rtl"] .map-controls { right:auto; left:3.7vw; transform-origin: top left; }
  html[dir="rtl"] .planner-list-view { left:30vw; right:36vw; }
}

/* RTL overrides for trip panel & timeline */
html[dir="rtl"] .trip-panel.is-collapsed {
  transform: translateX(calc(100% + 2.65vw));
}
html[dir="rtl"] .panel-collapse-btn {
  right: auto;
  left: -18px;
}
html[dir="rtl"] .panel-collapse-icon {
  transform: rotate(180deg);
}
html[dir="rtl"] .trip-panel.is-collapsed .panel-collapse-icon {
  transform: rotate(0deg);
}
html[dir="rtl"] .trip-panel.is-collapsed .panel-collapse-btn {
  right: auto;
  left: -52px;
}
html[dir="rtl"] .itinerary-list {
  padding-left: 3px;
  padding-right: 40px;
}
html[dir="rtl"] .itinerary-list::before {
  left: auto;
  right: 18px;
}
html[dir="rtl"] .day-number {
  left: auto;
  right: -22px;
  transform: translate(50%, -50%);
}
html[dir="rtl"] .detail-close { right:auto; left:22px; }
html[dir="rtl"] .user-live-card { left: auto; right: 14px; }
html[dir="rtl"] .mobile-route-label { left: auto; right: 16px; }
html[dir="rtl"] .map-marker--side-right .map-marker__label {
  left: 9px;
  right: auto;
  border-radius: 0 20px 20px 0;
  border-left: none;
  border-right: 1px solid rgba(255,255,255,.9);
}
html[dir="rtl"] .map-marker--side-left .map-marker__label {
  right: 9px;
  left: auto;
  border-radius: 20px 0 0 20px;
  border-right: none;
  border-left: 1px solid rgba(255,255,255,.9);
}

@media (max-width: 600px) {
  .planner-heading {
    margin-top: calc(var(--header-height) + 10px);
    width: 92vw;
  }
  .planner-heading h1 {
    font-size: clamp(1.8rem, 7.5vw, 2.3rem);
  }
  .planner-heading > p {
    font-size: 0.8rem;
  }
  .planner-heading-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }
  .view-toggle {
    width: 170px;
    height: 38px;
    margin: 4px auto 0;
  }
  .view-toggle button {
    font-size: 0.74rem;
  }
  .region-filter-bar {
    max-width: 94vw;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 5px;
    padding: 4px 6px;
  }
  .region-filter-bar::-webkit-scrollbar {
    display: none;
  }
  .region-chip {
    padding: 5px 12px;
    font-size: 0.74rem;
  }
  .route-stage {
    width: 94vw;
    height: 390px;
    border-radius: 20px;
  }
  .map-controls {
    top: 12px;
    right: 12px;
    width: 38px;
    border-radius: 19px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    transform: none;
  }
  .map-controls button {
    width: 38px;
    height: 36px;
    font-size: 1.2rem;
  }
  .map-controls button:first-child {
    height: 38px;
  }
  .map-controls svg {
    width: 17px;
    height: 17px;
  }
  html[dir="rtl"] .map-controls {
    right: auto;
    left: 12px;
  }
  .map-marker {
    transform: scale(0.74);
    transform-origin: center bottom;
  }
  .map-marker__label {
    height: 28px !important;
    padding: 2px 8px !important;
    gap: 5px !important;
    font-size: 0.7rem !important;
  }
  .map-marker__label img {
    width: 20px !important;
    height: 20px !important;
  }
  .map-marker__badge {
    display: none !important;
  }
  .place-detail {
    width: 94vw;
    padding: 18px 16px;
    border-radius: 18px;
  }
  .detail-gallery {
    gap: 7px;
  }
  .detail-gallery img {
    height: 85px;
  }
  .detail-description {
    font-size: 0.78rem;
    margin: 12px 0;
  }
  .detail-action {
    min-height: 50px;
  }
  .trip-preview-card {
    width: 94vw;
    border-radius: 18px;
    padding: 10px 14px;
  }
  .itinerary-item {
    grid-template-columns: 68px minmax(0, 1fr) 26px;
    min-height: 80px;
    gap: 10px;
  }
  .itinerary-thumb {
    width: 68px;
    height: 62px;
  }
  .itinerary-copy h3 {
    font-size: 0.82rem;
  }
  .itinerary-list {
    padding-left: 32px;
  }
  .itinerary-list::before {
    left: 14px;
  }
  .day-number {
    left: -16px;
    width: 32px;
    height: 32px;
    font-size: 0.65rem;
  }
  html[dir="rtl"] .itinerary-list {
    padding-left: 0;
    padding-right: 32px;
  }
  html[dir="rtl"] .itinerary-list::before {
    left: auto;
    right: 14px;
  }
  html[dir="rtl"] .day-number {
    left: auto;
    right: -16px;
    transform: translate(50%, -50%);
  }
  .planner-dialog {
    position: fixed;
    inset: auto 0 0 0;
    width: 100vw;
    max-width: 100vw;
    max-height: 88vh;
    border-radius: 24px 24px 0 0;
    padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  }
  .place-picker-grid {
    grid-template-columns: 1fr;
  }
  .preview-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}
