:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #0d1118;
  --panel-2: #121821;
  --panel-3: #18202b;
  --panel-soft: #121821;
  --panel-strong: #18202b;
  --line: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.1);
  --muted: #95a0ad;
  --text: #f5f7fb;
  --soft: #d7dde5;
  --accent: #35d4a4;
  --accent-2: #77a7ff;
  --warn: #ffd166;
  --danger: #ff6b6b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  --app-bg:
    radial-gradient(circle at 12% 0%, rgba(53, 212, 164, 0.16), transparent 30%),
    linear-gradient(180deg, var(--panel) 0%, var(--bg) 54%, var(--bg) 100%);
  --body-bg: var(--bg);
  --card-bg: rgba(5, 7, 11, 0.92);
  --surface-bg: rgba(18, 24, 33, 0.86);
  --soft-surface-bg: rgba(255, 255, 255, 0.055);
  --soft-surface-bg-2: rgba(255, 255, 255, 0.045);
  --map-bg: #0b1018;
  --popup-bg: #0e141d;
  --thumb-overlay: linear-gradient(180deg, transparent 36%, rgba(7, 9, 13, 0.72));
  --toggle-bg: rgba(7, 9, 13, 0.88);
  --toggle-active-bg: #f5f7fb;
  --toggle-active-text: #07090d;
  --marker-text: #06101a;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7f2;
  --panel: #ffffff;
  --panel-2: #e9f1ec;
  --panel-3: #dce8e1;
  --panel-soft: #e9f1ec;
  --panel-strong: #dce8e1;
  --line: rgba(5, 30, 20, 0.12);
  --border: rgba(5, 30, 20, 0.12);
  --muted: #66736d;
  --text: #07110d;
  --soft: #24352e;
  --accent: #148f6a;
  --accent-2: #2c6fd6;
  --warn: #a66b00;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(14, 36, 28, 0.14);
  --app-bg:
    radial-gradient(circle at 12% 0%, rgba(20, 143, 106, 0.14), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 58%, #edf5ef 100%);
  --body-bg:
    radial-gradient(circle at 50% 0%, rgba(20, 143, 106, 0.13), transparent 35%),
    #edf5ef;
  --card-bg: rgba(255, 255, 255, 0.92);
  --surface-bg: rgba(255, 255, 255, 0.9);
  --soft-surface-bg: rgba(5, 30, 20, 0.055);
  --soft-surface-bg-2: rgba(5, 30, 20, 0.045);
  --map-bg: #e9f1ec;
  --popup-bg: #ffffff;
  --thumb-overlay: linear-gradient(180deg, transparent 42%, rgba(5, 30, 20, 0.42));
  --toggle-bg: rgba(255, 255, 255, 0.88);
  --toggle-active-bg: #07110d;
  --toggle-active-text: #f3f7f2;
  --marker-text: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
}

body {
  overflow: hidden;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(76px + env(safe-area-inset-bottom));
  background: var(--app-bg);
  color: var(--text);
}

.weather-card {
  flex: 0 0 auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.weather-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.weather-actions {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.theme-toggle {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft-surface-bg);
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.weather-temp-wrap {
  display: flex;
  align-items: center;
  min-height: 42px;
}

.weather-icon {
  display: none;
  width: 42px;
  height: 42px;
  margin-right: 2px;
}

.weather-icon[src] {
  display: block;
}

.weather-temp {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.weather-condition {
  margin-top: 3px;
  color: var(--soft);
  font-size: 0.9rem;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.weather-grid div {
  min-width: 0;
  padding: 9px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: var(--soft-surface-bg-2);
}

.weather-grid span,
.meta-label {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.weather-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  font-size: 0.88rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-panel {
  position: relative;
  flex: 0 0 auto;
  height: clamp(300px, 50dvh, 470px);
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--map-bg);
  box-shadow: var(--shadow);
}

#map {
  width: 100%;
  height: 100%;
  background: var(--map-bg);
}

.leaflet-container {
  font: inherit;
  background: var(--map-bg);
}

.leaflet-control-attribution {
  background: var(--toggle-bg) !important;
  color: var(--muted) !important;
}

.leaflet-control-attribution a {
  color: var(--soft) !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--popup-bg);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-size: 0.88rem;
}

.place-marker,
.current-marker {
  display: grid;
  place-items: center;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.place-marker {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: var(--accent-2);
  color: var(--marker-text);
  font-size: 0.8rem;
  font-weight: 900;
  opacity: 0.72;
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.place-marker.selected {
  background: var(--accent);
  opacity: 1;
  transform: scale(1.28);
}

.place-marker.dimmed {
  opacity: 0.36;
}

.current-marker {
  width: 24px;
  height: 24px;
  border: 3px solid #ffffff;
  background: #1e8cff;
}

.current-marker::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  content: "";
}

.location-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 500;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--text);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36);
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  flex: 0 0 auto;
  margin-top: 10px;
}

