/* aimonitor.uk */
:root {
  --ground: #eef1f4;
  --paper: #ffffff;
  --ink: #18222e;
  --ink-soft: #4d5a68;
  --rule: #d3d9e0;
  --measured: #1f6f5c;
  --partial: #7fb3a4;
  --blind: #9aa6b2;
  --risk: #6b5ca5;
  --track: #e2e7ec;
  --focus: #1f6f5c;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 40rem;
  --gutter: clamp(16px, 4vw, 56px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #10161d; --paper: #18212b; --ink: #e8edf2; --ink-soft: #9fb0c0; --rule: #2c3845;
    --measured: #4fbf9f; --partial: #2f6e5f; --blind: #5d6b79; --risk: #a596e0; --track: #253140; --focus: #4fbf9f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #10161d; --paper: #18212b; --ink: #e8edf2; --ink-soft: #9fb0c0; --rule: #2c3845;
  --measured: #4fbf9f; --partial: #2f6e5f; --blind: #5d6b79; --risk: #a596e0; --track: #253140; --focus: #4fbf9f; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 1.0625rem; line-height: 1.55; overflow-x: hidden; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--blind); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: 8px 12px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; }
.wrap { max-width: 72rem; margin-inline: auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.prose { max-width: var(--measure); }

/* Masthead */
.mast { border-bottom: 1px solid var(--rule); background: var(--paper); }
.mast .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.0625rem; text-decoration: none; letter-spacing: -0.01em; }
.brand svg { flex: none; }
.nav { display: flex; gap: 20px; font-size: 0.9375rem; }
.nav a { text-decoration: none; color: var(--ink-soft); padding-block: 4px; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--measured); }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(28px, 4vw, 48px); }
.hero h1 { font-size: clamp(2.125rem, 5.2vw, 4rem); line-height: 1.04; letter-spacing: -0.03em; font-weight: 700; margin: 0 0 20px; max-width: 18ch; text-wrap: balance; }
.hero h1 .dim { color: var(--ink-soft); font-weight: 500; display: block; }
.hero .lede { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: var(--ink-soft); margin: 0; max-width: 36rem; }
.status-line { margin: 0 0 22px; font-size: 0.875rem; color: var(--ink-soft); }

/* The sightline: one cell per indicator */
.sightline { margin-top: clamp(32px, 5vw, 56px); position: relative; }
.sightline svg { display: block; width: 100%; height: auto; overflow: visible; }
.sightline .cell { cursor: pointer; }
.sightline .cell:focus-visible { outline: none; }
.sightline .cell:focus-visible rect.frame { stroke: var(--ink); stroke-width: 2.5; }
.key { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 18px; font-size: 0.875rem; color: var(--ink-soft); }
.key span { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 14px; height: 14px; border-radius: 2px; flex: none; display: inline-block; }
.swatch.measured { background: var(--measured); }
.swatch.partial { background: var(--partial); }
.swatch.blind { background: repeating-linear-gradient(135deg, var(--blind) 0 1.5px, transparent 1.5px 4px); box-shadow: inset 0 0 0 1px var(--blind); }
@media (prefers-reduced-motion: no-preference) {
  .sightline.reveal .cell { opacity: 0; animation: cellin 520ms cubic-bezier(.2,.7,.2,1) forwards; }
  @keyframes cellin { from { opacity: 0; } to { opacity: 1; } }
}

/* Sections */
section.band { padding-block: clamp(40px, 6vw, 72px); border-top: 1px solid var(--rule); }
section.band.paper { background: var(--paper); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 1.0625rem; line-height: 1.3; margin: 0 0 6px; font-weight: 600; }
.intro { color: var(--ink-soft); margin: 0 0 32px; max-width: var(--measure); }
.small { font-size: 0.875rem; line-height: 1.5; }
.soft { color: var(--ink-soft); }

