/* Two Letters: one stylesheet for every page.

   The scene: a homeowner at the kitchen table in daylight, an offer letter in
   one hand and a phone in the other. So: a warm paper page, ink-dark text,
   the answer set like a letter written back, and plain system type for every
   control and figure. One ink accent for actions and the records' range; one
   ochre for the owner's own number (an offer or the county's value), the same
   whatever it says, so colour never judges. No web fonts (SPEC 9.3).

   Contrast on the page colour: text 14.7, secondary 6.7, accent 7.0, ochre
   5.4, control borders 3.8 (WCAG 1.4.11 asks 3). */

:root {
  --paper: #fbf8f2;
  --paper-2: #f3eee3;
  --sheet: #fffdf8;
  --ink: #1d2430;
  --ink-2: #525963;
  --line: #ddd6c8;
  --line-strong: #857e70;
  --accent: #0b5c7a;
  --accent-ink: #084a63;
  --accent-soft: #e4eef2;
  --ochre: #9a5508;
  --ochre-soft: #f8ead3;
  --tap: 44px;
  --radius: 10px;
  --radius-lg: 16px;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-letter: ui-serif, "Iowan Old Style", Charter, "Palatino Linotype", Georgia, "Noto Serif", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Older names, still used by the map markers below. */
  --page: var(--paper);
  --text: var(--ink);
  --secondary: var(--ink-2);
  --border: var(--line);
  --soft: var(--paper-2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 18 px on a default browser, and larger when the reader has asked their
   browser for larger text. The band colour shows under a short page's footer. */
html {
  font-size: 112.5%;
  -webkit-text-size-adjust: 100%;
  background: var(--band, #0e3a4c);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.5;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

.site-header,
main,
.site-footer,
.notices {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Headings, labels and buttons are semibold (600), not bold: on phones the
   system fonts render 650 to 700 heavier than intended. Bold (700) is kept
   for the answer sentence, chips and verdicts. */
h3 {
  font-weight: 600;
}

/* ---- header ---- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  color: var(--ink);
  font-family: var(--font-letter);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex: none;
}

.as-of {
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.as-of:empty {
  display: none;
}

.notice {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--sheet);
  font-weight: 600;
}

main {
  padding-top: 0;
  padding-bottom: 48px;
}

/* ---- type ---- */

h1 {
  font-family: var(--font-letter);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 20px 0 10px;
  text-wrap: balance;
}

h2 {
  font-family: var(--font-letter);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 36px 0 10px;
  text-wrap: balance;
}

h3 {
  font-size: 1rem;
  margin: 20px 0 6px;
}

p,
ul,
ol {
  margin: 0 0 12px;
}

ul,
ol {
  padding-left: 22px;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-ink);
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="option"].active {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  position: static;
  display: inline-block;
  min-height: var(--tap);
  padding: 8px 16px;
}

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

[hidden] {
  display: none !important;
}

.lede {
  max-width: 34em;
  color: var(--ink-2);
  font-size: 1.05rem;
}

.small {
  font-size: 0.85rem;
  color: var(--ink-2);
}

/* ---- forms ---- */

form {
  margin: 20px 0 24px;
}

.field {
  margin-bottom: 18px;
  position: relative;
}

label,
legend {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.hint {
  display: block;
  font-weight: 400;
  color: var(--ink-2);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

input[type="text"],
input[type="search"],
input[type="number"],
select {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

input[type="text"]:hover,
select:hover {
  border-color: var(--ink-2);
}

input[type="text"]:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  outline-offset: 1px;
}

/* Safari draws a native select at its own small height and ignores
   min-height, so selects are drawn by the page, with an arrow image. */
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1 1l7 7 7-7' fill='none' stroke='%231d2430' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 10px;
}

select:disabled {
  color: var(--ink-2);
  background-color: var(--paper-2);
}

/* In Windows high-contrast modes the arrow image can vanish against the
   system colours, so the browser's own select comes back. */
@media (forced-colors: active) {
  select {
    -webkit-appearance: auto;
    appearance: auto;
    background-image: none;
    padding-right: 10px;
  }
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 4px 16px 4px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--sheet);
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
}

/* ---- buttons: one primary shape, one quiet shape ---- */

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 22px;
  font: inherit;
  font-weight: 600;
  color: var(--sheet);
  background: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease),
    color 150ms var(--ease);
}

.button:hover,
button:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--sheet);
}

.button.plain,
button.plain {
  color: var(--accent);
  background: var(--sheet);
  border-color: var(--line-strong);
}

.button.plain:hover,
button.plain:hover {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: var(--accent);
}

button:disabled,
button:disabled:hover {
  color: var(--ink-2);
  background: transparent;
  border: 1.5px dashed var(--line-strong);
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.actions .button,
.actions button {
  width: 100%;
  text-align: center;
}

/* ---- address type-ahead ---- */

/* The list floats just under the input (an absolute box with no top keeps its
   place in the flow), so typing never pushes the buttons or the page about. */
.field[data-address] {
  position: relative;
}

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 20;
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: 0 12px 28px -12px rgb(29 36 48 / 0.28);
}

