:root {
  --cream: #f3ebdd;
  --paper: #fff9f1;
  --maroon: #7a0019;
  --maroon-deep: #4e0010;
  --ink: #2a1216;
  --muted: #7a4548;
  --line: #e2cdb8;
  --ok: #1c5c3a;
  --warn: #8a4b12;
  --shadow: 0 10px 30px rgba(80, 20, 24, 0.06);
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
}
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
a { color: var(--maroon); }
a:hover { color: var(--maroon-deep); }
h1, h2, h3, .mark { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05; margin: 0 0 0.4em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.15; margin: 0 0 0.4em; }
h3 { font-size: 1.25rem; margin: 0 0 0.35em; }
p { margin: 0 0 0.8em; }
p, td, li, a, h1, h2, h3, label, figcaption { overflow-wrap: anywhere; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0; padding: 12px; min-inline-size: 0; max-width: 100%; }
legend { font-weight: 650; padding: 0 6px; }
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.lede { font-size: 1.08rem; max-width: 42rem; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: white; z-index: 9; padding: 8px; }
.site-header { background: var(--cream); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; isolation: isolate; }
.site-header::before, .site-footer::before, .hero-motif::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/img/contours.svg");
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}
.site-header::before { opacity: 0.2; background-size: 620px auto; background-position: right -40px top -250px; }
.site-footer::before { opacity: 0.18; background-size: 760px auto; background-position: left -80px bottom -360px; }
.hero-motif { position: relative; isolation: isolate; padding-bottom: 8px; }
.hero-motif::before { opacity: 0.26; background-size: min(980px, 150%) auto; background-position: center -30px; }
.site-header > *, .site-footer > *, .hero-motif > * { position: relative; z-index: 1; }
.brand-bar { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 14px 0 8px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--maroon); min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.mark { display: block; font-family: var(--mono); font-size: 0.84rem; letter-spacing: 0.12em; font-weight: 650; }
.tag { display: block; margin-top: 2px; font-size: 0.92rem; }
.coords { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink); letter-spacing: 0.02em; }
.waypoints { list-style: none; padding: 0; margin: 12px 0 16px; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.waypoints li { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.wpt-dot { width: 9px; height: 9px; margin-top: 0.35rem; border-radius: 50%; background: var(--maroon); box-shadow: 0 0 0 3px rgba(122, 0, 25, 0.12); flex: none; }
.wpt-name { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--maroon); }
.wpt-coord { display: block; font-family: var(--mono); font-size: 0.75rem; color: var(--ink); }
.nav-toggle {
  display: none;
  margin: 0 16px 10px;
  background: transparent;
  color: var(--maroon);
  border: 1px solid var(--maroon);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
}
.site-nav { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.site-nav a { text-decoration: none; color: var(--ink); font-size: 0.95rem; }
.site-nav a[aria-current="page"] { color: var(--maroon); text-decoration: underline; text-underline-offset: 4px; }
.nav-cta { background: var(--maroon); color: var(--cream) !important; border-radius: 999px; padding: 6px 12px; }

.page { padding: 28px 0 64px; }
.section { margin: 0 0 28px; }
.card, .callout, .listing-card, .empty, .confirm, .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.callout { border-left: 6px solid var(--maroon); }
.callout.warn { border-left-color: var(--warn); }
.kicker { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.muted { color: var(--muted); }
.fine { font-size: 0.92rem; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: grid; gap: 12px; }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 9.5rem) 1fr auto; gap: 8px; align-items: center; }
.bar-label { font-size: 0.92rem; }
.bar-track { background: #efe2d2; border-radius: 999px; height: 14px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--maroon); border-radius: 999px; }
.bar-fill.fast { background: #a33b22; }
.w-145 { width: 90.6%; }
.w-69 { width: 43.1%; }
.w-82 { width: 51.3%; }
.w-92 { width: 57.5%; }
.bar-value { font-variant-numeric: tabular-nums; font-size: 0.92rem; white-space: nowrap; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.step-no { width: 2rem; height: 2rem; border-radius: 50%; background: var(--maroon); color: var(--cream); display: grid; place-items: center; font-family: var(--mono); }
.steps h3 { margin-bottom: 0.2em; }

.switch { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.switch label { border: 1px solid var(--maroon); color: var(--maroon); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.switch input {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.band-switch .panel, .guide-switch .guide, .people-switch .part { display: none; }
.band-switch:has(#b-under:checked) .panel-under,
.band-switch:has(#b-mid:checked) .panel-mid,
.band-switch:has(#b-upper:checked) .panel-upper,
.band-switch:has(#b-lux:checked) .panel-lux,
.guide-switch:has(#g-buyer:checked) .guide-buyer,
.guide-switch:has(#g-seller:checked) .guide-seller,
.people-switch:has(#p-wards:checked) .part-wards,
.people-switch:has(#p-dist:checked) .part-dist,
.people-switch:has(#p-schools:checked) .part-schools { display: block; }
.switch input:focus-visible + label, .switch label:hover { background: var(--maroon); color: var(--cream); }
.switch input:checked + label { background: var(--maroon); color: var(--cream); }

table { width: 100%; border-collapse: collapse; background: var(--paper); }
th, td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.table-wrap { overflow: visible; }

.chart { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 0.88rem; margin-top: 8px; }
.swatch { width: 12px; height: 12px; display: inline-block; border-radius: 3px; margin-right: 6px; }
.swatch-under { background: #7A0019; }
.swatch-mid { background: #C46B2C; }
.swatch-upper { background: #8C4A4A; }
.swatch-lux { background: #2F5D50; }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--maroon);
  background: transparent; color: var(--maroon); font: inherit; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--maroon); color: var(--cream); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

label { display: block; font-weight: 650; margin: 0 0 4px; }
input, select, textarea {
  width: 100%; max-width: 100%; font: inherit; color: inherit;
  background: white; border: 1px solid #c9b39a; border-radius: 12px; padding: 12px;
}
textarea { min-height: 140px; resize: vertical; }
.fields { display: grid; gap: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; }
.days { display: flex; flex-wrap: wrap; gap: 8px; }
.days label { font-weight: 550; border: 1px solid var(--line); border-radius: 999px; padding: 8px 10px; background: white; }
.field-error, .form-banner { color: var(--maroon-deep); font-size: 0.92rem; margin: 4px 0 0; }
.form-banner { background: #f8e4e2; border-radius: 12px; padding: 10px 12px; }
.privacy-note { font-size: 0.92rem; color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.listing-card h3 { margin-bottom: 0.15em; }
.price { font-family: var(--serif); font-size: 1.6rem; color: var(--maroon); margin: 0; }
.confirm h2 { color: var(--ok); }
.map-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; align-items: start; }
.zone { stroke: #4e0010; stroke-width: 1.2; cursor: pointer; }
.zone.is-selected { stroke-width: 3.5; }
.map-frame { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 8px; }
.map-frame svg { width: 100%; height: auto; }
.site-footer { position: relative; isolation: isolate; border-top: 1px solid var(--line); padding: 22px 0 36px; background: var(--cream); }
.site-footer .waypoints, .site-footer p { margin-left: auto; margin-right: auto; width: min(1080px, calc(100% - 32px)); }
.site-footer p { margin-bottom: 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.foot-links a { color: var(--muted); }
.src a { overflow-wrap: anywhere; }

.sign-row { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 18px; align-items: center; }
.sign-art { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
.sign-finder { display: grid; gap: 12px; }
.sign-question { font-family: var(--serif); font-size: clamp(1.55rem, 4vw, 2.15rem); font-weight: 600; line-height: 1.15; }
.sign-address { font-size: 1.35rem; min-height: 3.4rem; }
.sign-suggest { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.suggest-hit { width: 100%; text-align: left; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: white; color: var(--ink); font: inherit; padding: 10px 12px; cursor: pointer; }
.sign-empty { margin: 0; }
.sign-other { font-weight: 650; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.a3-sheet {
  background: white; color: #7a0019; border: 8px solid #7a0019; border-radius: 4px;
  padding: 18px; display: grid; gap: 12px;
}
.a3-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.a3-brand { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.a3-title { font-family: var(--serif); font-weight: 800; font-size: clamp(2.4rem, 8vw, 5.4rem); line-height: 0.88; letter-spacing: -0.03em; margin: 0; text-align: center; }
.a3-call { text-align: center; letter-spacing: 0.18em; font-weight: 800; margin: 0; }
.a3-box { border: 3px solid #7a0019; min-height: 120px; border-radius: 2px; }
.a3-foot { text-align: center; font-size: 0.82rem; margin: 0; }
.qr-caption { font-size: 0.75rem; text-align: center; max-width: 92px; }

@media (max-width: 800px) {
  .grid-2, .grid-3, .map-layout, .two, .sign-row, .filter-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; padding-bottom: 12px; }
  .site-nav.open { display: flex; flex-direction: column; align-items: flex-start; }
  .bar-row { grid-template-columns: 1fr; }
  .coords, .waypoint.minor, .waypoints .minor { display: none; }
  .mark { letter-spacing: 0.06em; font-size: 0.78rem; }
  .site-header::before, .site-footer::before { opacity: 0.12; background-size: 460px auto; }
  .hero-motif::before { opacity: 0.18; }
}

@media (max-width: 700px) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 12px; background: var(--paper); }
  table.stack td { border: 0; padding: 8px 12px; }
  table.stack td::before { content: attr(data-label); display: block; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
}

@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: white; }
  .a3-print { break-inside: avoid; }
}
