:root {
  --night: #07182d;
  --night-soft: #143176;
  --royal: #143176;
  --gold: #ead8a7;
  --gold-light: #f6eac8;
  --cream: #fbf6e8;
  --paper: #ffffff;
  --ink: #17212b;
  --muted: #6f7d86;
  --line: #e8e2da;
  --coral: #ef6f61;
  --teal: #159d99;
  --saffron: #f5b642;
  --plum: #865d91;
  --sage: #6f9d88;
  --shadow: 0 18px 48px rgba(20, 38, 50, .11);
  --soft-shadow: 0 10px 28px rgba(20, 38, 50, .08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #e8e2d5;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--cream);
  position: relative;
  overflow: hidden;
  padding-bottom: 94px;
  box-shadow: 0 0 70px rgba(14,34,51,.08);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  padding: 16px 20px 22px;
  color: white;
  background:
    linear-gradient(180deg, rgba(4,18,28,.38), rgba(4,18,28,.88)),
    url("assets/tours-hero.jpg") center 47% / cover no-repeat;
  border-radius: 0 0 38px 38px;
}
.hero::before {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  pointer-events: none;
  width: 190px; height: 190px; right: -85px; top: 46px;
}

.hero-top, .section-heading, .view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  position: relative;
  z-index: 1;
}
.brand-mark {
  width: 44px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.22));
  animation: breathe 3.6s ease-in-out infinite;
}
.brand-text { display: grid; line-height: .9; letter-spacing: .14em; color: var(--gold-light); }
.brand-text strong { font-size: 15px; font-weight: 500; }
.brand-text em { font-size: 23px; font-style: normal; font-weight: 900; letter-spacing: .23em; }

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.1);
  color: white;
  font-size: 25px;
  backdrop-filter: blur(12px);
}
.hero-copy { position: relative; z-index: 1; margin: 20px 0 16px; }
.eyebrow, .section-kicker {
  margin: 0 0 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  color: var(--royal);
}
.hero-copy .eyebrow { color: var(--gold-light); }
.hero-copy h1 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(24px, 6.5vw, 34px);
  line-height: 1.05;
  letter-spacing: -.03em;
}
.hero-copy p:last-child {
  margin: 9px 0 0;
  max-width: 470px;
  color: rgba(255,255,255,.78);
  line-height: 1.4;
  font-size: 13px;
}
.search-box {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 28px 1fr 30px;
  align-items: center;
  min-height: 58px;
  padding: 0 12px 0 16px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 19px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(16px);
}
.search-box > span { font-size: 27px; transform: rotate(-15deg); opacity: .8; }
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
  font-size: 16px;
}
.search-box input::placeholder { color: rgba(255,255,255,.68); }
.search-box button {
  border: 0;
  background: transparent;
  color: white;
  font-size: 26px;
}

main { padding: 6px 16px 24px; }
.filters-section, .view-section, .field-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(23,33,43,.06);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.82);
  box-shadow: var(--soft-shadow);
}
.section-heading.compact { align-items: flex-end; }
.section-heading h2, .view-toolbar h2, .field-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.025em;
}
.near-me {
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--night);
  background: #e7f4f1;
  font-weight: 800;
  font-size: 12px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 6px;
  margin-top: 10px;
}
.category-chip {
  min-height: 50px;
  padding: 6px 4px;
  border: 1px solid color-mix(in srgb, var(--cat) 25%, transparent);
  border-radius: 15px;
  color: var(--cat-dark);
  background: color-mix(in srgb, var(--cat) 10%, white);
  display: grid;
  place-items: center;
  gap: 3px;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.category-chip:active { transform: scale(.97); }
.category-chip .cat-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}
.category-chip .cat-icon img {
  width: 100%;
  height: 100%;
  display: block;
}
.category-chip .cat-label { font-size: 10.5px; font-weight: 900; line-height: 1.05; }
.category-chip.active {
  color: white;
  background: var(--cat);
  border-color: transparent;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--cat) 28%, transparent);
}
.quick-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
  margin-top: 13px;
}
.quick-chip {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--muted);
  background: white;
  font-size: 11.5px;
  font-weight: 800;
}
.quick-chip[aria-pressed="true"] {
  color: white;
  border-color: var(--night);
  background: var(--night);
}

