:root {
  --red: #a4161f;
  --pine: #0f5132;
  --gold: #d9a21b;
  --rate: #e08a00;
  --live: #2e9e5b;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.16);
  --bg: #f5f5f7;
  --fav: #e0245e;
  --been: #1b7f3b;
  --home: #1d1d1f;
  --accent: var(--red);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-edge: rgba(255, 255, 255, 0.6);
  --blur: saturate(180%) blur(20px);
  --radius: 14px;
  --radius-chrome: 20px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.12);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --header-h: 56px;
  --chips-bottom: calc(var(--header-h) + 28px + 56px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
  padding: 0 14px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-chrome);
  box-shadow: var(--shadow-soft);
  z-index: 1001; /* above the home sheet's scrim, so the chip closes it */
}

header h1 {
  white-space: nowrap;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--red);
}

.title-logo {
  margin-right: 4px;
  vertical-align: -4px;
}

.legend {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.home {
  background: var(--home);
}

.garland {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 100%;
  height: 16px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.garland::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 7px;
  border-bottom: 1.5px solid var(--pine);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  opacity: 0.8;
}

.garland i {
  width: 6px;
  height: 9px;
  margin-top: 3px;
  border-radius: 50% 50% 55% 55%;
  background: var(--red);
  box-shadow: 0 0 6px 1px currentColor;
  color: var(--red);
}

.garland i:nth-child(4n + 2) {
  background: var(--gold);
  color: var(--gold);
}

.garland i:nth-child(4n + 3) {
  background: #2f9e62;
  color: #2f9e62;
}

.garland i:nth-child(4n + 4) {
  background: #fff;
  color: #fff;
}

.garland i:nth-child(odd) {
  margin-top: 6px;
}

@media (prefers-reduced-motion: no-preference) {
  .garland i {
    animation: twinkle 2.4s ease-in-out infinite;
  }

  .garland i:nth-child(3n) {
    animation-delay: 0.5s;
  }

  .garland i:nth-child(3n + 1) {
    animation-delay: 1.1s;
  }
}

@keyframes twinkle {
  50% {
    opacity: 0.45;
  }
}

@media (max-width: 480px) {
  header {
    top: 6px;
    left: 6px;
    right: 6px;
    gap: 8px;
    padding: 0 10px;
    height: 48px;
  }

  header h1 {
    font-size: 16px;
  }
}

#map {
  position: absolute;
  inset: 0;
}

#status {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--header-h) + 30px);
  z-index: 600;
  font-size: 13px;
  max-width: calc(100% - 24px);
}

#status[data-state="loading"] {
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

#status[data-state="error"] {
  background: #fff4f4;
  color: #a1001c;
  border: 1px solid #ffd0d6;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

#status[data-state="ready"] {
  display: none;
}

/* markers */
.pin > svg,
.pin > img {
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

/* popups */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.leaflet-popup-content-wrapper {
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  width: min(312px, calc(100vw - 48px)) !important;
}

.leaflet-popup-content .card {
  padding: 14px 16px;
}

/* phones: the open popup is a bottom sheet docked to the map (map-view.js moves it out of the panes) */
.leaflet-popup.sheet {
  position: absolute;
  left: 8px !important;
  right: 8px;
  bottom: 8px !important;
  margin: 0;
  transform: none !important;
  z-index: 700;
}

.leaflet-popup.sheet .leaflet-popup-content-wrapper {
  border-radius: 22px 22px 18px 18px;
}

.leaflet-popup.sheet .leaflet-popup-content-wrapper::before {
  content: "";
  display: block;
  width: 36px;
  height: 5px;
  margin: 6px auto 0;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.18);
}

.leaflet-popup.sheet .leaflet-popup-content {
  width: auto !important;
}

.leaflet-popup.sheet .leaflet-popup-tip-container {
  display: none;
}

.card h2 {
  font-size: 17px;
  margin: 4px 0 6px;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.4;
  color: #3a3a3c;
}

