:root {
  color-scheme: light;
  --navy: #123154;
  --navy-dark: #091f38;
  --blue: #1261a0;
  --blue-light: #e9f3fb;
  --yellow: #ffd84d;
  --ink: #17202a;
  --muted: #4b5867;
  --line: #c5d0db;
  --surface: #ffffff;
  --background: #eef3f7;
  --danger: #8f1d1d;
  --shadow: 0 6px 24px rgba(9, 31, 56, 0.1);
  font-family: Arial, Verdana, sans-serif;
  font-size: 20px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-size: 1rem;
  line-height: 1.55;
}

html.extra-large {
  font-size: 24px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
[role="option"]:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--navy-dark);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: #fff;
  background: var(--navy-dark);
  border-radius: 0.3rem;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  color: #fff;
  background: var(--navy);
  border-bottom: 5px solid var(--yellow);
}

.header-inner {
  width: min(100% - 2rem, 62rem);
  min-height: 4.6rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  color: var(--navy-dark);
  background: var(--yellow);
  border: 2px solid #fff;
  border-radius: 0.35rem 0.35rem 0.7rem 0.35rem;
  font-size: 1.25rem;
  font-weight: 900;
}

.text-size-button {
  min-height: 2.8rem;
  padding: 0.45rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.text-size-button:hover {
  color: var(--navy-dark);
  background: #fff;
}

.large-a {
  margin-left: 0.08rem;
  font-size: 1.35em;
}

main,
footer {
  width: min(100% - 2rem, 58rem);
  margin-inline: auto;
}

main {
  padding: 2.6rem 0 3.5rem;
}

.intro {
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 0;
  color: var(--navy-dark);
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h2 {
  margin: 0 0 0.75rem;
  color: var(--navy-dark);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  line-height: 1.2;
}

.intro-copy {
  max-width: 40rem;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.loading-card,
.lookup-card,
.error-card,
.results {
  padding: clamp(1.2rem, 4vw, 2rem);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 0.65rem;
  box-shadow: var(--shadow);
}

.loading-card {
  min-height: 10rem;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.2rem;
}

.loading-icon {
  width: 3rem;
  height: 3rem;
  border: 0.4rem solid var(--blue-light);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-card p {
  margin: 0;
  color: var(--muted);
}

.progress-track {
  height: 0.65rem;
  margin-top: 1rem;
  overflow: hidden;
  background: var(--blue-light);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 45%;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  animation: load 1.5s ease-in-out infinite alternate;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.7rem;
}

.search-field {
  position: relative;
}

input[type="search"] {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.65rem 0.85rem;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: 0.4rem;
  font-size: 1.16rem;
}

input[type="search"]::placeholder {
  color: #697582;
  opacity: 1;
}

.search-button,
.secondary-button {
  min-height: 3.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 0.4rem;
  font-weight: 800;
}

.search-button {
  color: #fff;
  background: var(--blue);
  border: 3px solid var(--blue);
}

.search-button:hover {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
}

.secondary-button {
  color: var(--navy-dark);
  background: #fff;
  border: 3px solid var(--navy);
}

.secondary-button:hover {
  background: var(--blue-light);
}

.field-help,
.form-message {
  margin: 0.55rem 0 0;
}

.field-help {
  color: var(--muted);
  font-size: 0.9rem;
}

.form-message {
  color: var(--danger);
  font-weight: 800;
}

.suggestions {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.3rem);
  right: 0;
  left: 0;
  max-height: 24rem;
  margin: 0;
  padding: 0.25rem;
  overflow-y: auto;
  list-style: none;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: 0.4rem;
  box-shadow: 0 12px 28px rgba(9, 31, 56, 0.2);
}

.suggestion {
  min-height: 3rem;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  color: var(--ink);
  border-radius: 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.suggestion + .suggestion {
  border-top: 1px solid var(--line);
}

.suggestion:hover,
.suggestion[aria-selected="true"] {
  color: #fff;
  background: var(--blue);
}

.results {
  margin-top: 1.5rem;
}

.results-heading {
  padding-bottom: 1.2rem;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 4px solid var(--navy);
}

.results-heading h2 {
  margin-bottom: 0.2rem;
}

.results-summary {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.address-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.address-card {
  padding: 1.25rem 0;
  display: grid;
  grid-template-columns: minmax(7rem, 0.28fr) 1fr;
  gap: 1.25rem;
  border-bottom: 2px solid var(--line);
}

.address-card:last-child {
  border-bottom: 0;
}

.house-number {
  color: var(--navy-dark);
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  font-weight: 900;
  line-height: 1.05;
}

.location {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.owner-label {
  margin: 0 0 0.15rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.owner-name {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.4;
}

.owner-name + .owner-name {
  margin-top: 0.3rem;
}

.error-card {
  border-color: var(--danger);
}

footer {
  padding: 1.5rem 0 2.5rem;
  color: #344251;
  border-top: 2px solid var(--line);
  font-size: 0.82rem;
}

footer p {
  margin: 0.35rem 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes load {
  from { transform: translateX(-70%); }
  to { transform: translateX(190%); }
}

@media (max-width: 700px) {
  :root {
    font-size: 18px;
  }

  .header-inner {
    width: min(100% - 1.2rem, 62rem);
    padding: 0.55rem 0;
    align-items: stretch;
    flex-direction: column;
  }

  #text-size-label {
    max-width: none;
    line-height: 1.2;
  }

  .brand {
    justify-content: center;
  }

  .text-size-button {
    width: 100%;
    justify-content: center;
  }

  main,
  footer {
    width: min(100% - 1.2rem, 58rem);
  }

  main {
    padding-top: 1.7rem;
  }

  .search-row,
  .address-card {
    grid-template-columns: 1fr;
  }

  .search-button,
  .secondary-button {
    width: 100%;
  }

  .results-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .address-card {
    gap: 0.65rem;
  }
}

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

  .loading-icon,
  .progress-track span {
    animation-duration: 3s;
  }
}

@media print {
  .site-header,
  .intro,
  .lookup-card,
  .secondary-button,
  footer {
    display: none !important;
  }

  body,
  .results {
    background: #fff;
  }

  main {
    width: 100%;
    padding: 0;
  }

  .results {
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
}
