:root {
  --paper: #f7f4ee;
  --panel: #ffffff;
  --ink: #17211f;
  --muted: #5c6661;
  --line: #d7d4ca;
  --green: #176b5b;
  --green-dark: #0d483e;
  --blue: #315f8d;
  --blue-soft: #dfe9f3;
  --red: #a83b32;
  --red-soft: #f3ddd8;
  --amber: #b87924;
  --amber-soft: #f2e2c4;
  --mint: #dfeee7;
  --cream: #fbfaf6;
  --shadow: 0 18px 44px rgba(23, 33, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: var(--green-dark);
  text-underline-offset: 0.18em;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  background: var(--ink);
  color: #fff;
  left: 1rem;
  padding: 0.75rem 1rem;
  position: absolute;
  top: -5rem;
  z-index: 20;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  align-items: center;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1.2rem;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-weight: 900;
  gap: 0.65rem;
  min-width: max-content;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--green);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 0.78rem;
  height: 2.35rem;
  justify-content: center;
  letter-spacing: 0;
  width: 2.35rem;
}

.site-nav {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  overflow-x: auto;
  scrollbar-width: thin;
}

.site-nav a {
  border-radius: 8px;
  color: var(--ink);
  flex: 0 0 auto;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 0.5rem 0.7rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--mint);
  color: var(--green-dark);
}

main {
  overflow: hidden;
}

.hero-section {
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  min-height: calc(86vh - 74px);
  padding: clamp(1.6rem, 3vw, 2.8rem) clamp(1rem, 5vw, 4rem);
}

.hero-copy {
  align-self: center;
  max-width: 780px;
}

.hero-visual {
  align-self: center;
  margin: 0;
}

.hero-visual img {
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  object-fit: cover;
}

.eyebrow,
.section-kicker {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin: 0 0 0.8rem;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.04;
  margin: 0;
}

h1 {
  font-size: clamp(2.35rem, 5.4vw, 4.45rem);
  max-width: 860px;
}

h2 {
  font-size: clamp(1.75rem, 3.7vw, 3rem);
}

h3 {
  font-size: 1.18rem;
}

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

.hero-text {
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  margin-top: 1rem;
  max-width: 680px;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.button {
  align-items: center;
  border: 2px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
}

.button-primary {
  background: var(--green);
  color: #fff;
}

.button-primary:hover {
  background: var(--green-dark);
}

.button-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.button-dark {
  background: var(--ink);
  color: #fff;
}

.page-hero,
.page-section,
.notice-band,
.data-section,
.link-panel,
.warning-panel,
.map-section {
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 5vw, 4rem);
}

.page-hero {
  max-width: 1080px;
}

.page-hero p:last-child {
  font-size: 1.12rem;
  margin-top: 1rem;
  max-width: 780px;
}

.notice-band {
  align-items: start;
  background: var(--mint);
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
}

.notice-band p,
.notice-band li {
  font-size: 1.05rem;
}

.data-section {
  background: #eee7dc;
}

.section-heading {
  margin-bottom: 1.6rem;
  max-width: 850px;
}

.section-heading p:last-child {
  margin-top: 0.7rem;
}

.card-grid,
.step-grid,
.data-grid,
.resource-grid,
.audit-grid,
.risk-grid,
.metric-grid {
  display: grid;
  gap: 1rem;
}

.card-grid,
.data-grid,
.resource-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step-grid,
.audit-grid,
.risk-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.follow-grid {
  margin-top: 1rem;
}

.card,
.step-card,
.data-card,
.resource-card,
.audit-card,
.risk-card,
.metric-card,
.note-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.15rem;
}

.resource-card {
  color: var(--ink);
  display: block;
  text-decoration: none;
}

.resource-card:hover {
  border-color: var(--green);
}

.card h3,
.step-card h3,
.data-card h3,
.resource-card h3,
.audit-card h3,
.risk-card h3 {
  margin-bottom: 0.55rem;
}

.label,
.step-number,
.resource-meta,
.status-pill {
  background: var(--blue-soft);
  border-radius: 999px;
  color: var(--blue);
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 900;
  margin-bottom: 0.85rem;
  padding: 0.25rem 0.55rem;
}

.status-pill.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.concern {
  background: var(--red-soft);
  color: var(--red);
}

.status-pill.protected {
  background: var(--ink);
  color: #fff;
}

.process-list {
  counter-reset: process;
  display: grid;
  gap: 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.process-list li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  counter-increment: process;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 1rem;
}

.process-list li::before {
  align-items: center;
  background: var(--green);
  border-radius: 8px;
  color: #fff;
  content: counter(process);
  display: inline-flex;
  font-weight: 950;
  height: 2.1rem;
  justify-content: center;
  width: 2.1rem;
}