.suggestions li {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.suggestions li + li {
  margin-top: 2px;
}

.suggestions li.active,
.suggestions li:hover {
  background: var(--accent-soft);
}

/* ---- the reply: answer, its picture, how sure ---- */

[data-state="result"] {
  animation: arrive 260ms var(--ease) both;
}

/* A small rise only: no fade, so the text is at full contrast from the start. */
@keyframes arrive {
  from {
    transform: translateY(8px);
  }
}

.reply {
  margin: 12px 0 8px;
  padding: 20px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgb(29 36 48 / 0.35);
}

.reply > :last-child {
  margin-bottom: 0;
}

[data-subject] {
  margin: 0 0 4px;
  font-weight: 600;
  color: var(--ink-2);
}

.answer {
  font-family: var(--font-letter);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 4px 0 14px;
  text-wrap: pretty;
  /* After a check the page scrolls the answer to the top; leave a little air. */
  scroll-margin-top: 16px;
}

/* The reply sheet is what scrolls to the top after a check (scrollToAnswer). */
.reply {
  scroll-margin-top: 16px;
}

.answer-more {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.message {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 16px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--sheet);
}

.panel {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--paper-2);
}

.panel > :last-child {
  margin-bottom: 0;
}

.panel > h2:first-child {
  margin-top: 0;
  font-size: 1.25rem;
}

.caveat {
  font-weight: 600;
}

.disclaimer {
  font-size: 0.85rem;
  color: var(--ink-2);
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* The picture of the answer: the range recorded sales support, and the
   owner's own number on it. Drawn as SVG; the sentence above says it. */
.figure {
  margin: 6px 0 16px;
}

.figure svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.figure text {
  font-family: var(--font-ui);
  font-size: 16px;
  fill: var(--ink);
  font-variant-numeric: tabular-nums;
}

.figure .label-strong {
  font-weight: 600;
}

.figure .label-quiet {
  fill: var(--ink-2);
}

.figure .track {
  fill: var(--paper-2);
  stroke: var(--line);
}

.figure .band {
  fill: var(--accent);
}

.figure .part {
  fill: var(--accent);
}

.figure .mark-line {
  stroke: var(--ochre);
  stroke-width: 3;
  stroke-linecap: round;
}

.figure .mark-head {
  fill: var(--ochre);
  stroke: var(--sheet);
  stroke-width: 2;
}

details {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
  padding: 0 16px;
}

details[open] {
  padding-bottom: 6px;
}

summary {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 200ms var(--ease);
}

details[open] > summary::after {
  transform: rotate(-135deg) translateY(-3px);
}

.plain-list {
  list-style: none;
  padding: 0;
}

.plain-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.plain-list li:last-child {
  border-bottom: 0;
}

/* A name and its count of homes, set like a ledger line. */
[data-names] li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

[data-names] li .small {
  flex: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.link-list {
  list-style: none;
  padding: 0;
}

.link-list a,
.link-list button {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  margin-bottom: 8px;
}

.link-list a::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

/* ---- tables: real tables that stack as cards on a narrow screen ---- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

caption {
  text-align: left;
  font-family: var(--font-letter);
  font-size: 1.25rem;
  font-weight: 600;
  padding: 6px 0 10px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--ink-2);
  font-weight: 600;
}

tbody tr[tabindex] {
  cursor: pointer;
}

/* A row that can be tapped is a tap target: at least 44px high. */
tbody tr[tabindex] th,
tbody tr[tabindex] td {
  padding-top: 11px;
  padding-bottom: 11px;
}

/* A row reached by mouse shows no focus ring; one reached by keyboard does. */
tbody tr[tabindex]:focus {
  outline: none;
}

tbody tr[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

tbody tr.highlight,
.plain-list li.highlight {
  background: var(--accent-soft);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* The comparable sales carry the same numbers as their map markers. */
[data-comparables] tbody {
  counter-reset: sale;
}

[data-comparables] tbody tr {
  counter-increment: sale;
}

[data-comparables] tbody th[scope="row"]::before {
  content: counter(sale);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-right: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--sheet);
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: 1px;
}

@media (max-width: 599px) {
  .hero .actions {
    gap: 0;
  }

  .hero .actions > :first-child {
    margin-bottom: 12px;
  }

  .hero .actions .plain {
    justify-content: space-between;
    min-height: 48px;
    padding: 0 2px;
    border: 0;
    border-top: 1px solid var(--band-line);
    border-radius: 0;
    background: transparent;
  }

  .hero .actions .plain::after {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
  }

  .hero .actions .plain:hover {
    color: var(--band-text);
    background: transparent;
    text-decoration: underline;
  }

  .site-header .brand {
    font-size: 1.15rem;
  }

  .site-header .as-of {
    padding: 3px 10px;
    font-size: 0.72rem;
  }

  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  table.stack,
  table.stack caption,
  table.stack tbody {
    display: block;
    width: 100%;
  }

  /* Each row becomes a card: its first cell is the card's heading and the
     rest sit two to a line, each under its own small label. */
  table.stack tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--sheet);
    margin-bottom: 10px;
    padding: 12px 14px;
  }

  table.stack td,
  table.stack th[scope="row"] {
    display: block;
    border: 0;
    padding: 0;
    color: var(--ink);
  }

  table.stack th[scope="row"] {
    grid-column: 1 / -1;
    font-weight: 600;
  }

  table.stack td::before {
    content: attr(data-label);
    display: block;
    color: var(--ink-2);
    font-size: 0.78rem;
    font-weight: 600;
  }

  tbody tr[tabindex] th,
  tbody tr[tabindex] td {
    padding-top: 0;
    padding-bottom: 0;
  }

  /* The comparable sales are a list to scan, not cards to read: the address
     and the price on the first line, then date, size, year and distance. */
  [data-comparables] table.stack tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 0;
    margin-bottom: 8px;
    padding: 10px 12px;
  }

  [data-comparables] table.stack th[scope="row"] {
    flex: 0 0 calc(100% - 6.5rem);
    min-width: 0;
    order: 0;
  }

  [data-comparables] table.stack td[data-label="Sale price"] {
    flex: 0 0 6.5rem;
    order: 1;
    font-weight: 600;
    text-align: right;
  }

  [data-comparables] table.stack td:not([data-label="Sale price"]) {
    flex: 0 0 auto;
    color: var(--ink-2);
    font-size: 0.85rem;
  }

  [data-comparables] table.stack td[data-label="Sale date"] {
    order: 2;
  }

  [data-comparables] table.stack td[data-label="Heated square feet"] {
    order: 3;
  }

  [data-comparables] table.stack td[data-label="Year built"] {
    order: 4;
  }

  [data-comparables] table.stack td[data-label="Distance"] {
    order: 5;
  }

  [data-comparables] table.stack td::before {
    content: none;
  }

  [data-comparables] table.stack td[data-label="Heated square feet"]::before,
  [data-comparables] table.stack td[data-label="Distance"]::before {
    content: "\00a0·\00a0";
    display: inline;
    color: var(--ink-2);
    font-size: inherit;
    font-weight: 400;
  }

  [data-comparables] table.stack td[data-label="Year built"]::before {
    content: "\00a0·\00a0 built\00a0";
    display: inline;
    color: var(--ink-2);
    font-size: inherit;
    font-weight: 400;
  }

  [data-comparables] table.stack td[data-label="Heated square feet"]::after {
    content: "\00a0 sq\00a0 ft";
  }
}