.addr {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.card ul {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.45;
  color: #3a3a3c;
}

.actions {
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.actions .share {
  flex: 0 0 44px;
  padding: 0;
}

.btn.primary {
  background: var(--accent);
  color: #fff !important;
}

.btn.secondary {
  background: #fbe9ea;
  color: var(--accent) !important;
}

.source {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.source a {
  color: var(--muted);
}

/* photo under the town, nearly full width */
.photo {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #e5e5ea;
  overflow: hidden;
  margin: 10px -4px 8px;
  border-radius: 12px;
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leaflet-container .photo .credit {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 11px;
  text-decoration: none;
  backdrop-filter: blur(4px);
}

/* the marks row (62 px) takes room from the scroll area too */

@media (max-width: 480px) {
  .photo {
    aspect-ratio: auto;
    height: 120px;
  }
}

/* close button readable over a photo */
.leaflet-container .leaflet-popup:has(.photo) a.leaflet-popup-close-button {
  z-index: 2;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  line-height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  font-size: 18px;
}

/* row icons */
.ico {
  flex: none;
  color: var(--muted);
}

.addr,
.source {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.addr .ico,
.source .ico {
  margin-top: -1px;
}

.source .ico {
  width: 13px;
  height: 13px;
}

/* one icon per offering line, tinted with the place's category */

/* drive time row */
.trip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink);
  margin: 0 0 8px;
}

.trip svg {
  flex: none;
  color: var(--muted);
}

.trip b {
  font-weight: 600;
}

.trip .km {
  color: var(--muted);
}

.trip.set-home {
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
}

.trip.set-home svg {
  color: var(--home);
}

.trip.pending,
.trip.missing {
  color: var(--muted);
}

.leaflet-control-attribution {
  font-size: 11px;
}

[hidden] {
  display: none !important;
}

/* the home button: right end of the title bar */
.home-chip {
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  max-width: 230px;
  padding: 0 10px 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.home-chip::after {
  content: "";
  position: absolute;
  inset: -8px -2px; /* 46 px hit area */
}

.home-chip .ico {
  color: var(--home);
  width: 15px;
  height: 15px;
}

.home-chip b {
  font-weight: 600;
}

.home-chip .town {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.home-chip .chev {
  display: inline-flex;
}

.home-chip .chev .ico {
  width: 12px;
  height: 12px;
  color: var(--muted);
}

.home-chip.unset {
  border-color: #f0c4c7;
  background: #fdf1f1;
  font-weight: 600;
}

.home-chip:hover {
  border-color: #c7c7cc;
}

/* the home sheet: a panel under the header, a bottom sheet on phones */
#home-sheet {
  position: absolute;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  left: 16px;
  width: 380px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 80px);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  font-size: 14px;
}

#home-scrim {
  position: absolute;
  inset: 0;
  z-index: 999;
  background: transparent;
}

.handle {
  display: none;
  width: 36px;
  height: 5px;
  margin: 8px auto 0;
  border-radius: 3px;
  background: #d1d1d6;
}

@media (max-width: 480px) {
  .home-chip {
    font-size: 12px;
  }

  #home-sheet {
    top: auto !important;
    left: 0 !important;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    max-height: 82%;
    border-radius: 18px 18px 0 0;
  }

  #home-scrim {
    background: rgba(0, 0, 0, 0.18);
  }

  .handle {
    display: block;
  }
}

.sheet-in {
  padding: 14px 16px 16px;
  overflow: auto;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -10px -12px -10px 0;
  border: 0;
  border-radius: 22px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.x span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--bg);
  font-size: 15px;
}

.lead {
  margin: 2px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

form.search {
  display: flex;
  gap: 8px;
}

.field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg);
}

.field:focus-within {
  border-color: var(--accent);
  background: #fff;
}

.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
}

