html:has(.hm-app),
body:has(.hm-app) {
  overflow: hidden;
  height: 100%;
}
body:has(.hm-app) > main {
  overflow: hidden;
  max-width: none;
}

.hm-app {
  --hm-nav: 4rem;
  --hm-gold: #ffcc66;
  --hm-hot: #ff4d7a;
  --hm-ink: #1d1d1f;
  --hm-muted: rgb(0 0 0 / 0.48);
  --hm-faint: rgb(0 0 0 / 0.32);
  --hm-line: rgb(0 0 0 / 0.08);
  --hm-glass: rgb(255 255 255 / 0.78);
  --hm-glass-strong: rgb(255 255 255 / 0.92);
  --hm-shadow: 0 8px 32px rgb(0 0 0 / 0.12), 0 1px 0 rgb(255 255 255 / 0.6) inset;
  --hm-radius: 22px;
  --hm-font: ui-rounded, "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, Inter, sans-serif;
  position: relative;
  height: calc(100dvh - var(--hm-nav));
  margin-top: var(--hm-nav);
  color: var(--hm-ink);
  font-family: var(--hm-font);
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] .hm-app {
  --hm-ink: #f5f5f7;
  --hm-muted: rgb(255 255 255 / 0.52);
  --hm-faint: rgb(255 255 255 / 0.38);
  --hm-line: rgb(255 255 255 / 0.12);
  --hm-glass: rgb(16 18 32 / 0.72);
  --hm-glass-strong: rgb(18 20 38 / 0.88);
  --hm-shadow: 0 12px 40px rgb(0 0 0 / 0.45), 0 1px 0 rgb(255 255 255 / 0.08) inset;
}

/* No text selection inside the tool: a highlighted selection turns a map
   drag into a native drag-and-drop of the selection image. Typing and
   selecting inside the search box still works. */
.hm-app {
  user-select: none;
  -webkit-user-select: none;
}
.hm-app input,
.hm-app textarea {
  user-select: text;
  -webkit-user-select: text;
}
.hm-app,
.hm-map,
.hm-map canvas,
.hm-app img,
.hm-app svg {
  -webkit-user-drag: none;
}
.hm-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 60vh;
  background: #0b0d14;
}
.hm-map .maplibregl-ctrl-bottom-left,
.hm-map .maplibregl-ctrl-bottom-right {
  z-index: 1;
}
.hm-map .maplibregl-ctrl-attrib {
  background: transparent;
  color: var(--hm-faint);
  font-size: 10px;
}
.hm-map .maplibregl-ctrl-attrib a {
  color: inherit;
}
.hm-map .maplibregl-ctrl-attrib-inner {
  padding-right: 8px;
}

.hm-glass {
  background: var(--hm-glass);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
  border: 1px solid var(--hm-line);
  box-shadow: var(--hm-shadow);
}

.hm-hud {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1080px, calc(100% - 24px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 28px;
}
.hm-search {
  position: relative;
  /* Above the slider, day tabs and theme toggle so the suggestion list
     never renders underneath them. */
  z-index: 10;
  flex: 1 1 220px;
  min-width: 180px;
}
.hm-search input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 42px;
  border: 0;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.05);
  color: var(--hm-ink);
  font: 500 16px/1 var(--hm-font);
  letter-spacing: -0.02em;
  outline: none;
}
:root[data-theme="dark"] .hm-search input {
  background: rgb(255 255 255 / 0.08);
}
.hm-search input::placeholder {
  color: var(--hm-muted);
  font-weight: 400;
}
.hm-search input:focus {
  box-shadow: 0 0 0 3px rgb(255 204 102 / 0.35);
}
.hm-ico {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--hm-muted);
  pointer-events: none;
}
.hm-ico-search { left: 14px; }
.hm-loc {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--hm-ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.hm-loc:hover { background: rgb(255 204 102 / 0.25); }
.hm-suggest {
  display: none;
  background: var(--hm-glass-strong);
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  padding: 6px;
  border-radius: 18px;
  overflow: hidden;
}
.hm-suggest.is-open { display: block; }
.hm-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--hm-ink);
  font: 500 14px/1.3 var(--hm-font);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.hm-suggest button:hover,
.hm-suggest button.is-active {
  background: rgb(255 204 102 / 0.22);
}

.hm-age {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0 12px;
  min-width: 200px;
  flex: 0 1 250px;
  height: 44px;
}
.hm-range {
  --a: 0;
  --b: 1;
  --thumb: 22px;
  position: relative;
  height: 24px;
}
.hm-range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 99px;
  background: rgb(127 127 127 / 0.22);
}
.hm-range-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 99px;
  left: calc(var(--a) * (100% - var(--thumb)) + var(--thumb) / 2);
  right: calc((1 - var(--b)) * (100% - var(--thumb)) + var(--thumb) / 2);
  background: linear-gradient(90deg, #ffcc66, #ff7a59 55%, #ff4d7a);
}
/* Value bubbles that ride on top of the (transparent) native thumbs. */
.hm-range-tip {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: var(--thumb);
  height: var(--thumb);
  margin-top: calc(var(--thumb) / -2);
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #1d1d1f;
  font: 700 10px/1 var(--hm-font);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.28), 0 0 0 1px rgb(0 0 0 / 0.06);
  pointer-events: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