.view-section { padding: 18px 0 0; overflow: hidden; }
.view-toolbar { padding: 0 20px 16px; }
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 13px;
  background: #eef0ef;
}
.segmented button {
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}
.segmented button.active {
  color: var(--night);
  background: white;
  box-shadow: 0 3px 12px rgba(20,38,50,.09);
}
.places-list { display: grid; gap: 12px; padding: 0 12px 16px; }
.place-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  grid-template-areas: "media content" "actions actions";
  align-items: start;
  overflow: hidden;
  border: 1px solid rgba(23,33,43,.07);
  border-radius: 21px;
  background: white;
  box-shadow: 0 8px 22px rgba(14,34,51,.06);
}
.place-cover {
  grid-area: media;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 75% 20%, rgba(255,255,255,.28), transparent 28%),
    linear-gradient(145deg, var(--cover-a), var(--cover-b));
}
.place-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.place-cover.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14,34,51,.42), rgba(14,34,51,.02) 70%);
}
.place-cover::before {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  transform: translate(35px, -45px);
}
.place-cover-icon { position: relative; z-index: 2; font-size: 38px; filter: drop-shadow(0 8px 12px rgba(0,0,0,.12)); }
.place-cover.has-photo .place-cover-icon { display: none; }
.verified-badge {
  position: absolute;
  z-index: 3;
  left: 8px;
  bottom: 8px;
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--night);
  background: rgba(255,255,255,.9);
  font-size: 8px;
  font-weight: 900;
}
.place-card-content { grid-area: content; padding: 10px 12px 8px; min-width: 0; }
.place-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.place-category { margin: 0; color: var(--coral); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.favorite-button {
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--night);
  font-size: 17px;
}
.favorite-button.active { color: var(--coral); background: #fff0ed; border-color: #ffd5cd; }
.place-card h3 { margin: 3px 0 4px; font-size: 16px; line-height: 1.1; }
.place-meta { display: flex; flex-wrap: wrap; gap: 5px 8px; color: var(--muted); font-size: 10.5px; }
.place-meta .open { color: #137a5d; font-weight: 900; }
.place-meta .closed { color: #a84f4f; font-weight: 900; }
.place-tags { display: flex; gap: 5px; margin-top: 7px; overflow: hidden; }
.place-tags span { flex: 0 0 auto; padding: 5px 7px; border-radius: 8px; background: #f5f3f0; color: #5e6870; font-size: 9px; font-weight: 800; }
.place-actions { grid-area: actions; display: flex; align-items: center; gap: 7px; padding: 8px 12px 12px; }
.place-actions button, .place-actions a {
  border: 0;
  border-radius: 11px;
  min-height: 34px;
  padding: 8px 10px;
  background: #edf5f4;
  color: var(--night);
  font-size: 10px;
  font-weight: 900;
}
.place-actions .details-btn {
  flex: 1 1 auto;
  background: var(--night);
  color: white;
}
.place-actions .route-btn,
.place-actions .share-btn {
  width: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
}

.map-panel { position: relative; padding: 0 12px 16px; }
#map { height: 58vh; height: 58dvh; min-height: 340px; border-radius: 22px; overflow: hidden; }
.map-legend {
  position: absolute;
  z-index: 500;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(14,34,51,.9);
  color: white;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.custom-marker {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50% 50% 50% 8px;
  transform: rotate(-45deg);
  color: white;
  box-shadow: 0 6px 14px rgba(0,0,0,.2);
}
.custom-marker span { transform: rotate(45deg); font-size: 14px; }

.empty-state { padding: 42px 24px 48px; text-align: center; }
.empty-state > div { font-size: 40px; }
.empty-state h3 { margin: 10px 0 6px; }
.empty-state p { margin: 0 0 15px; color: var(--muted); }
.empty-state button { border: 0; border-radius: 12px; padding: 10px 14px; background: var(--night); color: white; font-weight: 900; }

.field-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  align-items: center;
  background:
    radial-gradient(circle at 10% 30%, rgba(239,111,97,.13), transparent 27%),
    white;
}
.field-visual {
  width: 82px;
  height: 98px;
  display: grid;
  place-items: center;
  border-radius: 28px 28px 28px 9px;
  color: white;
  background: linear-gradient(145deg, var(--coral), #f69776);
  transform: rotate(-5deg);
  box-shadow: 0 14px 28px rgba(239,111,97,.22);
}
.field-visual span { font-size: 32px; transform: rotate(5deg); }
.field-card p:not(.section-kicker) { margin: 8px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.primary-link { color: var(--teal); font-size: 12px; font-weight: 900; }

.bottom-nav {
  position: fixed;
  z-index: 900;
  left: 50%;
  bottom: 0;
  width: min(100%, 760px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4,1fr);
  padding: 8px 10px var(--safe-bottom);
  border-top: 1px solid rgba(14,34,51,.08);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 -10px 32px rgba(14,34,51,.08);
}
.nav-item {
  min-height: 48px;
  border: 0;
  background: transparent;
  color: #89939a;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
}
.nav-item span { font-size: 20px; }
.nav-item small { font-size: 9px; font-weight: 900; }
.nav-item.active { color: var(--royal); }

.place-dialog {
  width: min(calc(100% - 24px), 640px);
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 28px;
  overflow: auto;
  background: var(--cream);
  box-shadow: var(--shadow);
}
.place-dialog::backdrop { background: rgba(5,18,27,.68); backdrop-filter: blur(4px); }
.dialog-close {
  position: sticky;
  z-index: 10;
  top: 12px;
  float: right;
  margin: 12px 12px -54px 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: rgba(14,34,51,.78);
  font-size: 24px;
}
.dialog-hero {
  min-height: 220px;
  padding: 32px 24px;
  display: flex;
  align-items: flex-end;
  color: white;
  background:
    radial-gradient(circle at 75% 20%, rgba(255,255,255,.28), transparent 28%),
    linear-gradient(145deg, var(--cover-a), var(--cover-b));
}
.dialog-hero.has-photo {
  background-size: cover;
  background-position: center;
  position: relative;
}
.dialog-hero.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14,34,51,.58), rgba(14,34,51,.04) 70%);
}
.dialog-hero-icon { position: relative; z-index: 2; font-size: 58px; }
.dialog-hero.has-photo .dialog-hero-icon { display: none; }
.dialog-body { padding: 22px; }
.dialog-body h2 { margin: 0; font-size: 28px; }
.dialog-body .lead { color: var(--muted); line-height: 1.55; }
.detail-attributes { margin-top: 14px; }
.detail-attributes small { display: block; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; margin-bottom: 6px; }
.detail-attributes .place-tags { margin-top: 0; }
.more-info { margin: 14px 0 4px; }
.more-info summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 13px;
  background: #f3f1ec;
  color: var(--night);
  font-size: 12px;
  font-weight: 900;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.more-info summary::-webkit-details-marker { display: none; }
.more-info summary::after { content: "▾"; margin-left: auto; }
.more-info[open] summary::after { content: "▴"; }
.more-info[open] summary { border-radius: 13px 13px 0 0; }
.more-info > *:not(summary) { margin-top: 0; }
.more-info .info-grid:first-of-type,
.more-info .detail-attributes:first-of-type { padding-top: 14px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.info-box { padding: 13px; border-radius: 15px; background: white; }
.info-box small { display: block; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.info-box strong { display: block; margin-top: 4px; font-size: 12px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.contact-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: #edf5f4;
  color: var(--night);
  font-size: 12px;
  font-weight: 800;
}
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.dialog-actions a, .dialog-actions button {
  border: 0;
  border-radius: 14px;
  padding: 13px;
  text-align: center;
  color: white;
  background: var(--night);
  font-size: 12px;
  font-weight: 900;
}
.dialog-actions .share-dialog-btn { background: var(--teal); }

@keyframes breathe {
  0%, 100% { transform: rotate(-45deg) scale(1); }
  50% { transform: rotate(-45deg) scale(1.06); }
}

@media (max-width: 420px) {
  .hero { min-height: 230px; }
  .category-grid { gap: 6px; }
  .category-chip { min-height: 50px; }
  .place-card { grid-template-columns: 100px 1fr; }
  .place-card-content { padding: 10px 12px 9px; }
  .place-actions { gap: 5px; }
  .place-actions button, .place-actions a { padding: 7px; font-size: 9px; }
}

@media (min-width: 600px) {
  main { padding-left: 24px; padding-right: 24px; }
  .places-list { grid-template-columns: 1fr 1fr; }
  .place-card { grid-template-columns: 120px 1fr; }
}

.leaflet-tile-pane {
  filter: brightness(.55) saturate(.75) contrast(1.1) hue-rotate(155deg);
}
.place-cover-icon img,
.dialog-hero-icon img {
  width: 42px;
  height: 42px;
  filter: brightness(0) invert(1);
}
.dialog-hero-icon img {
  width: 64px;
  height: 64px;
}
.custom-marker span img {
  width: 15px;
  height: 15px;
  filter: brightness(0) invert(1);
}
@media (max-width: 390px) {
  .quick-chip { font-size: 9.5px; padding-inline: 7px; }
}
