/* =========================================================
   Property Report – loaded only on /property-report/
   Reuses the tokens from main.css (:root). Mobile-first:
   everything stacks at 360 px and spreads out on wider screens.
   ========================================================= */

/* ---------- Search form ---------- */
.rp-form {
  display: grid; gap: 14px; margin-top: 24px; max-width: 760px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
}
.rp-form-row { display: grid; gap: 14px; }
@media (min-width: 640px) {
  .rp-form-row { grid-template-columns: 1fr 1.4fr auto; align-items: end; }
}
.rp-field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.rp-field .rp-hint { display: block; font-weight: 400; color: var(--text-muted); font-size: .85rem; }
.rp-field input {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
}
.rp-field input:focus-visible { outline: 3px solid var(--green); outline-offset: 1px; border-color: var(--green-700); }
.rp-field input[aria-invalid="true"] { border-color: #b91c1c; }
.rp-form .btn { min-height: 48px; }
.rp-error { color: #b91c1c; font-weight: 600; font-size: .95rem; margin: 0; }
.rp-error:empty { display: none; }

/* ---------- Layout ---------- */
.rp-report { display: grid; gap: 20px; padding-block: 28px 8px; }
.rp-report:empty { display: none; }
.rp-report:focus { outline: none; }
.rp-grid-2 { display: grid; gap: 20px; }
@media (min-width: 900px) { .rp-grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Cards ---------- */
.rp-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px; min-width: 0;
}
@media (min-width: 640px) { .rp-card { padding: 24px 26px; } }
.rp-card > h2 { font-size: clamp(1.25rem, 2.2vw, 1.5rem); margin-bottom: .6em; }
.rp-card h3 { font-size: 1.05rem; margin: 1.2em 0 .5em; }
.rp-card p:last-child { margin-bottom: 0; }
.rp-muted { color: var(--text-muted); }
.rp-small { font-size: .9rem; }
.rp-note { font-size: .9rem; color: var(--text-muted); border-left: 3px solid var(--border-strong); padding-left: 12px; margin-top: 1em; }
.rp-source {
  margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: .82rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 14px;
}
.rp-source a { color: var(--text-muted); }
.rp-status { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg); border: 1px dashed var(--border-strong); }
.rp-status p { margin: 0; }
.rp-status-icon { flex: none; width: 22px; height: 22px; color: var(--text-muted); }

/* ---------- Header ---------- */
.rp-header { display: grid; gap: 20px; }
@media (min-width: 900px) { .rp-header { grid-template-columns: 1.1fr 1fr; align-items: stretch; } }
.rp-address { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: .25em; }
.rp-postcode { font-family: var(--font-mono); font-size: 1rem; color: var(--green-700); letter-spacing: .04em; margin: 0 0 12px; }
.rp-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 12px; font-size: .95rem; }
.rp-meta dt { color: var(--text-muted); }
.rp-meta dd { margin: 0; font-weight: 500; }
.rp-map { min-height: 240px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); z-index: 0; }
.rp-banner { background: var(--green-50); border: 1px solid #a7f3d0; color: #065f46; padding: 12px 16px; border-radius: var(--radius-sm); font-size: .95rem; margin: 0; }
.rp-banner--warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }

/* "Which property did you mean?" picker */
.rp-picker ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 640px) { .rp-picker ul { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
.rp-picker a {
  display: block; padding: 12px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--navy); font-weight: 500; background: var(--surface);
}
.rp-picker a:hover, .rp-picker a:focus-visible { border-color: var(--green-700); color: var(--green-700); }

/* ---------- At a glance ---------- */
.rp-glance { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .rp-glance { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .rp-glance { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.rp-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; border-top: 4px solid var(--green); }
.rp-tile a { text-decoration: none; color: inherit; display: block; }
.rp-tile-label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); display: block; }
.rp-tile-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; display: block; margin-top: 4px; overflow-wrap: anywhere; }
.rp-tile-sub { font-size: .85rem; color: var(--text-muted); display: block; margin-top: 2px; }
.rp-tile--na .rp-tile-value { font-size: 1rem; color: var(--text-muted); font-weight: 500; }

/* ---------- Big figures ---------- */
.rp-figures { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 16px; }
.rp-figure { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; }
.rp-figure dt { font-size: .85rem; color: var(--text-muted); }
.rp-figure dd { margin: 2px 0 0; font-size: 1.3rem; font-weight: 700; font-family: var(--font-mono); letter-spacing: -.02em; }
.rp-up { color: var(--green-700); }
.rp-down { color: #b91c1c; }

/* ---------- Tables ---------- */
.rp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 8px; }
.rp-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rp-table th, .rp-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.rp-table th { font-weight: 600; background: var(--bg); white-space: nowrap; }
.rp-table td.num, .rp-table th.num { text-align: right; font-family: var(--font-mono); font-size: .88rem; white-space: nowrap; }
.rp-tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border-strong); color: var(--text-muted); margin-left: 4px; white-space: nowrap; }

details.rp-details { margin-top: 10px; }
details.rp-details > summary { cursor: pointer; color: var(--green-700); font-weight: 600; font-size: .92rem; padding: 6px 0; }
details.rp-details[open] > summary { margin-bottom: 8px; }

