:root {
  --color-badge-active: #0b6e4f;
  --color-badge-dissolved: #8a8a8a;
  --color-error: #b3261e;
  --icon-csv: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M3 9h18M3 15h18M9 3v18'/%3E%3C/svg%3E");
  --icon-pdf: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cpath d='M9 13h1.5a1.5 1.5 0 0 1 0 3H9v2'/%3E%3Cpath d='M14 13v5h1.5a1.5 1.5 0 0 0 1.5-1.5v-2A1.5 1.5 0 0 0 15.5 13H14z'/%3E%3C/svg%3E");
  --icon-zip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
  --icon-geojson: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 6-9 12-9 12s-9-6-9-12a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
  --icon-rss: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11a9 9 0 0 1 9 9'/%3E%3Cpath d='M4 4a16 16 0 0 1 16 16'/%3E%3Ccircle cx='5' cy='19' r='1' fill='currentColor'/%3E%3C/svg%3E");
  --icon-schema: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3Cpath d='M9 15l2 2 4-4'/%3E%3C/svg%3E");
}
/* Base, skip link, focus ring, header band, tables, format pills and footer:
   see opencommons.uk/shared/opencommons.css. The rules here are what differs. */
/* maplibre-gl.css loads after the shared sheet and sets outline: none on
   .maplibregl-ctrl-group button at the same specificity; this keeps the
   map buttons' focus ring. */