.btn.small {
  flex: none;
  padding: 0 16px;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.btn.ghost {
  border: 0;
  background: none;
  color: var(--accent) !important;
  font-family: inherit;
  cursor: pointer;
}

.locate {
  width: 100%;
  gap: 6px;
  margin-top: 8px;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.locate .ico {
  color: var(--accent);
}

.msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.msg.err {
  padding: 8px 10px;
  border: 1px solid #ffd0d6;
  border-radius: 10px;
  background: #fff4f4;
  color: #a1001c;
}

.msg.warn {
  padding: 8px 10px;
  border: 1px solid #ffe2a8;
  border-radius: 10px;
  background: #fff8e6;
  color: #7a4b00;
}

.spinner {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  border: 2px solid #d1d1d6;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

ul.results {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

ul.results li + li {
  border-top: 1px solid var(--line);
}

ul.results button {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

ul.results button:hover,
ul.results button:focus-visible {
  background: #fdf1f1;
}

ul.results b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

ul.results small {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: var(--muted);
}

.now {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.now .addr {
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--ink);
}

.credit {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

.credit a {
  color: var(--muted);
}

/* toast after home moved; #status stays the places banner */
#home-toast {
  position: absolute;
  left: 50%;
  top: 64px;
  transform: translateX(-50%);
  z-index: 1002;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: min(420px, calc(100% - 24px));
  padding: 10px 12px 10px 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
  font-size: 13px;
}

#home-toast .ico {
  margin-top: 1px;
  color: var(--home);
}

#home-toast .ico.check {
  color: #1b7f3b;
}

#home-toast .share-url {
  width: 100%;
  margin-top: 6px;
  font:
    13px ui-monospace,
    monospace;
  padding: 6px 8px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
}

#home-toast.warn .ico {
  color: #b26a00;
}

#home-toast p {
  margin: 0;
  line-height: 1.35;
}

#home-toast p.warn {
  margin-top: 4px;
  color: #7a4b00;
}

#home-toast .ico.heart {
  color: var(--gold);
}

#home-toast .toast-action {
  flex: none;
  align-self: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#home-toast .tx {
  flex: none;
  width: 28px;
  height: 28px;
  margin: -4px -4px 0 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

@media (max-width: 480px) {
  #home-toast {
    top: auto;
    bottom: 30px;
    width: calc(100% - 24px);
    max-width: none;
  }
}

/* home popup */
.card button.btn {
  width: 100%;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

/* account control: left of the home button in the title bar */
#account-slot {
  display: contents;
}

.account-btn {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  margin-left: auto;
}

.account-btn::after {
  content: "";
  position: absolute;
  inset: -8px -4px; /* 46 px hit area */
}

.account-btn .ico {
  width: 15px;
  height: 15px;
}

.account-btn.chip {
  border-radius: 999px;
  padding: 0 11px 0 9px;
  font-weight: 600;
  color: var(--accent);
  border-color: #f0c4c7;
  background: #fdf1f1;
}

.account-btn.round {
  width: 30px;
  border-radius: 50%;
  padding: 0;
}

.account-btn.round.in {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.account-btn .on {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1b7f3b;
  border: 2px solid #fff;
}

/* the pair sits 8 px apart at the right end; an empty slot leaves the home button its auto margin */
#account-slot:not(:empty) + .home-chip {
  margin-left: -8px;
}

#account-menu {
  position: absolute;
  z-index: 1002;
  right: var(--menu-right, 12px);
  width: 250px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  top: var(--menu-top, 0);
  max-height: calc(100dvh - var(--menu-top, 0px) - 12px);
  font-size: 13px;
  overflow-y: auto;
}

#account-menu .who {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

#account-menu .counts {
  display: flex;
  gap: 14px;
  margin: 10px 0 4px;
  font-weight: 600;
}

#account-menu .counts > span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

#account-menu .fav .ico {
  color: #e0245e;
}

#account-menu .been .ico {
  color: #1b7f3b;
}

#account-menu .synced {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

#account-menu .helger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin: 8px 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: #f2f2f7;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#account-menu .helger > span:first-child {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

#account-menu .helger .ico {
  color: var(--red);
}

#account-menu .helger .n {
  color: var(--muted);
}

#account-menu .btn {
  width: 100%;
  gap: 6px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

/* the login sheet: the home sheet's look; a bottom sheet on phones */
#login-sheet {
  position: absolute;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  width: 340px;
  max-width: calc(100% - 32px);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  font-size: 14px;
}

#login-sheet .lead {
  margin: 4px 0 14px;
  color: var(--ink);
  line-height: 1.4;
}

#login-sheet .btn {
  width: 100%;
  gap: 8px;
  margin-bottom: 8px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

#login-sheet .google .ico {
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  padding: 2px;
  color: var(--accent);
}

