/* Real Realty listings report. Brand CI from real.co.za: Montserrat, navy #142c44, teal #4faba7. */
:root {
  --navy: #142c44;
  --navy-deep: #0e1f30;
  --teal: #4faba7;
  --teal-ink: #2b7a76;
  --teal-tint: #e6f3f2;
  --navy-tint: #e8edf3;
  --ink: #39424c;
  --muted: #5f6873;
  --line: #e1e6eb;
  --bg: #f5f5f7;
  --card: #ffffff;
  --radius: 12px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-ink); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }
.print-only { display: none; }

/* ---------- masthead ---------- */
.masthead { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.masthead .mark-bg { position: absolute; right: -150px; top: -30px; width: 360px; opacity: .07; pointer-events: none; }
.masthead .wrap { position: relative; padding-top: 22px; padding-bottom: 30px; }
.logo { height: 40px; width: auto; }
.eyebrow { margin: 34px 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); }
.masthead h1 { margin: 0; font-size: 31px; line-height: 1.12; font-weight: 800; letter-spacing: -.01em; max-width: 16ch; }
.asof { margin: 14px 0 0; display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: rgba(255,255,255,.86); }
.asof .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(79,171,167,.22); flex: none; }
.jump { margin: 24px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.jump a { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28); color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; }
.jump a:hover { background: rgba(255,255,255,.08); }

