:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #102015;
  --forest: #163300;
  --muted: #667267;
  --line: #dfe3dc;
  --panel: #ffffff;
  --wash: #f3f0ea;
  --canvas: #f3f0ea;
  --cream: #fffdf8;
  --sage: #e7efe1;
  --lime: #9fe870;
  --orange: #fa9a2d;
  --blue: #2457a6;
  --green: #25724d;
  --plum: #6c4bd8;
  --amber: #a4620b;
  --shadow: 0 18px 42px rgba(31, 44, 28, 0.12);
  --soft-shadow: 0 10px 28px rgba(31, 44, 28, 0.09);
  --desktop-topbar-height: 88px;
  --desktop-filter-height: 64px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto;
}

.topbar,
.control-band {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 200px minmax(300px, 500px) auto;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  height: var(--desktop-topbar-height);
  min-height: var(--desktop-topbar-height);
  padding: 12px 32px;
}

.brand-block {
  display: flex;
  align-items: center;
  width: 190px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 190px;
  height: 50px;
  display: grid;
  place-items: center;
  overflow: visible;
  background: #fff;
}

.brand-mark img {
  width: 188px;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #1a365d;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.site-nav a {
  color: inherit;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.map-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-nav-item span {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--forest);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.mobile-shortlist-button,
.mobile-view-switch,
.mobile-map-preview,
.filter-sheet-heading,
.filter-sheet-actions {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 1.8vw, 1.75rem);
  line-height: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.top-search {
  display: grid;
  grid-template-columns: minmax(260px, 520px);
  gap: 8px;
  align-items: end;
}

.dataset-box {
  display: none;
}

.control-band {
  position: sticky;
  top: var(--desktop-topbar-height);
  z-index: 5;
  display: flex;
  gap: 12px;
  align-items: center;
  height: var(--desktop-filter-height);
  min-height: var(--desktop-filter-height);
  padding: 10px 48px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 5px 18px rgba(31, 44, 28, 0.05);
  overflow: visible;
}

.control-band::-webkit-scrollbar,
.filter-options::-webkit-scrollbar,
.residency-filter > div::-webkit-scrollbar {
  display: none;
}

.filter-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #dddddd;
  border-radius: 999px;
  background: #fff;
  color: #222;
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
}

.filter-button:hover,
.filter-button[aria-pressed="true"] {
  border-color: #222;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sliders-icon {
  display: inline-grid;
  gap: 3px;
  width: 15px;
}

.sliders-icon i {
  position: relative;
  display: block;
  height: 1px;
  background: currentColor;
}

.sliders-icon i::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #fff;
}

.sliders-icon i:nth-child(1)::after {
  left: 3px;
}

.sliders-icon i:nth-child(2)::after {
  left: 8px;
}

.sliders-icon i:nth-child(3)::after {
  left: 5px;
}

.filter-divider {
  flex: 0 0 1px;
  width: 1px;
  height: 24px;
  background: #dddddd;
}