#login-sheet .fine {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 480px) {
  #login-sheet {
    top: auto !important;
    left: 0 !important;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    border-radius: 18px 18px 0 0;
  }

  #login-sheet .handle {
    display: block;
  }

  #account-menu {
    right: 0;
    left: 0;
    margin-inline: auto;
    width: min(280px, calc(100vw - 24px));
  }

  /* phones: the login chip is the round icon, so title, account and home stay on one row */
  .account-btn.chip {
    width: 30px;
    padding: 0;
    border-radius: 50%;
  }

  .account-btn.chip span {
    display: none;
  }
}

/* marks: the toggles row in a popup, the badges on a pin */
.marks {
  display: flex;
  gap: 8px;
  margin: 10px 0 8px;
}

.mark {
  flex: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.mark .ico {
  color: var(--muted);
}

.mark.favourite[aria-pressed="true"] {
  border-color: #f5b5c8;
  background: #fdeef3;
  color: #a3123f;
}

.mark.favourite[aria-pressed="true"] .ico {
  color: var(--fav);
  fill: currentColor;
}

.mark.been[aria-pressed="true"] {
  border-color: #b5dcc2;
  background: #edf7f0;
  color: #145c2b;
}

.mark.been[aria-pressed="true"] .ico {
  color: var(--been);
}

.tour-stop {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--red);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.pin-badge {
  position: absolute;
  top: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  color: #fff;
}

.pin-badge.fav {
  background: var(--fav);
}

.pin-badge.been {
  background: var(--been);
}

.pin-badge.right {
  right: -7px;
}

.pin-badge.left {
  left: -7px;
}

/* the market status line under the town */
.status {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  align-items: baseline;
  margin: 0 0 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(138, 154, 144, 0.22);
  color: #2f3d35;
}

.status.today {
  background: rgba(31, 92, 58, 0.14);
  color: var(--pine);
  font-weight: 500;
}

.status.live {
  align-items: center;
  background: rgba(46, 158, 91, 0.16);
  color: var(--pine);
  font-weight: 500;
}

.status.distant {
  background: rgba(217, 162, 27, 0.18);
  color: #7a5a00;
  font-weight: 500;
}

.status.live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
}

.avg {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: -2px 0 6px;
  font-size: 13px;
  color: var(--rate);
}

.avg b {
  color: var(--ink);
  font-weight: 600;
}

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

.rate {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  min-height: 44px;
}

.rate .label {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

/* the five stars sit flush, as in the mock: the row's gap would squeeze the label onto two lines at 375 px */
.rate .stars {
  display: flex;
}

.star {
  width: 40px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: #c7c7cc;
  cursor: pointer;
  border-radius: 10px;
}

.star:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.star .ico {
  color: inherit;
}

.star.on {
  color: var(--rate);
}

.star.on .ico {
  fill: currentColor;
}

/* the rating row (52 px) and the average line (22 px) take room from the scroll area, like the marks row */

/* search: header button, sheet and result rows */
.search-btn {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.search-btn::after {
  content: "";
  position: absolute;
  inset: -8px -4px;
}
.search-btn .on {
  display: none;
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
}
.search-btn.active {
  border-color: #f0c4c7;
  background: #fdf1f1;
  color: var(--accent);
}
.search-btn.active .on {
  display: block;
}
/* the button takes the auto margin, so account and home sit right after it */
#search-btn ~ .home-chip {
  margin-left: 0;
}
#search-btn + #account-slot:not(:empty) {
  margin-left: -8px;
}
#search-btn + #account-slot:empty + .home-chip {
  margin-left: -8px;
}

/* where the title bar has room, a search bar replaces the button */
.search-bar {
  display: none;
  flex: 0 1 240px;
  min-height: 34px;
  margin-left: auto;
  border-color: var(--line);
  border-radius: 10px;
  color: var(--muted);
}
.search-bar input {
  font-size: 14px;
}
.search-bar input:focus::placeholder {
  color: transparent;
}
#search-sheet.from-bar.empty,
#search-sheet.from-bar .handle,
#search-sheet.from-bar .sheet-head,
#search-sheet.from-bar #search-form {
  display: none;
}
@media (min-width: 1200px) {
  .search-bar {
    display: flex;
  }
  .search-btn {
    display: none;
  }
  #search-btn + #account-slot:not(:empty),
  #search-btn + #account-slot:empty + .home-chip {
    margin-left: 0;
  }
}

