:root {
  color-scheme: light;
  --ink: #10231f;
  --muted: #61706a;
  --soft: #eef4f0;
  --paper: #fbfbf7;
  --line: #d7ded8;
  --mist: #dcebea;
  --sea: #245f68;
  --moss: #456b48;
  --ember: #c9693f;
  --gold: #d8aa58;
  --heather: #7a6c88;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(16, 35, 31, 0.13);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: rgba(251, 251, 247, 0.88);
  border-bottom: 1px solid rgba(215, 222, 216, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 68% 28%, rgba(216, 170, 88, 0.95) 0 5px, transparent 6px),
    linear-gradient(145deg, var(--ink), var(--moss));
  color: var(--paper);
  font-size: 0.92rem;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(16, 35, 31, 0.18);
}

.brand strong {
  font-size: 1.08rem;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a,
.ghost-button,
.text-button,
.primary-button,
.admin-actions button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.nav a,
.text-button {
  padding: 10px 12px;
  color: var(--muted);
}

.nav a:hover,
.text-button:hover {
  color: var(--ink);
}

.ghost-button {
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.58);
  border-color: var(--line);
  color: var(--ink);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
  font-weight: 750;
}

.primary-button.small,
.ghost-button.small {
  min-height: 36px;
  padding: 8px 11px;
  font-size: 0.92rem;
}

.hero {
  position: relative;
  min-height: clamp(620px, 86vh, 820px);
  display: grid;
  align-items: end;
  padding: clamp(28px, 5vw, 70px);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 25, 22, 0.84), rgba(9, 25, 22, 0.48) 42%, rgba(9, 25, 22, 0.08) 76%),
    linear-gradient(180deg, rgba(9, 25, 22, 0.18), rgba(9, 25, 22, 0.78)),
    url("assets/hero-scottish-sauna.png") center / cover;
  transform: scale(1.01);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  color: var(--white);
  padding-bottom: clamp(24px, 7vh, 70px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--ember);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffd99a;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 1.04;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  line-height: 1.15;
}

.hero-copy {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.hero-search {
  width: min(680px, 100%);
  margin-top: 28px;
}

.hero-search label {
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.hero-search div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
}

.hero-search input {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--white);
}

.hero-search button {
  min-width: 110px;
  border: 0;
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-stats span {
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

.toolbar-section,
.toolbar-dock,
.guide-section,
.results-layout,
.submission-band {
  width: min(1220px, calc(100% - 36px));
  margin-inline: auto;
}

.toolbar-section {
  padding: 58px 0 10px;
}

.section-heading {
  max-width: 760px;
}

.section-copy {
  color: var(--muted);
  line-height: 1.55;
}

.toolbar-dock {
  position: sticky;
  top: 67px;
  z-index: 15;
  padding: 12px 0 18px;
  background: linear-gradient(180deg, rgba(251, 251, 247, 0.98), rgba(251, 251, 247, 0.9));
  backdrop-filter: blur(16px);
}

.toolbar-wrap {
  padding: 10px;
  border: 1px solid rgba(215, 222, 216, 0.9);
  border-radius: var(--radius);
  background: rgba(251, 251, 247, 0.92);
  box-shadow: 0 12px 30px rgba(16, 35, 31, 0.08);
  backdrop-filter: blur(16px);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

.sticky-summary {
  display: grid;
  gap: 2px;
  min-width: min(260px, 100%);
  margin-right: auto;
  color: var(--muted);
  font-size: 0.84rem;
}

.sticky-summary strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.sticky-summary span {
  overflow: hidden;
  max-width: 420px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding-left: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--muted);
}

select {
  min-height: 46px;
  border: 0;
  padding: 0 34px 0 8px;
  background: transparent;
  color: var(--ink);
}

.filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-toggle {
  display: none;
}

.filter-pill {
  position: relative;
  display: inline-flex;
}

.filter-pill input {
  position: absolute;
  opacity: 0;
}

.filter-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.filter-pill input:checked + span {
  background: var(--sea);
  border-color: var(--sea);
  color: var(--white);
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(280px, 400px) 1fr;
  gap: 24px;
  align-items: start;
  padding: 12px 0 54px;
}

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

.map-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--mist);
  box-shadow: var(--shadow);
}

.real-map,
.map-fallback {
  position: relative;
  min-height: 500px;
}

.real-map {
  z-index: 1;
}

.leaflet-container {
  font: inherit;
}

.ww-marker {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(201, 105, 63, 0.18);
}