/* ---- maps ---- */

.map {
  height: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 12px 0 4px;
  z-index: 0;
}

.map-notice {
  font-size: 0.8rem;
  color: var(--secondary);
}

.legend {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.85rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* A marker is a 44px tap target with a smaller shape drawn inside it.
   Each kind has its own shape, so colour is never the only cue. */
.pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
}

.pin.small {
  width: 16px;
  height: 16px;
}

.legend .pin {
  width: 22px;
  height: 22px;
}

.shape {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: var(--accent);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--text);
}

.shape-circle {
  border-radius: 50%;
}

.shape-square {
  border-radius: 2px;
}

.shape-diamond {
  transform: rotate(45deg);
  background: var(--text);
}

.shape-diamond > span {
  transform: rotate(-45deg);
}

.shape-triangle {
  width: 0;
  height: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 21px solid #6b3fa0;
}

.shape-hexagon {
  background: #8a4b00;
  border: 0;
  box-shadow: none;
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
}

.shape-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7a7a7a;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #595959;
}

.shape-ring {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #595959;
  box-shadow: none;
}

.shape-cluster {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
}

/* Smaller shapes for a map with many homes, and for the legend. The tap
   target around each one stays 44px. */
.pin.compact .shape {
  width: 14px;
  height: 14px;
}

.pin.compact .shape-diamond {
  width: 16px;
  height: 16px;
}

.pin.compact .shape-triangle {
  width: 0;
  height: 0;
  border-left-width: 8px;
  border-right-width: 8px;
  border-bottom-width: 14px;
}

.pin.compact .shape-dot,
.pin.compact .shape-ring {
  width: 9px;
  height: 9px;
  border-width: 2px;
}

.pin.highlight .shape {
  box-shadow: 0 0 0 4px #ffb100, 0 0 0 5px var(--text);
}

.popup p {
  margin: 0 0 6px;
  font-size: 0.85rem;
}

.popup a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 600;
}

/* ---- accuracy chart (inline SVG) ---- */

.chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0;
}

.chart .track {
  fill: var(--paper-2);
}

.chart .bar {
  fill: var(--accent);
}

.chart .value {
  font-weight: 700;
}

