html,
body {
  height: 100%;
}

body.hyperlocal-page {
  margin: 0;
  background: #ffffff;
  color: #202124;
  overflow: hidden;
}

.righthere-canvas {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: #ffffff;
}

/* Mapbox GL JS container */
.map-bg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: #ffffff;
}


.map-debug-panel {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 5;
  max-width: min(420px, calc(100% - 36px));
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
}

.map-debug-panel[data-level="warn"] {
  background: rgba(120, 72, 0, 0.88);
}

.map-debug-panel[data-level="error"] {
  background: rgba(120, 24, 24, 0.88);
}

.map-debug-panel[data-level="ok"] {
  background: rgba(24, 72, 48, 0.88);
}

.map-debug-panel[data-level="info"] {
  background: rgba(24, 48, 96, 0.88);
}

.map-error-banner {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 5;
  max-width: min(520px, calc(100% - 36px));
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(120, 24, 24, 0.92);
  color: #ffffff;
  font-family: 'Lato', 'Helvetica', 'Arial', sans-serif;
  font-size: 13px;
  line-height: 1.35;
  transform: translateX(-50%);
  pointer-events: none;
}

.map-error-banner[hidden] {
  display: none;
}

.notes-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.hide-notes .notes-overlay-layer {
  opacity: 0;
  transform: translateY(100vh);
  pointer-events: none;
}