/* the Mina helger sheet: the search sheet's look */
#helger-out .wk {
  margin-top: 14px;
}
#helger-out .wk-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
#helger-out .wk-head h3 {
  margin: 0;
  font-size: 15px;
}
#helger-out .wk-head .sub {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
#helger-out .cal {
  flex: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}
#helger-out ul {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
#helger-out .row {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
}
#helger-out .pick {
  display: grid;
  flex: 1;
  grid-template-columns: 82px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
#helger-out .when {
  font-size: 12px;
  color: var(--muted);
}
#helger-out .when b,
#helger-out .what b {
  display: block;
  color: var(--ink);
}
#helger-out .when b {
  font-size: 13px;
}
#helger-out .what span {
  font-size: 12px;
  color: var(--muted);
}
#helger-out .rm {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 18px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
#helger-out .rm:hover {
  background: #f2f2f7;
}
#helger-out .rm svg {
  width: 45%;
  height: 45%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}
#helger-out .empty {
  margin: 0;
  padding: 18px 0 4px;
  color: var(--muted);
}
/* the Runda sheet */
#runda-sheet .sheet-head .sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
#helger-out .runda {
  display: flex;
  justify-content: flex-end;
  padding: 2px 0 8px;
}
#runda-out .stay {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  font-size: 13px;
}
#runda-out .seg {
  display: inline-flex;
  margin-left: auto;
  padding: 2px;
  border-radius: 9px;
  background: #f2f2f7;
}
#runda-out .seg button {
  padding: 4px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
#runda-out .seg button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  font-weight: 600;
}
#runda-out .state {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff1f0;
  font-size: 13px;
}
#runda-out .state.loading {
  background: #f6f6f8;
}
#runda-out .state .btn {
  margin-top: 8px;
}
#runda-out .summary {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f6f8;
  font-weight: 600;
}
#runda-out .maps {
  display: block;
  margin-top: 12px;
  text-align: center;
}
#runda-out .summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
#runda-out .stops {
  list-style: none;
  margin: 0;
  padding: 0;
}
#runda-out .adds h3 {
  margin: 14px 0 4px;
  font-size: 13px;
  color: var(--muted);
}
#runda-out .adds ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#runda-out .adds .limit,
#runda-out .adds .hint {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}
#runda-out .add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
}
#runda-out .leg {
  margin-left: 12px;
  padding: 2px 0 2px 34px;
  border-left: 2px dashed #d1d1d6;
  color: var(--muted);
  font-size: 12px;
}
#runda-out .stop {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 6px 0;
}
#runda-out .num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
#runda-out .home .num {
  background: var(--pine);
}
#runda-out .off .num {
  background: #c7c7cc;
}
#runda-out .off .what {
  opacity: 0.55;
}
#runda-out .what b,
#runda-out .what .meta,
#runda-out .what .check {
  display: block;
}
#runda-out .meta {
  color: var(--muted);
  font-size: 12px;
}
#runda-out .check {
  margin-top: 2px;
  font-size: 12px;
}
#runda-out .check.warn {
  color: #b25e00;
}
#runda-out .check.bad {
  color: var(--red);
  font-weight: 600;
}
#runda-out .toggle {
  position: relative;
  width: 38px;
  height: 22px;
  margin: 2px 0 0;
  border-radius: 11px;
  background: #d1d1d6;
  cursor: pointer;
  appearance: none;
}
#runda-out .toggle:checked {
  background: var(--pine);
}
#runda-out .toggle:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
#runda-out .toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}
#runda-out .toggle:checked::after {
  left: 18px;
}
/* the search sheet: the home sheet's look */
#search-sheet,
#helger-sheet,
#runda-sheet {
  position: absolute;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 80px);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  font-size: 14px;
}
#search-sheet:focus,
#helger-sheet:focus,
#runda-sheet:focus,
#home-sheet:focus {
  outline: none;
}
#search-sheet .search {
  margin-top: 10px;
}
#search-out .hit {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 6px;
  border: 0;
  border-radius: 10px;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