#hm-tip-min { left: calc(var(--a) * (100% - var(--thumb)) + var(--thumb) / 2); }
#hm-tip-max { left: calc(var(--b) * (100% - var(--thumb)) + var(--thumb) / 2); }
.hm-range:has(#hm-age-min:active) #hm-tip-min,
.hm-range:has(#hm-age-min:focus-visible) #hm-tip-min,
.hm-range:has(#hm-age-max:active) #hm-tip-max,
.hm-range:has(#hm-age-max:focus-visible) #hm-tip-max {
  transform: translateX(-50%) scale(1.12);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.3), 0 0 0 3px rgb(255 204 102 / 0.55);
}
.hm-range input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  touch-action: none;
  outline: none;
}
.hm-range #hm-age-min { z-index: 3; }
.hm-range #hm-age-max { z-index: 4; }
.hm-range input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 50%;
  border: 0;
  background: transparent;
  cursor: grab;
}
.hm-range input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }
.hm-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 50%;
  border: 0;
  background: transparent;
  cursor: grab;
}
.hm-range-ends {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 600 10px/1 var(--hm-font);
  color: var(--hm-faint);
  font-variant-numeric: tabular-nums;
}
/* End labels sit centred under the thumb's resting positions. */
.hm-range-ends > span:first-child,
.hm-range-ends > span:last-child {
  width: 22px;
  text-align: center;
}
.hm-range-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 9px;
}

.hm-days {
  position: relative;
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.05);
  flex: 0 0 auto;
}
:root[data-theme="dark"] .hm-days {
  background: rgb(255 255 255 / 0.08);
}
.hm-days-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  bottom: 3px;
  width: calc((100% - 6px) / 7);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.12);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
:root[data-theme="dark"] .hm-days-thumb {
  background: #2a3158;
}
.hm-days button {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--hm-muted);
  font: 600 12px/1 var(--hm-font);
  letter-spacing: -0.02em;
  cursor: pointer;
  border-radius: 999px;
}
.hm-days button.is-on {
  color: var(--hm-ink);
}

.hm-hud-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.hm-legend {
  position: absolute;
  z-index: 3;
  left: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--hm-muted);
}
.hm-legend-bar {
  width: 72px;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgb(255 204 102 / 0.15), #ffcc66 35%, #ff7a59 68%, #ff4d7a);
}

.hm-dock {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  border-radius: var(--hm-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(46vh, 420px);
}
body:has(#cookie-banner:not([hidden])) .hm-dock {
  bottom: 7.25rem;
}
.hm-cal {
  padding: 0 16px 10px;
}
.hm-cal-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 13px 14px 10px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hm-cal-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.hm-cal-sel {
  font-size: 12px;
  font-weight: 600;
  color: var(--hm-muted);
  white-space: nowrap;
}
.hm-cal-sel:not(:empty)::before {
  content: "·";
  margin-right: 8px;
  color: var(--hm-faint);
}
.hm-cal-city {
  margin-left: auto;
  font-size: 12px;
  color: var(--hm-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-cal-chev {
  flex: 0 0 auto;
  align-self: center;
  width: 16px;
  height: 16px;
  color: var(--hm-muted);
  transition: transform 0.2s ease;
}
.hm-dock.is-collapsed .hm-cal-chev { transform: rotate(180deg); }
.hm-dock.is-collapsed .hm-cal-body { display: none; }
.hm-cal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.hm-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.hm-cal-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hm-faint);
}
.hm-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.hm-day {
  position: relative;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--hm-ink);
  cursor: pointer;
  font: 600 13px/1 var(--hm-font);
  font-variant-numeric: tabular-nums;
}
.hm-day[disabled] {
  opacity: 0.28;
  cursor: default;
}
.hm-day .n { position: relative; z-index: 1; }
/* Every tile is the same size and shape; only the fill colour changes with
   busyness (--t, 0 = quiet, 1 = busy). */
