/* UK Sponsor Lookup: plain, neutral, readable.
 * Mobile-first, system fonts only, light and dark via prefers-color-scheme.
 * No images except the icon; no external resources. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1b1b1b;
  --muted: #525252;
  --line: #d6d6d6;
  --panel: #f6f6f6;
  --link: #0b57d0;
  --link-visited: #6b2fa0;
  --focus: #0b57d0;
  --ok: #1e7b3c;
  --ok-bg: #f0f7f2;
  --warn: #8f5200;
  --warn-bg: #fdf5e6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #e8e8e8;
    --muted: #ababab;
    --line: #3d3d3d;
    --panel: #1c1c1c;
    --link: #8db8ff;
    --link-visited: #c9a6f5;
    --focus: #8db8ff;
    --ok: #6fd08c;
    --ok-bg: #15261a;
    --warn: #f0b75a;
    --warn-bg: #2a2213;
  }
}

/* --- base --- */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: 46rem;
  padding: 0 1rem 2rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
}

a {
  color: var(--link);
}

a:visited {
  color: var(--link-visited);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Hidden until focused, then it is the first thing a keyboard user sees. */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--link);
}

.skip-link:focus {
  top: 0;
}

h1,
h2,
h3 {
  line-height: 1.2;
  overflow-wrap: anywhere;
}

h1 {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.6rem;
}

h2 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.25rem;
}

h3 {
  margin: 1.25rem 0 0.25rem;
  font-size: 1.05rem;
}

p {
  overflow-wrap: anywhere;
}

.lead {
  font-size: 1.1rem;
}

.note,
.disclaimer {
  color: var(--muted);
}

/* --- header and navigation --- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.25rem;
  padding: 1rem 0 0.5rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header nav a {
  display: inline-block;
  padding: 0.15rem 0;
  text-decoration: none;
}

.site-header nav a:hover {
  text-decoration: underline;
}

.site-header nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* --- answer box --- */

.answer {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 5px solid var(--line);
  border-radius: 0 4px 4px 0;
  background: var(--panel);
}

.answer.listed {
  border-left-color: var(--ok);
  background: var(--ok-bg);
}

.answer.removed {
  border-left-color: var(--warn);
  background: var(--warn-bg);
}

.answer p {
  margin: 0.35rem 0;
}

.verdict {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  font-weight: 700;
}

/* --- facts --- */

dl.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
  margin: 1rem 0;
}

dl.facts dt {
  font-weight: 600;
}

dl.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

@media (max-width: 32rem) {
  dl.facts {
    grid-template-columns: 1fr;
  }

  dl.facts dd {
    margin-bottom: 0.4rem;
  }
}

/* --- tables --- */

.table-wrap {
  margin: 1rem 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

caption {
  padding-bottom: 0.25rem;
  color: var(--muted);
  text-align: left;
}

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

th {
  font-weight: 600;
}

/* --- lists --- */

ol.list,
ol.history,
.results ul,
ul.links,
ul.inline {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

ol.list li,
.results li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

ol.history li {
  padding: 0.2rem 0;
}

ul.links li {
  padding: 0.15rem 0;
  break-inside: avoid;
}

ul.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}

/* Several columns when there is room; single column on phones. */
@media (min-width: 40rem) {
  ul.links {
    columns: 3;
    column-gap: 2rem;
  }
}

/* --- pager --- */

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.pager span {
  color: var(--muted);
}

.pager > :last-child {
  text-align: right;
}

/* --- search --- */

.search-section {
  margin: 1.25rem 0;
}

.search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.search label {
  flex: 0 0 100%;
  font-weight: 600;
}

.search input {
  flex: 1 1 10rem;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
}

.search button {
  flex: 0 0 auto;
  padding: 0.55rem 1rem;
  border: 1px solid var(--link);
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  color: var(--bg);
  background: var(--link);
  cursor: pointer;
}

.search button:hover {
  filter: brightness(1.15);
}

.results {
  margin: 0.5rem 0 1rem;
}

.results-status {
  margin: 0.5rem 0;
  color: var(--muted);
}

/* --- small meta text --- */

.meta,
.town,
.count {
  color: var(--muted);
}

.meta,
.count {
  font-size: 0.9rem;
}

.count {
  font-variant-numeric: tabular-nums;
}

.more {
  margin: 0.5rem 0;
}

/* --- FAQ --- */

.faq p {
  margin: 0.25rem 0 0;
}

/* --- footer --- */

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0.5rem 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

/* --- print --- */

@media print {
  .site-header nav,
  .search-section,
  .pager,
  .skip-link {
    display: none;
  }

  body {
    max-width: none;
    padding: 0;
  }
}