.filter-options {
  display: flex;
  flex: 1 1 auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

#filterOptions {
  position: absolute;
  top: calc(100% + 8px);
  left: 48px;
  z-index: 20;
  flex: 0 0 auto;
  width: min(720px, calc(100vw - 96px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

#filterOptions[hidden] {
  display: none;
}

#filterOptions .residency-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#filterOptions .residency-filter > div {
  flex-wrap: wrap;
  overflow: visible;
}

.dataset-box span,
.search-box span,
.api-key-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.dataset-box select,
.search-box div,
.api-key-box div {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.search-box div,
.api-key-box div {
  display: flex;
  overflow: hidden;
}

.search-box div {
  min-height: 44px;
  box-shadow: 0 4px 14px rgba(31, 44, 28, 0.08);
}

.dataset-box select {
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

input {
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 10px 16px;
  outline: 0;
  color: var(--ink);
  background: #fff;
}

.search-box button,
.api-key-box button,
.card-actions button,
.primary-action,
.results-header button {
  background: #172319;
  color: #fff;
  font-weight: 800;
  padding: 9px 18px;
}

.api-key-box button,
.results-header button {
  background: #eef2e9;
  color: var(--ink);
}

.toggles {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
  flex: 0 0 auto;
}

.residency-filter > div {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  padding: 1px 0;
  scrollbar-width: none;
}

.residency-filter label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #dddddd;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-size: 0.78rem;
  font-weight: 550;
  white-space: nowrap;
}

.toggles label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #dddddd;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-size: 0.78rem;
  font-weight: 550;
  white-space: nowrap;
}

.toggles input,
.residency-filter input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggles label:has(input:checked),
.residency-filter label:has(input:checked) {
  border-color: #222;
  background: #f7f7f7;
  color: #222;
  font-weight: 650;
}

.toggles label:focus-within,
.residency-filter label:focus-within {
  outline: 2px solid #9fe870;
  outline-offset: 2px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 51%) minmax(0, 49%);
  height: auto;
  min-height: 0;
  min-width: 0;
  overflow: visible;
  background: var(--canvas);
}

.map-panel {
  position: sticky;
  top: calc(var(--desktop-topbar-height) + var(--desktop-filter-height) + 16px);
  align-self: start;
  height: calc(100vh - var(--desktop-topbar-height) - var(--desktop-filter-height) - 64px);
  margin: 40px 48px 24px 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 22px;
  background: var(--canvas);
  box-shadow: 0 8px 24px rgba(31, 44, 28, 0.12);
}

#map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  box-shadow: none;
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 28px;
  border: 0;
  border-radius: inherit;
  background: var(--canvas);
  text-align: center;
}

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

.map-fallback h2 {
  margin-bottom: 8px;
}

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

.results-panel {
  height: auto;
  min-height: 0;
  min-width: 0;
  overflow: visible;
  background: var(--canvas);
  border-right: 0;
}

.results-header {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding: 24px 48px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 234, 0.96);
  backdrop-filter: blur(10px);
}

.results-header[hidden],
.shortlist-strip[hidden] {
  display: none !important;
}

.results-header h2 {
  margin-bottom: 0;
  font-size: 1.22rem;
  line-height: 1.25;
}

.shortlist-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 48px 0;
  overflow: hidden;
}

.favourites-label {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--forest);
  font-size: 0.84rem;
  font-weight: 850;
}

.favourites-label .bookmark-icon {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.favourites-list {
  display: flex;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.favourites-list::-webkit-scrollbar {
  display: none;
}

.favourites-list button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--orange);
  border-radius: 999px;
  background: var(--orange);
  color: var(--forest);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.favourites-list button:hover,
.favourites-list button:focus-visible {
  border-color: #e38318;
  background: #f18d20;
  box-shadow: 0 3px 9px rgba(250, 154, 45, 0.24);
}

.provider-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 24px 48px 48px;
  background: var(--canvas);
}

.results-panel.is-detail-view {
  padding-bottom: 48px;
}

.provider-list.is-detail-view {
  display: block;
  padding: 24px 48px 0;
}

.provider-list.is-detail-view .detail-view {
  max-width: none;
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(22, 51, 0, 0.06);
}

.provider-list.is-detail-view .detail-hero h2 {
  font-size: clamp(1.75rem, 2.6vw, 2.3rem);
}

.provider-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #dce3da;
  border-radius: 14px;
  padding: 14px 16px 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(22, 51, 0, 0.04);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.provider-card:hover {
  background: #fff;
  border-color: #b9d3ad;
  box-shadow: 0 5px 14px rgba(22, 51, 0, 0.08);
  transform: translateY(-1px);
}

.provider-card.is-selected {
  background: #fff;
  border-color: #dce3da;
  box-shadow: 0 1px 2px rgba(22, 51, 0, 0.04);
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.card-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.top-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  white-space: nowrap;
}