.process-list h3,
.process-list p {
  grid-column: 2;
}

.timeline {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
  padding-left: 1.65rem;
  position: relative;
}

.timeline::before {
  background: var(--ink);
  border-radius: 999px;
  bottom: 0.35rem;
  content: "";
  left: 0.45rem;
  position: absolute;
  top: 0.35rem;
  width: 4px;
}

.timeline-item {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(5.6rem, 0.22fr) minmax(0, 1fr);
  position: relative;
}

.timeline-item::before {
  background: var(--ink);
  border-radius: 999px;
  content: "";
  height: 4px;
  left: -1.2rem;
  position: absolute;
  top: 0.72rem;
  width: 1.05rem;
}

.timeline-date {
  color: var(--ink);
  font-weight: 950;
  line-height: 1.1;
}

.timeline-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

.timeline-card h3 {
  margin-bottom: 0.45rem;
}

.bar-chart {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.bar-row {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(5.6rem, 0.18fr) minmax(0, 1fr) minmax(4.6rem, auto);
}

.bar-row span,
.bar-row strong {
  color: var(--ink);
  font-weight: 900;
}

.bar-row strong {
  text-align: right;
}

.bar-track {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 0.95rem;
  overflow: hidden;
}

.bar-track i {
  background: var(--green);
  border-radius: inherit;
  display: block;
  height: 100%;
  width: var(--bar);
}

.value-chart .bar-track i {
  background: var(--blue);
}

.bar-row.partial .bar-track i {
  background: var(--amber);
}

.big-stat {
  color: var(--green-dark);
  display: block;
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 950;
  line-height: 1;
  margin-bottom: 0.65rem;
  overflow-wrap: anywhere;
}

.metric-card p {
  font-size: 0.94rem;
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

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

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

th {
  background: var(--cream);
  color: var(--ink);
  font-size: 0.82rem;
  text-transform: uppercase;
}

td:last-child,
th:last-child {
  text-align: right;
}

.plain-list,
.big-list,
.check-list {
  display: grid;
  gap: 0.72rem;
  margin: 0;
  padding-left: 1.1rem;
}

.big-list {
  list-style: none;
  padding-left: 0;
}

.big-list li {
  background: rgba(255, 255, 255, 0.72);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  padding: 0.9rem 1rem;
}

.compact-list li {
  font-weight: 750;
}

.warning-panel {
  background: var(--ink);
}

.warning-panel h2 {
  color: #fff;
  margin-bottom: 0.85rem;
}

.warning-panel p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 860px;
}

.link-panel {
  background: #fff;
}

.link-panel.major {
  background: var(--mint);
}

.link-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.2rem;
}

.link-grid a {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 850;
  padding: 0.9rem 1rem;
  text-decoration: none;
}

.link-grid a:hover {
  border-color: var(--green);
}

.depth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: clamp(1rem, 3vw, 2rem) clamp(1rem, 5vw, 4rem);
}

.depth-panel > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 900;
  gap: 1rem;
  justify-content: space-between;
  list-style: none;
  padding: 1rem 1.15rem;
}

.depth-panel > summary::-webkit-details-marker {
  display: none;
}

.depth-panel > summary::after {
  align-items: center;
  background: var(--mint);
  border-radius: 999px;
  color: var(--green-dark);
  content: "+";
  display: inline-flex;
  flex: 0 0 auto;
  height: 1.7rem;
  justify-content: center;
  width: 1.7rem;
}

.depth-panel[open] > summary::after {
  content: "-";
}

.depth-content {
  border-top: 1px solid var(--line);
  padding: 1.1rem;
}

.map-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.5fr);
}

.uk-research-map {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 520px;
  padding: 1rem;
}

.region-cell {
  align-items: end;
  background: var(--blue-soft);
  border: 1px solid rgba(49, 95, 141, 0.22);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  font-size: 0.82rem;
  font-weight: 900;
  min-height: 5rem;
  padding: 0.65rem;
}

.region-cell.high {
  background: var(--red-soft);
  border-color: rgba(168, 59, 50, 0.32);
}

.region-cell.medium {
  background: var(--amber-soft);
  border-color: rgba(184, 121, 36, 0.32);
}

.region-cell.unknown {
  background: var(--cream);
  border-style: dashed;
  color: var(--muted);
}

.source-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 1rem;
}

.site-footer {
  background: var(--ink);
  color: #fff;
  padding: 1.5rem clamp(1rem, 5vw, 4rem);
}

.site-footer p {
  color: rgba(255, 255, 255, 0.78);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.8rem;
}

.footer-links a {
  color: #fff;
}

@media (max-width: 1320px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow-x: visible;
  }
}