.ww-marker span {
  display: block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 8px 18px rgba(16, 35, 31, 0.26);
}

.ww-marker.is-lead span {
  background: var(--gold);
}

.map-fallback {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background:
    linear-gradient(160deg, rgba(36, 95, 104, 0.2), rgba(255, 255, 255, 0.35)),
    var(--mist);
}

.map-fallback span {
  max-width: 280px;
  color: var(--muted);
}

.map-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 3;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(201, 105, 63, 0.22);
  transform: translate(-50%, -50%);
}

.map-pin span {
  width: 12px;
  height: 12px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 8px 18px rgba(16, 35, 31, 0.28);
}

.map-pin.saved span {
  background: var(--gold);
}

.map-meta {
  display: grid;
  gap: 4px;
  padding: 12px 2px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.map-meta strong {
  color: var(--ink);
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 48px;
  margin-bottom: 14px;
}

.results-head p {
  margin: 0;
  color: var(--muted);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.listing-card,
.guide-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.listing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow: hidden;
  padding: 24px;
  min-height: 0;
  background:
    linear-gradient(135deg, rgba(220, 235, 234, 0.72), rgba(255, 255, 255, 0) 42%),
    var(--white);
  box-shadow: 0 16px 40px rgba(16, 35, 31, 0.08);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.listing-card:hover {
  border-color: rgba(36, 95, 104, 0.3);
  box-shadow: 0 22px 48px rgba(16, 35, 31, 0.11);
  transform: translateY(-1px);
}

.listing-card.is-selected {
  border-color: rgba(36, 95, 104, 0.82);
  background:
    linear-gradient(135deg, rgba(220, 235, 234, 0.9), rgba(255, 255, 255, 0) 45%),
    var(--white);
  box-shadow: 0 0 0 3px rgba(36, 95, 104, 0.12), 0 18px 44px rgba(16, 35, 31, 0.12);
}

.listing-card.is-selected::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sea), var(--gold), var(--ember));
}

.card-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.card-head {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.card-head > span:first-child {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(238, 244, 240, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: none;
}

.status-warn {
  color: #8d5a19;
  font-weight: 760;
}

.status-ok {
  color: #285d3d;
  font-weight: 760;
}

.status-muted {
  color: var(--muted);
  font-weight: 760;
}

.place {
  margin-bottom: 0;
  color: var(--sea);
  font-weight: 760;
}

.listing-card h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.listing-summary {
  margin: 0;
  color: #2f423d;
  font-size: 0.98rem;
  line-height: 1.5;
}

.type-badge {
  display: grid;
  flex: 0 0 96px;
  min-height: 96px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px solid rgba(36, 95, 104, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.26)),
    var(--soft);
  color: var(--ink);
  text-align: center;
}

.type-badge strong {
  font-size: 0.74rem;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.type-mark {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sea);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.32);
}

.type-mark::before,
.type-mark::after {
  content: "";
  position: absolute;
}