.hm-day-heat {
  --t: 0;
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: color-mix(in srgb, #ff4d7a calc(var(--t) * 72%), var(--hm-line));
  transition: background 0.25s ease;
}
.hm-day.is-on {
  color: #3a2200;
}
.hm-day.is-on .hm-day-heat {
  background: linear-gradient(160deg, #ffe0a3, #ffcc66);
  box-shadow: 0 0 0 1px rgb(255 204 102 / 0.7);
}
:root[data-theme="dark"] .hm-day.is-on {
  color: #fff8e8;
}

.hm-events {
  border-top: 1px solid var(--hm-line);
  overflow: auto;
  padding: 4px 6px 8px;
}
.hm-events:empty { display: none; }
.hm-event {
  display: grid;
  grid-template-columns: 54px 8px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 12px;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.hm-event:hover,
.hm-event.is-on {
  background: rgb(255 204 102 / 0.16);
}
.hm-event-time {
  font-size: 11px;
  font-weight: 650;
  color: var(--hm-muted);
  font-variant-numeric: tabular-nums;
}
.hm-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d7a;
}
.hm-event-dot[data-kind="concert"],
.hm-event-dot[data-kind="festival"] { background: #ff4d7a; }
.hm-event-dot[data-kind="market"] { background: #34c759; }
.hm-event-dot[data-kind="culture"] { background: #5b8cff; }
.hm-event-dot[data-kind="nightlife"] { background: #bf5af2; }
.hm-event-dot[data-kind="campus"] { background: #ffcc66; }
.hm-event-dot[data-kind="sports"] { background: #ff9f0a; }
.hm-event-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hm-event-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-event-sub {
  font-size: 11px;
  color: var(--hm-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--hm-muted);
  font-size: 13px;
}

.hm-progress {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.hm-progress.is-on { opacity: 1; }
.hm-progress span {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, #ffcc66, #ff4d7a, transparent);
  animation: hm-slide 1.1s ease-in-out infinite;
}
@keyframes hm-slide {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}

.hm-app .maplibregl-popup-content {
  font-family: var(--hm-font);
  padding: 0;
  border-radius: 18px;
  background: var(--hm-glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--hm-line);
  box-shadow: var(--hm-shadow);
  color: var(--hm-ink);
  overflow: hidden;
}
.hm-app .maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  border-top-color: var(--hm-glass-strong);
}
.hm-app .maplibregl-popup-anchor-top .maplibregl-popup-tip {
  border-bottom-color: var(--hm-glass-strong);
}
.hm-app .maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: var(--hm-glass-strong);
}
.hm-app .maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: var(--hm-glass-strong);
}
.hm-pop {
  min-width: 228px;
  max-width: 280px;
  padding: 14px 14px 12px;
}
.hm-pop-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.hm-pop-meta {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--hm-muted);
}
.hm-pop-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.hm-pop-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px 7px;
  border: 0;
  border-radius: 14px;
  background: rgb(0 0 0 / 0.05);
  color: var(--hm-ink);
  text-decoration: none;
  cursor: pointer;
  font: 600 10px / 1 var(--hm-font);
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}
:root[data-theme="dark"] .hm-pop-btn {
  background: rgb(255 255 255 / 0.08);
}
.hm-pop-btn:hover {
  background: rgb(255 204 102 / 0.22);
}
.hm-pop-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.hm-pop-btn.is-on {
  background: rgb(255 204 102 / 0.3);
}
/* Busy-times histogram (Google "popular times" style). */
.hm-busy {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--hm-line);
}
.hm-busy-cap {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.hm-busy-src {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 500;
  color: var(--hm-faint);
}
.hm-busy-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 2px;
  height: 52px;
  margin-top: 8px;
}
.hm-busy-bar {
  position: relative;
  height: 100%;
  border-radius: 3px 3px 1px 1px;
  background: rgb(127 127 127 / 0.14);
  overflow: hidden;
}
.hm-busy-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--v) * 100%);
  min-height: 2px;
  border-radius: inherit;
  background: rgb(255 77 122 / 0.55);
}
.hm-busy-bar.is-now::after {
  background: linear-gradient(180deg, #ffe0a3, #ffcc66);
}
.hm-busy-bar.is-now {
  box-shadow: 0 0 0 1px rgb(255 204 102 / 0.7);
}
.hm-busy-hours {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  margin-top: 4px;
}
.hm-busy-hours span {
  font-size: 9px;
  font-weight: 600;
  color: var(--hm-faint);
  text-align: center;
  font-variant-numeric: tabular-nums;
  overflow: visible;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .hm-hud {
    top: 10px;
    padding: 8px;
    gap: 8px;
    border-radius: 22px;
  }
  .hm-age { flex: 1 1 100%; padding: 0 8px; }
  .hm-days { width: 100%; }
  .hm-days button { flex: 1; width: auto; }
  .hm-days-thumb { width: calc((100% - 6px) / 7); }
  .hm-hud-tools { margin-left: 0; }
  .hm-dock { max-height: 48vh; bottom: 10px; }
  .hm-cal-head { padding: 11px 12px 8px 14px; }
  .hm-cal { padding: 0 12px 8px; }
  body:has(#cookie-banner:not([hidden])) .hm-dock { bottom: 11.5rem; }
  .hm-day { height: 36px; }
  .hm-legend { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-days-thumb, .hm-day-heat, .hm-progress span {
    transition: none;
    animation: none;
  }
}
