:root {
  color-scheme: light;
  --ink: #17231f;
  --muted: #64706a;
  --paper: #f4f0e8;
  --paper-deep: #ebe4d8;
  --card: #fffdf8;
  --line: #d9d2c6;
  --green: #175a4b;
  --green-deep: #0d4136;
  --coral: #d96f51;
  --gold: #c29a48;
  --blue: #467a87;
  --shadow: 0 20px 55px rgba(33, 48, 41, 0.09);
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 35, 31, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 35, 31, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

button,
input,
select,
summary {
  font: inherit;
}

button,
select,
summary {
  cursor: pointer;
}

a {
  color: inherit;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 26px 0 54px;
  color: #f9f5ec;
  background:
    radial-gradient(circle at 86% 18%, rgba(217, 111, 81, 0.26), transparent 24rem),
    linear-gradient(128deg, var(--green-deep), #163d35 58%, #1c4c40);
}

.hero__content {
  position: relative;
  z-index: 1;
}

.brand-row,
.brand,
.footer .shell,
.section-heading,
.results-intro,
.pagination,
.legend {
  display: flex;
  align-items: center;
}

.brand-row,
.section-heading,
.results-intro,
.footer .shell {
  justify-content: space-between;
}

.brand {
  gap: 11px;
  color: inherit;
  font-size: 0.93rem;
  font-weight: 720;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
}

.data-status {
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
}

.data-status::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #e4b970;
  content: "";
}

.data-status.is-ready::before {
  background: #8bd3ae;
}

.data-status.is-error::before {
  background: #f09a82;
}

.hero__copy {
  max-width: 940px;
  padding: 54px 0 50px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 13px;
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #e9b19d;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.hero__note {
  margin: 0;
  max-width: 640px;
  color: #5d5d5d;
  font-size: 0.85rem;
  line-height: 1.5;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.metric {
  padding: 26px 22px 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.metric:first-child {
  padding-left: 0;
}

.metric:last-child {
  border-right: 0;
}

.metric dt {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric dd {
  margin: 8px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.main-content {
  padding: 62px 0 78px;
}

.panel {
  border: 1px solid rgba(87, 94, 87, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.filters-panel,
.chart-panel,
.table-panel {
  padding: clamp(22px, 4vw, 38px);
}

.section-heading {
  gap: 24px;
  margin-bottom: 26px;
}

.section-heading h2,
.results-intro h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.text-button {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: var(--green);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 750;
}

.filters {
  display: grid;
  grid-template-columns: 1.7fr repeat(4, 1fr);
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field--wide {
  grid-column: span 2;
}

.field > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.field > input,
.field > select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fffefa;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field > input:focus,
.field > select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 90, 75, 0.12);
}

.multi-select {
  position: relative;
}

.multi-select summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fffefa;
  list-style: none;
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select summary::after {
  color: var(--green);
  content: "⌄";
  font-size: 1rem;
}

.multi-select[open] summary,
.multi-select summary:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 90, 75, 0.12);
}

.multi-select[open] summary::after {
  transform: rotate(180deg);
}

.multi-select__options {
  position: absolute;
  z-index: 10;
  top: calc(100% + 7px);
  left: 0;
  display: grid;
  width: max(100%, 220px);
  max-height: 280px;
  gap: 2px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefa;
  box-shadow: 0 18px 38px rgba(33, 48, 41, 0.16);
}

.multi-select__options label {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  cursor: pointer;
}

.multi-select__options label:hover {
  background: #edf4f0;
}

.multi-select__options input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
  appearance: none;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
  cursor: pointer;
}

.multi-select__options input:checked {
  background: #111;
  box-shadow: inset 0 0 0 3px #fff;
}

.multi-select__options input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.multi-select__options span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
}

.results-intro {
  gap: 30px;
  padding: 64px 8px 26px;
}

.results-intro > p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.chart-panel {
  margin-bottom: 28px;
}

.section-heading--chart {
  align-items: flex-end;
}

.legend {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 18px;
  color: var(--muted);
  font-size: 0.72rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot--apartment { background: var(--green); }
.dot--house { background: var(--coral); }
.dot--land { background: var(--gold); }
.dot--other { background: var(--blue); }

.ring {
  width: 10px;
  height: 10px;
  border: 2px solid var(--coral);
  border-radius: 50%;
}

.chart-wrap {
  position: relative;
  min-height: 390px;
  padding: 12px 8px 0;
  border: 1px solid #e7e0d5;
  border-radius: 16px;
  background: #fffefa;
}

#scatter-chart {
  display: block;
  width: 100%;
  height: 390px;
}

.chart-note {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid #e7e0d5;
  border-radius: 16px;
}

table {
  width: 100%;
  min-width: 890px;
  border-collapse: collapse;
}

th,
td {
  padding: 17px 16px;
  border-bottom: 1px solid #eee8df;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #f8f4ed;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-weight: 760;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-button:hover,
.sort-button:focus-visible,
th[aria-sort="ascending"] .sort-button,
th[aria-sort="descending"] .sort-button {
  color: var(--green);
}

.sort-button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fbf7ef;
}

tbody tr.is-flagged {
  background: linear-gradient(90deg, rgba(217, 111, 81, 0.08), transparent 42%);
}

tbody tr.is-flagged:hover {
  background: linear-gradient(90deg, rgba(217, 111, 81, 0.13), #fbf7ef 62%);
}

.listing-link {
  display: block;
  max-width: 340px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 760;
  line-height: 1.35;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-link:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cell-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.7rem;
}

.price {
  color: var(--green-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.03rem;
  font-weight: 600;
  white-space: nowrap;
}

.type-pill {
  display: inline-block;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green-deep);
  background: #e5efe9;
  font-size: 0.63rem;
  font-weight: 760;
  text-transform: capitalize;
}

.quality-stack {
  display: flex;
  max-width: 190px;
  flex-wrap: wrap;
  gap: 5px;
}

.quality-pill {
  display: inline-block;
  padding: 4px 7px;
  border: 1px solid rgba(217, 111, 81, 0.28);
  border-radius: 999px;
  color: #a64831;
  background: #fff2ed;
  font-size: 0.61rem;
  font-weight: 760;
  white-space: nowrap;
}

.quality-pill--clean {
  border-color: #cbd9d1;
  color: var(--green);
  background: #edf4f0;
}

.page-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.pagination {
  justify-content: center;
  gap: 8px;
  padding-top: 24px;
}

.pagination button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fffefa;
}

.pagination button:hover:not(:disabled),
.pagination button.is-active {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.page-buttons {
  display: flex;
  gap: 6px;
}

.empty-state,
.error-state {
  padding: 42px 20px;
  text-align: center;
}

.empty-state span,
.error-state span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.error-state {
  margin-top: 30px;
  border: 1px solid rgba(217, 111, 81, 0.35);
  border-radius: var(--radius);
  background: #fff4ef;
}

.footer {
  padding: 28px 0;
  color: rgba(255, 255, 255, 0.68);
  background: var(--green-deep);
  font-size: 0.78rem;
}

.footer a {
  color: #fff;
  text-underline-offset: 4px;
}

@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(n + 3) {
    margin-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .metric:nth-child(3) {
    padding-left: 0;
  }

  .filters {
    grid-template-columns: repeat(2, 1fr);
  }

  .field--wide {
    grid-column: span 2;
  }

  .section-heading--chart {
    align-items: flex-start;
    flex-direction: column;
  }

  .legend {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    padding-top: 18px;
  }

  .brand-row {
    align-items: flex-start;
  }

  .data-status {
    max-width: 150px;
    text-align: center;
  }

  .hero__copy {
    padding: 46px 0 42px;
  }

  h1 {
    font-size: clamp(2.35rem, 12vw, 4rem);
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .metric {
    padding: 20px 12px 3px;
  }

  .metric dd {
    font-size: 1.55rem;
  }

  .main-content {
    padding-top: 32px;
  }

  .section-heading,
  .results-intro,
  .footer .shell {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: auto;
  }

  .results-intro {
    padding-top: 46px;
  }

  .results-intro > p {
    text-align: left;
  }

  .chart-wrap {
    min-height: 330px;
    padding-left: 0;
  }

  #scatter-chart {
    height: 330px;
  }

  .page-buttons button:nth-child(n + 4) {
    display: none;
  }

  .footer .shell {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

/* Interface técnica: funcional, densa e explícita. */
:root {
  --ink: #111;
  --muted: #5d5d5d;
  --paper: #fff;
  --paper-deep: #e7e7e5;
  --card: #fff;
  --line: #9b9b9b;
  --green: #086b56;
  --green-deep: #111;
  --coral: #e8422d;
  --gold: #ffc400;
  --blue: #1675d1;
  --shadow: none;
  --radius: 0;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  color: var(--ink);
  background: #e7e7e5;
  background-image: none;
}

.shell {
  width: min(1180px, calc(100% - 32px));
}

.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 0;
  padding: 0;
  overflow: visible;
  border: 1px solid #767676;
  border-bottom: 0;
  color: var(--ink);
  background: #fff;
}

.hero__content {
  width: 100%;
  padding: 16px 20px 0;
}

.brand-row {
  min-height: 38px;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dotted #777;
}

.brand {
  flex: 1;
  color: #111;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand__mark {
  display: grid;
  width: 42px;
  height: 24px;
  border: 1px solid #111;
  border-radius: 0;
  place-items: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.66rem;
  font-weight: 800;
}

.data-status {
  padding: 6px 9px;
  border: 1px solid #777;
  border-radius: 0;
  color: #333;
  background: #f5f5f5;
  font-size: 0.68rem;
}

.data-status::before {
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border: 1px solid #111;
  background: var(--gold);
}

.data-status.is-ready::before { background: #29a06f; }
.data-status.is-error::before { background: var(--coral); }

.hero__copy {
  display: grid;
  max-width: none;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 28px 0 30px;
}

.eyebrow,
.section-kicker,
.hero .eyebrow {
  grid-column: 1 / -1;
  margin: 0;
  color: #111;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(2rem, 3.4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

.purpose-switch {
  width: fit-content;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
}

.purpose-switch legend {
  margin-bottom: 6px;
  padding: 0;
  color: #333;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.purpose-switch__options {
  display: inline-flex;
  border: 1px solid #111;
  background: #fff;
}

.purpose-switch__options label {
  position: relative;
  display: block;
  cursor: pointer;
}

.purpose-switch__options label + label {
  border-left: 1px solid #111;
}

.purpose-switch__options input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.purpose-switch__options span {
  display: block;
  min-width: 112px;
  padding: 9px 18px;
  color: #111;
  background: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.purpose-switch__options label:hover span {
  background: #fff3b5;
}

.purpose-switch__options input:checked + span {
  background: var(--gold);
}

.purpose-switch__options input:focus-visible + span {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.metrics {
  border: 1px solid #777;
  border-bottom: 0;
  background: #f7f7f7;
}

.metric {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 16px 16px;
  border-right: 1px solid #aaa;
}

.metric:first-child { padding-left: 13px; }
.metric dt {
  color: #555;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.metric dd {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
}

.main-content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 20px 30px;
  border: 1px solid #767676;
  border-top: 0;
  background: #fff;
}

.panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.filters-panel,
.chart-panel,
.table-panel {
  padding: 28px 0;
}

.filters-panel {
  border-top: 1px solid #777;
}

.section-heading {
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 7px;
  border-bottom: 1px dotted #777;
}

.section-heading h2,
.results-intro h2 {
  margin-top: 3px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.text-button {
  padding: 5px 8px;
  border: 1px solid #111;
  color: #111;
  background: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
}

.filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.field { gap: 5px; }
.field > span {
  color: #333;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field > input,
.field > select,
.multi-select summary {
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid #777;
  border-radius: 0;
  color: #111;
  background: #fff;
  font-size: 0.76rem;
}

.field > input:focus,
.field > select:focus,
.multi-select[open] summary,
.multi-select summary:focus-visible {
  border-color: #111;
  box-shadow: 0 0 0 2px var(--gold);
}

.multi-select__options {
  top: calc(100% + 2px);
  width: max(100%, 240px);
  gap: 0;
  padding: 4px;
  border: 1px solid #111;
  border-radius: 0;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.multi-select__options label {
  min-height: 32px;
  padding: 5px 6px;
  border-radius: 0;
  border-bottom: 1px solid #ddd;
}

.multi-select__options label:hover { background: #fff3b5; }
.multi-select__options span { font-size: 0.74rem; }

.results-intro {
  gap: 28px;
  padding: 22px 0 16px;
  border-top: 1px solid #111;
}

.results-intro > p {
  max-width: 560px;
  color: #333;
  font-size: 0.76rem;
}

.chart-panel,
.table-panel {
  margin: 0;
  border-top: 1px solid #111;
}

.legend {
  gap: 8px 14px;
  color: #333;
  font-size: 0.65rem;
}

.chart-wrap {
  min-height: 360px;
  padding: 8px 4px 0;
  border: 1px solid #777;
  border-radius: 0;
  background: #fff;
}

#scatter-chart { height: 360px; }
.chart-note { margin: 8px 0 0; color: #444; font-size: 0.68rem; }

.table-scroll {
  border: 1px solid #777;
  border-radius: 0;
}

table { min-width: 980px; }
th,
td {
  padding: 10px 9px;
  border-right: 1px solid #ddd;
  border-bottom: 1px solid #ccc;
}

th:last-child,
td:last-child { border-right: 0; }
th {
  color: #111;
  background: #e9e9e9;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

tbody tr:hover { background: #fff8cc; }
tbody tr.is-flagged { background: #fff1ed; }
tbody tr.is-flagged:hover { background: #ffe6de; }
.listing-link { max-width: 300px; font-size: 0.76rem; }
.cell-meta { margin-top: 3px; font-size: 0.62rem; }
.price { color: #111; font-family: Arial, Helvetica, sans-serif; font-size: 0.82rem; }
.type-pill,
.quality-pill {
  margin-top: 5px;
  padding: 2px 5px;
  border-radius: 0;
  font-size: 0.57rem;
}

.type-pill { border: 1px solid #8c8c8c; background: #eee; }
.quality-pill { border-color: #c65a48; color: #8a281b; background: #fff; }
.quality-pill--clean { border-color: #6a8e80; color: #195d48; background: #fff; }

.page-label { font-size: 0.68rem; }
.pagination { padding-top: 14px; }
.pagination button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #777;
  border-radius: 0;
  background: #fff;
  font-size: 0.7rem;
}

.pagination button:hover:not(:disabled),
.pagination button.is-active {
  border-color: #111;
  color: #111;
  background: var(--gold);
}

.empty-state,
.error-state { padding: 28px 16px; }
.error-state { border-radius: 0; }

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  padding: 0;
  border: 1px solid #767676;
  border-top: 0;
  color: #333;
  background: #f1f1f1;
  font-size: 0.61rem;
  letter-spacing: 0.06em;
}

.footer .shell {
  width: 100%;
  padding: 11px 20px;
}

.footer a { color: #111; }

@media (max-width: 900px) {
  .hero__copy { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric,
  .metric:first-child,
  .metric:nth-child(3) {
    margin-top: 0;
    padding: 11px 13px 12px;
    border-top: 0;
    border-right: 1px solid #aaa;
    border-bottom: 1px solid #aaa;
  }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-last-child(-n + 2) { border-bottom: 0; }
}

@media (max-width: 620px) {
  .shell,
  .hero,
  .main-content,
  .footer { width: calc(100% - 16px); }

  .hero { margin-top: 8px; }
  .hero__content,
  .main-content { padding-right: 12px; padding-left: 12px; }
  .brand { font-size: 0.72rem; }
  .data-status { max-width: 132px; }
  .hero__copy { gap: 12px; padding: 22px 0 24px; }
  h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .section-heading { align-items: flex-start; flex-direction: row; }
  .results-intro { padding-top: 18px; }
  .chart-wrap { min-height: 310px; }
  #scatter-chart { height: 310px; }
  .footer .shell { padding: 10px 12px; }
}

@media (max-width: 420px) {
  .purpose-switch,
  .purpose-switch__options { width: 100%; }
  .purpose-switch__options label { flex: 1; }
  .purpose-switch__options span { min-width: 0; }
  .metrics { grid-template-columns: 1fr; }
  .metric,
  .metric:first-child,
  .metric:nth-child(2n),
  .metric:nth-child(3),
  .metric:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid #aaa;
  }
  .metric:last-child { border-bottom: 0; }
}