.chart-key {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-key::before {
  content: "";
  width: 0;
  height: 18px;
  border-left: 2px dashed var(--ochre);
}

.chart .target-line {
  stroke: var(--ochre);
  stroke-width: 2.5;
  stroke-dasharray: 3 2;
}

.chart text {
  fill: var(--ink);
  font-size: 15px;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}

.chart .axis {
  stroke: var(--line);
}

/* ---- relief card ---- */

.program {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  padding: 16px 18px;
  margin: 14px 0;
}

.program h3 {
  margin-top: 0;
  font-family: var(--font-letter);
  font-size: 1.3rem;
  line-height: 1.25;
}

.verdict {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

/* The words say the verdict; the shape only makes "may qualify" easy to
   spot when scanning four programs. */
.program[data-verdict="yes"] {
  border-color: var(--accent);
}

.program[data-verdict="yes"] .verdict {
  color: var(--sheet);
  background: var(--accent);
  border-color: var(--accent);
}

.program[data-verdict="unknown"] .verdict {
  border-style: dashed;
}

dl {
  margin: 0;
}

dt {
  font-weight: 600;
  color: var(--ink-2);
  font-size: 0.85rem;
}

dd {
  margin: 0 0 10px;
}

/* A relief card's facts as label and value on one line (a narrower label
   column on a phone). */
.program dl {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  gap: 8px 12px;
  align-items: baseline;
}

.program dd {
  margin: 0;
  min-width: 0;
}

.program dd[data-passed] {
  grid-column: 2;
}

@media (min-width: 600px) {
  .program dl {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 8px 18px;
  }
}

/* ---- home ---- */

.facts {
  margin-top: 28px;
}

.facts li {
  margin-bottom: 8px;
}

/* ---- share and print ---- */

.share {
  margin: 28px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.share .actions {
  margin: 8px 0;
}

.share-url {
  margin-bottom: 8px;
}

@media print {
  .skip,
  form,
  .actions,
  .share,
  .map,
  .map-notice,
  .legend,
  .lede,
  .site-footer a,
  [data-map-holder] h2,
  [data-map-holder] .small,
  [data-homes] h2,
  [data-homes] .map,
  summary {
    display: none !important;
  }

  body {
    font-size: 12pt;
    background: none;
  }

  .answer {
    font-size: 18pt;
  }

  .reply,
  details,
  .program {
    border: 1px solid #999;
    box-shadow: none;
    background: none;
  }

  details {
    padding: 0;
    border: 0;
  }

  .panel {
    background: none;
  }

  /* An official page's address is printed beside its link (not beside a
     button, whose ::after draws its arrow). */
  a[href^="http"]:not(.button)::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
  }

  .site-nav,
  .preview,
  .panel:has(.link-list),
  .hero-example {
    display: none !important;
  }

  /* Printers drop backgrounds, so the bands print as plain ink on paper. */
  .site-header,
  .page-band,
  .hero,
  .site-footer {
    background: none;
    box-shadow: none;
    clip-path: none;
    color: var(--ink);
  }

  .site-header .brand,
  .site-header .as-of,
  .page-band h1,
  .hero h1,
  .hero .lede,
  .site-footer,
  .site-footer a {
    color: var(--ink);
    background: none;
  }

  table.stack tr {
    break-inside: avoid;
  }
}

/* ---- footer ---- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  padding-bottom: 32px;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.site-footer p {
  margin-bottom: 6px;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

@media (min-width: 600px) {
  .hero .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hero .actions > :first-child {
    grid-column: 1 / -1;
  }

  .hero .actions .button,
  .hero .actions button {
    width: 100%;
    padding-inline: 14px;
  }

  /* In a full table, a column of numbers is set flush right. */
  table.stack .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  h1 {
    font-size: 2.4rem;
  }

  .actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .actions .button,
  .actions button {
    width: auto;
  }

  .reply {
    padding: 26px 28px 20px;
  }

  .map {
    height: 380px;
  }
}

/* ---- the ink band: header, page titles, the home hero, footer ----
   A band runs edge to edge: the element keeps the column width and a large
   shadow paints the colour out to both sides, clipped to the element's own
   height, so nothing scrolls sideways. Text on it: 10.8 to 1 and 7.3 to 1. */

:root {
  --band: #0e3a4c;
  --band-text: #f6f1e7;
  --band-muted: #b9cbd3;
  --band-line: #5f8796;
  --band-accent: #f2b562;
}

.site-header,
.page-band,
.hero,
.site-footer {
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  /* One pixel over the top and bottom, so two bands that meet overlap and no
     hairline of the page shows between them. */
  clip-path: inset(-1px -100vmax);
  color: var(--band-text);
}

.site-header .brand {
  flex: none;
  color: var(--band-text);
  white-space: nowrap;
}

.site-header .as-of {
  background: rgb(255 255 255 / 0.1);
  color: var(--band-muted);
}

/* The main menu: on a phone, one row under the brand that scrolls sideways
   (its right edge fades to show there is more); on a laptop, beside it. */
.site-nav {
  order: 3;
  flex: 1 0 100%;
  margin: 0 calc(-1 * var(--gutter, 16px));
  padding: 0 var(--gutter, 16px);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 82%, transparent);
  mask-image: linear-gradient(to right, #000 82%, transparent);
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav ul {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: 999px;
  color: var(--band-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--band-text);
  background: rgb(255 255 255 / 0.08);
}

.site-nav a[aria-current="page"] {
  color: var(--band-text);
  background: rgb(255 255 255 / 0.14);
}

.site-header :focus-visible,
.page-band :focus-visible,
.hero :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--band-text);
}

.page-band {
  padding: 4px 0 30px;
  margin-bottom: 8px;
}

.page-band h1 {
  margin-top: 8px;
}

.page-band .lede {
  color: var(--band-muted);
  margin-bottom: 0;
}

.site-footer {
  margin-top: 40px;
  border-top: 0;
  color: var(--band-muted);
}

.site-footer a {
  color: var(--band-text);
}

/* ---- home: the hero ---- */

.hero {
  padding: 8px 0 36px;
}

.eyebrow {
  margin: 8px 0 0;
  color: var(--band-accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.hero h1 {
  margin-top: 8px;
}

.hero .lede {
  color: var(--band-muted);
}

.hero label {
  color: var(--band-text);
}

.hero .hint,
.hero .small {
  color: var(--band-muted);
}

.hero .message {
  color: var(--band-text);
}

.hero input[type="text"] {
  border-color: var(--sheet);
}

.hero .suggestions {
  color: var(--ink);
}

.hero button,
.hero .button {
  color: var(--band);
  background: var(--band-text);
  border-color: var(--band-text);
}

.hero button:hover,
.hero .button:hover {
  color: var(--band);
  background: var(--sheet);
  border-color: var(--sheet);
}

.hero .button.plain,
.hero button.plain {
  color: var(--band-text);
  background: transparent;
  border-color: var(--band-line);
}

.hero .button.plain:hover,
.hero button.plain:hover {
  color: var(--band);
  background: var(--band-text);
}

.hero button:disabled,
.hero button:disabled:hover {
  color: var(--band-muted);
  background: transparent;
  border: 1.5px dashed var(--band-line);
}

.hero-example {
  margin: 4px 0 0;
  color: var(--band-muted);
}

.hero-example a {
  color: var(--band-text);
}

.hero-art {
  margin: 28px auto 0;
  max-width: 440px;
}

.hero-art figcaption {
  margin: 14px auto 0;
  max-width: 34ch;
  color: var(--band-muted);
  font-size: 0.9rem;
  text-align: center;
}

.hero-art svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 28px rgb(0 0 0 / 0.35));
}