/* ---------- Charts ---------- */
.rp-chart { position: relative; height: 240px; margin: 8px 0; }
@media (min-width: 640px) { .rp-chart { height: 280px; } }
.rp-chart--tall { height: 320px; }

/* ---------- EPC rating bars ---------- */
.rp-epc { display: grid; gap: 16px; }
@media (min-width: 640px) { .rp-epc { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }
.rp-epc-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-width: 420px; }
.rp-epc-bar { display: grid; grid-template-columns: 1fr 64px 64px; align-items: center; gap: 6px; font-size: .9rem; }
.rp-epc-bar span:first-child { padding: 3px 10px; font-weight: 700; color: #0b1a2e; border-radius: 3px 0 0 3px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); }
.rp-epc-mark { font-family: var(--font-mono); font-weight: 700; text-align: center; border-radius: 4px; padding: 2px 0; }
.rp-epc-mark:empty { visibility: hidden; }
.rp-epc-head { display: grid; grid-template-columns: 1fr 64px 64px; gap: 6px; font-size: .75rem; color: var(--text-muted); text-align: center; max-width: 420px; }
.rp-epc-head span:first-child { text-align: left; }

/* ---------- Flood ---------- */
.rp-zone { display: inline-flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 700; padding: 8px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.rp-zone--1 { background: var(--green-50); color: #065f46; }
.rp-zone--2 { background: #fffbeb; color: #78350f; }
.rp-zone--3 { background: #fef2f2; color: #991b1b; }

/* ---------- Constraints list ---------- */
.rp-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rp-checks li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.rp-checks .rp-check-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.rp-check--yes .rp-check-icon { background: #fef3c7; color: #78350f; }
.rp-check--no .rp-check-icon { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border-strong); }
.rp-checks strong { display: block; }
.rp-checks p { margin: 2px 0 0; font-size: .92rem; color: var(--text-muted); }

/* ---------- Deprivation scale ---------- */
.rp-scale { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.rp-scale li { height: 30px; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center; font-family: var(--font-mono); font-size: .8rem; color: var(--text-muted); }
.rp-scale li.is-current { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }
.rp-scale-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-muted); }
.rp-domains { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.rp-domain { display: grid; grid-template-columns: minmax(0, 1fr) 120px 26px; gap: 10px; align-items: center; font-size: .92rem; }
.rp-domain-bar { height: 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.rp-domain-bar span { display: block; height: 100%; background: var(--blue-700); }
.rp-domain b { font-family: var(--font-mono); text-align: right; }

/* ---------- Schools ---------- */
.rp-schools { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rp-school { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.rp-school strong { display: block; }
.rp-school span { font-size: .88rem; color: var(--text-muted); }
.rp-school-links { display: flex; gap: 14px; font-size: .88rem; margin-top: 4px; }
.rp-school .rp-ofsted { display: block; margin-top: 4px; color: var(--text); }
.rp-school .rp-ofsted b { font-weight: 600; }
.rp-school .rp-ofsted-warn { color: var(--text); font-weight: 600; }
.rp-school details { margin-top: 2px; }
.rp-school details > summary { cursor: pointer; color: var(--green-700); font-size: .85rem; font-weight: 600; padding: 2px 0; }
.rp-school details ul { margin: 4px 0 0; padding-left: 18px; font-size: .85rem; }

/* ---------- Checklist, links, partners ---------- */
.rp-checklist { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.rp-checklist li::marker { color: var(--green-700); }
.rp-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 720px) { .rp-links { grid-template-columns: 1fr 1fr; } }
.rp-links a { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; }
.rp-links a strong { display: block; color: var(--navy); }
.rp-links a span { font-size: .88rem; color: var(--text-muted); }
.rp-links a:hover { border-color: var(--green-700); }
.rp-partners { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rp-partner { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; position: relative; }
.rp-partner-label { position: absolute; top: 10px; right: 10px; font-size: .7rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }

.rp-attribution ul { margin: 0; padding-left: 1.1em; font-size: .9rem; color: var(--text-muted); display: grid; gap: 6px; }
.rp-disclaimer { font-size: .9rem; color: var(--text-muted); }

/* ---------- Skeleton loaders ---------- */
.rp-skel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.rp-skel-line { height: 14px; border-radius: 6px; margin-bottom: 12px; background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%); background-size: 400% 100%; animation: rp-shimmer 1.4s ease infinite; }
.rp-skel-line--title { height: 22px; width: 45%; }
.rp-skel-line--short { width: 60%; }
.rp-skel-block { height: 160px; border-radius: var(--radius-sm); }
@keyframes rp-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .rp-skel-line { animation: none; } }

/* ---------- Intro copy below the form ---------- */
.rp-intro { padding-block: 32px 0; }
.rp-intro .prose { max-width: 72ch; }
.rp-covers { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rp-covers li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .95rem; }
.rp-covers strong { display: block; }

@media print {
  .site-header, .site-footer, .rp-form, .consent, .rp-intro, .rp-partners-card { display: none !important; }
  .rp-card { box-shadow: none; break-inside: avoid; }
}
