/* The map and the panel beside it. The panel is a plain column down the left
   of the window and the map has the rest to itself: only its own controls sit
   on it (zoom, the key, suburb names, the card for a picked sale). On a phone
   the panel is a sheet over the bottom of the map. */

.explore { position: fixed; inset: var(--top-h) 0 var(--tab-h) 0; overflow: hidden; --gap: 12px; --panel-width: clamp(340px, 36vw, var(--panel-w)); }
.stage { position: absolute; inset: 0 0 0 var(--panel-width); background: var(--map-land); }
#map { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }
#map:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* --- suburb names on the map: plain words, with the map's own colour round the letters ---- */
.maptags { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.maptag {
  position: absolute; left: 0; top: 0; width: max-content; max-width: 124px; padding: 3px 7px; pointer-events: auto;
  font: 600 12.5px/1.2 var(--font); text-align: center; text-wrap: balance; text-decoration: none; color: var(--map-label-strong);
  /* An edge in the ground's colour, as the canvas gives its own words. Shadows and not a stroke: older browsers draw a stroke over the letters. */
  --h: var(--map-halo);
  text-shadow: 1.6px 0 var(--h), -1.6px 0 var(--h), 0 1.6px var(--h), 0 -1.6px var(--h), 1.15px 1.15px var(--h), -1.15px 1.15px var(--h), 1.15px -1.15px var(--h), -1.15px -1.15px var(--h), 0 0 4px var(--h);
  border-radius: 6px;
}
.maptag.away { visibility: hidden; }
.maptag:hover, .maptag:focus-visible, .maptag.pointed { z-index: 2; text-shadow: none; background: var(--bg); box-shadow: 0 0 0 1px var(--line-2); }
.maptag.current { display: none; }   /* the panel already says which suburb this is */

/* --- zoom, the key and the credit ---------------------------------------------------- */
.mapctl { position: absolute; top: var(--gap); right: var(--gap); z-index: 4; display: grid; overflow: hidden; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-s); }
.mapctl button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: var(--ink-2); background: none; border: 0; }
.mapctl button + button { border-top: 1px solid var(--line); }
.mapctl button:hover { color: var(--ink); background: var(--soft); }
.mapctl button:focus-visible { outline-offset: -2px; }
.mapctl .ico { width: 16px; height: 16px; }

/* the key is one line in the corner: what the colours stand for, then the colours from low to high */
.legend {
  position: absolute; left: var(--gap); bottom: var(--gap); z-index: 4; max-width: min(440px, 100% - var(--gap) * 3 - 136px);   /* the credit keeps the corner beside it */
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 4px 10px 4px 5px;
  font-size: 12px; line-height: 1.3; color: var(--ink-2);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s);
}
.legend select { width: auto; field-sizing: content; min-height: 0; height: 26px; padding: 0 2px 0 5px; font: 500 12px/1 var(--font); color: var(--ink); background: transparent; border-color: transparent; border-radius: 5px; }
.legend select:hover { background: var(--soft); }
.bands { display: flex; align-items: center; gap: 2px; }
.bands .end { white-space: nowrap; }
.bands .end:first-child { margin-right: 5px; }
.bands .end:not(:first-child) { margin-left: 5px; }
.legend .band { display: flex; align-items: center; gap: 5px; padding: 5px 0; color: inherit; background: none; border: 0; border-radius: 3px; }   /* no taller than the list beside it, so the key keeps its height */
.legend .band i { display: block; width: 15px; height: 8px; background: var(--c); border-radius: 2px; box-shadow: inset 0 0 0 1px var(--c); }
.legend .band[aria-pressed="false"] i { background: transparent; }
.legend .band.none { margin-left: 10px; }
.legend .band[aria-pressed="false"] .name { text-decoration: line-through; color: var(--ink-3); }
.legendnote { flex: 1 1 100%; padding: 0 0 3px 5px; font-size: 11.5px; line-height: 1.35; color: var(--ink-3); }
.legendnote:empty { display: none; }
.credit { position: absolute; right: var(--gap); bottom: 7px; z-index: 3; font-size: 10.5px; color: var(--map-label); }