.art-paper {
  fill: var(--sheet);
}

.art-head {
  fill: #d8e6ed;
}

.art-label {
  font: 700 13px var(--font-ui);
  letter-spacing: 0.14em;
  fill: var(--ink-2);
}

.art-big {
  font-family: var(--font-letter);
  font-size: 52px;
  font-weight: 700;
  fill: var(--ink);
}

.art-line {
  fill: #e6dfd1;
}

.art-script {
  font-family: var(--font-letter);
  font-style: italic;
  font-size: 27px;
  fill: var(--ink);
}

.art-stamp {
  fill: none;
  stroke: var(--ochre);
  stroke-width: 3;
  stroke-dasharray: 3 3;
}

.art-stamp-text {
  font: 800 12px var(--font-ui);
  letter-spacing: 0.08em;
  fill: var(--ochre);
}

.art-lens {
  fill: rgb(255 253 248 / 0.94);
  stroke: var(--band-accent);
  stroke-width: 8;
}

.art-handle {
  stroke: var(--band-accent);
  stroke-width: 14;
  stroke-linecap: round;
}

.art-track {
  fill: var(--paper-2);
  stroke: var(--line);
}

.art-band {
  fill: var(--accent);
}

.art-dot {
  fill: var(--ochre);
  stroke: var(--sheet);
  stroke-width: 2;
}

.art-caption {
  font: 700 16px var(--font-ui);
  fill: var(--ink);
}

.art-caption-quiet {
  font: 400 15px var(--font-ui);
  fill: var(--ink-2);
}

/* ---- home: how it works, what it means, the figures, the other tools ---- */

.how,
.meaning,
.story,
.more {
  margin-top: 48px;
}

.how h2,
.meaning h2,
.story h2,
.more h2 {
  font-family: var(--font-letter);
  font-size: 1.6rem;
  margin: 0 0 18px;
}

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 22px;
  margin: 0;
}

.steps li {
  padding-top: 16px;
  border-top: 2px solid var(--ink);
}

.steps p {
  margin: 0;
  color: var(--ink-2);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--sheet);
  font-weight: 800;
}

.steps .step-title {
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--font-letter);
  font-size: 1.3rem;
  font-weight: 600;
}

.meaning-art {
  margin: 0 0 20px;
}

/* Drawn in HTML so its words keep their full size on any screen. */
.m-labels,
.m-track {
  position: relative;
}

.m-labels {
  height: 30px;
  font-weight: 600;
  font-size: 0.95rem;
}

.m-labels span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.m-track {
  height: 16px;
  border-radius: 8px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.m-band {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 37%;
  width: 26%;
  border-radius: 8px;
  background: var(--accent);
}

.m-dot {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--sheet);
  border-radius: 50%;
  background: var(--ochre);
  transform: translate(-50%, -50%);
}

/* Over the middle of each of the three meanings below it. */
.m-below {
  left: 16.67%;
}

.m-within {
  left: 50%;
}

.m-above {
  left: 83.33%;
}

.m-caption {
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 0.85rem;
}

.meanings {
  display: grid;
  gap: 16px;
  margin: 0 0 16px;
}

.meanings dt {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.meanings dd {
  margin: 2px 0 0;
  color: var(--ink-2);
}

.story {
  padding: 28px 22px;
  border-radius: var(--radius-lg);
  background: var(--paper-2);
}

.story-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 26px;
}

.story-figure {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-letter);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.story-text {
  display: block;
}

.story-note {
  display: block;
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 0.85rem;
}

main.reading > .tool-list {
  margin-top: 24px;
}

.tool-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.tool-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  height: 100%;
  min-height: var(--tap);
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}

.tool-list a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tool-name {
  display: block;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 600;
}

.tool-line {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
}

.promises {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.promises li {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---- picture keys and the newer pictures ---- */

.figure-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 0.85rem;
}

.key-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.key-mark {
  display: inline-block;
  flex: none;
}

.key-band {
  width: 24px;
  height: 12px;
  border-radius: 6px;
  background: var(--accent);
}

.key-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ochre);
}

.key-company,
.key-home {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
}

.key-home {
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.key-hub {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
}

.key-node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.figure .home {
  fill: var(--paper-2);
  stroke: var(--line-strong);
  stroke-width: 1;
}

.figure .home-company {
  fill: var(--accent);
  stroke: var(--accent);
}

.figure .link {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.figure .node {
  fill: var(--accent);
}

.figure .hub {
  fill: var(--ink);
}

.figure .hub-mark {
  fill: none;
  stroke: var(--sheet);
  stroke-width: 1.5;
}

/* ---- the method page: at a glance, and what is on it ---- */

.glance {
  margin: 8px 0 24px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--paper-2);
}

.glance h2,
.toc h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.toc {
  margin: 0 0 32px;
}

.toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--sheet);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.toc a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---- icons, the verdict badge, the home example, footer, loading ---- */