#search-out .hit:hover,
#search-out .hit:focus-visible,
#search-out li:first-child .hit {
  background: #f2f2f7;
}
#search-out .hit b {
  display: block;
  font-weight: 600;
}
#search-out .hit small {
  color: var(--muted);
}
#search-out ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
#search-out .none {
  margin: 12px 4px 4px;
  color: var(--muted);
}
#search-out .count {
  margin: 10px 4px 0;
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 480px) {
  #search-sheet,
  #helger-sheet,
  #runda-sheet {
    top: auto !important;
    left: 0 !important;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    max-height: 60%;
    border-radius: 18px 18px 0 0;
  }
}

/* gray-out */
.pin.dim svg > path:first-child {
  fill: #aeaeb2;
}

.pin.dim > :is(img, svg) {
  filter: grayscale(1) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
  opacity: 0.6;
}

.pin.dim .pin-badge {
  filter: grayscale(1);
  opacity: 0.8;
}

/* address and entry: label column and value */
.card .row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-top: 0.5px solid var(--line);
  font-size: 13px;
}

.card .kind {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--red);
}

.days {
  margin: 8px 0 4px;
  border-top: 0.5px solid var(--line);
}

.day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 0.5px solid var(--line);
  font-size: 13.5px;
}

.day .d {
  font-weight: 500;
}

.day.past .d {
  color: var(--muted);
  font-weight: 400;
  text-decoration: line-through;
}

.day .w {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.day .w:empty {
  flex: 1;
}

.day .wi,
.day .wi .ico {
  display: inline-flex;
  width: 16px;
  height: 16px;
}

.day .w .mm {
  color: var(--muted);
}

.weather-note {
  margin: 4px 0;
  font-size: 11.5px;
  color: var(--muted);
}

.day .h {
  font-variant-numeric: tabular-nums;
}

/* a 32 px target inside a row that keeps its height: the negative margins eat the row padding */
.day .save {
  flex: none;
  width: 32px;
  height: 32px;
  margin: -6px -8px -6px -4px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.day .save.on {
  color: var(--red);
}

.day .save .ico {
  color: inherit;
}

.day .save:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.day .save.on .ico {
  fill: currentColor;
}

.card button.more {
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--red);
  cursor: pointer;
}

.card .cal {
  margin: 8px 0;
}

.card .cal-toggle {
  gap: 6px;
}

.card .cal-toggle .ico {
  color: currentColor;
}

.cal-menu {
  margin-top: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.cal-menu button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.cal-menu button:hover,
.cal-menu button:focus-visible {
  background: rgba(0, 0, 0, 0.05);
}

.card .blurb {
  margin: 6px 0;
  font-size: 13.5px;
}

.card .row b {
  flex: none;
  width: 88px;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 500;
}

/* Christmas chrome: glass, red, spring */
.leaflet-popup-content-wrapper,
#home-sheet,
#search-sheet,
#helger-sheet,
#runda-sheet,
#login-sheet,
#account-menu,
#home-toast {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

#home-sheet,
#search-sheet,
#helger-sheet,
#runda-sheet,
#login-sheet,
#account-menu {
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-chrome);
}

.leaflet-popup-tip {
  background: var(--glass-strong);
}

.home-chip,
.account-btn,
.search-btn {
  background: var(--glass);
  border-color: var(--glass-edge);
  transition:
    transform 0.35s var(--spring),
    background-color 0.2s;
}

.home-chip:active,
.account-btn:active,
.search-btn:active {
  transform: scale(0.94);
}

.home-chip,
.account-btn,
.search-btn,
.account-btn.round {
  height: 36px;
}

.search-btn,
.account-btn.round {
  width: 36px;
}

.search-btn .long {
  display: none;
}

@media (min-width: 481px) {
  .search-btn:has(.long) {
    width: auto;
    gap: 6px;
    padding: 0 14px 0 11px;
    border-radius: 999px;
  }

  .search-btn .long {
    display: inline;
    font-size: 13px;
    font-weight: 600;
  }
}