/* Five areas */
.areas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; counter-reset: none; }
.areas > li { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 0 20px 4px; border-left: 1px solid var(--rule); min-width: 0; }
.areas > li:first-child { border-left: 0; padding-left: 0; }
.areas > li:last-child { padding-right: 0; }
.area-num { font-size: 3.25rem; line-height: .9; font-weight: 700; letter-spacing: -0.04em; color: var(--measured); font-variant-numeric: tabular-nums; }
.area-name { font-size: 1.1875rem; font-weight: 700; line-height: 1.2; margin: 0; }
.area-q { margin: -8px 0 0; color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.4; min-height: 2.8em; }
.area-cells { display: flex; gap: 3px; }
.area-cells i { flex: 1 1 0; height: 22px; border-radius: 2px; }
.area-cells i.measured { background: var(--measured); }
.area-cells i.partial { background: var(--partial); }
.area-cells i.blind { background: repeating-linear-gradient(135deg, var(--blind) 0 1.5px, transparent 1.5px 4px); box-shadow: inset 0 0 0 1px var(--blind); }
.area-count { font-size: 0.8125rem; color: var(--ink-soft); margin-top: -8px; }
.area-block { border-top: 1px solid var(--rule); padding-top: 10px; }
.area-block .k { font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 2px; }
.area-block .f { font-weight: 600; line-height: 1.35; }
.area-block .d { font-size: 0.875rem; color: var(--ink-soft); line-height: 1.4; }
.area-block.gap .f { font-weight: 500; }
.area-link { margin-top: auto; padding-top: 6px; font-size: 0.875rem; font: inherit; font-size: 0.875rem; background: none; border: 0; padding-left: 0; color: var(--ink); text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--blind); }
.area-link:hover { text-decoration-color: currentColor; }
@media (max-width: 1080px) {
  .areas { grid-template-columns: 1fr; gap: 0; }
  .areas > li, .areas > li:first-child, .areas > li:last-child { border-left: 0; border-top: 1px solid var(--rule); padding: 22px 0; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; row-gap: 10px; align-items: start; }
  .areas > li:first-child { border-top: 2px solid var(--ink); }
  .area-num { grid-row: 1 / span 5; }
  .area-name, .area-q, .area-cells, .area-count, .area-link { grid-column: 2 / span 2; }
  .area-q { min-height: 0; margin: 0; }
  .area-count { margin: 0; }
  .area-block.read { grid-column: 2; }
  .area-block.gap { grid-column: 3; }
}
@media (max-width: 640px) {
  .areas > li, .areas > li:first-child, .areas > li:last-child { grid-template-columns: 3rem minmax(0, 1fr); column-gap: 14px; }
  .area-num { font-size: 2.5rem; grid-row: 1 / span 6; }
  .area-name, .area-q, .area-cells, .area-count, .area-link, .area-block.read, .area-block.gap { grid-column: 2; }
}

/* Readings */
.readings { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0 40px; }
.readings li { padding: 18px 0 22px; border-top: 2px solid var(--ink); }
.readings .v { font-size: clamp(2.25rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.readings li.outcome { border-top-color: var(--partial); }
.readings p { margin: 12px 0 10px; }
.readings .src { font-size: 0.8125rem; color: var(--ink-soft); }

/* Charts */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 48px 56px; }
.chart h3 { font-size: 1.125rem; }
.chart .what { margin: 0 0 16px; color: var(--ink-soft); font-size: 0.9375rem; }
.chart .box { position: relative; }
.chart .src { margin-top: 10px; font-size: 0.8125rem; color: var(--ink-soft); }
.chart svg { display: block; width: 100%; height: auto; }
.tip { position: absolute; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 6px 10px; font-size: 0.8125rem; line-height: 1.4; pointer-events: none; opacity: 0; white-space: nowrap; z-index: 3; box-shadow: 0 6px 20px rgba(24, 34, 46, .12); max-width: 18rem; }
.tip strong { display: block; font-weight: 600; white-space: normal; }

/* Indicator explorer */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.filters button { font: inherit; font-size: 0.875rem; background: transparent; color: var(--ink); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.area { margin-bottom: 40px; }
.area-title { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: baseline; margin-bottom: 8px; }
.area-title .n { font-size: 1.75rem; font-weight: 700; color: var(--measured); line-height: 1; font-variant-numeric: tabular-nums; }
.area-title h3 { font-size: 1.25rem; margin: 0; }
.area-title p { grid-column: 2; margin: 0; color: var(--ink-soft); font-size: 0.9375rem; }
.ind { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 4px 14px; padding: 16px 0; border-top: 1px solid var(--rule); scroll-margin-top: 24px; }
.ind:target, .ind.flash { background: linear-gradient(90deg, color-mix(in srgb, var(--measured) 10%, transparent), transparent 70%); }
.ind .swatch { margin-top: 5px; }
.ind-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 4px 32px; }
.ind-name { font-weight: 600; }
.ind-def { color: var(--ink-soft); font-size: 0.875rem; }
.ind-fig { font-variant-numeric: tabular-nums; }
.ind-fig.none { color: var(--ink-soft); font-style: italic; }
.ind-meta { font-size: 0.8125rem; color: var(--ink-soft); }
.ind-status { font-size: 0.8125rem; font-weight: 600; }
@media (max-width: 720px) { .ind-body { grid-template-columns: 1fr; } }

/* Gaps */
.gaps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 32px 40px; }
.gaps li { border-left: 3px solid var(--measured); padding-left: 16px; }
.gaps p { margin: 0; color: var(--ink-soft); font-size: 0.9375rem; }

