/* UK Grid News – shared stylesheet for every page. */

:root {
  /* Category colours: the validated 8-slot categorical palette, in slot order (CAT_ORDER in build-site.py).
     Always paired with the name. Categories 9 and 10 (flexibility, industry moves) and General share neutral grey,
     because more than eight hues can't stay distinguishable. */
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4; --cat-6: #008300; --cat-7: #6250d6; --cat-8: #e34948;
  /* Brand: grid navy with a signal-amber bolt; cobalt for links, focus and single-series charts. */
  --bg: #f6f7f9; --surface: #ffffff; --text: #0f172a; --muted: #526072; --faint: #5f6b7d; --line: #dde2ea;
  --accent: #2747a8; --accent-ink: #1e3a8a; --accent-soft: #e8edfa; --warn: #b45309;
  --brand: #13254a; --bolt: #ffc23d; --live: #b07c00;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
[data-theme="dark"] {
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #0ca30c; --cat-7: #9085e9; --cat-8: #e66767;
  --bg: #0a0f1c; --surface: #111827; --text: #e7eaf0; --muted: #a3adbd; --faint: #8a95a8; --line: #243042;
  --accent: #7b9cff; --accent-ink: #a9bcff; --accent-soft: #17224a; --warn: #fbbf24;
  --brand: #2e4f9a; --bolt: #ffc23d; --live: #ffc23d;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; font: 16px/1.6 var(--sans); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Masthead ---------- */
.mast { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.mast-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand svg { flex: none; display: block; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; letter-spacing: -.015em; }
.mast-right { display: flex; align-items: center; gap: 26px; }
.main-nav { display: flex; gap: 24px; font-weight: 500; font-size: .92rem; color: var(--muted); }
.main-nav a { padding: 22px 0; border-bottom: 2px solid transparent; transition: color .15s; }
.main-nav a:hover { color: var(--text); }
.main-nav a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.mast-buttons { display: flex; gap: 8px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); padding: 0; }
.icon-btn:hover { color: var(--text); border-color: var(--faint); }
.icon-btn .sun, [data-theme="dark"] .icon-btn .moon { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }
.menu-btn { display: none; }

.subbar { border-bottom: 1px solid var(--line); }
/* Trending tags that don't fit drop off whole (they wrap to a second line that is clipped), so nothing is cut mid-word */
.subbar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; height: 44px; overflow: hidden; font-size: .84rem; line-height: 44px; color: var(--muted); white-space: nowrap; }
.subbar .tag { line-height: 26px; }
.subbar strong { color: var(--text); font-weight: 600; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex: none; }
.sep { width: 1px; height: 16px; background: var(--line); flex: none; }
.tag { height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; color: var(--text); font-size: .8rem; font-weight: 500; }
.tag + .tag { margin-left: -6px; }
.tag:hover { border-color: var(--faint); }
.tag[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Shared bits ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; background: var(--faint); flex: none; }
.c-regulation-price-controls { background: var(--cat-1); }
.c-policy-government { background: var(--cat-2); }
.c-grid-connections { background: var(--cat-3); }
.c-network-investment-projects { background: var(--cat-4); }
.c-transmission { background: var(--cat-5); }
.c-distribution-dso { background: var(--cat-6); }
.c-generation-renewables { background: var(--cat-7); }
.c-storage { background: var(--cat-8); }
.c-flexibility-demand-response, .c-industry-moves, .c-general { background: var(--faint); }
.cat { white-space: nowrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .86rem; font-weight: 500; cursor: pointer; color: var(--text); white-space: nowrap; }
.chip:hover { border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip:disabled { cursor: default; }
.tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); font-size: .74rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -100%); z-index: 60; }
.tip[hidden] { display: none; }
.kicker { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.byline { font-size: .85rem; color: var(--muted); }
.byline b { color: var(--text); font-weight: 600; }
.coverage { color: var(--accent-ink); font-weight: 600; }
.text-link { color: var(--accent-ink); font-weight: 600; font-size: .9rem; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Two-column layout ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; margin-top: 34px; }
aside > section { padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
aside > section:last-child { border-bottom: 0; }

/* ---------- Homepage front ---------- */
.lead { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.strap { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; padding-top: 22px; }
.strap h1 { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; letter-spacing: -.01em; }
.strap p { font-size: .9rem; color: var(--muted); }
.wrap:has(> .strap) + .grid { margin-top: 22px; }
.lead h2 { font-family: var(--serif); font-weight: 600; font-size: 2.6rem; line-height: 1.1; letter-spacing: -.02em; margin: 10px 0 14px; max-width: 22ch; }
.lead h2 a:hover, .seconds h2 a:hover { color: var(--accent-ink); }
.also { list-style: none; padding: 0 0 0 14px; margin-top: 16px; border-left: 2px solid var(--line); font-size: .9rem; color: var(--muted); }
.also li { margin: 4px 0; }
.also a { color: var(--text); }
.also a:hover { color: var(--accent-ink); }
.seconds { display: grid; grid-template-columns: 1fr 1fr; padding: 24px 0 28px; border-bottom: 1px solid var(--line); }
.seconds > div:first-child { padding-right: 28px; border-right: 1px solid var(--line); }
.seconds > div:last-child { padding-left: 28px; }
.seconds h2 { font-family: var(--serif); font-weight: 600; font-size: 1.32rem; line-height: 1.22; letter-spacing: -.01em; margin: 8px 0 10px; }

/* ---------- Story list ---------- */
.list-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 34px 0 4px; flex-wrap: wrap; }
#filter-category { margin: 12px 0 2px; }
.list-head h2 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; letter-spacing: -.01em; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select { font-size: .86rem; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.filters input { width: 250px; }
.filters input:focus, .filters select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.day-split { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 22px 0 2px; }
.story-list { list-style: none; padding: 0; }
.item { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.item time { font-size: .8rem; color: var(--faint); padding-top: 2px; font-variant-numeric: tabular-nums; }
.item a { font-weight: 600; line-height: 1.4; }
.item a:hover { color: var(--accent-ink); }
.item .src { display: block; font-size: .8rem; color: var(--muted); margin-top: 3px; }
details.more { margin-top: 8px; font-size: .86rem; }
details.more summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; color: var(--accent-ink); font-weight: 600; padding: 3px 0; border-radius: 4px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details.more[open] summary::before { transform: rotate(45deg); }
details.more summary:hover { text-decoration: underline; text-underline-offset: 3px; }
details.more ul { list-style: none; padding: 4px 0 2px 14px; margin-top: 6px; border-left: 2px solid var(--line); }
details.more li { padding: 5px 0; line-height: 1.4; }
details.more li a { font-weight: 500; }
details.more li span { color: var(--muted); font-size: .8rem; margin-left: 8px; white-space: nowrap; }
.empty { padding: 24px 0; color: var(--muted); }
.load { margin: 24px 0; width: 100%; height: 44px; font-weight: 600; font-size: .9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.load:hover { border-color: var(--text); }
.load[hidden] { display: none; }

/* ---------- Sidebar widgets ---------- */
.week-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.week-num { display: flex; align-items: baseline; gap: 10px; }
.week-num strong { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.week-num span { font-size: .88rem; color: var(--muted); }
.facts { margin-top: 16px; border-top: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.facts dt { color: var(--muted); }
.facts dd { text-align: right; }
.facts dd a { font-weight: 600; }
.facts dd a:hover { color: var(--accent-ink); }
.facts .n { color: var(--faint); }
.week-box .text-link { display: inline-block; margin-top: 14px; }

/* ---------- Small charts ---------- */
.weekbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 88px; margin-top: 18px; }
.weekbars .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 5px; }
.weekbars .bar { width: 100%; max-width: 26px; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .45; min-height: 2px; }
.weekbars .col.today .bar, .weekbars .col:hover .bar { opacity: 1; }
.weekbars .col.future .bar { background: var(--line); opacity: 1; }
.weekbars .val { font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; border-top: 1px solid var(--line); padding-top: 6px; font-size: .7rem; color: var(--faint); text-align: center; font-weight: 600; }
.weekdays .today { color: var(--text); }
.week-box .facts { margin-top: 14px; }
.mini-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 16px; font-size: .8rem; color: var(--muted); }
.mini-head b { color: var(--text); font-weight: 600; white-space: nowrap; }
.spark-wrap { margin-top: 10px; }
.spark { display: block; width: 100%; height: 44px; overflow: hidden; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .area { fill: var(--accent); opacity: .1; }
.spark .cross { stroke: var(--faint); stroke-width: 1; }
.spark-axis { display: flex; justify-content: space-between; font-size: .7rem; color: var(--faint); margin-top: 4px; }
.catbars > div { display: grid; grid-template-columns: 118px 1fr 28px; gap: 10px; align-items: center; padding: 6px 0; font-size: .84rem; }
.catbars .name { display: flex; align-items: center; }
.catbars .fill { display: block; height: 8px; border-radius: 0 4px 4px 0; }
.catbars .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.strip { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 26px; }
.strip.cells-3 { grid-template-columns: 1.5fr 1fr 1.3fr; }
.strip.cells-2 { grid-template-columns: 1.5fr 1fr; }
.strip > div { background: var(--surface); padding: 16px 18px; min-width: 0; }
.strip dt { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.strip dd { margin-top: 6px; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; line-height: 1.15; }
.strip dd.text { font-size: 1.08rem; }
.strip dd a:hover { color: var(--accent-ink); }
.strip dd small { display: block; font-family: var(--sans); font-size: .8rem; font-weight: 400; color: var(--muted); margin-top: 3px; }
.strip .none { color: var(--faint); font-weight: 500; }
.strip .spark-wrap { margin-top: 8px; }
.ranked { list-style: none; padding: 0; counter-reset: r; }
.ranked li { counter-increment: r; display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ranked li:first-child { padding-top: 0; }
.ranked li:last-child { border-bottom: 0; padding-bottom: 0; }
.ranked li::before { content: counter(r); font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1; color: var(--accent); }
.ranked a { font-weight: 600; font-size: .92rem; line-height: 1.38; }
.ranked a:hover { color: var(--accent-ink); }
.ranked small { display: block; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.ranked.bare li { grid-template-columns: 1fr; }
.ranked.bare li::before { content: none; }
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.plain-list li:first-child { padding-top: 0; }
.plain-list a { font-weight: 600; font-size: .92rem; line-height: 1.38; }
.plain-list a:hover { color: var(--accent-ink); }
.plain-list small { display: block; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.chip-links { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-links a { font-size: .84rem; padding: 6px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.chip-links a:hover, .chip-links a[aria-current] { border-color: var(--accent); color: var(--accent-ink); }
.chip-links span { color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: 40px 0 28px; border-bottom: 1px solid var(--line); }
.crumbs { font-size: .82rem; color: var(--faint); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs span[aria-hidden] { margin: 0 7px; }
.page-head h1 { font-family: var(--serif); font-weight: 600; font-size: 2.6rem; line-height: 1.1; letter-spacing: -.02em; max-width: 24ch; }
.page-head .intro { margin-top: 12px; font-size: 1.08rem; color: var(--muted); max-width: 64ch; }
.page-head .meta { margin-top: 14px; font-size: .85rem; color: var(--faint); }

/* ---------- Cards (networks / topics / about) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 34px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s; }
a.card:hover { border-color: var(--accent); }
.card h2, .card h3 { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.25; }
.card .count { font-size: .8rem; font-weight: 600; color: var(--accent-ink); }
.card p { font-size: .9rem; color: var(--muted); line-height: 1.5; }
.card.quiet { opacity: .7; }

/* ---------- Prose (guide, FAQ, about, legal) ---------- */
.prose-wrap { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 56px; margin-top: 34px; }
.prose-wrap.solo { grid-template-columns: minmax(0, 720px); }
.toc { position: sticky; top: 100px; align-self: start; font-size: .88rem; }
.toc ol { list-style: none; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
.prose { font-size: 1.02rem; line-height: 1.7; }
.prose > * + *, .prose section > * + * { margin-top: 1em; }
.prose h2 { font-family: var(--serif); font-weight: 600; font-size: 1.65rem; line-height: 1.2; letter-spacing: -.01em; margin-top: 2.2em; padding-top: .2em; }
.prose > h2:first-child, .prose > section:first-child > h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.08rem; font-weight: 700; margin-top: 1.8em; }
.prose h2 + p, .prose h3 + p { margin-top: .5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose a:not(.card):not(.btn) { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { font-weight: 600; }
.prose section { scroll-margin-top: 90px; }
.prose .lede { font-size: 1.15rem; color: var(--muted); }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 18px 22px; }
.callout > * + * { margin-top: .6em; }
.callout h3 { margin-top: 0; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }
.prose td.num { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.def-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.def-grid > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.def-grid h3 { margin: 0 0 6px; font-size: 1rem; }
.def-grid p { margin: 0; font-size: .93rem; color: var(--muted); line-height: 1.55; }
.steps { list-style: none; padding: 0 !important; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 0 46px; margin-top: 18px !important; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: .9rem; display: grid; place-items: center; }
.steps strong { display: block; }
details.faq { border-bottom: 1px solid var(--line); }
details.faq:first-of-type { border-top: 1px solid var(--line); }
details.faq summary { cursor: pointer; list-style: none; padding: 16px 32px 16px 0; font-weight: 600; position: relative; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: ''; position: absolute; right: 6px; top: 22px; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); transition: transform .2s; }
details.faq[open] summary::after { transform: rotate(-135deg); top: 26px; }
details.faq summary:hover { color: var(--accent-ink); }
details.faq > div { padding: 0 0 18px; color: var(--muted); }
/* Glossary and timeline */
.glossary dt { font-weight: 700; margin-top: 18px; scroll-margin-top: 90px; }
.glossary dt:first-child { margin-top: 6px; }
.glossary dd { margin: 4px 0 0; color: var(--muted); }
.timeline { list-style: none; padding: 0 !important; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li { position: relative; padding: 0 0 4px 22px; margin-top: 20px !important; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li.ahead::before { border-style: dashed; }
.timeline time { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.timeline strong { display: block; margin-top: 2px; }
.timeline p { margin: 4px 0 0 !important; color: var(--muted); font-size: .95rem; }
.btn { display: inline-block; background: var(--accent); color: var(--surface); font-weight: 600; padding: 11px 20px; border-radius: 8px; }
.btn:hover { background: var(--accent-ink); }

/* ---------- Weekly ---------- */
.summary-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 30px; }
.summary-facts div { background: var(--surface); padding: 16px 18px; }
.summary-facts dt { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.summary-facts dd { margin-top: 6px; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.15; }
.summary-facts dd a:hover { color: var(--accent-ink); }
.summary-facts dd small { display: block; font-family: var(--sans); font-size: .8rem; font-weight: 400; color: var(--muted); }
.week-section h2 { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; margin-top: 38px; }
.week-section h2 span { color: var(--faint); font-weight: 500; }
.week-list { list-style: none; padding: 0; }
.week-list li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.week-list a { font-weight: 600; }
.week-list a:hover { color: var(--accent-ink); }
.week-list span { color: var(--muted); font-size: .88rem; white-space: nowrap; }

/* ---------- New sites table ---------- */
.sites-count { font-size: .85rem; color: var(--muted); margin: 6px 0 12px; min-height: 1.4em; }
.sites { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sites th, .sites td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sites th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; white-space: nowrap; }
.sites tbody tr:last-child td { border-bottom: 0; }
.sites tbody tr:hover { background: var(--bg); }
.sites tr[hidden] { display: none; }
.sites time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sites .site { min-width: 260px; }
.sites .site a { font-weight: 600; line-height: 1.4; }
.sites .site a:hover { color: var(--accent-ink); }
.sites small { display: block; font-size: .8rem; color: var(--muted); margin-top: 3px; }
.sites .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sites td.num { font-weight: 600; }
.sites .none { color: var(--faint); font-weight: 400; }
.sites-note { font-size: .82rem; color: var(--muted); margin-top: 14px; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 90px 0 40px; }
.not-found .code { font-family: var(--serif); font-size: 5rem; font-weight: 600; color: var(--accent); line-height: 1; }
.not-found h1 { font-family: var(--serif); font-size: 2rem; font-weight: 600; margin: 14px 0 10px; }
.not-found p { color: var(--muted); margin-bottom: 26px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 72px; background: var(--surface); }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-top: 44px; padding-bottom: 30px; }
.foot p { font-size: .88rem; color: var(--muted); margin-top: 12px; max-width: 34ch; }
.foot h2 { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.foot ul { list-style: none; padding: 0; }
.foot li { margin: 7px 0; font-size: .9rem; }
.foot li a:hover { color: var(--accent-ink); }
.legal { border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 28px; font-size: .8rem; color: var(--faint); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.legal a:hover { color: var(--accent-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; gap: 20px; }
  .menu-btn { display: grid; }
  /* Touch screens: the bar scrolls sideways instead, with a fade at the edge to show there is more */
  .subbar-inner { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: 48px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
  .subbar-inner::-webkit-scrollbar { display: none; }
  .main-nav { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 6px 24px 14px; box-shadow: 0 12px 24px rgba(0,0,0,.08); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .main-nav a:last-child { border-bottom: 0; }
  .main-nav a[aria-current] { color: var(--accent-ink); border-bottom-color: var(--line); }
  .foot { grid-template-columns: 1fr 1fr; }
  .prose-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .lead h2 { font-size: 1.95rem; }
  .page-head h1 { font-size: 2rem; }
  .seconds { grid-template-columns: 1fr; }
  .seconds > div:first-child { padding: 0 0 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .seconds > div:last-child { padding: 20px 0 0; }
  .filters, .filters input, .filters select { width: 100%; }
  .strip, .strip.cells-3, .strip.cells-2 { grid-template-columns: 1fr 1fr; }
  .strip > div:first-child, .strip > div:last-child:nth-child(even) { grid-column: 1 / -1; }
  .filters input, .filters select { font-size: 16px; height: 42px; } /* under 16px, iOS Safari zooms the page on focus */
  .item { grid-template-columns: 52px 1fr; gap: 12px; }
  .brand-name { font-size: 1.08rem; }
  .mast-right { gap: 12px; }
  .foot { grid-template-columns: 1fr; gap: 24px; }
  .week-list li { flex-direction: column; gap: 2px; }
  /* New sites: each row becomes a card */
  .sites thead { position: absolute; left: -9999px; }
  .sites, .sites tbody, .sites tr, .sites td { display: block; }
  .sites tr { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
  .sites tbody tr:last-child { border-bottom: 0; }
  .sites th, .sites td { padding: 0; border: 0; }
  .sites td.site, .sites td[data-label="Reported"] { grid-column: 1 / -1; }
  .sites td.site { order: -1; min-width: 0; }
  .sites td.num { text-align: left; }
  .sites td[data-label]:not([data-label="Reported"])::before { content: attr(data-label); display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
  .sites td:has(> .none:only-child) { display: none; }
}
@media print {
  .mast, .subbar, .site-footer, aside, .filters, .load { display: none !important; }
}