/* A line icon at the left of a tool card; the name and line sit beside it. */
.tool-icon {
  grid-row: span 2;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 12px;
  background: var(--accent-soft);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-list .tool-name,
.tool-list .tool-line {
  grid-column: 2;
}

/* Where the number sits against the range, in the site's three words. A
   small track with a dot shows the place; the colour is the same for all
   three, because colour never judges an offer. */
.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 6px;
  padding: 4px 12px 4px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.verdict-badge::before {
  content: "";
  width: 34px;
  height: 8px;
  border-radius: 4px;
  background:
    radial-gradient(circle at var(--dot, 50%) 50%, var(--ochre) 3.5px, transparent 4px),
    linear-gradient(to right, var(--paper-2) 30%, var(--accent) 30% 70%, var(--paper-2) 70%);
  box-shadow: inset 0 0 0 1px var(--line);
}

.verdict-badge[data-position="below"] {
  --dot: 12%;
}

.verdict-badge[data-position="within"] {
  --dot: 50%;
}

.verdict-badge[data-position="above"] {
  --dot: 88%;
}

/* The home page's example answer. */
.example-reply {
  margin-top: 12px;
}

.example-sales {
  display: grid;
  gap: 2px;
  margin: 14px 0 6px;
  padding: 0;
  list-style: none;
}

.example-sales li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.example-sale-address {
  font-weight: 600;
}

.example-sale-price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.example-sale-date {
  grid-column: 1 / -1;
  color: var(--ink-2);
  font-size: 0.85rem;
}

/* The footer: who it is for and every page, then the fine print. */
.footer-grid {
  display: grid;
  gap: 18px 40px;
  padding: 10px 0 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--band-line);
}

.footer-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  color: var(--band-text);
  font-family: var(--font-letter);
  font-size: 1.2rem;
  font-weight: 700;
}

.footer-brand p:last-child {
  max-width: 46ch;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}

/* While an answer loads: grey bars in the shape of one. */
.skeleton {
  display: grid;
  gap: 12px;
  margin: 8px 0 14px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--sheet);
}

.skeleton span {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--line) 50%, var(--paper-2) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton span:nth-child(1) {
  width: 40%;
}

.skeleton span:nth-child(2) {
  height: 26px;
  width: 92%;
}

.skeleton span:nth-child(3) {
  height: 26px;
  width: 70%;
}

.skeleton span:nth-child(4) {
  height: 18px;
  width: 100%;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

/* ---- examples, the buyer on the offer page, lists and tables ---- */

.preview-example {
  margin: 16px 0 0;
}

.example-names {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.example-names a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--sheet);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.example-names a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Before a search, the page says what the answer will hold (on every screen). */
#result[hidden] + .preview {
  display: block;
  margin-top: 16px;
  padding: 20px 22px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--ink-2);
}

.buyer-box h2 {
  margin-top: 0;
}

.buyer-box [data-buyer-answer] p {
  margin: 0 0 8px;
}

/* No match, but close ones: the matches lead, the sentence steps down. */
.has-matches [data-answer] {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 600;
}

.network-list .network-name {
  font-weight: 600;
}

/* The quarter-mile edge on the street map. */
path.radius {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-dasharray: 8 6;
  stroke-opacity: 0.9;
  fill: var(--accent);
  fill-opacity: 0.06;
}

/* Map tiles in warm grey, so the markers, numbers and circle are the only
   colour on a map and read at a glance. */
.map .leaflet-tile-pane {
  filter: grayscale(1) sepia(0.18) brightness(1.04) contrast(0.92);
}

/* Numbered and company markers a little larger, with a soft shadow. */
.pin:not(.compact) .shape-circle {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.pin:not(.compact) .shape-diamond {
  width: 26px;
  height: 26px;
}

.shape-circle,
.shape-square,
.shape-diamond {
  box-shadow: 0 0 0 1px var(--text), 0 2px 5px rgb(29 36 48 / 0.35);
}

.pin.compact .shape-square {
  width: 16px;
  height: 16px;
}

.pin.compact .shape-diamond {
  width: 20px;
  height: 20px;
}

/* How sure the answer is: one quiet strip at the foot of the reply sheet. */
.reply [data-confidence],
.reply [data-figures] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: 18px 0 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--paper-2);
}

.reply [data-confidence] p,
.reply [data-figures] p {
  display: contents;
}

.reply [data-confidence] p > a,
.reply [data-figures] p > a {
  order: 3;
  margin-left: auto;
}

.reply [data-reasons] {
  order: 2;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.9rem;
}

.reply [data-reasons] li {
  display: inline;
}

.reply [data-reasons] li + li::before {
  content: " · ";
}

/* Pictures: the range's end ticks, the buyer network's names and rings. */
.figure .tick {
  stroke: var(--ink-2);
  stroke-width: 1.5;
}

.figure .label-name {
  font-weight: 500;
}

.figure .link-current {
  stroke: var(--accent);
  stroke-width: 2.5;
}

.figure .node-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}

.figure .hub-mark {
  stroke-linejoin: round;
}

/* An all-caps company name inside a sentence, set as small capitals. */
.answer .entity {
  font-size: 0.82em;
  letter-spacing: 0.04em;
}

/* The method page's chart as a titled card. */
.chart-card {
  margin: 16px 0 12px;
  padding: 24px 28px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgb(29 36 48 / 0.35);
}