.house-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shortlist-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin: -4px -4px -4px auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  line-height: 1;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.bookmark-icon {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shortlist-icon:hover,
.shortlist-icon:focus-visible {
  border-color: var(--ink);
  background: #f5f8f1;
  transform: scale(1.05);
}

.shortlist-icon.is-saved {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--forest);
}

.type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
}

.type-pill.residential_aged_care {
  background: #f2f3ef;
  color: #3f4b3e;
  border: 1px solid #e1e6de;
}

.type-pill.retirement_village {
  background: #f2f3ef;
  color: #3f4b3e;
  border: 1px solid #e1e6de;
}

.provider-card h3 {
  margin-bottom: 5px;
  color: #111;
  font-size: 1.03rem;
  font-weight: 850;
  line-height: 1.2;
}

.provider-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.32;
  font-size: 0.88rem;
}

.card-price {
  margin: 8px 0 0 !important;
  color: var(--ink) !important;
  font-size: 0.94rem !important;
  font-weight: 650;
}

.card-address {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.compact-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  margin: 12px 0 10px;
  color: #476044;
  font-size: 0.9rem;
}

.compact-facts strong {
  color: var(--forest);
  font-size: 1rem;
  font-weight: 950;
}

.star-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid #aeb8ad;
  border-radius: 999px;
  background: #fff;
  color: #182219;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
}

.compact-facts .fact-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  white-space: nowrap;
}

.compact-facts .fact-with-icon::before {
  content: none;
}

.provider-card.retirement_village .compact-facts {
  color: #6f6251;
}

.provider-card.retirement_village .compact-facts strong {
  color: #a45b0a;
}

.compact-facts span::before {
  content: "";
}

.compact-facts span + span::before {
  content: "· ";
  color: var(--muted);
}

.pin-warning {
  display: inline-flex;
  margin: -4px 0 12px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff8ed;
  color: #70470d;
  font-size: 0.78rem;
  font-weight: 900;
}

.star-summary {
  display: inline-flex;
  margin: -4px 0 12px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eaf5e3;
  color: #174f33;
  font-size: 0.78rem;
  font-weight: 900;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.category-chips span {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #e1e6de;
  background: #f2f3ef;
  color: #3f4b3e;
  font-size: 0.76rem;
  font-weight: 850;
}

.category-chips.in-metric {
  margin: 0;
}

.category-chips.in-metric span {
  background: #fff;
}

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

.rooms-section {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.register-section {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.section-heading h3 {
  margin-bottom: 14px;
  font-size: 1.35rem;
}

.empty-note {
  margin-bottom: 0;
  padding: 14px;
  border-radius: 8px;
  background: #fff8ed;
  color: #70470d;
}

.inline-action {
  display: inline-flex;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  background: #172319;
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.room-list {
  display: grid;
  gap: 14px;
}

.room-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf6;
}

.room-card summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.room-card summary::-webkit-details-marker {
  display: none;
}

.room-card summary strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.08rem;
}

.room-card summary small {
  color: var(--muted);
  font-weight: 700;
}

.room-card summary b {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 1.08rem;
}

.room-card summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eaf5e3;
  color: var(--ink);
  font-weight: 900;
}

.room-card[open] summary::after {
  content: "−";
}

.room-expanded {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.room-card p {
  color: var(--muted);
  line-height: 1.5;
}

.room-card .combination {
  margin: 10px 0;
  padding: 12px;
  border-radius: 8px;
  background: #eaf5e3;
  color: #174f33;
  font-weight: 800;
}

.room-card .capture-method {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: #fff8ed;
  color: #70470d;
  font-size: 0.9rem;
}

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

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

.room-metrics div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f4f7f1;
}

.register-grid div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f4f7f1;
}

.room-metrics span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.register-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.register-grid strong {
  overflow-wrap: anywhere;
}