@media (max-width: 480px) {
  .home-chip {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .home-chip > :not(.ico):not(svg),
  .account-btn.chip > span {
    display: none;
  }

  .account-btn.chip {
    width: 36px;
    padding: 0;
  }

  .home-chip svg,
  .account-btn svg {
    width: 18px;
    height: 18px;
  }

  #filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  /* phones pinch to zoom; the buttons would sit on an open popup */
  .leaflet-control-zoom {
    display: none;
  }
}

#filter-chips {
  position: absolute;
  top: calc(var(--header-h) + 28px);
  left: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-chrome);
  z-index: 1000;
}

.leaflet-top {
  top: var(--chips-bottom);
}

.btn.primary {
  background: var(--red);
}

/* map pins */
.pin > svg,
.pin > img {
  overflow: visible;
  transform-origin: 50% 100%;
  transition:
    transform 0.4s var(--spring),
    opacity 0.25s;
}

.pin {
  transition: opacity 0.25s;
}

.pin:hover > svg,
.pin:hover > img {
  transform: scale(1.08);
}

.pin.ended > :is(img, svg),
.pin.distant > :is(img, svg) {
  transform: scale(0.85);
  filter: grayscale(1) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
  opacity: 0.7;
}

.pin.live::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 30px;
  height: 12px;
  margin-left: -15px;
  box-sizing: border-box;
  border: 2px solid var(--live);
  border-radius: 50%;
  pointer-events: none;
  animation: live-ring 1.8s ease-out infinite;
}

.pin.live > :is(img, svg) {
  position: relative;
}

@keyframes live-ring {
  from {
    transform: scale(0.5);
    opacity: 0.9;
  }

  to {
    transform: scale(1.6);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pin.live::before {
    animation: none;
  }
}

.pin.gone {
  opacity: 0;
  pointer-events: none;
}

.pin.gone > svg,
.pin.gone > img {
  transform: scale(0.3);
}

/* cluster bubbles */
.cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--red) 82%, transparent);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 2px solid var(--glass-edge);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--red) 25%, transparent),
    var(--shadow-soft);
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  transition: opacity 0.25s;
}

.cluster-s {
  font-size: 14px;
}

.cluster-m {
  font-size: 16px;
}

.cluster-l {
  font-size: 18px;
}

.cluster.dim {
  background: color-mix(in srgb, #aeaeb2 82%, transparent);
}

.cluster.live::after {
  content: attr(data-live);
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 9px;
  background: var(--live);
  border: 1.5px solid #fff;
  color: #fff;
  font-size: 11px;
  line-height: 15px;
  text-align: center;
}

/* snow: one layer inside the map's own pane, three depths */
.leaflet-snow-pane {
  z-index: 650;
  pointer-events: none;
}

.snow {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.snow .flakes i {
  position: absolute;
  left: var(--x);
  top: -24px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(95, 120, 160, 0.35);
  animation:
    snow-fall var(--fall) linear var(--delay) infinite,
    snow-sway calc(var(--fall) / 3) ease-in-out var(--delay) infinite alternate;
}

.snow .near i {
  opacity: 0.95;
}

.snow .mid i {
  opacity: 0.8;
}

.snow .far i {
  opacity: 0.6;
}

@keyframes snow-fall {
  to {
    transform: translateY(calc(100vh + 48px));
  }
}

@keyframes snow-sway {
  from {
    translate: calc(var(--sway) * -1) 0;
  }
  to {
    translate: var(--sway) 0;
  }
}

#filter-chips .chip {
  flex: none;
  min-height: 28px;
  padding: 0 11px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  background: var(--glass-strong);
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 0.3s var(--spring),
    background 0.2s,
    color 0.2s;
}

#filter-chips .chip small {
  font-size: 12px;
  opacity: 0.75;
}

#filter-chips .chip:active {
  transform: scale(0.95);
}

#filter-chips .chip[aria-pressed="true"] {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

#filter-chips .chip.live-chip::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--live);
}

#filter-chips .chip.live-chip[aria-pressed="true"]::before {
  background: #fff;
}

#filter-chips .chip:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
}

#filter-count {
  flex: none;
  margin-left: auto;
  padding-left: 10px;
  align-self: center;
  font-size: 12px;
  white-space: nowrap;
}

#filter-empty {
  position: absolute;
  top: var(--chips-bottom);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-chrome);
  box-shadow: var(--shadow);
  z-index: 1000;
}

#filter-empty[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  #filter-chips .chip,
  .cluster {
    transition: none;
  }
}