/* --- the card for a picked sale, and the tip under the mouse --------------------------- */
.pincard {
  position: absolute; left: 0; top: 0; z-index: 12; width: 284px; padding: 16px;
  background: var(--raise); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--float);
}
.pincard[data-away] { visibility: hidden; }
.pincard::after { content: ""; position: absolute; left: var(--arrow, 50%); width: 12px; height: 12px; margin-left: -6px; background: inherit; rotate: 45deg; }
.pincard[data-side="above"]::after { bottom: -7px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.pincard[data-side="below"]::after { top: -7px; border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); }
.pincard .eyebrow { margin-right: 28px; font-size: 12.5px; color: var(--ink-3); }
.pincard h2 { margin: 2px 28px 0 0; font-size: 16px; }
.cardclose { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; padding: 0; font-size: 20px; line-height: 1; color: var(--ink-3); background: none; border: 0; border-radius: 6px; }
.cardclose:hover { color: var(--ink); background: var(--soft); }
.cardprice { margin-top: 12px; font: 600 26px/1 var(--font); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.cardprice.none { font-size: 17px; letter-spacing: 0; color: var(--ink-2); }
.cardwhen { margin-top: 5px; font-size: 13px; color: var(--ink-2); }
.cardfacts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cardfacts dt { font-size: 12.5px; color: var(--ink-3); }
.cardfacts dd { font: 500 14px/1.3 var(--font); font-variant-numeric: tabular-nums; }
.cardfacts dd small { display: block; font-weight: 400; color: var(--ink-3); }
.cardfacts div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.cardmore { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.flip { margin-bottom: 6px; font-size: 13.5px; color: var(--ink-2); }
.flip b { color: var(--ink); }
.pincard .actions { margin-top: 14px; }
.pincard .hint { margin-top: 10px; }
.pastsales li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pastsales li + li { border-top: 1px solid var(--line); }
.pastsales span:first-child { color: var(--ink-2); }

.pintip {
  position: absolute; left: 0; top: 0; z-index: 11; translate: -50% calc(-100% - 12px); display: flex; align-items: baseline; gap: 8px; padding: 4px 9px; pointer-events: none; white-space: nowrap;
  font-size: 12.5px; color: var(--bg); background: var(--ink); border-radius: 6px;
}
.pintip b { font-weight: 500; }
.pintip span { font-variant-numeric: tabular-nums; }
.pintip small { opacity: .7; }

/* --- the panel ----------------------------------------------------------------------------- */
.panel { position: absolute; z-index: 10; inset: 0 auto 0 0; width: var(--panel-width); display: flex; flex-direction: column; overflow: hidden; background: var(--bg); border-right: 1px solid var(--line); }
.panelscroll { flex: 1; min-height: 0; overflow: hidden auto; overscroll-behavior: contain; padding: 30px 24px 36px; }
.grip { display: none; }
.pane > * + * { margin-top: 26px; }

.hero > * + * { margin-top: 12px; }
.hero h1 > span { display: block; color: var(--ink-3); }
.hero .lede { font-size: 14.5px; }
.trylink { display: inline-block; font-size: 14.5px; font-weight: 500; color: var(--accent); text-decoration: none; }
.trylink::after { content: " →"; }
.trylink:hover { text-decoration: underline; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs + .placehead { margin-top: 12px; }
.placehead > * + * { margin-top: 4px; }
.placehead h1 { overflow-wrap: anywhere; }
/* the answer in one word, beside the name: it shows while the full answer is out of sight, and always on a phone.
   The row is as tall with it as without, so nothing below moves when it comes and goes. */
.placetitle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.placechip { display: none; flex: none; padding: 3px 10px; font: 600 14px/1.3 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--v, var(--ink-2)); background: color-mix(in srgb, var(--v, var(--ink-2)) 15%, transparent); border: 0; border-radius: var(--pill); }
.placechip:hover { background: color-mix(in srgb, var(--v, var(--ink-2)) 24%, transparent); }
.panel[data-answer="away"] .placechip { display: block; }
.example { font-size: 12.5px; color: var(--ink-3); }

.blockhead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin-bottom: 10px; }
.blockhead .sub { font-size: 13px; color: var(--ink-3); }
.block > .hint { margin-top: 10px; }
.block > .chips { margin-bottom: 4px; }
.empty { color: var(--ink-2); }
.panefoot { padding-top: 18px; border-top: 1px solid var(--line); }
.panefoot > * + * { margin-top: 10px; }
.about summary { font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.about ul { margin-top: 8px; padding-left: 1.1em; list-style: disc; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.about li + li { margin-top: 5px; }

/* median price by suburb and year: a plain table. Its year headings switch years on the map. */
.heatwrap { overflow-x: auto; }
.heat { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.heat th { padding: 0; font-weight: inherit; text-align: left; }
.heat th:first-child { width: 36%; }
.heat thead th { padding-bottom: 4px; text-align: right; vertical-align: bottom; font-size: 12.5px; color: var(--ink-3); }
.heat thead th:first-child { text-align: left; }
.yearbtn { padding: 3px 0 3px 6px; font: 500 12.5px/1.2 var(--font); color: var(--ink-2); background: none; border: 0; border-radius: 4px; }
.yearbtn:hover { color: var(--ink); text-decoration: underline; }
.yearbtn[aria-pressed="false"] { color: var(--ink-3); text-decoration: line-through; }
.heat tbody tr, .heat tfoot tr { border-top: 1px solid var(--line); }
.rowname { display: block; padding: 9px 8px 9px 0; font-weight: 500; font-size: 14px; line-height: 1.25; text-decoration: none; }
.heat tbody tr:hover .rowname, .rowname:focus-visible { color: var(--accent); }
.cell { padding: 9px 0 9px 4px; text-align: right; font-size: 13.5px; line-height: 1.25; color: var(--ink-2); white-space: nowrap; transition: opacity .15s; }
.cell b { font-weight: 400; }
.cell:last-child { color: var(--ink); }
.cell:last-child b { font-weight: 500; }
.cell.few, .cell.none { color: var(--ink-3); }
.cell.few b { font-weight: 400; }
.cell.off { opacity: .3; }
.heat tfoot th { padding: 9px 8px 9px 0; font-size: 13px; line-height: 1.25; color: var(--ink-2); }

/* lists of sales and of streets */
.salelist li + li, .streetlist li + li { border-top: 1px solid var(--line); }
.salerow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; width: calc(100% + 16px); margin: 0 -8px; padding: 9px 8px; text-align: left; background: none; border: 0; border-radius: var(--radius-s); }
.salerow:hover, .streetrow:hover { background: var(--soft); }
.salemain b { display: block; font-weight: 500; font-size: 14.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.salemain small { display: block; font-size: 12.5px; color: var(--ink-3); }
.saleprice { font: 500 14.5px/1.2 var(--font); white-space: nowrap; font-variant-numeric: tabular-nums; }
.saleprice.none { font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.streetrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 62px; align-items: baseline; gap: 12px; margin: 0 -8px; padding: 9px 8px; text-decoration: none; border-radius: var(--radius-s); }
.streetrow b { font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.streetrow small { font-size: 12.5px; color: var(--ink-3); }
.streetrow .saleprice { text-align: right; }

/* a suburb in figures: one large figure, then a few lines of label and value */
.figure > * + * { margin-top: 5px; }
.bigfig { font: 600 34px/1.05 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bigfig.none { font-size: 20px; letter-spacing: -.01em; color: var(--ink-2); }
.figcap { font-size: 13.5px; color: var(--ink-2); }
.kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 1px solid var(--line); }
.kv dt { font-size: 14px; line-height: 1.35; color: var(--ink-2); }
.kv dt small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-3); }
.kv dd { flex: none; font: 500 14.5px/1.35 var(--font); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* median price per year, as thin bars */
.bars { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px 12px; font-size: 13.5px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bars .yr { color: var(--ink-2); }
.bars .yr small { display: block; font-size: 11px; color: var(--ink-3); }
.bars .bar { height: 6px; min-width: 2px; background: var(--accent); border-radius: 3px; }
.bars .bar.thin { opacity: .3; }
.bars .val { font-weight: 500; text-align: right; }
.bars .val small { font-weight: 400; color: var(--ink-3); }

/* where a set of prices falls, and where the asking price sits among them */
.strip { position: relative; height: 30px; margin: 14px 3px 24px; }
.strip:has(.asklabel), #verdict-body > .strip:has(.asklabel) { margin-top: 36px; }   /* room for the words that name the asking price */
.strip .track { position: absolute; inset: 14px 0 auto 0; height: 1px; background: var(--line-2); }
.strip .band { position: absolute; top: 6px; height: 17px; background: color-mix(in srgb, var(--ink) 9%, transparent); border-radius: 3px; }
.strip .dot { position: absolute; top: 11px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--ink-2); opacity: .65; }
.strip .mid { position: absolute; top: 2px; width: 2px; height: 25px; margin-left: -1px; background: var(--ink); }
.strip .end { position: absolute; top: 34px; font-size: 11.5px; line-height: 1; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.strip .end.lo { left: 0; }
.strip .end.hi { right: 0; }
.strip .ask { position: absolute; top: -6px; width: 2px; height: 40px; margin-left: -1px; background: var(--v, var(--accent)); border-radius: 1px; }
.strip .asklabel { position: absolute; top: -26px; translate: -50% 0; font: 600 12px/1.4 var(--font); white-space: nowrap; color: var(--v, var(--accent)); }
.strip .asklabel.left { translate: -12% 0; }
.strip .asklabel.right { translate: -88% 0; }

/* the price check: the form, then the answer under a line */
.askform { display: grid; gap: 12px; }
.field.big input { height: 50px; padding: 0 14px; font: 600 22px/1 var(--font); letter-spacing: -.015em; font-variant-numeric: tabular-nums; }

.verdict { --v: var(--ink-2); padding-top: 22px; border-top: 1px solid var(--line); }
[data-level="far-above"] { --v: var(--far-above); }
[data-level="above"] { --v: var(--above); }
[data-level="in-line"] { --v: var(--in-line); }
[data-level="below"] { --v: var(--below); }
.verdict > * + *, #verdict-body > * + * { margin-top: 10px; }
.says { font-size: 13.5px; color: var(--ink-3); }
.says q { font-style: italic; }
.verdicthead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; }
.verdictfig { font: 600 40px/1 var(--font); letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: var(--v); }
.verdictlabel { font: 600 14.5px/1.3 var(--font); color: var(--v); }
.verdict h2 { font-size: 17px; line-height: 1.3; }
.basis { font-size: 13.5px; color: var(--ink-2); }
.verdict .kv { margin-top: 14px; }
.tip { font-size: 14px; font-weight: 500; }
.tip::before { content: "→ "; color: var(--v); }

.claim { padding: 20px 0 0; border-top: 1px solid var(--line); }
.claim + .claim { margin-top: 20px; }
.claim > * + * { margin-top: 8px; }
.claim p:not(.says) { font-size: 14px; color: var(--ink-2); }
.claim p strong { color: var(--ink); }
.claim .bars { margin-top: 12px; }

/* --- a phone: the panel is a sheet over the bottom of the map ------------------------------ */
@media (max-width: 760px) {
  .explore { --gap: 8px; --peek: 118px; --sheet: 46dvh; }
  .explore:has(.panel[data-sheet="peek"]) { --sheet: var(--peek); }
  .explore:has(.panel[data-sheet="full"]) { --sheet: calc(100% - 6px); }
  .stage { inset: 0; }
  .panel { inset: auto 0 0 0; width: auto; height: var(--sheet); border-right: 0; border-top: 1px solid var(--line-2); border-radius: 14px 14px 0 0; transition: height .3s var(--ease); }
  .panel.dragging, .panel.noslide { transition: none; }
  .panelscroll { padding: 4px 16px 28px; }
  .panel[data-sheet="peek"] .panelscroll { overflow: hidden; }
  .grip { display: grid; place-items: center; flex: none; width: 100%; height: 24px; padding: 0; background: none; border: 0; touch-action: none; cursor: grab; }
  .grip span { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); }
  .pane > * + * { margin-top: 22px; }
  /* the key goes to the top of the map, clear of the sheet, and says less */
  .legend { top: var(--gap); bottom: auto; max-width: calc(100% - 34px - var(--gap) * 3); gap: 2px 6px; padding-right: 8px; }
  .legend .band i { width: 13px; }
  .legend .band.none, .legendnote { display: none; }
  .credit { right: auto; left: var(--gap); bottom: calc(min(var(--sheet), 62%) + 4px); }
  .pincard { top: auto; left: var(--gap); right: var(--gap); bottom: calc(var(--peek) + var(--gap)); width: auto; max-height: calc(100% - var(--peek) - 110px); overflow-y: auto; }
  .pincard::after { display: none; }
  .maptag { max-width: 104px; padding: 2px 6px; font-size: 12px; }
  .placechip { display: block; }   /* beside the name it shows however low the sheet is */
  .panel[data-sheet="peek"] .crumbs { display: none; }
}

/* --- a short window, as on most laptops: everything sits closer, so more of the figures fit -- */
@media (min-width: 761px) and (max-height: 720px) {
  .panelscroll { padding-top: 20px; }
  .pane > * + * { margin-top: 18px; }
  .hero > * + * { margin-top: 8px; }
  .rowname, .cell, .heat tfoot th { padding-top: 7px; padding-bottom: 7px; }
  .bigfig { font-size: 30px; }
  .askform { gap: 10px; }
  .field.big input { height: 44px; font-size: 20px; }
  .verdict { padding-top: 16px; }
}