/* Method and sources pages */
.page-head { padding-block: clamp(40px, 6vw, 72px) 24px; }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 16px; }
.doc h2 { margin-top: 48px; }
.doc p, .doc li { max-width: var(--measure); }
.doc dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; max-width: 48rem; }
.doc dt { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.doc dd { margin: 0; color: var(--ink-soft); }
.doc ol.chain { padding-left: 1.4em; }
.doc ol.chain li { margin-bottom: 10px; }
.src-list { list-style: none; padding: 0; margin: 0; max-width: 52rem; }
.src-list li { padding: 14px 0; border-top: 1px solid var(--rule); }
.src-list .used { font-size: 0.875rem; color: var(--ink-soft); }
@media (max-width: 560px) { .doc dl { grid-template-columns: 1fr; } .doc dd { margin-bottom: 8px; } }

/* Footer */
.foot { border-top: 1px solid var(--rule); padding-block: 32px 48px; font-size: 0.875rem; color: var(--ink-soft); }
.foot p { margin: 0 0 8px; max-width: 48rem; }

/* Compare page */
.finding { font-size: clamp(1.25rem, 2.2vw, 1.625rem); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; max-width: 38rem; margin: 8px 0 clamp(32px, 5vw, 56px); padding-left: 18px; border-left: 4px solid var(--measured); text-wrap: balance; }
.grid-scroll { overflow-x: auto; margin: 0 0 16px; -webkit-overflow-scrolling: touch; }
table.cov { border-collapse: separate; border-spacing: 6px; min-width: 40rem; margin-left: -6px; }
table.cov th { font-size: 0.875rem; font-weight: 600; text-align: left; vertical-align: bottom; padding: 0 2px 6px; line-height: 1.25; }
table.cov thead th:not(:first-child) { text-align: center; width: 8.5%; }
table.cov thead th.uk { color: var(--measured); }
table.cov tbody th { font-weight: 500; padding: 0 12px 0 0; vertical-align: middle; min-width: 12rem; }
table.cov tbody th .a { color: var(--measured); font-weight: 700; margin-right: 8px; font-variant-numeric: tabular-nums; }
table.cov td { padding: 0; }
.covcell { display: block; width: 100%; height: 40px; border: 0; border-radius: 3px; cursor: pointer; padding: 0; }
.covcell.measured { background: var(--measured); }
.covcell.partial { background: var(--partial); }
.covcell.blind { background: repeating-linear-gradient(135deg, var(--blind) 0 1.5px, var(--paper) 1.5px 5px); box-shadow: inset 0 0 0 1px var(--blind); }
.covcell[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
td.ukcol .covcell { box-shadow: 0 0 0 2px var(--ground), 0 0 0 3px var(--measured); }
td.ukcol .covcell.blind { box-shadow: inset 0 0 0 1px var(--blind), 0 0 0 2px var(--ground), 0 0 0 3px var(--measured); }
.cell-detail { min-height: 5.5rem; max-width: 44rem; padding: 14px 0; border-top: 1px solid var(--rule); }
.cell-detail .who { font-weight: 600; }
.cell-detail p { margin: 4px 0; }
table.nat { border-collapse: collapse; width: 100%; min-width: 40rem; font-size: 0.9375rem; }
table.nat th, table.nat td { text-align: left; padding: 12px 16px 12px 0; border-top: 1px solid var(--rule); vertical-align: top; }
table.nat thead th { font-size: 0.8125rem; color: var(--ink-soft); font-weight: 600; border-top: 0; }
table.nat td.fig { font-weight: 700; font-size: 1.25rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.nat tr.uk td.fig, table.nat tr.uk th { color: var(--measured); }


/* Mobile menu */
.menu-btn { display: none; align-items: center; gap: 10px; font: inherit; font-size: 0.9375rem; font-weight: 600; color: var(--ink); background: transparent; border: 1px solid var(--rule); border-radius: 6px; min-height: 44px; padding: 0 14px; cursor: pointer; }
.menu-btn .bars { display: inline-flex; flex-direction: column; gap: 4px; width: 18px; }
.menu-btn .bars i { display: block; height: 2px; border-radius: 1px; background: currentColor; transition: transform 200ms ease, opacity 200ms ease; }
.menu-btn[aria-expanded="true"] .bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars i:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .menu-btn .bars i { transition: none; } }

@media (max-width: 720px) {
  .mast { position: sticky; top: 0; z-index: 20; }
  .mast .wrap { flex-wrap: nowrap; padding-block: 8px; min-height: 60px; }
  .js .menu-btn { display: inline-flex; }
  .js .nav { display: none; }
  .js .nav.open { display: flex; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--rule); box-shadow: 0 12px 24px rgba(24, 34, 46, .12); padding: 4px max(var(--gutter), env(safe-area-inset-right, 0px)) 12px max(var(--gutter), env(safe-area-inset-left, 0px)); }
  .no-js .nav { position: static; flex-direction: row; flex-wrap: wrap; box-shadow: none; border: 0; padding: 0; gap: 16px; }
  .nav a { display: flex; align-items: center; min-height: 52px; font-size: 1.0625rem; color: var(--ink); border-bottom: 1px solid var(--rule); border-left: 3px solid transparent; padding-left: 12px; }
  .nav a:last-child { border-bottom: 0; }
  .nav a[aria-current="page"] { border-bottom-color: var(--rule); border-left-color: var(--measured); font-weight: 600; }
  .mast .wrap { position: relative; }
  body { font-size: 1rem; }
  .hero { padding-block: 28px 24px; }
  section.band { padding-block: 36px; }
  .intro { margin-bottom: 24px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px))); padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-bottom: 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; min-height: 44px; padding: 0 16px; }
  .area-link { min-height: 44px; }
  .charts { gap: 40px; }
  .readings li { padding: 16px 0 18px; }
  .finding { padding-left: 14px; }
  .doc dl { gap: 6px 16px; }
  .src-list li { padding: 16px 0; }
}