@media (max-width: 1100px) {
  .hero-section,
  .notice-band,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .step-grid,
  .audit-grid,
  .risk-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .site-nav a {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    justify-content: center;
    min-width: 0;
    padding: 0.55rem 0.45rem;
    text-align: center;
  }

  .hero-section {
    min-height: auto;
  }

  .card-grid,
  .data-grid,
  .resource-grid,
  .step-grid,
  .audit-grid,
  .risk-grid,
  .metric-grid,
  .link-grid,
  .uk-research-map {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .process-list li {
    grid-template-columns: 1fr;
  }

  .process-list li::before,
  .process-list h3,
  .process-list p {
    grid-column: 1;
  }

  .timeline {
    padding-left: 1.3rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .bar-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .bar-row strong {
    text-align: left;
  }

  .court-page .table-wrap {
    overflow: visible;
  }

  .system-page .table-wrap {
    overflow: visible;
  }

  .court-page table,
  .system-page table,
  .court-page tbody,
  .system-page tbody,
  .court-page tr,
  .system-page tr,
  .court-page td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .system-page td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .court-page thead {
    display: none;
  }

  .system-page thead {
    display: none;
  }

  .court-page tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .system-page tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .court-page td {
    border: 0;
    overflow-wrap: anywhere;
    padding: 0;
    text-align: left;
  }

  .system-page td {
    border: 0;
    overflow-wrap: anywhere;
    padding: 0;
    text-align: left;
  }

  .court-page td + td {
    margin-top: 0.85rem;
  }

  .system-page td + td {
    margin-top: 0.85rem;
  }

  .court-page td:first-child {
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 900;
  }

  .system-page td:first-child {
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 900;
  }

  .court-page td:nth-child(n + 2)::before {
    color: var(--red);
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 0.22rem;
    text-transform: uppercase;
  }

  .system-page td:nth-child(n + 2)::before {
    color: var(--red);
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 0.22rem;
    text-transform: uppercase;
  }

  .court-page td:nth-child(2)::before {
    content: "Why or link";
  }

  .court-page td:nth-child(3)::before {
    content: "Known figure";
  }

  .court-page td:nth-child(4)::before {
    content: "Question";
  }

  .system-page td:nth-child(2)::before {
    content: "What it questioned";
  }

  .system-page td:nth-child(3)::before {
    content: "What it does not prove";
  }

  .system-page td:nth-child(4)::before {
    content: "Audit action";
  }

  .rules-page .table-wrap {
    overflow: visible;
  }

  .rules-page table,
  .rules-page tbody,
  .rules-page tr,
  .rules-page td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .rules-page thead {
    display: none;
  }

  .rules-page tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .rules-page td {
    border: 0;
    overflow-wrap: anywhere;
    padding: 0;
    text-align: left;
  }

  .rules-page td + td {
    margin-top: 0.85rem;
  }

  .rules-page td:first-child {
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 900;
  }

  .rules-page td:nth-child(n + 2)::before {
    color: var(--red);
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 0.22rem;
    text-transform: uppercase;
  }

  .rules-page td:nth-child(2)::before {
    content: "DVLA asks for";
  }

  .rules-page td:nth-child(3)::before {
    content: "Public audit question";
  }

  .dvla-page .table-wrap {
    overflow: visible;
  }

  .dvla-page table,
  .dvla-page tbody,
  .dvla-page tr,
  .dvla-page td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .dvla-page thead {
    display: none;
  }

  .dvla-page tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .dvla-page td {
    border: 0;
    overflow-wrap: anywhere;
    padding: 0;
    text-align: left;
  }

  .dvla-page td + td {
    margin-top: 0.85rem;
  }

  .dvla-page td:first-child {
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 900;
  }

  .dvla-page td:nth-child(n + 2)::before {
    color: var(--red);
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 0.22rem;
    text-transform: uppercase;
  }

  .dvla-page td:nth-child(2)::before {
    content: "What to ask for";
  }

  .dvla-page td:nth-child(3)::before {
    content: "False ticket fit";
  }

  .gdpr-page .table-wrap {
    overflow: visible;
  }

  .gdpr-page table,
  .gdpr-page tbody,
  .gdpr-page tr,
  .gdpr-page td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .gdpr-page thead {
    display: none;
  }

  .gdpr-page tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .gdpr-page td {
    border: 0;
    overflow-wrap: anywhere;
    padding: 0;
    text-align: left;
  }

  .gdpr-page td + td {
    margin-top: 0.85rem;
  }

  .gdpr-page td:first-child {
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 900;
  }

  .gdpr-page td:nth-child(n + 2)::before {
    color: var(--red);
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 0.22rem;
    text-transform: uppercase;
  }

  .gdpr-page td:nth-child(2)::before {
    content: "What was found";
  }

  .gdpr-page td:nth-child(3)::before {
    content: "Audit question";
  }
}
