:root {
  --paper: #f5ecd4;
  --paper-strong: #ead9b2;
  --paper-deep: #d7b76b;
  --ink: #14222b;
  --ink-soft: #48545b;
  --claret: #9f3728;
  --navy: #1f4c66;
  --navy-soft: #6c95ab;
  --olive: #5f6f4d;
  --white: #fffdf7;
  --shadow: 0 22px 50px rgba(20, 34, 43, 0.12);
  --border: rgba(20, 34, 43, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(215, 183, 107, 0.4), transparent 30%),
    radial-gradient(circle at bottom left, rgba(31, 76, 102, 0.2), transparent 32%),
    repeating-linear-gradient(
      135deg,
      rgba(20, 34, 43, 0.025) 0,
      rgba(20, 34, 43, 0.025) 10px,
      transparent 10px,
      transparent 22px
    ),
    linear-gradient(180deg, #fbf4e3 0%, #f7edd8 100%);
}

button,
input,
a {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  width: min(1400px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 24px 0 120px;
}

body.has-map-fullscreen {
  overflow: hidden;
  overscroll-behavior: none;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(159, 55, 40, 0.24);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(31, 76, 102, 0.06), transparent 40%),
    linear-gradient(145deg, rgba(159, 55, 40, 0.08), transparent 45%),
    rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px dashed rgba(159, 55, 40, 0.22);
  border-radius: 24px;
  pointer-events: none;
}

.hero__stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 10px 16px;
  border: 2px solid rgba(159, 55, 40, 0.45);
  border-radius: var(--radius-sm);
  color: var(--claret);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-5deg);
}

.hero__eyebrow,
.panel__eyebrow,
.detail-sheet__eyebrow {
  margin: 0;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1,
.panel h2,
.detail-sheet h2,
.empty-state h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.hero h1 {
  margin-top: 12px;
  font-size: clamp(3rem, 10vw, 5.6rem);
}

.hero__lede {
  width: min(44rem, 100%);
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 3vw, 1.15rem);
  line-height: 1.6;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.stat-card,
.panel,
.toolbar,
.detail-sheet {
  border: 1px solid var(--border);
  background: rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 16px;
  border-radius: 20px;
}

.stat-card__value {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
}

.stat-card__label {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.toolbar {
  position: sticky;
  top: 10px;
  z-index: 900;
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 26px;
  backdrop-filter: blur(12px);
}

.toolbar__search {
  width: 100%;
}

.search-field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(31, 76, 102, 0.18);
  border-radius: 18px;
  background: var(--white);
}

.search-field:focus-within {
  border-color: var(--navy-soft);
  box-shadow: 0 0 0 4px rgba(108, 149, 171, 0.16);
}

.search-field__icon {
  color: var(--claret);
  font-size: 1.2rem;
}

.search-field input {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.toolbar__actions,
.view-toggle,
.detail-actions,
.pub-card__actions,
.status-row,
.detail-section__header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-pill,
.view-toggle__button,
.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.action-pill,
.view-toggle__button.is-active,
.detail-link {
  border: 1px solid rgba(159, 55, 40, 0.18);
  background: var(--claret);
  color: var(--white);
  font-weight: 700;
}

.action-pill:hover,
.view-toggle__button:hover,
.detail-link:hover,
.pub-card:hover {
  transform: translateY(-1px);
}

.action-pill--ghost,
.view-toggle__button {
  border: 1px solid rgba(31, 76, 102, 0.18);
  background: rgba(31, 76, 102, 0.08);
  color: var(--ink);
}

.view-toggle {
  border-radius: 18px;
  padding: 4px;
  background: rgba(31, 76, 102, 0.08);
}

.view-toggle__button {
  min-width: 88px;
}

.toolbar__status {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.workspace {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.panel {
  overflow: hidden;
  border-radius: 30px;
}

.map-panel {
  display: flex;
  flex-direction: column;
}

.panel__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(20, 34, 43, 0.08);
}

.panel h2 {
  margin-top: 4px;
  font-size: clamp(2rem, 6vw, 2.4rem);
}

.panel__meta {
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-align: right;
}

.panel__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.map-fullscreen-toggle {
  min-width: 124px;
}

#map {
  width: 100%;
  height: 58vh;
  min-height: 420px;
  background: #e4dac1;
}

.map-panel:fullscreen,
.map-panel:-webkit-full-screen,
.map-panel.is-fallback-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  border-radius: 0;
}

.map-panel:fullscreen::backdrop,
.map-panel:-webkit-full-screen::backdrop {
  background: rgba(20, 34, 43, 0.18);
}

.map-panel:fullscreen .panel__header,
.map-panel:-webkit-full-screen .panel__header,
.map-panel.is-fallback-fullscreen .panel__header {
  padding:
    max(16px, env(safe-area-inset-top))
    18px
    16px;
}

.map-panel:fullscreen #map,
.map-panel:-webkit-full-screen #map,
.map-panel.is-fallback-fullscreen #map {
  flex: 1;
  height: auto;
  min-height: 0;
}