.control-stack {
  display: grid;
  grid-template-columns: auto auto;
  gap: 7px;
  justify-items: end;
}

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: var(--soft-surface-bg);
  color: var(--soft);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.chip.active {
  border-color: rgba(53, 212, 164, 0.64);
  background: rgba(53, 212, 164, 0.16);
  color: #effff9;
}

.sort-control {
  display: grid;
  grid-template-columns: auto auto;
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 0 8px 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: var(--soft-surface-bg);
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.sort-control span {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.sort-control select {
  min-height: 28px;
  max-width: 104px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: 0;
}

.sort-control option {
  background: var(--panel-2);
  color: var(--text);
}

.content {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 10px;
  overflow: hidden;
}

.tiles {
  display: flex;
  height: 100%;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 10px;
  scroll-padding: 2px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.tiles::-webkit-scrollbar {
  display: none;
}

.list {
  display: none;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 1px 12px;
}

.list-mode .tiles {
  display: none;
}

.list-mode .list {
  display: block;
}

.place-card,
.itinerary-card,
.list-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: var(--surface-bg);
  color: var(--text);
}

.place-card,
.itinerary-card {
  display: flex;
  flex: 0 0 min(82vw, 348px);
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  text-align: left;
  scroll-snap-align: start;
}

.place-card {
  padding: 0;
  cursor: pointer;
}

.place-card.selected,
.list-item.selected {
  border-color: rgba(53, 212, 164, 0.86);
  box-shadow: inset 0 0 0 1px rgba(53, 212, 164, 0.46), 0 18px 46px rgba(0, 0, 0, 0.35);
}

.thumb {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(119, 167, 255, 0.18), rgba(53, 212, 164, 0.12)),
    var(--panel-2);
}

.thumb img {
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
  opacity: 0.9;
}

.thumb::after {
  position: absolute;
  inset: 0;
  background: var(--thumb-overlay);
  content: "";
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 13px;
}

.place-topline,
.list-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.category {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.distance {
  flex: 0 0 auto;
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.subtle-line {
  overflow: hidden;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hours-block {
  display: grid;
  gap: 3px;
  margin-top: 9px;
  color: var(--soft);
  font-size: 0.8rem;
  line-height: 1.25;
}

.hours-block span {
  font-weight: 800;
}

.hours-block small {
  color: var(--muted);
  font-size: 0.7rem;
}

.detail-grid {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.detail-grid div {
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: var(--soft-surface-bg-2);
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--soft);
  font-size: 0.8rem;
  line-height: 1.25;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.badge {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.place-card h2,
.itinerary-card h2 {
  margin: 8px 0 0;
  font-size: 1.15rem;
  line-height: 1.16;
  letter-spacing: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
  color: var(--soft);
  font-size: 0.86rem;
}

.status {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

.status.open {
  color: var(--accent);
}

.status.soon {
  color: var(--warn);
}

.status.closed {
  color: var(--danger);
}

.status.unknown {
  color: var(--muted);
}

.notes {
  display: -webkit-box;
  overflow: hidden;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.list-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 96px;
  margin-bottom: 10px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.list-thumb {
  width: 72px;
  height: 76px;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(119, 167, 255, 0.18), rgba(53, 212, 164, 0.12)),
    var(--panel-2);
}

.list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-copy {
  min-width: 0;
}

.list-copy h2 {
  overflow: hidden;
  margin: 4px 0 0;
  font-size: 1rem;
  line-height: 1.16;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-copy .meta-row,
.list-copy .status {
  margin-top: 6px;
  font-size: 0.82rem;
}

.list-copy .subtle-line {
  margin-top: 5px;
  font-size: 0.78rem;
}

.list-copy .hours-block,
.list-copy .detail-grid {
  margin-top: 7px;
}

.list-copy .detail-grid div {
  padding: 7px 8px;
}

.list-notes {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.itinerary-card {
  padding: 15px;
  background:
    linear-gradient(135deg, rgba(119, 167, 255, 0.28), rgba(53, 212, 164, 0.1)),
    rgba(12, 17, 26, 0.94);
}

.itinerary-type {
  width: fit-content;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #e9f1ff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.itinerary-card .subtitle {
  margin: 8px 0 0;
  color: var(--soft);
  font-weight: 800;
}

.itinerary-card .details {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.itinerary-list .subtitle,
.itinerary-list .details {
  color: var(--soft);
}

.route-options {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.route-options li {
  padding: 8px 9px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--soft);
  font-size: 0.84rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}

.action-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}

.list-item.itinerary-list {
  display: block;
  padding: 13px;
  background:
    linear-gradient(135deg, rgba(119, 167, 255, 0.25), rgba(53, 212, 164, 0.09)),
    rgba(12, 17, 26, 0.94);
}

.list-item.itinerary-list h2 {
  margin: 8px 0 0;
  font-size: 1rem;
}

.empty-state {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.view-toggle {
  position: fixed;
  right: max(12px, calc((100vw - 430px) / 2 + 12px));
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: max(12px, calc((100vw - 430px) / 2 + 12px));
  z-index: 900;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  max-width: 406px;
  min-height: 54px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: var(--toggle-bg);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(18px);
}

.view-toggle button {
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
}

.view-toggle button.active {
  background: var(--toggle-active-bg);
  color: var(--toggle-active-text);
}

@media (max-height: 720px) {
  .app {
    padding-top: calc(8px + env(safe-area-inset-top));
  }

  .weather-card {
    padding: 11px;
  }

  .weather-grid {
    gap: 5px;
    margin-top: 9px;
  }

  .weather-grid div {
    padding: 7px 6px;
  }

  .map-panel {
    height: clamp(260px, 47dvh, 390px);
    margin-top: 8px;
  }

  .controls,
  .content {
    margin-top: 8px;
  }

  .thumb {
    min-height: 92px;
  }

  .thumb img {
    min-height: 92px;
  }
}

@media (min-width: 760px) {
  body {
    background: var(--body-bg);
  }

  .app {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
  }
}

/* Compact viewport-fit layout */
html,
body {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

.app {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  padding: calc(8px + env(safe-area-inset-top)) 10px calc(64px + env(safe-area-inset-bottom));
}

.weather-card {
  flex: 0 0 auto;
  max-height: 118px;
  padding: 10px;
  overflow: hidden;
  border-radius: 18px;
}

.weather-main {
  gap: 10px;
}

.eyebrow {
  margin-bottom: 2px;
  font-size: 0.66rem;
}

h1 {
  font-size: 1.12rem;
}

.weather-actions {
  gap: 4px;
}

.theme-toggle {
  min-height: 26px;
  padding: 0 9px;
  font-size: 0.68rem;
}

.weather-temp-wrap {
  min-height: 30px;
}

.weather-icon {
  width: 30px;
  height: 30px;
}

.weather-temp {
  font-size: 1.55rem;
}

.weather-condition {
  margin-top: 2px;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.weather-grid div {
  padding: 6px 5px;
  border-radius: 11px;
}

.weather-grid span {
  font-size: 0.58rem;
}

.weather-grid strong {
  margin-top: 2px;
  font-size: 0.74rem;
}

.map-panel {
  flex: 0 1 42dvh;
  height: auto;
  min-height: 220px;
  max-height: 42dvh;
  margin-top: 8px;
  border-radius: 20px;
}

.app.list-active .map-panel {
  display: none;
}

.controls {
  flex: 0 0 auto;
  gap: 7px;
  margin-top: 8px;
}

.filter-chips {
  gap: 7px;
}

.chip {
  min-height: 32px;
  padding: 0 11px;
  font-size: 0.78rem;
}

.control-stack {
  grid-template-columns: auto;
  gap: 0;
}

.sort-control {
  min-height: 32px;
  gap: 5px;
  padding: 0 7px 0 10px;
  font-size: 0.74rem;
}

.sort-control span {
  font-size: 0.58rem;
}

.sort-control select {
  min-height: 26px;
  max-width: 94px;
}

.content {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 8px;
  overflow: hidden;
}

.app.list-active .content {
  flex: 1 1 auto;
  min-height: 0;
}

.tiles {
  display: flex;
  gap: 10px;
  height: 132px;
  max-height: 132px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 6px;
  scroll-padding: 2px;
  scroll-snap-type: x mandatory;
}

.place-card,
.itinerary-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  flex: 0 0 min(86vw, 360px);
  height: 124px;
  min-height: 124px;
  max-height: 124px;
  padding: 10px;
  overflow: hidden;
  border-radius: 18px;
  scroll-snap-align: start;
}

.place-card {
  text-align: left;
}

.place-card .thumb {
  width: 76px;
  height: 76px;
  min-height: 76px;
  border-radius: 14px;
  overflow: hidden;
}

.place-card .thumb img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.place-card .thumb::after {
  display: none;
}

.card-body,
.list-copy {
  min-width: 0;
  overflow: hidden;
}

.card-body {
  display: block;
  padding: 0;
}

.place-card h2,
.itinerary-card h2,
.list-item h2 {
  overflow: hidden;
  margin: 2px 0;
  font-size: 0.98rem;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-topline,
.list-topline {
  gap: 8px;
  min-width: 0;
}

.category {
  overflow: hidden;
  min-width: 0;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distance {
  font-size: 0.74rem;
}

.subtle-line,
.notes,
.list-notes,
.hours-block,
.detail-grid {
  overflow: hidden;
}

.subtle-line {
  margin-top: 4px;
  font-size: 0.74rem;
}

.meta-row {
  gap: 6px;
  margin-top: 5px;
  font-size: 0.74rem;
}

.place-card .notes,
.place-card .detail-grid,
.place-card .hours-block small {
  display: none;
}

.place-card .hours-block {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.place-card .status {
  margin-top: 4px;
  font-size: 0.76rem;
}

.badge-row {
  gap: 4px;
  margin-top: 5px;
}

.place-card .badge-row {
  flex-wrap: nowrap;
}

.badge {
  padding: 3px 6px;
  font-size: 0.64rem;
}

.list {
  display: none;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 1px 10px;
}

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

.list-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 124px;
  margin: 0;
  padding: 10px;
  border-radius: 18px;
  text-align: left;
}

.list-thumb {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  overflow: hidden;
}

.list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-copy .meta-row,
.list-copy .status {
  margin-top: 5px;
  font-size: 0.76rem;
}

.list-copy .hours-block,
.list-copy .detail-grid {
  margin-top: 6px;
}

.list-notes {
  margin-top: 6px;
  font-size: 0.74rem;
}

.itinerary-card {
  grid-template-columns: 1fr;
  background:
    linear-gradient(135deg, rgba(119, 167, 255, 0.28), rgba(53, 212, 164, 0.1)),
    var(--surface-bg);
}

.itinerary-card .subtitle,
.itinerary-card .details {
  overflow: hidden;
  margin: 4px 0 0;
  font-size: 0.8rem;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.itinerary-card .details {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.itinerary-card .action-row,
.itinerary-card .route-options {
  display: none;
}

.view-toggle {
  right: max(10px, calc((100vw - 430px) / 2 + 10px));
  bottom: calc(8px + env(safe-area-inset-bottom));
  left: max(10px, calc((100vw - 430px) / 2 + 10px));
  min-height: 48px;
  padding: 4px;
}

.view-toggle button {
  min-height: 40px;
}

@media (max-height: 720px) {
  .weather-card {
    max-height: 104px;
    padding: 8px;
  }

  .weather-grid {
    gap: 4px;
    margin-top: 6px;
  }

  .weather-grid div {
    padding: 5px 4px;
  }

  .weather-grid span {
    font-size: 0.54rem;
  }

  .weather-grid strong {
    font-size: 0.68rem;
  }

  .map-panel {
    min-height: 190px;
    max-height: 36dvh;
  }

  .controls {
    margin-top: 6px;
  }

  .content {
    margin-top: 6px;
  }
}

@media (max-height: 640px) {
  .map-panel {
    min-height: 160px;
    max-height: 32dvh;
  }

  .tiles {
    height: 120px;
    max-height: 120px;
  }

  .place-card,
  .itinerary-card {
    height: 112px;
    min-height: 112px;
    max-height: 112px;
  }

  .list-item {
    min-height: 112px;
  }
}

/* iPhone 15 Pro balance: natural weather, flexible map, no dead bottom space */
.app {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  padding: calc(8px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
}

.weather-card {
  position: relative;
  flex: 0 0 auto;
  max-height: none;
  padding: 10px 12px;
  overflow: visible;
  border-radius: 20px;
}

.weather-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 10px;
}

.weather-temp-wrap {
  align-items: center;
  justify-content: flex-end;
  min-height: 34px;
}

.weather-temp {
  font-size: clamp(1.7rem, 7vw, 2.15rem);
}

.weather-condition {
  margin-top: 6px;
  font-size: 0.9rem;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.weather-grid div {
  min-width: 0;
  padding: 7px 7px;
  border-radius: 13px;
}

.weather-grid span {
  font-size: 0.62rem;
}

.weather-grid strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle {
  align-self: start;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.map-panel {
  flex: 1 1 auto;
  height: auto;
  min-height: 260px;
  max-height: none;
  margin-top: 8px;
}

.controls {
  flex: 0 0 auto;
  margin-top: 8px;
}

.content {
  flex: 0 0 auto;
  height: 132px;
  min-height: 0;
  margin-top: 8px;
  overflow: hidden;
}

.tiles {
  height: 132px;
  max-height: 132px;
}

.view-toggle {
  position: static;
  flex: 0 0 52px;
  display: grid;
  width: 100%;
  max-width: none;
  height: 52px;
  min-height: 52px;
  margin-top: 8px;
  padding: 4px;
}

.view-toggle button {
  min-height: 44px;
}

.app.list-active .map-panel {
  display: none;
}

.app.list-active .content {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

.app.list-active .list {
  height: 100%;
  overflow-y: auto;
}

.app.list-active .view-toggle {
  flex: 0 0 52px;
}

@media (max-height: 760px) {
  .app {
    padding-top: calc(6px + env(safe-area-inset-top));
    padding-inline: 8px;
  }

  .weather-card {
    padding: 8px 10px;
  }

  .weather-grid {
    gap: 5px;
    margin-top: 7px;
  }

  .map-panel {
    min-height: 210px;
    margin-top: 6px;
  }

  .controls,
  .content,
  .view-toggle {
    margin-top: 6px;
  }

  .content,
  .tiles {
    height: 124px;
  }

  .place-card,
  .itinerary-card {
    height: 116px;
    min-height: 116px;
    max-height: 116px;
  }

  .view-toggle {
    flex-basis: 48px;
    height: 48px;
    min-height: 48px;
  }

  .view-toggle button {
    min-height: 40px;
  }
}

@media (max-height: 680px) {
  .weather-grid div {
    padding: 5px;
  }

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

  .content,
  .tiles {
    height: 112px;
  }

  .place-card,
  .itinerary-card {
    height: 106px;
    min-height: 106px;
    max-height: 106px;
  }

  .thumb,
  .list-thumb,
  .place-card .thumb {
    width: 64px;
    height: 64px;
    min-height: 64px;
  }
}

/* Weather forecast, controls, and utility modal */
.weather-card {
  padding: 10px 12px;
}

.weather-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: start;
  gap: 8px;
}

.weather-place {
  min-width: 0;
}

.weather-place h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button,
.theme-toggle,
.location-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-surface-bg-2);
  color: var(--text);
  font-weight: 900;
}

.refresh-button {
  width: 32px;
  padding: 0;
  font-size: 1rem;
}

.weather-temp-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: max-content;
}

.weather-temp {
  font-size: clamp(1.75rem, 7vw, 2.2rem);
  line-height: 1;
}

.weather-icon {
  width: 34px;
  height: 34px;
}

.weather-summary {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  margin-top: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--soft);
  text-align: left;
}

.weather-summary span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  flex: 0 0 auto;
  margin-left: 8px;
  transition: transform 160ms ease;
}

.weather-summary[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.weather-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

.weather-meta strong {
  color: var(--text);
}

.forecast-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.forecast-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--soft);
  font-size: 0.78rem;
}

.forecast-header span {
  color: var(--muted);
}

.forecast-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.forecast-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
}

.forecast-row .desc {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forecast-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.location-button {
  position: static;
  width: fit-content;
  min-height: 32px;
  padding: 0 10px;
  box-shadow: none;
  font-size: 0.74rem;
  cursor: pointer;
}

.control-stack {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app.weather-expanded .map-panel {
  min-height: 160px;
}

.utility-card,
.utility-list-item {
  cursor: pointer;
}

.utility-lines {
  display: grid;
  gap: 3px;
  overflow: hidden;
  color: var(--soft);
  font-size: 0.75rem;
  line-height: 1.2;
}

.utility-lines span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utility-lines strong {
  color: var(--text);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  align-items: end;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.52);
}

.modal-sheet {
  position: relative;
  width: min(100%, 430px);
  max-height: min(72dvh, 560px);
  margin: 0 auto;
  overflow: auto;
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.contacts-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.contact-row {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft-surface-bg-2);
}

.contact-row strong {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.contact-row a,
.contact-row span {
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
}

@media (max-height: 700px) {
  .weather-top {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .weather-icon {
    display: none;
  }

  .theme-toggle {
    padding: 0 8px;
  }

  .weather-meta {
    gap: 4px 8px;
    font-size: 0.7rem;
  }

  .app.weather-expanded .map-panel {
    min-height: 120px;
  }

  .app.weather-expanded .forecast-panel {
    max-height: 150px;
    overflow-y: auto;
  }
}

@media (max-width: 380px), (max-height: 700px) {
  .app {
    padding-inline: 8px;
  }

  .weather-card {
    padding: 8px 10px;
  }

  .weather-temp {
    font-size: 1.65rem;
  }

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

  .content,
  .tiles {
    height: 116px;
  }

  .place-card,
  .itinerary-card {
    grid-template-columns: 62px minmax(0, 1fr);
    height: 108px;
    min-height: 108px;
    max-height: 108px;
    padding: 8px;
  }

  .thumb,
  .list-thumb,
  .place-card .thumb {
    width: 62px;
    height: 62px;
    min-height: 62px;
  }

  .view-toggle {
    flex-basis: 46px;
    height: 46px;
    min-height: 46px;
  }
}

/* Bottom spacing hotfix */
html,
body,
.app {
  height: 100%;
  overflow: hidden;
}

.app {
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}

.map-panel {
  flex: 1 1 auto;
  min-height: 220px;
}

.content {
  flex: 0 0 auto;
  height: 124px;
  margin-top: 6px;
}

.tiles {
  height: 124px;
  max-height: 124px;
  padding-bottom: 0;
}

.place-card,
.itinerary-card {
  height: 116px;
  min-height: 116px;
  max-height: 116px;
}

.view-toggle {
  flex: 0 0 48px;
  height: 48px;
  min-height: 48px;
  margin-top: 6px;
}

/* Tile/list controls and venue details */
.location-button {
  display: none !important;
}

.controls {
  grid-template-columns: minmax(0, 1fr);
}

.control-stack,
.sort-control {
  display: none;
}

.app.list-active .controls {
  grid-template-columns: minmax(0, 1fr) auto;
}

.app.list-active .control-stack {
  display: flex;
}

.app.list-active .sort-control {
  display: grid;
}

.info-button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
}

.place-card,
.list-item {
  position: relative;
}

.place-card .badge-row,
.list-item .badge-row {
  padding-right: 46px;
}

.venue-image {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
  border-radius: 16px;
  background: var(--panel-2);
}

.venue-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.venue-title-row h3 {
  margin: 3px 0 0;
  font-size: 1.15rem;
  line-height: 1.15;
}

.venue-address,
.venue-notes {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.modal-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* Category color hooks */
.chip {
  border-color: var(--chip-color, var(--line));
  border-color: color-mix(in srgb, var(--chip-color, var(--line)) 45%, transparent);
  color: var(--soft);
  color: color-mix(in srgb, var(--chip-color, var(--soft)) 70%, var(--soft));
}

.chip.active {
  border-color: var(--chip-color, var(--accent));
  background: rgba(53, 212, 164, 0.16);
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 18%, transparent);
  color: var(--text);
}

.chip.transport-off {
  opacity: 0.48;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.place-marker {
  background: var(--place-color, var(--accent-2));
  color: #06101a;
}

.place-marker.selected {
  background: var(--place-color, var(--accent));
}

.map-has-selection .place-marker:not(.selected) {
  opacity: 0.36;
}

.place-card,
.list-item {
  border-color: var(--place-color, var(--line));
  border-color: color-mix(in srgb, var(--place-color, var(--line)) 55%, transparent);
}

.place-card.selected,
.list-item.selected {
  border-color: var(--place-color, var(--accent));
  box-shadow:
    inset 0 0 0 1px var(--place-color, var(--accent)),
    0 18px 46px rgba(0, 0, 0, 0.35);
}

/* Compact itinerary tickets */
.itinerary-card {
  position: relative;
  grid-template-columns: 1fr;
  height: 116px;
  min-height: 116px;
  max-height: 116px;
  padding: 10px;
  overflow: hidden;
  box-shadow: none;
}

.itinerary-card h2,
.itinerary-card .subtitle,
.itinerary-card .details {
  margin: 0;
  line-height: 1.15;
}

.itinerary-card h2 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1.03rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.itinerary-card .subtitle {
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.itinerary-card .details {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.itinerary-card .itinerary-type {
  padding: 4px 8px;
  font-size: 0.62rem;
}

.itinerary-card .action-row,
.itinerary-card .route-options {
  display: none;
}

.itinerary-card.flight-card {
  border-color: rgba(0, 0, 0, 0.18);
  background: #fde68a;
  color: #111827;
}

.itinerary-card.flight-card::after {
  position: absolute;
  right: 54px;
  top: 10px;
  bottom: 10px;
  border-left: 1px dashed rgba(0, 0, 0, 0.24);
  content: "";
}

.itinerary-card.flight-card .itinerary-type {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.3);
  color: #111827;
}

.itinerary-card.flight-card .subtitle,
.itinerary-card.flight-card .details {
  color: #3f3f46;
}

.itinerary-card.transport-card {
  border-color: rgba(248, 113, 113, 0.46);
  background:
    linear-gradient(135deg, rgba(253, 186, 116, 0.18), rgba(248, 113, 113, 0.12)),
    var(--surface-bg);
}

.itinerary-list {
  grid-template-columns: 1fr;
  gap: 5px;
}

.itinerary-list.flight-card {
  border-color: rgba(250, 204, 21, 0.6);
}

.itinerary-list.transport-card {
  border-color: rgba(248, 113, 113, 0.46);
}

@media (max-width: 380px), (max-height: 700px) {
  .itinerary-card {
    height: 108px;
    min-height: 108px;
    max-height: 108px;
    padding: 8px;
  }

  .itinerary-card h2 {
    font-size: 0.98rem;
  }

  .itinerary-card .subtitle,
  .itinerary-card .details {
    font-size: 0.74rem;
  }
}

@media (max-height: 680px) {
  .itinerary-card {
    height: 106px;
    min-height: 106px;
    max-height: 106px;
  }
}

/* Final viewport, map, and shadow polish */
html,
body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

.app {
  height: 100svh;
  min-height: 100svh;
  padding-bottom: calc(4px + env(safe-area-inset-bottom));
  overflow: hidden;
}

@supports (height: 100dvh) {
  .app {
    height: 100dvh;
    min-height: 100dvh;
  }
}

.map-panel {
  flex: 1 1 0;
  min-height: 210px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.controls,
.content,
.view-toggle {
  margin-top: 5px;
}

.view-toggle {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.place-card.selected,
.list-item.selected {
  box-shadow:
    inset 0 0 0 1px var(--place-color, var(--accent)),
    0 10px 24px rgba(0, 0, 0, 0.2);
}

.modal-sheet {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip,
.current-marker::after {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.place-marker,
.current-marker {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.26);
}

.map-control-stack {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 700;
  display: grid;
  gap: 6px;
}

.map-control-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(7, 9, 13, 0.82);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.map-control-button:active,
.map-control-button.active,
.map-control-button.busy {
  border-color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent);
}

:root[data-theme="light"] .map-control-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.map-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(2px);
}

.map-backdrop.hidden {
  display: none;
}

body.map-expanded {
  overflow: hidden;
}

body.map-expanded .map-panel {
  position: fixed;
  top: calc(4dvh + env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  left: max(10px, env(safe-area-inset-left));
  z-index: 1600;
  width: auto;
  max-width: none;
  height: min(92dvh, calc(100dvh - 22px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  min-height: 0;
  margin: 0;
  border-radius: 24px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

@media (max-height: 700px) {
  .map-panel {
    min-height: 170px;
  }

  .controls,
  .content,
  .view-toggle {
    margin-top: 4px;
  }

  body.map-expanded .map-panel {
    top: calc(3dvh + env(safe-area-inset-top));
    height: min(92dvh, calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  }
}