/* Coverage grid: keep row labels in view while the grid scrolls */
table.cov tbody th, table.cov thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--ground); }
@media (max-width: 720px) {
  table.cov { min-width: 34rem; border-spacing: 4px; }
  table.cov tbody th { min-width: 8.5rem; max-width: 8.5rem; font-size: 0.8125rem; padding-right: 8px; line-height: 1.3; }
  table.cov thead th { font-size: 0.8125rem; }
  .covcell { height: 44px; }
  .grid-scroll { margin-inline: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px))); padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)); }
  .scroll-hint { display: block; }
}
.scroll-hint { display: none; font-size: 0.8125rem; color: var(--ink-soft); margin: -8px 0 12px; }

/* National figures: stacked rows on phones */
@media (max-width: 720px) {
  table.nat { min-width: 0; }
  table.nat thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.nat, table.nat tbody, table.nat tr, table.nat th, table.nat td { display: block; width: 100%; }
  table.nat tr { border-top: 1px solid var(--rule); padding: 14px 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
  table.nat th, table.nat td { border: 0; padding: 0; }
  table.nat th { grid-column: 1; font-size: 1rem; }
  table.nat td.fig { grid-column: 2; grid-row: 1; text-align: right; }
  table.nat td:not(.fig) { grid-column: 1 / -1; font-size: 0.9375rem; color: var(--ink-soft); }
  table.nat td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--ink); }
  table.nat td.src-cell { margin-top: 4px; }
  .grid-scroll.nat-wrap { overflow: visible; margin-inline: 0; padding-inline: 0; }
}
@media (max-width: 720px) { .ind, .area, .areas > li, h2[id] { scroll-margin-top: 80px; } }