.list-panel {
  display: flex;
  flex-direction: column;
}

.pub-list {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.pub-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(20, 34, 43, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(31, 76, 102, 0.05), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 253, 247, 0.96));
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.pub-card__media {
  overflow: hidden;
  border-radius: 18px;
  background: #e0d3b6;
  aspect-ratio: 4 / 3;
}

.pub-card__media img,
.detail-sheet__hero img,
.gallery-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pub-card__content {
  display: grid;
  gap: 10px;
}

.pub-card__topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pub-card h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
}

.pub-card__address,
.detail-address,
.detail-section__header p,
.empty-state p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.status-row {
  align-items: center;
}

.status-pill,
.chip,
.pub-card__distance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 800;
}

.status-pill {
  background: rgba(95, 111, 77, 0.12);
  color: var(--olive);
}

.status-pill.is-closed {
  background: rgba(159, 55, 40, 0.12);
  color: var(--claret);
}

.status-note {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.chip-cloud,
.gallery-strip,
.hours-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rating-links {
  display: grid;
  gap: 12px;
}

.chip {
  border: 1px solid rgba(31, 76, 102, 0.14);
  background: rgba(31, 76, 102, 0.06);
  color: var(--ink);
}

.pub-card__facilities .chip:nth-child(n + 5) {
  display: none;
}

.empty-state,
.load-more-wrap {
  padding: 0 16px 16px;
}

.empty-state {
  padding-top: 8px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 14px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(20, 34, 43, 0.35);
  backdrop-filter: blur(4px);
}

body.has-map-fullscreen .sheet-backdrop {
  z-index: 1298;
}

.detail-sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 999;
  height: min(90vh, 960px);
  border-radius: 28px 28px 0 0;
  overflow: hidden;
  transform: translateY(105%);
  transition: transform 220ms ease;
}

body.has-map-fullscreen .detail-sheet {
  z-index: 1299;
}

.detail-sheet.is-open {
  transform: translateY(0);
}

.detail-sheet__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: rgba(20, 34, 43, 0.72);
  color: var(--white);
  cursor: pointer;
}

.detail-sheet__scroll {
  height: 100%;
  overflow-y: auto;
}

.detail-sheet__hero {
  position: relative;
  height: 260px;
  background: #d7c29c;
}

.detail-sheet__badge {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 247, 0.86);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-sheet__body {
  display: grid;
  gap: 22px;
  padding: 18px 18px 120px;
}