/* ---------- sections ---------- */
.section { padding: 36px 0 8px; }
.preheading { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
h2 { margin: 0 0 6px; color: var(--navy); font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.005em; }
h3 { margin: 0 0 12px; color: var(--navy); font-size: 16px; font-weight: 700; }
.lede { margin: 0 0 20px; max-width: 64ch; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 13px; min-width: 0; }
.kpi-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi-value { margin-top: 4px; font-size: 25px; line-height: 1.15; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-sub { margin-top: 4px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.kpi-value .sm, .kpi-sub .sm-inline { display: none; }
.kpi.accent { background: var(--navy); border-color: var(--navy); }
.kpi.accent .kpi-label { color: rgba(255,255,255,.72); }
.kpi.accent .kpi-value { color: #fff; }
.kpi.accent .kpi-sub { color: rgba(255,255,255,.8); }

.grid2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px; font-size: 14px; }
.bars .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .val { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.bars .val small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.bars .bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: #edf1f4; overflow: hidden; }
.bars .bar span { display: block; height: 100%; border-radius: 4px; background: var(--teal); }
.bars li.other .bar span { background: #b9c3cc; }

.split { margin: 4px 0 16px; }
.split-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #edf1f4; }
.split-bar span { display: block; height: 100%; }
.split-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.split-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.suburbs { list-style: none; margin: 0; padding: 0; columns: 1; column-gap: 28px; font-size: 14px; }
.suburbs li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.suburbs li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suburbs small { color: var(--muted); }
.suburbs b { color: var(--navy); font-variant-numeric: tabular-nums; }

.suburbs-card { margin-top: 12px; }
.insights-block { margin: 26px 0 26px; }
.summary-lower { margin-top: 30px; display: grid; gap: 30px; }
.summary-lower h3 { font-size: 19px; margin-bottom: 6px; }
.small-lede { margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.insights-block h3 { margin-bottom: 14px; }
.insights { list-style: none; margin: 0; padding: 0; counter-reset: ins; display: grid; gap: 10px; }
.insights li { counter-increment: ins; position: relative; padding: 14px 14px 14px 52px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-size: 14.5px; }
.insights li::before { content: counter(ins); position: absolute; left: 14px; top: 13px; width: 26px; height: 26px; border-radius: 50%; background: var(--teal-tint); color: var(--teal-ink); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.insights b { color: var(--navy); }

/* newest cards */
.newest { display: grid; grid-template-columns: 1fr; gap: 12px; }
.lcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.lcard:hover { border-color: #c9d2da; }
.lcard .ph { aspect-ratio: 4 / 3; background: #dfe5ea; position: relative; }
.lcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.lcard .ph .tag { position: absolute; left: 10px; top: 10px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 5px 9px; border-radius: 6px; }
.lcard .body { padding: 13px 14px 14px; display: grid; gap: 4px; }
.lcard .price { font-size: 18px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.lcard .what { font-size: 14px; font-weight: 600; color: var(--ink); }
.lcard .meta { font-size: 12.5px; color: var(--muted); }

/* status pills */
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill.sale { background: var(--teal-tint); color: var(--teal-ink); }
.pill.offer { background: var(--navy-tint); color: var(--navy); }
.pill.let { background: #f1eee8; color: #6a5a3c; }

/* ---------- top agents ---------- */
.measure { margin: 0 0 16px; padding: 12px 14px; background: var(--teal-tint); border-radius: 10px; font-size: 13.5px; color: #24514f; }
.measure b { color: #183f3d; }
.agents { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.agents th { text-align: right; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.agents th.l, .agents td.l { text-align: left; }
.agents td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.agents tr:last-child td { border-bottom: 0; }
.agents .rank { width: 44px; font-weight: 800; color: var(--navy); text-align: left; }
.agents .who { display: flex; align-items: center; gap: 12px; }
.agents .who img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; background: #dfe5ea; flex: none; }
.agents .who a { color: var(--navy); font-weight: 700; text-decoration: none; }
.agents .who a:hover { text-decoration: underline; }
.agents .main { font-weight: 800; color: var(--navy); font-size: 16px; white-space: nowrap; }
.agents .main .sm, .agents .m-unit { display: none; }
.agents .m-break { display: none; }
.subhead { margin: 40px 0 10px; font-size: 21px; font-weight: 800; }
.tienote { margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); }

/* ---------- all listings ---------- */
.controls { display: grid; gap: 12px; margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 13px; font-weight: 600; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .n { font-weight: 500; opacity: .75; margin-left: 4px; }
.search { width: 100%; font: inherit; font-size: 15px; padding: 11px 14px; border: 1px solid #cdd5dc; border-radius: 10px; background: #fff; color: var(--ink); }
.countline { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.listings { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13.5px; }
.listings th { position: sticky; top: 0; z-index: 1; background: #fafbfc; text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.listings th:first-child { border-top-left-radius: var(--radius); }
.listings th:last-child { border-top-right-radius: var(--radius); }
.listings td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.listings tbody tr:last-child td { border-bottom: 0; }
.listings td.price, .listings th.price, .listings td.beds, .listings th.beds { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.listings td.price { font-weight: 700; color: var(--navy); }
.listings td.ref a { font-weight: 600; font-variant-numeric: tabular-nums; }
.listings td.area small { display: block; color: var(--muted); font-size: 12px; }
.listings td.listed { white-space: nowrap; color: var(--muted); }
.listings .m-sum, .listings .m-meta { display: none; }
.listings tr[hidden] { display: none; }
.showall { display: none; margin: 14px auto 0; font: inherit; font-size: 14px; font-weight: 700; padding: 12px 18px; border-radius: 10px; border: 0; background: var(--teal); color: #08302e; cursor: pointer; }
.noresults { display: none; padding: 18px; text-align: center; color: var(--muted); }

/* ---------- footer ---------- */
.foot { margin-top: 44px; background: var(--navy-deep); color: rgba(255,255,255,.8); font-size: 13px; }
.foot .wrap { padding-top: 26px; padding-bottom: 30px; display: grid; gap: 12px; }
.foot img { height: 30px; width: auto; }
.foot p { margin: 0; max-width: 78ch; }
.foot .by { color: rgba(255,255,255,.6); font-size: 12px; }
.foot a { color: #9fd6d3; }

/* ---------- phone layouts ---------- */
@media screen and (max-width: 719px) {
  .kpi-value .lg { display: none; }
  .kpi-value .sm, .kpi-sub .sm-inline { display: inline; }
}
@media screen and (max-width: 559px) {
  .lcard { flex-direction: row; }
  .lcard .ph { width: 112px; flex: none; aspect-ratio: auto; min-height: 100px; }
  .lcard .ph img { position: absolute; inset: 0; }
  .lcard .ph .tag { display: none; }
  .lcard .body { padding: 10px 12px; align-content: center; gap: 2px; }
  .lcard .price { font-size: 16px; }
  .lcard .what { font-size: 13.5px; }
  .lcard .meta { font-size: 12px; }
}
@media screen and (max-width: 759px) {
  .agents thead { display: none; }
  .agents, .agents tbody, .agents tr { display: block; }
  .agents tr { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .agents tr:last-child { border-bottom: 0; }
  .agents td { border: 0; padding: 0; }
  .agents td.rank { grid-row: 1 / span 2; width: auto; font-size: 17px; }
  .agents td.l:not(.rank) { grid-column: 2; }
  .agents td.main { grid-column: 3; grid-row: 1; font-size: 18px; }
  .agents td.main .lg { display: none; }
  .agents td.main .sm { display: inline; }
  .agents td.main .m-unit { display: inline; font-size: 12px; font-weight: 600; color: var(--muted); }
  .agents td.d-only { display: none; }
  .agents .m-break { display: block; grid-column: 2 / -1; text-align: left; font-size: 12.5px; color: var(--muted); padding-left: 56px; }
  .agents .who img { width: 46px; height: 46px; }

  .listings thead { display: none; }
  .listings, .listings tbody { display: block; border: 0; background: none; }
  .listings tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
  .listings td { border: 0; padding: 0; }
  .listings td.ref, .listings td.area, .listings td.type, .listings td.beds, .listings td.agent, .listings td.listed { display: none; }
  .listings td.price { grid-column: 1; grid-row: 1; text-align: left; font-size: 16px; }
  .listings td.status { grid-column: 2; grid-row: 1; justify-self: end; }
  .listings .m-sum { display: block; grid-column: 1 / -1; font-size: 14px; font-weight: 600; color: var(--ink); }
  .listings .m-meta { display: block; grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
  .listings tr.is-extra { display: none; }
  .js .showall { display: block; }
  .js .showall[hidden] { display: none; }
}

@media (min-width: 560px) {
  .newest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .suburbs { columns: 2; }
}
@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 16px 18px; }
  .kpi-value { font-size: 30px; }
}
@media (min-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 28px; }
  .masthead .wrap { padding-top: 28px; padding-bottom: 44px; }
  .masthead .mark-bg { right: -40px; top: -60px; width: 520px; }
  .logo { height: 48px; }
  .eyebrow { margin-top: 56px; }
  .masthead h1 { font-size: 50px; max-width: 18ch; }
  .asof { font-size: 16px; }
  h2 { font-size: 30px; }
  .section { padding-top: 52px; }
  .controls { grid-template-columns: 1fr minmax(240px, 320px); align-items: center; }
}
@media (min-width: 900px) {
  .grid2 { grid-template-columns: 1fr 1fr; gap: 16px; }
  .newest { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .insights { grid-template-columns: 1fr 1fr; }
  .insights li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- print (A4 PDF) ---------- */
@page {
  size: A4;
  margin: 13mm 12mm 15mm;
  @bottom-left { content: "Real Realty: your listings today"; font-family: Montserrat, Arial, sans-serif; font-size: 7.5pt; color: #5f6873; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font-family: Montserrat, Arial, sans-serif; font-size: 7.5pt; color: #5f6873; }
}
@page :first { margin: 0; @bottom-left { content: none; } @bottom-right { content: none; } }
@media print {
  html, body { background: #fff; font-size: 9pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .screen-only, .masthead, .jump, .controls, .countline, .showall, .noresults { display: none !important; }
  .print-only { display: block; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }

  .cover { display: flex; flex-direction: column; justify-content: space-between; width: 210mm; height: 297mm; background: var(--navy); color: #fff; padding: 22mm 20mm 20mm; position: relative; overflow: hidden; break-after: page; }
  .cover .mark-bg { position: absolute; right: -60mm; bottom: -30mm; width: 190mm; opacity: .07; }
  .cover .logo { height: 17mm; }
  .cover .eyebrow { margin: 0 0 5mm; font-size: 10pt; }
  .cover h1 { margin: 0; font-size: 40pt; line-height: 1.08; font-weight: 800; max-width: 14ch; }
  .cover .asof { margin-top: 7mm; font-size: 13pt; color: rgba(255,255,255,.88); }
  .cover .stats { display: flex; gap: 10mm; margin-top: 14mm; }
  .cover .stats div { border-top: 2px solid var(--teal); padding-top: 3mm; }
  .cover .stats b { display: block; font-size: 22pt; font-weight: 800; }
  .cover .stats span { font-size: 9pt; color: rgba(255,255,255,.78); }
  .cover .contents { font-size: 9.5pt; color: rgba(255,255,255,.75); }

  .section { padding: 0; }
  #summary { break-after: page; }
  #agents { break-after: page; }
  h2 { font-size: 17pt; margin-bottom: 1mm; }
  .preheading { font-size: 7.5pt; margin-bottom: 1mm; }
  .lede { font-size: 8.8pt; margin-bottom: 3mm; }
  h3 { font-size: 10pt; margin-bottom: 2.2mm; }
  .card { padding: 3.2mm 3.8mm; border-radius: 3mm; }
  .kpis { grid-template-columns: repeat(3, 1fr); gap: 2.2mm; margin: 2.4mm 0 3mm; }
  .kpi { padding: 2.1mm 3mm; border-radius: 3mm; }
  .kpi-label { font-size: 6.6pt; }
  .kpi-value { font-size: 15pt; margin-top: .6mm; }
  .kpi-sub { font-size: 7.3pt; margin-top: .4mm; }
  .grid2 { grid-template-columns: 1fr 1fr; gap: 2.6mm; }
  .bars { gap: 1.25mm; }
  .bars li { font-size: 7.8pt; grid-template-columns: 27mm minmax(0, 1fr) 15mm; align-items: center; column-gap: 2.2mm; row-gap: 0; }
  .bars .label { grid-column: 1; grid-row: 1; }
  .bars .bar { grid-column: 2; grid-row: 1; height: 1.9mm; }
  .bars .val { grid-column: 3; grid-row: 1; text-align: right; }
  .bars .val small { font-size: 6.6pt; }
  .split { margin: 0 0 2.2mm; }
  .split-bar { height: 2.4mm; }
  .split-legend { font-size: 7.5pt; margin-top: 1.5mm; }
  .insights-block { margin: 0 0 2.6mm; }
  .summary-lower { display: block; margin-top: 3mm; }
  .suburbs-card { display: none; }
  .small-lede { font-size: 7.8pt; margin-bottom: 1.6mm; }
  .newest-block h3, .insights-block h3, .summary-lower h3 { margin-top: 0; margin-bottom: 1.6mm; font-size: 10pt; }
  .newest { grid-template-columns: repeat(3, 1fr); gap: 1.6mm 2.2mm; }
  .lcard { flex-direction: row; border-radius: 2.4mm; }
  .lcard .ph { width: 17mm; flex: none; aspect-ratio: auto; min-height: 15mm; }
  .lcard .ph img { position: absolute; inset: 0; }
  .lcard .ph .tag { display: none; }
  .lcard .body { padding: 1.2mm 2mm; gap: 0; align-content: center; }
  .lcard .price { font-size: 8pt; }
  .lcard .what { font-size: 6.8pt; line-height: 1.3; }
  .lcard .meta { font-size: 6.3pt; line-height: 1.3; }
  .insights { grid-template-columns: 1fr 1fr; gap: 1.6mm 2.6mm; }
  .insights li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .insights li { font-size: 7.9pt; padding: 2.2mm 2.6mm 2.2mm 9.6mm; border-radius: 2.4mm; line-height: 1.4; }
  .insights li::before { left: 2.4mm; top: 2.1mm; width: 5mm; height: 5mm; font-size: 7pt; }

  .measure { font-size: 8.4pt; padding: 3mm 3.6mm; margin-bottom: 4mm; }
  .agents { font-size: 9pt; border-radius: 3mm; }
  .agents th { font-size: 6.8pt; padding: 2.6mm 3mm; }
  .agents .main { font-size: 10.5pt; }
  .agents td { padding: 1.15mm 3mm; }
  .agents th { white-space: nowrap; padding: 2mm 3mm; }
  .agents .who { gap: 2.6mm; }
  .agents .who a { white-space: nowrap; }
  .agents .who img { width: 7.6mm; height: 7.6mm; }
  .subhead, #rental-agents { break-inside: avoid; break-after: avoid; }
  #rental-agents { break-after: auto; }
  .subhead { margin: 7mm 0 2mm; font-size: 13pt; }
  #agents .measure { margin-bottom: 3mm; }
  .tienote { font-size: 7.8pt; }

  .listings-head h2 { font-size: 15pt; }
  .listings { font-size: 7.2pt; border-radius: 0; border: 0; }
  .listings thead { display: table-header-group; }
  .listings th { position: static; font-size: 6.2pt; padding: 1.5mm 1.6mm; border-bottom: 1px solid #c9d1d8; border-radius: 0 !important; }
  .listings td { padding: .9mm 1.5mm; line-height: 1.25; }
  .listings td.area small { font-size: 6.6pt; display: inline; }
  .listings td.area small::before { content: ", "; }
  .listings tr { break-inside: avoid; }
  .listings tr.is-extra { display: table-row !important; }
  .pill { font-size: 6.4pt; padding: .5mm 1.8mm; }
  .foot { margin-top: 6mm; background: none; color: var(--muted); font-size: 7.5pt; }
  .foot .wrap { padding: 0; gap: 1.5mm; }
  .foot img { display: none; }
  .foot .by { color: var(--muted); font-size: 7.5pt; }
  .foot a { color: var(--muted); }
}
