:root{
  --ink:#17342d;--muted:#52655f;--paper:#f5f3ed;--surface:#fff;--line:#cfdad5;
  --green:#245d4d;--green-dark:#173f35;--accent:#9d4f2d;--soft:#edf3f0;
  --focus:#0b63ce;--aged:#8b4b2f;--retirement:#245d8c;
  --retirement-derived:#2f7a6b;--retirement-approximate:#e0b63f;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--paper);color:var(--ink);font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;line-height:1.5}
button,input,select{font:inherit}
[hidden]{display:none!important}
.skip-link{position:absolute;left:.75rem;top:-5rem;z-index:10000;padding:.65rem .85rem;background:#fff;color:#102f28;border:2px solid var(--focus);border-radius:8px}
.skip-link:focus{top:.75rem}
.header{padding:1rem 1.25rem;background:var(--green-dark);color:#fff}
.header-inner{max-width:1450px;margin:auto;display:flex;justify-content:space-between;gap:1rem;align-items:center}
.header h1{margin:0;font:600 1.45rem Georgia,serif}
.header p{margin:.25rem 0 0;color:#e3efeb;font-size:.88rem}
.badge{flex:none;padding:.32rem .68rem;border-radius:999px;background:#f3d8c7;color:#173f35;font-size:.74rem;font-weight:800}
.notice{max-width:1450px;margin:1rem auto;padding:.85rem 1rem;border:1px solid #d8bf6c;border-radius:10px;background:#fff3cf}
.controls{max-width:1450px;margin:0 auto 1rem;padding:1rem;background:var(--surface);border:1px solid var(--line);border-radius:14px;display:grid;grid-template-columns:minmax(0,1fr) minmax(520px,.95fr);gap:1rem;align-items:start}
.search-field>label,.select-label{display:block;margin-bottom:.35rem;font-weight:750}
.input-row{display:flex;gap:.5rem}
.input-row input{width:100%;min-width:0;min-height:46px;padding:.65rem .8rem;border:1px solid #9eaea7;border-radius:9px;background:#fff;color:var(--ink)}
.input-row button,.view-button,.map-link,.popup-select{min-height:44px;border:1px solid #8da198;border-radius:9px;background:#fff;color:var(--ink);font-weight:700;cursor:pointer}
.input-row button{padding:.55rem .85rem}
.hint{margin:.35rem 0 0;color:var(--muted);font-size:.8rem}
.filter-stack{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:.65rem .8rem;align-items:end}
.filter-field{min-width:0}
.filter-field select{width:100%;min-height:46px;padding:.55rem .75rem;border:1px solid #9eaea7;border-radius:9px;background:#fff;color:var(--ink)}
.check{grid-column:1/-1;display:flex;min-height:34px;align-items:center;gap:.55rem;color:var(--ink);font-size:.88rem}
.check input{width:1.15rem;height:1.15rem;accent-color:var(--green)}
.detail-hint{grid-column:1/-1;margin-top:-.2rem;padding:.48rem .6rem;border-left:3px solid #d8bf6c;background:#fff8df;border-radius:4px}
.view-switch{display:none;grid-column:1/-1;gap:.35rem;padding:.25rem;border:1px solid var(--line);border-radius:10px;background:var(--soft)}
.view-button{min-width:5.5rem;padding:.48rem .75rem;border-color:transparent;background:transparent}
.view-button[aria-pressed="true"]{background:var(--green);color:#fff}
.layout{max-width:1450px;margin:auto;padding:0 0 2rem;display:grid;grid-template-columns:minmax(0,1.25fr) minmax(370px,.75fr);grid-template-areas:"map results";gap:1rem}
.panel{min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.results-panel{grid-area:results}
.map-panel{grid-area:map;position:relative}
.map{height:720px}
.summary{padding:.85rem 1rem;border-bottom:1px solid var(--line);color:var(--muted);font-size:.88rem;font-weight:700}
.results{max-height:665px;overflow:auto}
.card{padding:1rem;border-bottom:1px solid var(--line)}
.card:last-child{border-bottom:0}
.card h2{margin:0 0 .3rem;font:600 1.08rem Georgia,serif}
.meta{color:var(--muted);font-size:.84rem}
.meta+.meta{margin-top:.18rem}
.badges{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.6rem}
.status{display:inline-block;padding:.18rem .48rem;border-radius:999px;background:var(--soft);font-size:.71rem;font-weight:800}
.status.type-retirement{background:#e2eef7;color:#17496e}
.status.type-aged{background:#f3e4db;color:#6d351f}
.status.no-point{background:#f4e5dc;color:#713619}
.status.source-point{background:#f7eadf;color:#6d351f}
.status.exact-point{background:#e2eef7;color:#17496e}
.status.derived-point{background:#dcefe9;color:#165345}
.status.approximate-point{background:#fff0bd;color:#5f4a08}
.status.attribute-reviewed{background:#e4f0df;color:#285522}
.status.attribute-no-source{background:#f2e7dd;color:#713619}
.status.aged-care-rated{background:#e7ead8;color:#405112}
.capacity{margin:.55rem 0 0;color:var(--ink);font-size:.82rem}
.capacity-note,.location-note,.attribute-source-note{margin:.22rem 0 0;color:var(--muted);font-size:.75rem}
.map-link{display:block;margin-top:.7rem;padding:.48rem .72rem;color:var(--green-dark)}
.attribute-details{margin-top:.8rem;border:1px solid var(--line);border-radius:9px;background:#fbfcfb}
.attribute-details summary{min-height:44px;padding:.65rem .75rem;cursor:pointer;font-weight:750;color:var(--green-dark)}
.attribute-details[open] summary{border-bottom:1px solid var(--line)}
.attribute-list{display:grid;grid-template-columns:minmax(130px,.7fr) minmax(0,1.3fr);margin:0;padding:.65rem .75rem;gap:.35rem .75rem;font-size:.78rem}
.attribute-list dt{font-weight:750;color:var(--ink)}
.attribute-list dd{margin:0;color:var(--muted);overflow-wrap:anywhere}
.attribute-condition{font-weight:700;color:#6a4d00}
.attribute-source{padding:.6rem .75rem .75rem;border-top:1px solid var(--line);font-size:.76rem}
.attribute-source a{color:var(--green-dark);font-weight:750}
.attribute-source a:visited{color:#4c3a67}
.aged-care-details{margin-top:.8rem;border:1px solid var(--line);border-radius:9px;background:#fffdf8}
.aged-care-details summary{min-height:44px;padding:.65rem .75rem;cursor:pointer;font-weight:750;color:#604214}
.aged-care-details[open] summary{border-bottom:1px solid var(--line)}
.aged-care-rating-list{display:grid;grid-template-columns:minmax(145px,.8fr) minmax(0,1.2fr);margin:0;padding:.65rem .75rem;gap:.35rem .75rem;font-size:.78rem}
.aged-care-rating-list dt{font-weight:750;color:var(--ink)}
.aged-care-rating-list dd{margin:0;color:var(--muted);overflow-wrap:anywhere}
.aged-care-rating-list .aged-care-rating-overall{font-weight:800;color:#604214}
.aged-care-rating-explanation{margin:0;padding:.65rem .75rem;color:var(--muted);font-size:.78rem}
.aged-care-rating-source{padding:.6rem .75rem .75rem;border-top:1px solid var(--line);font-size:.76rem}
.aged-care-rating-source a{color:var(--green-dark);font-weight:750}
.aged-care-rating-source a:visited{color:#4c3a67}
.aged-care-rating-attribution,.aged-care-rating-current{margin:0 0 .25rem}
.aged-care-rating-note{margin:.25rem 0 0;color:var(--muted);font-size:.74rem}
.aged-care-rating-disclaimer{margin:.55rem 0 0;padding:.5rem .58rem;border-left:3px solid var(--aged);border-radius:4px;background:#f7eee9;color:var(--ink);font-size:.74rem}
.empty,.error{padding:2rem;text-align:center;color:var(--muted)}
.error{color:#7a1e1e}
.legend{position:absolute;left:12px;bottom:12px;z-index:500;display:grid;gap:.35rem;max-width:390px;padding:.55rem .7rem;border:1px solid #aab8b2;border-radius:8px;background:rgba(255,255,255,.95);font-size:.73rem;box-shadow:0 1px 5px rgba(0,0,0,.15)}
.legend span{display:flex;align-items:center;gap:.4rem}
.legend-dot{width:.72rem;height:.72rem;border-radius:50%;display:inline-block;border:2px solid #fff;box-shadow:0 0 0 1px #43534d}
.legend-dot.retirement{background:var(--retirement)}
.legend-dot.retirement-exact{background:var(--retirement)}
.legend-dot.retirement-derived{background:var(--retirement-derived)}
.legend-dot.retirement-approximate{background:var(--retirement-approximate);border-style:dashed}
.legend-dot.aged-care{background:var(--aged)}
.footer{max-width:1450px;margin:auto;padding:1rem 0 2rem;color:var(--muted);font-size:.8rem}
.leaflet-popup-content h3{margin:0 0 .25rem}
.leaflet-popup-content p{margin:.15rem 0}
.leaflet-popup-content>div{background:#fff;color:var(--ink)}
.leaflet-popup-content .popup-type{font-weight:750}
.leaflet-popup-content .popup-select{display:block;width:100%;margin-top:.65rem;padding:.48rem .72rem;color:var(--green-dark)}
.card:focus{outline:3px solid var(--focus);outline-offset:-3px}
.leaflet-interactive:focus{outline:3px solid var(--focus);outline-offset:2px}
button:hover,select:hover{border-color:var(--green)}
input:focus-visible,select:focus-visible,button:focus-visible,summary:focus-visible,a:focus-visible,.skip-link:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
@media(max-width:1100px){
  .controls{grid-template-columns:1fr}
  .layout{grid-template-columns:minmax(0,1.1fr) minmax(350px,.9fr)}
}
@media(max-width:900px){
  .header{padding:.9rem .85rem}
  .header-inner{align-items:flex-start}
  .header h1{font-size:1.25rem}
  .badge{margin-top:.1rem}
  .notice,.controls{margin-left:.7rem;margin-right:.7rem}
  .notice{font-size:.9rem}
  .controls{grid-template-columns:1fr;padding:.85rem}
  .filter-stack{grid-template-columns:1fr}
  .check,.detail-hint,.view-switch{grid-column:1}
  .view-switch{display:flex;width:100%;margin-top:.35rem}
  .view-button{flex:1}
  .layout{grid-template-columns:minmax(0,1fr);grid-template-areas:none;padding:0 .7rem}
  .results-panel,.map-panel{grid-area:1/1}
  .results{max-height:none}
  .map{height:min(62vh,520px)}
  .legend{max-width:calc(100% - 24px)}
  .footer{padding:1rem .85rem 2rem}
  .card{padding:.9rem}
  .map-link{width:100%}
}
@media(max-width:520px){
  .header-inner{display:block}
  .badge{display:inline-block;margin-top:.65rem}
  .input-row{align-items:stretch}
  .input-row button{padding:.5rem .7rem}
  .hint{font-size:.76rem}
  .summary{font-size:.8rem}
  .card h2{font-size:1rem}
  .attribute-list{grid-template-columns:1fr;gap:.12rem}
  .attribute-list dd{margin-bottom:.42rem}
  .aged-care-rating-list{grid-template-columns:1fr;gap:.12rem}
  .aged-care-rating-list dd{margin-bottom:.42rem}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