.register-grid a {
  color: var(--green);
}

.room-card a {
  display: block;
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #f4f7f1;
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.room-card a span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.checked-note {
  margin: 10px 0 0;
  font-size: 0.84rem;
}

.metrics div,
.detail-grid div {
  min-width: 0;
  padding: 11px;
  border-radius: 8px;
  background: #f4f7f0;
}

.metrics span,
.detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metrics strong,
.detail-grid strong {
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.card-arrow,
.preview-arrow {
  flex: 0 0 40px !important;
  width: 40px;
  min-height: 40px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  background: var(--lime) !important;
  color: var(--forest) !important;
  font-size: 1.35rem !important;
  font-weight: 500 !important;
  line-height: 1;
}

.card-arrow:hover,
.card-arrow:focus-visible,
.preview-arrow:hover,
.preview-arrow:focus-visible {
  background: #b4f38b !important;
  transform: translateX(1px);
}

.map-tooltip {
  display: flex;
  width: min(280px, calc(100vw - 96px));
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 14px;
  color: var(--ink);
}

.map-tooltip strong {
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.map-tooltip .preview-arrow {
  flex-basis: 34px !important;
  width: 34px;
  min-height: 34px !important;
  font-size: 1.15rem !important;
}

.gm-style .gm-style-iw-c:has(.map-tooltip) {
  padding: 0 !important;
  border: 1px solid #d8dfd8;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(31, 44, 28, 0.2);
}

.gm-style .gm-style-iw-d:has(.map-tooltip) {
  overflow: hidden !important;
}

.gm-style .gm-style-iw-chr:has(+ .gm-style-iw-d .map-tooltip) {
  display: none;
}

.card-actions button,
.card-actions a {
  flex: 1;
  min-width: 0;
  border-radius: 8px;
}

.card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  background: #f4f7f0;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.card-actions .pending-link {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff8ed;
  color: #70470d;
  font-size: 0.86rem;
  font-weight: 850;
  text-align: center;
}

.card-actions button:first-child {
  background: var(--lime);
  color: var(--forest);
}

.card-actions button,
.card-actions a,
.card-actions .pending-link {
  min-height: 36px;
  font-size: 0.86rem;
}

.card-actions button:last-child {
  background: #e8f2e3;
  color: var(--forest);
}

.detail-view {
  max-width: 760px;
  margin: 0 auto;
}

.detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 26px;
}

.detail-back,
.detail-save {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 8px;
  font-weight: 850;
}

.detail-back {
  padding-left: 0;
  background: transparent;
  color: var(--ink);
}

.detail-back:hover {
  color: var(--green);
}

.detail-save {
  background: var(--lime);
  color: var(--forest);
}

.detail-hero {
  clear: both;
  margin-bottom: 22px;
}

.detail-hero .type-pill {
  display: inline-flex;
  margin-bottom: 8px;
}

.detail-hero h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.05;
}

.detail-hero p {
  color: var(--muted);
}

.aged-care-summary {
  margin-bottom: 20px;
}

.village-profile {
  display: grid;
  gap: 26px;
  margin: 24px 0 28px;
}

.village-section-heading,
.village-info-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
}

.village-section-heading {
  margin-bottom: 14px;
}

.village-section-heading h3,
.village-info-title h4 {
  margin: 0;
  color: var(--green);
  font-size: 1rem;
  line-height: 1.2;
}

.village-info-title h4 {
  font-size: 0.86rem;
}

.village-section-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.village-key-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.village-metric-card {
  min-width: 0;
  padding: 13px 14px;
  border-radius: 7px;
  background: #f1f3ef;
}

.village-metric-card span {
  display: block;
  margin-bottom: 6px;
  color: #647064;
  font-size: 0.72rem;
  font-weight: 800;
}

.village-metric-card strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.village-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.village-info-group {
  min-width: 0;
}