.chart-title {
  margin: 0 0 4px;
  font-family: var(--font-letter);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
}

.chart-sub {
  margin: 0 0 16px;
  max-width: 46em;
}

.chart-card .chart-key {
  margin: 8px 0 0;
}

.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart .axis-label {
  fill: var(--ink-2);
  font-size: 13px;
}

.chart .row-strong {
  font-weight: 600;
}

.chart .bar-all {
  fill: var(--accent-ink);
}

.chart .target-label {
  fill: var(--ochre);
  font-size: 13px;
  font-weight: 600;
}

/* Method page sections carry serif headings, like the home page. */
main.reading section:not(.glance) > h2 {
  margin: 48px 0 14px;
  font-family: var(--font-letter);
  font-size: 1.6rem;
}

/* Leaflet's zoom buttons at the site's tap size. */
.leaflet-touch .leaflet-bar a {
  width: 44px;
  height: 44px;
  line-height: 44px;
  font-size: 22px;
}

/* Numbers line up on the right; dates and prices stay on one line. */
table.stack td[data-label="Sale date"],
table.stack td[data-label="Sale price"] {
  white-space: nowrap;
}

table.stack tbody tr:hover {
  background: var(--accent-soft);
}

/* ---- wide screens: use the width ----
   On a laptop the tools sit in two columns: what you enter on the left, kept
   in view, and the answer on the right. Prose (the method page) keeps a
   reading width; lines stay near 70 characters everywhere. */

.preview {
  display: none;
}

@media (min-width: 1024px) {
  :root {
    --wide: 1260px;
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    column-gap: 56px;
    align-items: center;
    align-content: center;
    min-height: calc(100vh - 72px);
    min-height: calc(100svh - 72px);
    padding-top: 40px;
    padding-bottom: 56px;
  }

  .hero h1 {
    font-size: 3.2rem;
  }

  .hero-art {
    margin: 0 0 0 auto;
    max-width: 500px;
  }

  .steps,
  .meanings,
  .story-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-header,
  .notices,
  .site-footer,
  main {
    max-width: var(--wide);
    padding-left: 32px;
    padding-right: 32px;
  }

  /* The band lines up with the header brand; the prose keeps a reading width. */
  main.reading > :not(.page-band) {
    max-width: 820px;
  }

  .glance .story-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-header {
    flex-wrap: nowrap;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .site-nav {
    order: 0;
    flex: 0 1 auto;
    margin: 0 auto 0 24px;
    padding: 0;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .site-header .as-of {
    flex: none;
  }

  main.tool {
    display: grid;
    grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
    column-gap: 56px;
    align-items: start;
  }

  main.tool > .page-band,
  main.tool > h1,
  main.tool > .lede,
  main.tool > .caveat,
  main.tool > .message {
    grid-column: 1 / -1;
  }

  main.tool > .page-band {
    padding-bottom: 36px;
  }

  main.tool > .lede {
    margin-bottom: 8px;
  }

  .tool-side {
    grid-column: 1;
  }

  /* A short form stays in view while the answer scrolls; a long one (the
     relief questions) scrolls with the page, so all of it can be reached. */
  main.tool:not(.tall) .tool-side {
    position: sticky;
    top: 24px;
  }

  /* After an answer that has a map, the form becomes one row across the top
     and the answer sits beside its map, so the range, the sales and their
     places share one screen. */
  main.tool:has([data-state="result"]:not([hidden]) > [data-map-holder]:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
  }

  main.tool:has([data-state="result"]:not([hidden]) > [data-map-holder]:not([hidden])) .tool-side {
    position: static;
  }

  main.tool:has([data-state="result"]:not([hidden]) > [data-map-holder]:not([hidden])) .tool-side form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    padding: 18px 22px;
  }

  main.tool:has([data-state="result"]:not([hidden]) > [data-map-holder]:not([hidden])) .tool-side .field {
    flex: 1 1 0;
    margin: 0;
  }

  main.tool:has([data-state="result"]:not([hidden]) > [data-map-holder]:not([hidden])) .tool-side .field[data-address] {
    flex-grow: 1.7;
  }

  main.tool:has([data-state="result"]:not([hidden]) > [data-map-holder]:not([hidden])) .tool-side .hint {
    display: none;
  }

  main.tool:has([data-state="result"]:not([hidden]) > [data-map-holder]:not([hidden])) .tool-side form > button {
    flex: none;
    width: auto;
  }

  main.tool:has([data-state="result"]:not([hidden]) > [data-map-holder]:not([hidden])) .tool-side [data-form-error] {
    flex: 1 0 100%;
    margin: 0;
  }

  main.tool:has([data-state="result"]:not([hidden]) > [data-map-holder]:not([hidden])) .tool-main {
    grid-column: 1;
  }

  [data-state="result"]:has(> [data-map-holder]:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 32px;
    align-items: start;
  }

  [data-state="result"]:has(> [data-map-holder]:not([hidden])) > * {
    grid-column: 1 / -1;
  }

  [data-state="result"]:has(> [data-map-holder]:not([hidden])) > .reply {
    grid-column: 1;
    grid-row: 1;
    margin-top: 0;
  }

  [data-state="result"]:has(> [data-map-holder]:not([hidden])) > [data-map-holder] {
    grid-column: 2;
    grid-row: 1;
  }

  [data-state="result"]:has(> [data-map-holder]:not([hidden])) > [data-map-holder] > h2 {
    margin-top: 0;
  }

  /* Scrolled to the same line as the sticky form, so the two sit level. */
  main.tool .reply {
    scroll-margin-top: 24px;
  }

  .tool-side form {
    margin-top: 16px;
    padding: 22px 22px 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--sheet);
  }

  .tool-side .actions button,
  .tool-side form > button,
  .tool-side form .actions .button {
    width: 100%;
  }

  .tool-main {
    grid-column: 2;
    min-width: 0;
  }

  .tool-main > #result,
  .tool-main > section:first-child {
    margin-top: 16px;
  }

  .tool-main .reply:first-child,
  .tool-main [data-state] > .reply:first-child {
    margin-top: 0;
  }

  #result[hidden] + .preview {
    padding: 28px 30px;
  }

  .preview-title {
    margin: 0 0 12px;
    color: var(--ink);
    font-family: var(--font-letter);
    font-size: 1.4rem;
    font-weight: 600;
  }

  .preview ol {
    margin: 0;
    padding-left: 24px;
  }

  .preview li {
    margin-bottom: 8px;
  }

  .answer {
    font-size: 1.9rem;
  }

  .reply {
    padding: 30px 34px 24px;
  }

  .map {
    height: 460px;
  }
}