.hyperlocal-topbar {
  position: absolute;
  top: max(18px, env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 20;
  display: flex;
  width: min(1020px, calc(100% - 28px));
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.topbar-collapse-toggle {
  display: none;
}

.toolbar-left-group {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.title-container {
  flex: 0 1 auto;
  min-width: 0;
}

.title-container h2 {
  margin: 0;
  color: #202124;
  font-family: 'Catamaran', 'Helvetica', 'Arial', sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.title-container p {
  margin: 2px 0 0;
  color: #5f6368;
  font-family: 'Lato', 'Helvetica', 'Arial', sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}

.toolbar-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.toolbar-add-own {
  display: none;
}

.lang-toggle {
  display: inline-flex;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgba(32, 33, 36, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.lang-toggle__btn {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #5f6368;
  font-family: 'Lato', 'Helvetica', 'Arial', sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-toggle__btn.is-active {
  background: #1abc9c;
  color: #ffffff;
}

.lang-toggle__btn:hover,
.lang-toggle__btn:focus {
  outline: none;
}

.lang-toggle__btn:not(.is-active):hover,
.lang-toggle__btn:not(.is-active):focus {
  background: rgba(26, 188, 156, 0.08);
  color: #202124;
}

.hyperlocal-controls {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.postcode-group {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(32, 33, 36, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.postcode-group:focus-within {
  border-color: #1abc9c;
  box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.15);
}

.listing-search-input,
.postcode-input,
.type-filter {
  height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #202124;
  font-size: 14px;
  outline: none;
}

.listing-search-input {
  flex: 1 1 160px;
  min-width: 120px;
  max-width: 280px;
  padding: 0 14px;
  border: 1px solid rgba(32, 33, 36, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-family: 'Lato', 'Helvetica', 'Arial', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.listing-search-input::placeholder {
  color: #80868b;
}

.listing-search-input:focus {
  border-color: #1abc9c;
  box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.15);
  outline: none;
}

.postcode-input {
  width: 96px;
  padding: 0 12px 0 14px;
}

.locate-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(32, 33, 36, 0.12);
  border-radius: 0;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.locate-icon {
  display: block;
}

.locate-button:hover,
.locate-button:focus {
  background: rgba(26, 188, 156, 0.08);
  color: #1abc9c;
  outline: none;
}

.locate-button.loading .locate-icon {
  animation: locate-pulse 1s infinite alternate;
}

@keyframes locate-pulse {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.45; transform: scale(0.82); }
}

.type-filter {
  padding: 0 12px;
  border: 1px solid rgba(32, 33, 36, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.postcode-input:focus,
.type-filter:focus {
  outline: none;
}

.type-filter:focus {
  border-color: #1abc9c;
  box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.15);
}

.hyperlocal-button {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-family: 'Lato', 'Helvetica', 'Arial', sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hyperlocal-button:hover,
.hyperlocal-button:focus {
  background: #1abc9c;
}

.status-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100% - 36px));
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  color: #3c4043;
  font-size: 14px;
  backdrop-filter: blur(18px);
}

.status-panel[hidden] {
  display: none;
}

.status-panel strong {
  display: block;
  margin-bottom: 4px;
  color: #202124;
}

.listing-note {
  position: absolute;
  width: clamp(210px, 23vw, 315px);
  min-height: 145px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, -50%) rotate(var(--note-rotation, -1deg));
  transition: transform 180ms ease, box-shadow 180ms ease;
  pointer-events: auto;
  touch-action: none;
}

.listing-note.dragging {
  transition: none !important;
  z-index: 10 !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28) !important;
}

.note-snap-back {
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease !important;
}

.note-swipe-out {
  transition: transform 0.4s cubic-bezier(0.5, 0, 0.5, 1), opacity 0.4s ease !important;
  opacity: 0 !important;
}

.listing-note:hover,
.listing-note:focus-within {
  z-index: 3;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -54%) rotate(0deg);
}

.notes-overlay-layer[data-demo-mode="true"]::before {
  content: "Demo";
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 3;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.78);
  color: #ffffff;
  font-family: 'Lato', 'Helvetica', 'Arial', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.listing-note--demo {
  outline: 1px dashed rgba(0, 0, 0, 0.12);
}

body.hyperlocal-page--demo .listing-note--demo.listing-note--clickable {
  cursor: pointer;
}

.demo-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff3cd;
  color: #664d03;
  font-family: 'Lato', 'Helvetica', 'Arial', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

body.hyperlocal-page--demo .status-panel {
  border-left: 3px solid #ffc107;
}

.listing-note--service {
  background: #d1e7dd;
}

.listing-note--rental {
  background: #e2d9f3;
}

.listing-note--pro {
  background: #cff4fc;
}

.listing-note--clickable {
  cursor: pointer;
}

.listing-note--promo {
  width: clamp(320px, 30vw, 380px);
  min-height: auto;
  background: linear-gradient(145deg, #d8f0ec 0%, #c8e8e2 100%);
  border-color: rgba(26, 188, 156, 0.24);
  z-index: 2;
  touch-action: auto;
}

.listing-note--promo h2 {
  line-height: 1.15;
}

.listing-note--promo p {
  display: block;
  overflow: visible;
  -webkit-box-orient: unset;
  -webkit-line-clamp: unset;
}

.listing-note--promo:hover,
.listing-note--promo:focus-within {
  transform: translate(-50%, -54%) rotate(0deg);
}

.add-own-promo-anchor {
  position: absolute;
  top: calc(max(18px, env(safe-area-inset-top, 0px)) + 92px);
  right: max(18px, env(safe-area-inset-right, 0px));
  z-index: 4;
  width: clamp(200px, 20vw, 248px);
  pointer-events: auto;
}

.add-own-promo-anchor .listing-note--add-own {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  min-height: 0;
  padding: 14px 14px 12px;
  transform: rotate(-1deg);
  touch-action: auto;
}

.add-own-promo-anchor .listing-note--add-own h2 {
  font-size: 15px;
  line-height: 1.2;
}

.add-own-promo-anchor .listing-note--add-own p {
  display: block;
  margin: 6px 0 0;
  overflow: visible;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: unset;
  -webkit-line-clamp: unset;
}

.add-own-promo-anchor .listing-note--add-own:hover,
.add-own-promo-anchor .listing-note--add-own:focus-within {
  transform: translateY(-4px) rotate(0deg);
}

.add-own-promo-anchor .listing-note__cta {
  min-height: 32px;
  padding: 0 14px;
  font-size: 12px;
}

.listing-note__meta--promo {
  margin-top: 4px;
}

.listing-note__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #1abc9c;
  color: #ffffff;
  font-family: 'Lato', 'Helvetica', 'Arial', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(26, 188, 156, 0.28);
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.listing-note__cta:hover,
.listing-note__cta:focus {
  background: #17a589;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(26, 188, 156, 0.34);
  transform: translateY(-1px);
  outline: none;
}

.listing-note__type {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: rgba(0, 0, 0, 0.62);
  font-family: 'Lato', 'Helvetica', 'Arial', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.listing-note__type--pro {
  background: rgba(255, 255, 255, 0.58);
  color: rgba(0, 72, 96, 0.82);
}

.listing-note h2 {
  margin: 0 0 8px;
  color: #202124;
  font-family: 'Catamaran', 'Helvetica', 'Arial', sans-serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.05;
}

.listing-note p {
  display: -webkit-box;
  margin: 0 0 12px;
  overflow: hidden;
  color: #3c4043;
  font-size: 14px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.listing-note__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #3c4043;
  font-size: 13px;
}

.listing-note__price {
  font-weight: 700;
}

.listing-note__rating {
  color: rgba(0, 0, 0, 0.62);
}

.listing-note__date {
  margin-left: auto;
  color: rgba(0, 0, 0, 0.5);
  font-size: 12px;
}

@media (max-width: 720px) {
  .hyperlocal-topbar {
    top: max(10px, env(safe-area-inset-top, 0px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 22px;
    padding: 12px 12px 8px;
    transition: gap 0.25s ease, padding 0.25s ease;
  }

  .hyperlocal-topbar--collapsed {
    gap: 0;
    padding-bottom: 6px;
  }

  .topbar-collapse-toggle {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 44px;
    height: 28px;
    margin-top: 2px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(32, 33, 36, 0.06);
    color: #5f6368;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
  }

  .topbar-collapse-toggle:hover,
  .topbar-collapse-toggle:focus {
    background: rgba(26, 188, 156, 0.12);
    color: #1abc9c;
    outline: none;
  }

  .topbar-collapse-toggle__icon {
    display: block;
    transform: rotate(180deg);
    transition: transform 0.25s ease;
  }

  .hyperlocal-topbar--collapsed .topbar-collapse-toggle__icon {
    transform: rotate(0deg);
  }

  .hyperlocal-topbar--collapsed .topbar-collapse-toggle {
    margin-top: 6px;
  }

  .title-container p,
  .hyperlocal-controls {
    max-height: 520px;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.25s ease;
  }

  .hyperlocal-topbar--collapsed .title-container p,
  .hyperlocal-topbar--collapsed .hyperlocal-controls {
    max-height: 0;
    opacity: 0;
    margin: 0;
    pointer-events: none;
  }

  .hyperlocal-topbar--collapsed .toolbar-left-group {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .hyperlocal-topbar--collapsed .title-container {
    flex: 1 1 0;
    min-width: 0;
  }

  .hyperlocal-topbar--collapsed .title-container h2 {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hyperlocal-topbar--collapsed .toolbar-actions {
    flex-direction: row;
    flex-shrink: 0;
    width: auto;
  }

  .toolbar-left-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-width: 0;
  }

  .title-container h2 {
    font-size: 20px;
  }

  .title-container p {
    font-size: 12px;
  }

  .toolbar-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
    gap: 0;
  }

  .toolbar-actions .lang-toggle {
    display: none;
  }

  .hyperlocal-controls {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .listing-search-input {
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
  }

  .postcode-group {
    flex: 1 1 140px;
  }

  .postcode-input {
    flex: 1 1 72px;
    width: auto;
    min-width: 0;
  }

  .type-filter {
    flex: 1 1 120px;
  }

  .hyperlocal-button {
    flex: 1 1 100%;
  }

  .listing-note {
    width: min(285px, calc(100vw - 40px));
  }

  .listing-note--promo {
    width: min(360px, calc(100vw - 32px));
  }

  .add-own-promo-anchor {
    display: none;
  }

  .toolbar-add-own {
    display: inline-flex;
    box-sizing: border-box;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 40px;
    padding: 6px 10px 6px 8px;
    border: 1px solid rgba(32, 33, 36, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #202124;
    font-family: 'Lato', 'Helvetica', 'Arial', sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  }

  .toolbar-add-own:hover,
  .toolbar-add-own:focus {
    border-color: rgba(26, 188, 156, 0.35);
    background: rgba(26, 188, 156, 0.08);
    color: #202124;
    outline: none;
  }

  .toolbar-add-own__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(26, 188, 156, 0.18);
    color: #15967d;
    font-family: 'Catamaran', 'Helvetica', 'Arial', sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
  }

  .toolbar-add-own__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .toolbar-add-own__cta {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 999px;
    background: #1abc9c;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
  }

  .hyperlocal-topbar--collapsed .toolbar-actions {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
    max-width: min(210px, 58%);
    width: auto;
  }

  .hyperlocal-topbar--collapsed .toolbar-add-own {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 6px 10px 6px 8px;
    gap: 6px;
    font-size: 13px;
    border-color: rgba(26, 188, 156, 0.32);
    box-shadow: 0 2px 12px rgba(26, 188, 156, 0.14);
  }

  .hyperlocal-topbar--collapsed .toolbar-add-own__icon {
    width: 22px;
    height: 22px;
    font-size: 15px;
  }

  .hyperlocal-topbar--collapsed .toolbar-add-own__label {
    display: none;
  }

  .hyperlocal-topbar--collapsed .toolbar-add-own__cta {
    padding: 6px 10px;
    font-size: 12px;
  }

  .hyperlocal-topbar--collapsed ~ .notes-overlay-layer .listing-note {
    min-height: 158px;
  }

  .hyperlocal-topbar--collapsed ~ .notes-overlay-layer .listing-note p {
    -webkit-line-clamp: 4;
  }
}