button:focus-visible { outline: 2px solid var(--color-link); }
code, pre { font-size: 0.9em; }
code { background: var(--color-panel-bg); padding: 0.1rem 0.35rem; border-radius: 4px; }
pre {
  background: var(--color-panel-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; }

.site-title { font-weight: 700; }
.site-title a { color: var(--color-header-text); }
.site-title span { opacity: 0.7; font-weight: 600; }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--spacing) 3rem;
}
h1 { font-size: 1.75rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.25rem; margin: 2.5rem 0 0.75rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.25rem; }
.spec-content > section:first-child h2 { margin-top: 0; }
h3 { font-size: 1rem; margin: 1.75rem 0 0.5rem; }
.lede { color: var(--color-muted); margin: 0 0 2rem; max-width: 62ch; }
p, li { max-width: 72ch; }
.muted { color: var(--color-muted); }
.small { font-size: var(--text-sm); }
.wide { max-width: none; }
.stats-demo dl { margin: 0; }
.chart-demo caption { text-align: left; padding-bottom: 0.4rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.spec-layout { display: grid; grid-template-columns: 200px 1fr; gap: 0 2.5rem; align-items: start; }
.spec-content { min-width: 0; }
.spec-sidebar { position: sticky; top: 1.5rem; }
.spec-nav { display: flex; flex-direction: column; gap: 0.1rem; font-size: var(--text-sm); }
.spec-nav a { text-decoration: none; padding: 0.25rem 0.6rem; border-radius: 4px; color: var(--color-text); }
.spec-nav a:hover { background: var(--color-panel-bg); }
.spec-nav > a.active { color: var(--color-link); background: var(--color-accent-bg); }
.spec-subnav { display: flex; flex-direction: column; gap: 0.1rem; margin: 0.15rem 0 0.4rem 0.6rem; border-left: 1px solid var(--color-border); }
.spec-subnav a { padding: 0.15rem 0.6rem; font-size: var(--text-xs); color: var(--color-muted); }
.spec-subnav a.active { color: var(--color-link); background: none; font-weight: 600; }
/* With scripting on, designlanguage.js opens the current section's subnav. */
@media (scripting: enabled) {
  .spec-subnav { display: none; }
  .spec-subnav.open { display: flex; }
}
section[id], h3[id] { scroll-margin-top: 1.5rem; }

.anchor { color: inherit; text-decoration: none; }
.anchor:hover { color: var(--color-link); }
.anchor::after { content: "#"; margin-left: 0.4em; color: var(--color-muted); font-weight: 400; opacity: 0; }
.anchor:hover::after, .anchor:focus-visible::after { opacity: 1; }

.table-wrap { margin: 1rem 0; }
table { font-size: var(--text-sm); }
th, td { padding: 0.45rem 0.75rem; vertical-align: top; }
th { font-size: var(--text-sm); }
tbody tr:hover { background: var(--color-panel-bg); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1.25rem; margin: 1rem 0; }
dl.facts dt { color: var(--color-muted); font-size: var(--text-sm); font-weight: 600; }
dl.facts dd { margin: 0; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--color-badge-active);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
}
.badge.dissolved { background: var(--color-badge-dissolved); }
.tag {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--color-accent-bg);
  color: var(--color-link);
  font-size: 0.78rem;
}

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.swatch { border: 1px solid var(--color-border); border-radius: 6px; overflow: hidden; font-size: 0.8rem; }
.swatch-chip { height: 3rem; border-bottom: 1px solid var(--color-border); }
.swatch-meta { padding: 0.4rem 0.6rem; }
/* Each chip shows the colour its card names. */
.chip-bg, .chip-header-text { background: #fff; }
.chip-text { background: #313131; }
.chip-muted { background: #666; }
.chip-header-bg, .chip-link { background: #1a5fb4; }
.chip-link-hover { background: #0d3d6b; }
.chip-border { background: #ddd; }
.chip-accent { background: #eef3fc; }
.chip-panel { background: #f5f7fa; }
.chip-footer { background: #f5f5f5; }
.chip-positive { background: #0b6e4f; }
.chip-inactive { background: #8a8a8a; }
.chip-error { background: #b3261e; }
.chip-success { background: #1a7f37; }
.chip-caveat { background: #fff8e1; border-bottom: 3px solid #e0b800; }
.chip-mark { background: #fff3a8; }
.swatch-meta code { display: block; background: none; padding: 0; font-size: var(--text-xs); }
.swatch-meta .muted { display: block; }

.favicon-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; }
.favicon-item { text-align: center; font-size: 0.8rem; color: var(--color-muted); width: 5rem; }
.favicon-item svg { width: 48px; height: 48px; display: block; margin: 0 auto 0.35rem; }

.wordmark-strip { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.wordmark-demo {
  background: var(--color-header-bg);
  color: var(--color-header-text);
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.wordmark-demo span { opacity: 0.7; font-weight: 600; }

.demo {
  border: 1px dashed var(--color-border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.entity-preview-static {
  position: static;
  visibility: visible;
  opacity: 1;
}
@media (max-width: 640px) {
  .entity-preview-static { display: block; }
}
.demo-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); margin: 0 0 0.75rem; }

.panel {
  background: var(--color-panel-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}
.stats-demo { max-width: 15rem; }
.stats-demo dt { font-size: 0.8rem; color: var(--color-muted); }
.stats-demo dd { margin: 0 0 0.6rem; font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.pagination-demo {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--color-border);
  padding-top: 0.75rem;
  font-size: var(--text-sm);
}
.pagination-demo .pagination-prev { justify-self: start; }
.pagination-demo .pagination-next { justify-self: end; }
.pagination-demo .pagination-status { color: var(--color-muted); white-space: nowrap; }
.pagination-demo a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.pagination-demo a:hover { background: var(--color-accent-bg); border-color: var(--color-link); color: var(--color-link-hover); }

.search-tabs-demo { display: flex; gap: 0.25rem; box-shadow: inset 0 -1px 0 var(--color-border); overflow-x: auto; }
.search-tabs-demo a {
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  font-size: var(--text-sm);
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  white-space: nowrap;
}
.search-tabs-demo a.active {
  background: var(--color-bg);
  border-color: var(--color-border);
  box-shadow: 0 1px 0 var(--color-bg);
  color: var(--color-text);
  font-weight: 600;
}

.data-links a { transition: background 0.15s, border-color 0.15s; }
.data-links a::before { margin-left: -0.2rem; }
.data-links a.format-csv::before { -webkit-mask-image: var(--icon-csv); mask-image: var(--icon-csv); }
.data-links a.format-pdf::before { -webkit-mask-image: var(--icon-pdf); mask-image: var(--icon-pdf); }
.data-links a.format-zip::before { -webkit-mask-image: var(--icon-zip); mask-image: var(--icon-zip); }
.data-links a.format-geojson::before { -webkit-mask-image: var(--icon-geojson); mask-image: var(--icon-geojson); }
.data-links a.format-rss::before { -webkit-mask-image: var(--icon-rss); mask-image: var(--icon-rss); }
.data-links a.format-schema::before { -webkit-mask-image: var(--icon-schema); mask-image: var(--icon-schema); }

.statement-demo { max-width: 42rem; }
.statement-demo th[scope="row"] { font-weight: normal; color: var(--color-text); border-bottom: 1px solid var(--color-border); white-space: normal; text-align: left; }
.statement-demo .num { width: 9rem; }
.statement-demo tbody tr:last-child > * { border-bottom: none; }
.statement-demo tr.sub th[scope="row"] { padding-left: 1rem; color: var(--color-muted); }
.statement-demo tr.total > * { font-weight: 600; }
.statement-demo .prior, .statement-demo .not-filed { color: var(--color-muted); }
.statement-note { max-width: 42rem; margin: 0.25rem 0 0; }
@media (max-width: 640px) {
  .statement-demo th[scope="row"] { padding-right: 0.4rem; }
  .statement-demo .num { width: auto; padding-left: 0.4rem; }
}

.breadcrumb-demo ol { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 0; font-size: var(--text-sm); color: var(--color-muted); }
.breadcrumb-demo li + li::before { content: "›"; margin: 0 0.45rem; }

.info-tip { position: relative; display: inline-block; }
.info-tip summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  width: 1.05rem; height: 1.05rem;
  line-height: 1.05rem;
  text-align: center;
  border: 1px solid var(--color-muted);
  border-radius: 50%;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-style: italic;
  font-family: Georgia, serif;
}
.info-tip summary::-webkit-details-marker { display: none; }
.info-tip[open] .info-tip-content {
  position: absolute;
  left: 0; top: 1.5rem;
  z-index: 10;
  width: 16rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
}

.error { color: var(--color-error); font-weight: 600; }

.chart-demo { margin: 0; }

.finance-chart { width: 100%; height: 240px; }
.chart-demo .table-wrap { margin: 0.75rem 0 0; }
.chart-demo figcaption { font-size: var(--text-xs); color: var(--color-muted); margin-top: 0.6rem; max-width: 72ch; }

.map-demo { margin: 0; display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-start; }
[data-oc-map] {
  width: 280px;
  height: 240px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  overflow: hidden;
}
[data-oc-map] .maplibregl-ctrl-attrib { font-size: 10px; }
.cluster-key svg { display: block; width: 100%; height: 100%; }
.map-notes { flex: 1 1 20rem; min-width: 0; }
.map-notes pre { margin: 0 0 0.75rem; }
.map-notes p { margin: 0; }
.cluster-key { flex: 1 1 100%; max-width: 300px; }
.map-demo figcaption { flex: 1 1 100%; font-size: var(--text-xs); color: var(--color-muted); margin-top: 0.2rem; max-width: 72ch; }

.site-key { font-size: 0.78rem; }

footer { background: #f5f5f5; margin-top: 3rem; font-size: var(--text-sm); color: var(--color-muted); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
  justify-content: space-between;
}
.footer-nav { flex-direction: column; }
/* The shared .footer-credit { margin: 0 } would drop this page's paragraph margins. */
.footer-credit { margin: 1em 0; }

@media (max-width: 640px) {
  .spec-layout { display: block; }
  .spec-sidebar { display: none; }
  .site-title { font-size: 1.1rem; }
  dl.facts { grid-template-columns: 1fr; gap: 0 0; }
  dl.facts dd { margin-bottom: 0.6rem; }
  dl.facts code { overflow-wrap: anywhere; }
  [data-oc-map] { width: 100%; height: 200px; }
}
@media (max-width: 500px) {
  .finance-chart { height: 220px; }
}