.detail-sheet h2 {
  font-size: clamp(2rem, 9vw, 3rem);
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-link {
  width: 100%;
}

.detail-section {
  display: grid;
  gap: 12px;
}

.detail-section__header {
  align-items: baseline;
  justify-content: space-between;
}

.detail-section__header h3 {
  margin: 0;
  font-size: 1.08rem;
}

.hours-grid {
  display: grid;
  gap: 10px;
}

.hours-row {
  display: grid;
  grid-template-columns: minmax(92px, 120px) 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(31, 76, 102, 0.06);
}

.hours-row__day {
  font-weight: 800;
}

.gallery-strip {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.gallery-strip figure {
  flex: 0 0 220px;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #e3d4b2;
  aspect-ratio: 1.08;
  scroll-snap-align: start;
}

.rating-feature {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(31, 76, 102, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(66, 133, 244, 0.08), transparent 55%),
    linear-gradient(155deg, rgba(251, 188, 5, 0.14), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 253, 247, 0.96));
}

.rating-feature.is-unavailable {
  background:
    linear-gradient(135deg, rgba(31, 76, 102, 0.06), transparent 55%),
    rgba(255, 253, 247, 0.96);
}

.rating-feature__brand,
.rating-source-links,
.rating-feature__scoreline,
.rating-feature__stars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.rating-feature__brand {
  justify-content: space-between;
}

.google-wordmark {
  display: inline-flex;
  gap: 0.02em;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.google-wordmark__letter.is-blue {
  color: #4285f4;
}

.google-wordmark__letter.is-red {
  color: #db4437;
}

.google-wordmark__letter.is-yellow {
  color: #f4b400;
}

.google-wordmark__letter.is-green {
  color: #0f9d58;
}

.rating-feature__kicker {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rating-feature__scoreline {
  gap: 8px;
}

.rating-feature__score {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.8rem, 11vw, 4rem);
  line-height: 0.9;
}

.rating-feature__scale {
  color: var(--ink-soft);
  font-size: 1.05rem;
  font-weight: 700;
}

.rating-feature__stars {
  color: #f4b400;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
}

.rating-star {
  opacity: 0.38;
}

.rating-star.is-filled {
  opacity: 1;
}

.rating-feature__empty-title,
.rating-feature__note {
  margin: 0;
}

.rating-feature__empty-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
}

.rating-feature__note {
  color: var(--ink-soft);
  line-height: 1.5;
}

.rating-source-links {
  gap: 8px;
}

.rating-source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(31, 76, 102, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(31, 76, 102, 0.08);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.rating-source-link.is-google {
  border-color: rgba(66, 133, 244, 0.22);
  background: rgba(66, 133, 244, 0.1);
}

.rating-source-link:hover {
  transform: translateY(-1px);
  border-color: rgba(159, 55, 40, 0.22);
}

.passport-marker {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--claret);
  box-shadow: 0 4px 10px rgba(20, 34, 43, 0.22);
}

.passport-marker::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(159, 55, 40, 0.16);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
}

.leaflet-container a {
  color: var(--navy);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(255, 253, 247, 0.96);
}

.leaflet-popup-content {
  margin: 14px;
  font-family: "Manrope", system-ui, sans-serif;
}

.popup-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.popup-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

@media (max-width: 879px) {
  .workspace[data-view="map"] .list-panel {
    display: none;
  }

  .workspace[data-view="list"] .map-panel {
    display: none;
  }
}

@media (min-width: 880px) {
  .page-shell {
    width: min(1600px, calc(100vw - 48px));
    padding-top: 32px;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1.6fr) auto auto;
    align-items: center;
  }

  .toolbar__status {
    grid-column: 1 / -1;
  }

  .view-toggle {
    display: none;
  }

  .workspace {
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
    align-items: start;
  }

  .map-panel {
    position: sticky;
    top: 162px;
  }

  .map-panel,
  .list-panel {
    height: max(calc(100vh - 141px), 736px);
  }

  #map {
    flex: 1;
    height: auto;
    min-height: 640px;
  }

  .pub-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 10px;
  }

  .pub-card {
    grid-template-columns: 180px 1fr;
  }

  .detail-sheet {
    top: 18px;
    right: 18px;
    left: auto;
    bottom: 18px;
    width: min(520px, calc(100vw - 36px));
    height: auto;
    border-radius: 28px;
    transform: translateX(105%);
  }

  .detail-sheet.is-open {
    transform: translateX(0);
  }

  .detail-sheet__hero {
    height: 280px;
  }
}

@media (max-width: 639px) {
  .page-shell {
    width: calc(100vw - 18px);
    padding-top: 12px;
  }

  .hero,
  .toolbar,
  .panel {
    border-radius: 24px;
  }

  .hero {
    padding: 22px;
  }

  .hero__stats {
    grid-template-columns: 1fr;
  }

  .toolbar {
    top: 8px;
    padding: 14px;
  }

  .toolbar__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toolbar__actions .action-pill:first-child {
    grid-column: 1 / -1;
  }

  #map {
    min-height: 360px;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }
}