.village-info-title {
  margin-bottom: 12px;
}

.village-info-rows,
.village-operator-grid {
  display: grid;
}

.village-info-row {
  display: grid;
  grid-template-columns: minmax(82px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: baseline;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.village-info-row span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.village-info-row strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.village-operator {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.village-operator-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 13px 14px;
  border-radius: 7px;
  background: #e6f3ed;
}

.village-operator-grid .village-info-row {
  display: block;
  padding: 0 14px;
  border-bottom: 0;
  border-left: 1px solid rgba(23, 79, 51, 0.1);
}

.village-operator-grid .village-info-row:first-child {
  padding-left: 0;
  border-left: 0;
}

.village-operator-grid .village-info-row span,
.village-operator-grid .village-info-row strong {
  display: block;
  text-align: left;
}

.village-operator-grid .village-info-row strong {
  margin-top: 6px;
}

.ratings-section {
  margin: 4px 0 22px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
}

.rating-primary,
.rating-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.rating-primary {
  color: #344236;
  font-size: 0.94rem;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #24774f;
  color: #fff;
  font-weight: 900;
}

.rating-muted {
  color: var(--muted);
  font-weight: 800;
}

.bed-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
}

.bed-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}

.rating-secondary {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.rating-secondary strong {
  color: var(--ink);
}

.rating-separator {
  color: #a2aba1;
}

.rating-period {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.rating-period a {
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
}

.rating-period a:hover {
  text-decoration: underline;
}

.contact-block {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.contact-block a,
.contact-block p {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #f4f7f1;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.contact-block a {
  text-decoration: none;
}

.aged-care-detail .contact-block {
  gap: 0;
  margin: 24px 0 16px;
}

.aged-care-detail .contact-block a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  background: transparent;
  color: var(--blue);
}

.aged-care-detail .contact-block a:hover {
  text-decoration: underline;
}

.aged-care-detail .contact-block a .contact-label {
  color: var(--blue);
  font-size: 0.98rem;
  font-weight: 750;
}

.aged-care-detail .contact-block a strong {
  color: var(--blue);
  font-weight: 600;
}

.contact-icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-icon-my-aged-care {
  width: 18px;
  height: 18px;
  margin-left: -1px;
}

.contact-icon-my-aged-care img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.aged-care-detail .contact-block > p {
  margin: 0;
}

.detail-sources {
  display: grid;
  gap: 2px;
  margin: 16px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.detail-sources p,
.detail-sources a {
  margin: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.detail-sources strong {
  color: #4f5b50;
  font-weight: 850;
}

.detail-sources a {
  color: var(--blue);
  text-decoration: none;
}

.detail-sources a:hover {
  text-decoration: underline;
}

.detail-contact-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  text-decoration: none;
}

.primary-action {
  border-radius: 8px;
  background: var(--lime);
  color: #163300;
}

@media (max-width: 1280px) {
  .site-nav a:not(.map-nav-item) {
    display: none;
  }
}

@media (max-width: 980px) {
  .app-shell {
    min-height: 100vh;
    grid-template-rows: auto auto auto;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .topbar {
    position: static;
    height: auto;
    min-height: 0;
    grid-template-columns: 180px minmax(260px, 1fr) auto;
    align-items: center;
    padding-inline: 24px;
  }

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

  .api-key-box {
    display: none;
  }

  .control-band {
    top: auto;
    position: relative;
    height: auto;
    min-height: 58px;
    overflow: visible;
  }

  #filterOptions {
    left: 16px;
    width: min(720px, calc(100vw - 32px));
  }

  .map-panel {
    position: relative;
    top: auto;
    height: auto;
    margin: 0;
    min-height: 48vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .results-panel {
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: 0;
  }

  .provider-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .provider-list.is-detail-view {
    padding: 24px;
  }

  .village-key-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .village-info-grid,
  .village-operator-grid {
    grid-template-columns: 1fr;
  }

  .village-operator-grid .village-info-row {
    padding: 8px 0;
    border-left: 0;
    border-bottom: 1px solid rgba(23, 79, 51, 0.1);
  }

  .village-operator-grid .village-info-row:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 767px) {
  html.is-mobile-layout,
  html.is-mobile-layout body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  .topbar {
    position: relative;
    z-index: 20;
    grid-template-columns: 108px minmax(0, 1fr) 42px;
    gap: 10px;
    align-items: center;
    min-height: 62px;
    padding: 8px 12px;
  }

  .brand-block,
  .brand-mark {
    width: 108px;
    height: 36px;
  }

  .brand-mark img {
    width: 108px;
    height: auto;
  }

  .site-nav {
    display: none;
  }

  .header-actions {
    width: 42px;
  }

  .top-search {
    display: block;
    min-width: 0;
  }

  .search-box > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .search-box div {
    min-height: 44px;
    border-color: #d8ddd5;
    box-shadow: 0 3px 12px rgba(31, 44, 28, 0.08);
  }

  .search-box input {
    padding: 10px 12px;
    font-size: 16px;
  }

  .search-box button {
    flex: 0 0 auto;
    min-width: 66px;
    padding: 9px 13px;
    font-size: 0.82rem;
  }

  .mobile-shortlist-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
  }

  .mobile-shortlist-button.has-favourites {
    border-color: var(--orange);
    background: var(--orange);
    color: var(--forest);
  }

  .api-key-box {
    display: none;
  }

  .control-band {
    position: relative;
    z-index: 15;
    top: auto;
    min-height: 54px;
    height: 54px;
    gap: 7px;
    padding: 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: none;
    box-shadow: 0 4px 12px rgba(31, 44, 28, 0.05);
  }

  .control-band.is-filter-focus {
    z-index: 100;
  }

  .control-band.is-filter-focus::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(16, 32, 21, 0.34);
    backdrop-filter: blur(2px);
  }

  .toggles {
    gap: 7px;
  }

  .toggles label,
  .filter-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.76rem;
  }

  #filterOptions {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: block;
    width: 100%;
    max-height: min(72dvh, 620px);
    padding: 0 16px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -16px 44px rgba(16, 32, 21, 0.18);
  }

  #filterOptions[hidden] {
    display: none;
  }

  .filter-sheet-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: #fff;
    font-size: 1rem;
  }

  .filter-sheet-heading button {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #f2f4ef;
    color: var(--ink);
    font-size: 1.45rem;
  }

  #filterOptions .residency-filter {
    display: grid;
    gap: 8px;
    padding: 16px 0;
  }

  #filterOptions .residency-filter > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #filterOptions .residency-filter label {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
  }

  .filter-sheet-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
    padding-top: 12px;
    background: #fff;
  }

  .filter-sheet-actions button {
    min-height: 46px;
    border-radius: 8px;
    background: #edf2e9;
    color: var(--forest);
    font-weight: 850;
  }

  .filter-sheet-actions button:last-child {
    background: var(--lime);
  }

  .workspace {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

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

  .map-panel {
    position: relative;
    top: auto;
    width: auto;
    height: calc(100% - 16px);
    min-height: 0;
    margin: 8px 10px;
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 6px 22px rgba(31, 44, 28, 0.13);
  }

  .results-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .results-header {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 14px 16px 10px;
    background: rgba(243, 240, 234, 0.96);
  }

  .results-header h2 {
    font-size: 1rem;
  }

  .shortlist-strip {
    padding: 10px 16px 0;
  }

  .favourites-label,
  .favourites-list button {
    min-height: 32px;
    font-size: 0.78rem;
  }

  .provider-list {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 12px calc(104px + env(safe-area-inset-bottom));
  }

  .provider-card {
    min-height: 0;
    padding: 14px;
    border-radius: 12px;
  }

  .provider-card h3 {
    font-size: 1rem;
  }

  .provider-card p {
    font-size: 0.87rem;
  }

  .provider-list.is-detail-view {
    min-height: 100%;
    padding: 0 0 calc(88px + env(safe-area-inset-bottom));
    background: #fff;
  }

  .provider-list.is-detail-view .detail-view {
    min-height: 100%;
    padding: 0 16px 28px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .detail-toolbar {
    position: sticky;
    top: 0;
    z-index: 4;
    min-height: 62px;
    margin: 0 -16px 20px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
  }

  .detail-back,
  .detail-save {
    min-height: 42px;
  }

  .detail-hero h2,
  .provider-list.is-detail-view .detail-hero h2 {
    font-size: 1.75rem;
    line-height: 1.08;
  }

  .metrics,
  .detail-grid,
  .room-metrics,
  .register-grid {
    grid-template-columns: 1fr;
  }

  .village-profile {
    gap: 22px;
    margin-top: 20px;
  }

  .village-key-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .village-metric-card {
    padding: 12px;
  }

  .village-info-grid {
    gap: 22px;
  }

  .village-info-row {
    grid-template-columns: minmax(96px, 0.9fr) minmax(0, 1.1fr);
  }

  .village-operator-grid {
    padding: 12px;
  }

  .room-card {
    padding: 14px;
  }

  .room-card summary {
    align-items: flex-start;
    gap: 10px;
  }

  .room-card summary > span:first-child {
    min-width: 0;
  }

  .room-card summary strong {
    font-size: 1rem;
  }

  .mobile-view-switch {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 40;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 150px;
    min-height: 48px;
    padding: 4px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: var(--forest);
    box-shadow: 0 10px 28px rgba(16, 32, 21, 0.28);
  }

  .mobile-view-switch button {
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-size: 0.86rem;
    font-weight: 850;
  }

  .mobile-view-switch button[aria-pressed="true"] {
    background: var(--lime);
    color: var(--forest);
  }

  .mobile-map-preview {
    position: absolute;
    right: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 8;
    display: block;
    padding: 12px;
    border: 1px solid rgba(16, 32, 21, 0.12);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(16, 32, 21, 0.22);
  }

  .mobile-map-preview[hidden] {
    display: none;
  }

  .mobile-preview-topline,
  .mobile-preview-body,
  .mobile-preview-actions {
    display: flex;
    align-items: center;
  }

  .mobile-preview-topline {
    justify-content: space-between;
    margin-bottom: 8px;
  }

  .mobile-preview-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #f2f4ef;
    color: var(--ink);
    font-size: 1.25rem;
  }

  .mobile-preview-body {
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-preview-body > div:first-child {
    min-width: 0;
  }

  .mobile-preview-body strong {
    display: block;
    font-size: 1rem;
    line-height: 1.18;
  }

  .mobile-preview-body p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
  }

  .mobile-preview-body b {
    display: block;
    margin-top: 5px;
    color: var(--forest);
    font-size: 0.9rem;
  }

  .mobile-preview-actions {
    flex: 0 0 auto;
    gap: 8px;
  }

  .mobile-preview-actions .shortlist-icon {
    width: 40px;
    height: 40px;
    margin: 0;
  }

  .mobile-preview-actions .preview-arrow {
    flex-basis: 40px !important;
  }

  .gm-style .gm-style-iw-c:has(.map-tooltip) {
    display: none;
  }
}

@media (max-width: 390px) {
  .topbar {
    grid-template-columns: 96px minmax(0, 1fr) 40px;
    gap: 7px;
    padding-inline: 9px;
  }

  .brand-block,
  .brand-mark {
    width: 96px;
  }

  .brand-mark img {
    width: 96px;
  }

  .search-box button {
    min-width: 58px;
    padding-inline: 10px;
  }

  .toggles label,
  .filter-button {
    padding-inline: 10px;
  }
}