.type-coastal .type-mark {
  background: linear-gradient(180deg, #7bb7c0 0 46%, #e3c077 47% 100%);
}

.type-coastal .type-mark::before {
  inset: 21px 7px auto;
  height: 8px;
  border-top: 3px solid var(--white);
  border-radius: 50%;
}

.type-cold .type-mark {
  background: #b9dce0;
}

.type-cold .type-mark::before,
.type-cold .type-mark::after {
  left: 50%;
  top: 8px;
  width: 3px;
  height: 26px;
  border-radius: 999px;
  background: var(--white);
  transform: translateX(-50%);
}

.type-cold .type-mark::after {
  transform: translateX(-50%) rotate(90deg);
}

.type-both .type-mark {
  background: linear-gradient(135deg, var(--ink) 0 49%, #b9dce0 50% 100%);
}

.type-both .type-mark::before {
  left: 9px;
  top: 9px;
  width: 4px;
  height: 23px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 8px 0 0 var(--white);
}

.type-both .type-mark::after {
  right: 8px;
  bottom: 9px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--white);
  border-top-color: transparent;
  border-radius: 50%;
}

.type-loch .type-mark {
  background: linear-gradient(180deg, #c5d8a4 0 42%, #5d9ca4 43% 100%);
}

.type-loch .type-mark::before {
  left: 8px;
  right: 8px;
  bottom: 11px;
  height: 7px;
  border-top: 3px solid var(--white);
  border-radius: 50%;
}

.type-sauna .type-mark {
  background: linear-gradient(145deg, var(--ink), var(--moss));
}

.type-sauna .type-mark::before {
  left: 10px;
  top: 8px;
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 9px 0 0 var(--white), 18px 0 0 var(--white);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.feature-grid span {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(36, 95, 104, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
  color: #31453f;
  font-size: 0.88rem;
  font-weight: 720;
  line-height: 1.25;
}

.more-details {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.more-details summary {
  width: max-content;
  cursor: pointer;
  color: var(--sea);
  font-weight: 760;
}

.more-details div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.more-details span {
  color: var(--muted);
  font-size: 0.8rem;
}

.more-details span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(215, 222, 216, 0.72);
}

.card-actions .primary-button.small {
  padding-inline: 14px;
}

.primary-button.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--white);
}

.submission-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
}

.submission-band p:not(.eyebrow) {
  max-width: 640px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.guide-section {
  padding: 66px 0 80px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.guide-grid article {
  padding: 20px;
}

.guide-grid p {
  color: var(--muted);
  line-height: 1.55;
}

.admin-dialog {
  width: min(980px, calc(100% - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

.admin-dialog::backdrop,
.map-dialog::backdrop {
  background: rgba(16, 35, 31, 0.56);
}

.map-dialog {
  width: min(860px, calc(100% - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: var(--white);
  box-shadow: var(--shadow);
}

.map-dialog-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.map-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.map-dialog-head .eyebrow {
  margin-bottom: 6px;
}

.map-dialog-head h2 {
  margin: 0 0 5px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.map-dialog-head p:last-child {
  margin: 0;
  color: var(--sea);
  font-weight: 760;
}

.listing-modal-map {
  overflow: hidden;
  min-height: min(56vh, 480px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--mist);
}

.modal-map-fallback {
  display: grid;
  min-height: min(56vh, 480px);
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.modal-map-fallback strong {
  color: var(--ink);
}

.map-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.admin-head h2 {
  margin: 0;
  font-size: 1.45rem;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
}

textarea {
  width: 100%;
  min-height: 430px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #101815;
  color: #eef7f0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-actions button {
  padding: 9px 13px;
  background: var(--soft);
  border-color: var(--line);
}

.admin-note {
  margin: 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .results-layout {
    grid-template-columns: 1fr;
  }

  .map-panel {
    position: relative;
    top: auto;
  }

  .real-map,
  .map-fallback {
    min-height: 340px;
  }

  .listing-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: 740px;
    padding: 24px 18px;
  }

  .hero-media {
    background:
      linear-gradient(180deg, rgba(9, 25, 22, 0.54), rgba(9, 25, 22, 0.82)),
      url("assets/hero-scottish-sauna.png") center / cover;
  }

  .hero-search div {
    grid-template-columns: 1fr;
  }

  .hero-search button {
    min-height: 48px;
  }

  .toolbar-section,
  .toolbar-dock,
  .guide-section,
  .results-layout,
  .submission-band {
    width: min(100% - 24px, 1220px);
  }

  .toolbar-wrap {
    max-height: calc(100vh - 126px);
    overflow: auto;
  }

  .toolbar-dock {
    top: 113px;
    padding-bottom: 12px;
  }

  .sticky-summary span {
    max-width: 100%;
  }

  .toolbar {
    margin-bottom: 0;
  }

  .sticky-summary {
    min-width: 0;
  }

  .filter-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .toolbar-wrap:not(.is-open) .select-label,
  .toolbar-wrap:not(.is-open) #resetFilters,
  .toolbar-wrap:not(.is-open) .filter-grid {
    display: none;
  }

  .toolbar-wrap.is-open .toolbar {
    margin-bottom: 12px;
  }

  .select-label,
  .select-label select,
  .toolbar .ghost-button {
    width: 100%;
  }

  .toolbar .filter-toggle {
    width: auto;
  }

  .results-head,
  .submission-band {
    align-items: stretch;
    flex-direction: column;
  }

  .listing-card {
    padding: 20px;
  }

  .card-hero {
    flex-direction: column;
  }

  .type-badge {
    flex-basis: auto;
    min-height: 92px;
    grid-template-columns: auto 1fr;
    justify-content: start;
    padding: 14px;
    text-align: left;
  }

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

  .listing-modal-map {
    min-height: 340px;
  }

  .map-dialog-actions {
    justify-content: stretch;
  }

  .map-dialog-actions .primary-button,
  .map-dialog-actions form,
  .map-dialog-actions button {
    width: 100%;
  }
}