/* ---- motion ----
   Things move into place; they never fade, so text is at full contrast at
   every moment. Everything is visible at rest, and reduced motion turns all
   of it off (the last rule in this file). */

:root {
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* The headline's hand-drawn underline, in the band's warm accent. */
.signature {
  display: block;
  width: min(330px, 70%);
  height: auto;
  margin: -4px 0 6px;
  overflow: visible;
}

.signature path {
  fill: none;
  stroke: var(--band-accent);
  stroke-width: 3.5;
  stroke-linecap: round;
}

/* The hero drawing's parts turn about their own middles. */
.art-float,
.art-glass,
.art-dot {
  transform-box: fill-box;
  transform-origin: center;
}

/* Pictures in an answer grow from their own middles too. */
.figure .band,
.figure .mark-head,
.figure .home,
.figure .node,
.figure .node-ring {
  transform-box: fill-box;
  transform-origin: center;
}

@media (prefers-reduced-motion: no-preference) {
  /* The signature writes itself, once. */
  .signature path {
    stroke-dasharray: 340;
    stroke-dashoffset: 340;
    animation: sign 1200ms 450ms var(--ease-quart) forwards;
  }

  /* The two letters arrive from either side, the magnifier settles over the
     offer, and then the letters breathe, slowly and slightly out of step. */
  .art-float-a {
    animation: letter-in-a 1000ms var(--ease-expo) both, breathe-a 7s 1000ms ease-in-out infinite;
  }

  .art-float-b {
    animation: letter-in-b 1000ms 140ms var(--ease-expo) both, breathe-b 8s 1140ms ease-in-out infinite;
  }

  .art-glass {
    animation: glass-in 900ms 520ms var(--ease-expo) both;
  }

  .art-dot {
    animation: dot-slide 700ms 1250ms var(--ease-expo) both;
  }

  /* Cards answer the pointer, and a pressed button gives a little. */
  .tool-list a,
  .link-list a {
    transition: transform 220ms var(--ease-quart), box-shadow 220ms var(--ease-quart),
      border-color 150ms var(--ease), background-color 150ms var(--ease);
  }

  .tool-list a:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -18px rgb(29 36 48 / 0.4);
  }

  button:active,
  .button:active {
    transform: scale(0.98);
  }
}

@keyframes sign {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes letter-in-a {
  from {
    transform: translate(-46px, 22px) rotate(-6deg);
  }
}

@keyframes letter-in-b {
  from {
    transform: translate(52px, 30px) rotate(7deg);
  }
}

@keyframes glass-in {
  from {
    transform: translate(38px, 34px) scale(0.6) rotate(-18deg);
  }
}

@keyframes dot-slide {
  from {
    transform: translateX(42px);
  }
}

@keyframes breathe-a {
  50% {
    transform: translateY(-4px) rotate(-0.6deg);
  }
}

@keyframes breathe-b {
  50% {
    transform: translateY(3px) rotate(0.5deg);
  }
}

/* "1 in 8" as a field of homes: one dot per home in a sample of 64. */
.dot-field {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 6px;
  max-width: 520px;
  margin: 22px 0 8px;
}

.dot {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

.dot {
  transition: background-color 450ms var(--ease-quart), box-shadow 450ms var(--ease-quart);
}

.dot-company {
  background: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

@media (max-width: 599px) {
  .dot-field {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    max-width: 260px;
  }
}

/* "What the answer means": the place shown now, and its meaning, lit together. */
.m-track .m-dot {
  transition: transform 300ms var(--ease-quart), box-shadow 300ms var(--ease-quart);
}

.m-track .m-dot.is-current {
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.meanings > div {
  margin: 0 -10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: background-color 300ms var(--ease-quart);
}

.meanings > div.is-current {
  background: var(--accent-soft);
}

/* Moving between pages: the header stays put; the page below slides in. */
@view-transition {
  navigation: auto;
}

.site-header {
  view-transition-name: site-header;
}

::view-transition-old(root) {
  animation: 160ms var(--ease-quart) both page-out;
}

::view-transition-new(root) {
  animation: 300ms var(--ease-expo) both page-in;
}

@keyframes page-out {
  to {
    transform: translateY(-6px);
  }
}

@keyframes page-in {
  from {
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
