/* diabetis.ca. The frame is ruled like a blood glucose logbook; the reading column stays plain.
   Spacing is on an 8 px unit (--u). */

@font-face {
  font-family: m5x7;
  src: url(/fonts/m5x7.ttf) format("truetype");
  font-display: swap;
}

:root {
  --u: 8px;
  --paper: oklch(0.992 0.003 240);
  --ink: oklch(0.25 0.03 255);
  --ink-2: oklch(0.43 0.03 255);
  --rule: oklch(0.88 0.025 238);
  --rule-strong: oklch(0.74 0.045 240);
  --tint: oklch(0.955 0.018 236);
  --cover: oklch(0.36 0.085 252);
  --cover-deep: oklch(0.29 0.075 254);
  --on-cover: oklch(0.975 0.008 240);
  --on-cover-2: oklch(0.86 0.03 240);
  --link: oklch(0.42 0.12 252);
  --low: oklch(0.5 0.18 27);
  --low-tint: oklch(0.965 0.022 27);
  --game: oklch(0.21 0.03 262);
  --game-2: oklch(0.27 0.035 262);
  --game-ink: oklch(0.94 0.035 92);
  --game-ink-2: oklch(0.8 0.03 92);
  --game-gold: oklch(0.84 0.15 88);
  --sans: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", monospace;
  --pixel: m5x7, var(--mono);
  --measure: 68ch;
  --wrap: 1240px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--u) * 3); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

::selection { background: oklch(0.86 0.07 245); color: var(--ink); }

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cover); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { line-height: 1.2; text-wrap: balance; margin: 0; }
p, ul, ol { margin: 0 0 calc(var(--u) * 2); }
li + li { margin-top: var(--u); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 calc(var(--u) * 4); }

.skip {
  position: absolute; left: var(--u); top: -100px; z-index: 10;
  background: var(--ink); color: var(--paper); padding: var(--u) calc(var(--u) * 2);
}
.skip:focus { top: var(--u); }

.label {
  font: 500 0.75rem/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Emergency strip ---------- */

.alertbar { background: var(--cover-deep); color: var(--on-cover); font-size: 0.9375rem; }
.alertbar .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: calc(var(--u) * 2);
  min-height: calc(var(--u) * 6);
}
.alertbar p { margin: 0; padding: var(--u) 0; }
.alertbar a { color: var(--on-cover); }
.alertbar strong { font-weight: 700; }
.alertbar-play {
  font: 1.25rem/1 var(--pixel);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: var(--u);
  min-height: 44px; padding: 0 calc(var(--u) * 1.5);
  color: var(--game-gold) !important;
}
.alertbar-play:hover { text-decoration: underline; }

/* ---------- Masthead: a log page header ---------- */

.masthead { background: var(--cover); color: var(--on-cover); }
.masthead .wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  gap: calc(var(--u) * 4);
  padding-top: calc(var(--u) * 2);
  padding-bottom: calc(var(--u) * 2);
}

.brand {
  display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto;
  column-gap: calc(var(--u) * 1.5); align-items: center; align-content: center; justify-content: start;
  color: inherit; text-decoration: none;
}
.brand-mark { grid-row: 1 / span 2; width: 40px; height: 40px; }
.brand-name { font-weight: 800; font-size: 1.625rem; letter-spacing: -0.02em; line-height: 1.1; }
.brand-name span { font-weight: 400; color: var(--on-cover-2); }
.brand-line { font-size: 0.875rem; color: var(--on-cover-2); line-height: 1.3; }

.lognav ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid oklch(0.55 0.07 250);
  border-radius: 4px;
  overflow: hidden;
}
.lognav li { margin: 0; border-left: 1px solid oklch(0.55 0.07 250); }
.lognav li:first-child { border-left: 0; }
.lognav a {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  height: 100%; min-height: calc(var(--u) * 8);
  padding: var(--u) calc(var(--u) * 1.5);
  color: var(--on-cover); text-decoration: none;
  font-weight: 700; font-size: 0.9375rem; line-height: 1.2;
}
.lognav .label { color: var(--on-cover-2); font-weight: 400; }
.lognav a:hover { background: oklch(0.42 0.085 252); }
.lognav a[aria-current] { background: var(--paper); color: var(--cover-deep); }
.lognav a[aria-current] .label { color: var(--ink-2); }

/* ---------- Page opener ---------- */

.opener { border-bottom: 1px solid var(--rule-strong); background: var(--tint); }
.opener .wrap { padding-top: calc(var(--u) * 5); padding-bottom: 0; }
.crumbs { font-size: 0.9375rem; color: var(--ink-2); margin-bottom: calc(var(--u) * 2); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--u); }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: var(--u); color: var(--rule-strong); }
.crumbs a { color: var(--ink-2); }
.opener h1 {
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  font-weight: 800; letter-spacing: -0.025em;
  max-width: 22ch;
  margin-bottom: calc(var(--u) * 2);
}
.standfirst { font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); max-width: 60ch; margin-bottom: calc(var(--u) * 4); }

/* The log row: one ruled line of cells under each title. */
.logrow {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0; border-top: 1px solid var(--rule-strong);
}
.logrow div { padding: calc(var(--u) * 1.5) calc(var(--u) * 2) calc(var(--u) * 1.5) 0; }
.logrow div + div { border-left: 1px solid var(--rule); padding-left: calc(var(--u) * 2); }
.logrow dt { color: var(--ink-2); margin-bottom: 2px; }
.logrow dd { margin: 0; font-weight: 700; font-size: 0.9375rem; }

/* ---------- Article layout ---------- */

.page { padding-top: calc(var(--u) * 6); padding-bottom: calc(var(--u) * 10); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: calc(var(--u) * 8); align-items: start; }

.rail { position: sticky; top: calc(var(--u) * 3); display: grid; gap: calc(var(--u) * 3); }
.toc { border-top: 3px solid var(--cover); padding-top: calc(var(--u) * 1.5); }
.toc .label { color: var(--ink-2); display: block; margin-bottom: var(--u); }
.toc ol, .prose .toc ol { list-style: none; padding: 0; margin: 0; font-size: 0.9375rem; }
.toc li { margin: 0; border-bottom: 1px solid var(--rule); }
.toc a { display: flex; align-items: center; min-height: 44px; padding: var(--u) 0; color: var(--ink); text-decoration: none; line-height: 1.3; }
.toc a:hover { color: var(--link); text-decoration: underline; }

.prose { max-width: var(--measure); }
.prose > h2 {
  font-size: 1.625rem; font-weight: 800; letter-spacing: -0.015em;
  margin: calc(var(--u) * 7) 0 calc(var(--u) * 2);
  padding-top: calc(var(--u) * 2);
  border-top: 1px solid var(--rule);
}
.with-note > .prose > h2:first-child { border-top: 0; padding-top: 0; }
.prose h3 { font-size: 1.1875rem; font-weight: 700; margin: calc(var(--u) * 4) 0 var(--u); }
.prose ul, .prose ol { padding-left: calc(var(--u) * 3); }
.prose strong { font-weight: 700; }
.lede { font-size: 1.1875rem; line-height: 1.6; }

/* A section with a game note beside it. The note never sits inside the steps. */
.article { max-width: calc(var(--measure) + 300px + var(--u) * 6); }
.article > .prose, .article > .careteam { max-width: var(--measure); }
.with-note {
  display: grid; grid-template-columns: minmax(0, var(--measure)) 300px;
  gap: calc(var(--u) * 6); align-items: start;
  margin-top: calc(var(--u) * 7);
}
.with-note.top { margin-top: 0; }
.with-note > .prose > h2:first-child { margin-top: 0; }
.article > .prose:first-child > h2:first-child { margin-top: 0; }
.with-note + .prose > h2:first-child, .careteam + .prose > h2:first-child { margin-top: calc(var(--u) * 7); }
.toc { margin-top: calc(var(--u) * 4); }
.with-note > .prose { min-width: 0; }

/* Numbered steps, set as log rows */
.steps { list-style: none; padding: 0 !important; counter-reset: step; border-top: 1px solid var(--rule-strong); margin-bottom: calc(var(--u) * 3); }
.steps > li {
  counter-increment: step;
  display: grid; grid-template-columns: calc(var(--u) * 6) 1fr; gap: calc(var(--u) * 2);
  padding: calc(var(--u) * 2) 0; margin: 0;
  border-bottom: 1px solid var(--rule-strong);
}
.steps > li::before {
  content: counter(step);
  font: 700 1.5rem/1 var(--mono);
  color: var(--cover);
  padding-top: 2px;
}
.steps > li > :last-child { margin-bottom: 0; }
.steps p { margin-bottom: var(--u); }

/* Callouts */
.note {
  background: var(--tint); border: 1px solid var(--rule);
  border-radius: 4px; padding: calc(var(--u) * 2) calc(var(--u) * 2.5);
  margin: calc(var(--u) * 3) 0;
}
.note > :last-child { margin-bottom: 0; }
.note .label { display: block; color: var(--ink-2); margin-bottom: var(--u); }

.careteam {
  display: grid; grid-template-columns: auto 1fr; gap: calc(var(--u) * 2); align-items: start;
  border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong);
  padding: calc(var(--u) * 2.5) 0; margin: calc(var(--u) * 5) 0;
}
.careteam svg { width: 28px; height: 28px; color: var(--cover); margin-top: 2px; }
.careteam p { margin: 0; }

.emergency {
  border: 2px solid var(--low); border-radius: 4px; background: var(--low-tint);
  padding: calc(var(--u) * 2.5) calc(var(--u) * 3);
  margin: calc(var(--u) * 3) 0;
}
.emergency h2, .emergency h3 {
  color: var(--low); font-size: 1.1875rem; font-weight: 800; margin: 0 0 var(--u);
  border: 0; padding: 0; display: flex; align-items: center; gap: var(--u);
}
.emergency h2 svg, .emergency h3 svg { width: 22px; height: 22px; flex: none; }
.emergency ul { padding-left: calc(var(--u) * 3); }
.emergency > :last-child { margin-bottom: 0; }
.emergency .call { font-size: 1.25rem; font-weight: 800; }
.emergency .call a { color: var(--low); }

/* Tables, set on the log grid */
.table-wrap { overflow-x: auto; margin: calc(var(--u) * 3) 0; border: 1px solid var(--rule-strong); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9688rem; line-height: 1.45; }
caption { text-align: left; padding: calc(var(--u) * 1.5) calc(var(--u) * 2); font-weight: 700; border-bottom: 1px solid var(--rule-strong); }
th, td { text-align: left; vertical-align: top; padding: calc(var(--u) * 1.25) calc(var(--u) * 2); border-bottom: 1px solid var(--rule); }
td + td, th + th { border-left: 1px solid var(--rule); }
thead th { background: var(--tint); font: 500 0.75rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 700; }

/* Reading marks: a symbol and a word, never colour alone */
.mark { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.mark-low { color: var(--low); }
.mark-range { color: var(--cover); }
.mark-high { color: oklch(0.45 0.1 60); }

/* Sources */
.sources { margin-top: calc(var(--u) * 7); padding-top: calc(var(--u) * 2); border-top: 3px solid var(--cover); max-width: var(--measure); }
.sources h2 { font-size: 1.125rem; font-weight: 800; margin-bottom: calc(var(--u) * 1.5); }
.sources ol { font-size: 0.9375rem; padding-left: calc(var(--u) * 3); color: var(--ink-2); }
.sources a { word-break: break-word; }
.reviewed { font-size: 0.875rem; color: var(--ink-2); }

/* ---------- The game, slipped between the pages ---------- */

.game-note {
  background: var(--game); color: var(--game-ink);
  border-radius: 4px; padding: calc(var(--u) * 2.5);
  font-size: 0.9375rem; line-height: 1.55;
}
.game-note .partner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--u);
  font: 1.125rem/1 var(--pixel); color: var(--game-ink-2);
  border-bottom: 1px solid oklch(0.38 0.04 262); padding-bottom: var(--u); margin-bottom: calc(var(--u) * 1.5);
}
.game-note h3, .game-note h2 { font: 1.75rem/1 var(--pixel); color: var(--game-gold); margin: 0 0 var(--u); letter-spacing: 0; border: 0; padding: 0; }
.game-note p { margin-bottom: calc(var(--u) * 1.5); }
.game-note a { color: var(--game-gold); }
.game-note .sprite { image-rendering: pixelated; width: auto; height: 72px; margin-bottom: var(--u); }
.game-note .shot { image-rendering: pixelated; border-radius: 2px; margin: 0 0 calc(var(--u) * 1.5); width: 100%; }
.game-note .fine { font-size: 0.8125rem; color: var(--game-ink-2); margin: 0; }
.game-note > :last-child { margin-bottom: 0; }
.game-note .cta {
  display: inline-flex; align-items: center; min-height: 44px;
  font: 1.375rem/1 var(--pixel); color: var(--game); background: var(--game-gold);
  padding: 0 calc(var(--u) * 2); border-radius: 3px; text-decoration: none;
  margin-bottom: calc(var(--u) * 1.5);
}
.game-note .cta:hover { background: oklch(0.9 0.14 92); }

.start-here {
  display: grid; grid-template-columns: auto 1fr; gap: calc(var(--u) * 2.5); align-items: center;
  margin-top: calc(var(--u) * 6); padding: calc(var(--u) * 3);
  background: var(--game); color: var(--game-ink); border-radius: 4px; max-width: var(--measure);
}
.start-here img { image-rendering: pixelated; height: 96px; width: auto; }
.start-here p { margin: 0 0 var(--u); font-size: 1.125rem; }
.start-here strong { font: 1.75rem/1.1 var(--pixel); color: var(--game-gold); display: block; margin-bottom: 4px; }
.start-here a { color: var(--game-gold); font-weight: 700; }

/* Next and previous */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 2); margin-top: calc(var(--u) * 6); max-width: var(--measure); }
.pager a {
  display: block; padding: calc(var(--u) * 2); border: 1px solid var(--rule-strong); border-radius: 4px;
  text-decoration: none; color: var(--ink); min-height: 44px;
}
.pager a:hover { border-color: var(--cover); background: var(--tint); }
.pager .label { display: block; color: var(--ink-2); margin-bottom: 4px; }
.pager strong { font-weight: 700; color: var(--link); }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- Lists of articles (home and sections) ---------- */

.entries { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule-strong); }
.entries li { margin: 0; border-bottom: 1px solid var(--rule); }
.entries a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: calc(var(--u) * 2); align-items: baseline;
  padding: calc(var(--u) * 2) 0; text-decoration: none; color: var(--ink);
}
.entries a:hover h2 { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.entries h2 { font-size: 1.1875rem; font-weight: 700; margin-bottom: 4px; }
.entries p { margin: 0; color: var(--ink-2); font-size: 0.9688rem; line-height: 1.5; }
.entries .label { color: var(--ink-2); }

/* ---------- Home ---------- */

.home-top { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: calc(var(--u) * 6); padding-top: calc(var(--u) * 6); }
.home-start h1 { font-size: clamp(2.125rem, 1.4rem + 2.6vw, 3.375rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; margin-bottom: calc(var(--u) * 2); max-width: 15ch; }
.home-start .standfirst { margin-bottom: calc(var(--u) * 3); }
.home-side { display: grid; gap: calc(var(--u) * 3); align-content: start; }

.sections-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 3px solid var(--cover); margin-top: calc(var(--u) * 8);
}
.sections-grid > section { padding: calc(var(--u) * 2.5) calc(var(--u) * 3) calc(var(--u) * 3) 0; }
.sections-grid > section + section { border-left: 1px solid var(--rule); padding-left: calc(var(--u) * 3); }
.sections-grid h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: calc(var(--u) * 1.5); }
.sections-grid h2 a { color: var(--ink); text-decoration: none; }
.sections-grid h2 a:hover { color: var(--link); text-decoration: underline; }
.sections-grid ul { list-style: none; padding: 0; margin: 0; font-size: 0.9688rem; }
.sections-grid li { margin: 0; border-top: 1px solid var(--rule); }
.sections-grid li a { display: block; padding: var(--u) 0; min-height: 44px; line-height: 1.4; display: flex; align-items: center; }

.band { margin-top: calc(var(--u) * 10); padding: calc(var(--u) * 6) 0; background: var(--tint); border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
.band h2 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.015em; margin-bottom: calc(var(--u) * 1.5); }

.stories-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: calc(var(--u) * 2); margin-top: calc(var(--u) * 3); list-style: none; padding: 0; }
.stories-strip li { margin: 0; }
.stories-strip a { display: block; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 4px; padding: calc(var(--u) * 2); text-decoration: none; color: var(--ink); height: 100%; }
.stories-strip a:hover { border-color: var(--cover); }
.stories-strip img { image-rendering: pixelated; height: 80px; width: auto; margin-bottom: calc(var(--u) * 1.5); }
.stories-strip strong { display: block; font-weight: 700; }
.stories-strip span { font-size: 0.9375rem; color: var(--ink-2); line-height: 1.45; display: block; }

/* ---------- Patient stories ---------- */

.story { display: grid; grid-template-columns: 200px minmax(0, var(--measure)); gap: calc(var(--u) * 5); padding: calc(var(--u) * 5) 0; border-top: 1px solid var(--rule-strong); }
.story-portrait { background: var(--game); border-radius: 4px; display: grid; place-items: center; aspect-ratio: 1; }
.story-portrait img { image-rendering: pixelated; width: 60%; height: auto; }
.story h2 { font-size: 1.625rem; font-weight: 800; margin-bottom: 4px; }
.story .who { color: var(--ink-2); margin-bottom: calc(var(--u) * 2); }
.story blockquote { margin: 0 0 calc(var(--u) * 2); font-size: 1.1875rem; line-height: 1.55; border-left: 0; padding: 0; }
.story blockquote p::before { content: "\201C"; }
.story blockquote p::after { content: "\201D"; }

/* ---------- Resources directory: hairline-ruled modules ---------- */

.directory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule-strong); border-left: 1px solid var(--rule-strong); margin: calc(var(--u) * 3) 0; }
.directory > div { border-right: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); padding: calc(var(--u) * 2) calc(var(--u) * 2.5); }
.directory h3 { font-size: 1.0625rem; font-weight: 700; margin: 0 0 4px; }
.directory p { margin: 0 0 var(--u); font-size: 0.9375rem; color: var(--ink-2); }
.directory p:last-child { margin: 0; }
.directory .label { color: var(--ink-2); display: block; margin-bottom: var(--u); }

/* ---------- Patch notes ---------- */

.patch { border-top: 1px solid var(--rule-strong); padding: calc(var(--u) * 3) 0; display: grid; grid-template-columns: 180px minmax(0, var(--measure)); gap: calc(var(--u) * 4); }
.patch .label { color: var(--ink-2); padding-top: 4px; }
.patch h2 { font: 1.75rem/1.1 var(--pixel); margin: 0 0 var(--u); }
.patch ul { padding-left: calc(var(--u) * 3); }

/* ---------- Footer ---------- */

.sitefoot { background: var(--cover-deep); color: var(--on-cover); margin-top: calc(var(--u) * 4); }
.sitefoot a { color: var(--on-cover); }
.sitefoot .wrap { padding-top: calc(var(--u) * 6); padding-bottom: calc(var(--u) * 5); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: calc(var(--u) * 5); }
.sitefoot h2 { font-size: 1.125rem; font-weight: 800; margin-bottom: var(--u); }
.sitefoot p { color: var(--on-cover-2); font-size: 0.9375rem; }
.signup form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--u); margin-bottom: var(--u); }
.signup label { grid-column: 1 / -1; font-size: 0.875rem; color: var(--on-cover-2); }
.signup input {
  min-height: 48px; padding: 0 calc(var(--u) * 1.5); font: inherit; font-size: 1rem;
  border: 1px solid oklch(0.55 0.06 250); border-radius: 4px; background: var(--paper); color: var(--ink); min-width: 0;
}
.signup button, .button {
  min-height: 48px; padding: 0 calc(var(--u) * 2.5); font: 700 1rem var(--sans);
  border: 0; border-radius: 4px; background: var(--on-cover); color: var(--cover-deep); cursor: pointer;
  display: inline-flex; align-items: center; text-decoration: none;
}
.signup button:hover { background: oklch(0.9 0.03 240); }
.signup .fine { font-size: 0.8125rem; margin: 0; }
.foot-links ul { list-style: none; padding: 0; margin: 0; font-size: 0.9375rem; }
.foot-links li { margin: 0; }
.foot-links a { display: flex; align-items: center; min-height: 44px; }
.foot-emergency { border: 1px solid oklch(0.62 0.12 27); border-radius: 4px; padding: calc(var(--u) * 2); }
.foot-emergency h2 { color: oklch(0.85 0.08 30); }
.foot-emergency p { margin-bottom: var(--u); }
.disclaimer { margin-top: calc(var(--u) * 5); padding-top: calc(var(--u) * 3); border-top: 1px solid oklch(0.45 0.06 252); font-size: 0.9375rem; color: var(--on-cover-2); max-width: 90ch; }
.disclaimer strong { color: var(--on-cover); }

.button-primary { background: var(--cover); color: var(--on-cover); }
.button-primary:hover { background: var(--cover-deep); }

.foot-emergency { align-self: start; }
a[href^="tel:"] { white-space: nowrap; }

/* ---------- The logbook cover: openers in cover blue, ruled every 32 px ---------- */

.opener {
  background-color: var(--cover);
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, oklch(1 0 0 / 0.07) 31px 32px);
  color: var(--on-cover);
  border-top: 1px solid oklch(0.5 0.07 250);
  border-bottom: 0;
}
.opener .crumbs, .opener .crumbs a { color: var(--on-cover-2); }
.opener .crumbs li + li::before { color: oklch(0.65 0.05 245); }
.opener .standfirst { color: var(--on-cover-2); }
.opener .logrow { border-top-color: oklch(0.62 0.06 245); }
.opener .logrow div { border-color: oklch(0.5 0.07 250); }
.opener .logrow dt { color: var(--on-cover-2); }
.opener :focus-visible { outline-color: var(--on-cover); }

/* Home: the column heads over the start-here entries, and the "need an answer now" log table */
.entries-head {
  display: flex; justify-content: space-between; margin: 0;
  padding-bottom: 6px; border-bottom: 2px solid var(--cover); color: var(--ink-2);
}
.entries-head + .entries { border-top: 0; }
table.hurry { margin-top: calc(var(--u) * 6); width: 100%; border-top: 2px solid var(--cover); }
table.hurry caption { font: 500 0.75rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); padding: 0 0 6px; border: 0; caption-side: top; }
table.hurry thead th { background: transparent; }
table.hurry td { vertical-align: middle; padding-top: 4px; padding-bottom: 4px; }
table.hurry td:first-child { width: 9rem; }
.hurry a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; font-weight: 700; color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; }
.hurry a:hover { background: none; text-decoration-thickness: 2px; }

/* Reading marks drawn as small SVG shapes, always beside a word */
.mark::before {
  content: ""; width: 10px; height: 10px; flex: none; background: currentColor;
  -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat;
}
.mark-low { --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M0 1h10L5 9.5z'/%3E%3C/svg%3E"); }
.mark-high { --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M0 9h10L5 .5z'/%3E%3C/svg%3E"); }
.mark-range { --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='4.5'/%3E%3C/svg%3E"); }
.mark-sick { color: var(--ink); --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.5 0h3v3.5H10v3H6.5V10h-3V6.5H0v-3h3.5z'/%3E%3C/svg%3E"); }
.mark-sick::before { background: var(--ink-2); }

/* Resources: the category is a field after the name; the coverage list sits in the reading column */
.directory .field { margin: 0 0 var(--u); }
.directory.one { grid-template-columns: minmax(0, 1fr); margin-top: calc(var(--u) * 3); }

/* The game panel: its "Featured partner" tag sits at the foot, like a sponsor's line */
.game-note { display: flex; flex-direction: column; align-items: flex-start; box-shadow: 0 10px 24px -12px oklch(0.2 0.05 262 / 0.5); }
.game-note > * { max-width: 100%; }
.game-note .shot { align-self: stretch; }
.game-note .partner {
  order: 10; align-self: stretch; margin: calc(var(--u) * 1.5) 0 0; padding: var(--u) 0 0;
  border-bottom: 0; border-top: 1px solid oklch(0.38 0.04 262);
}

/* Home opener: the same ruled cover band as every other page */
.home-opener h1 { font-size: clamp(2.125rem, 1.4rem + 2.6vw, 3.375rem); letter-spacing: -0.03em; line-height: 1.08; max-width: 15ch; }
.home-opener .wrap { padding-bottom: calc(var(--u) * 5); }
.home-opener .standfirst, .opener.home-opener .standfirst { margin-bottom: 0; }
.home-opener + .wrap .home-top { padding-top: calc(var(--u) * 5); }
table.hurry td > * { vertical-align: middle; }
table.hurry .mark, table.hurry td a { display: flex; align-items: center; min-height: 44px; width: fit-content; }

/* m5x7 is a pixel font: set it only at 16 px or 32 px, without smoothing */
.game-note .partner { font-size: 16px; }
.alertbar-play, .game-note .cta, .game-note h3, .game-note h2, .start-here strong, .patch h2 { font-size: 32px; }
.alertbar-play, .game-note .partner, .game-note .cta, .game-note h3, .game-note h2, .start-here strong, .patch h2 {
  -webkit-font-smoothing: none; font-smooth: never;
}

/* ---------- Narrower screens ---------- */

@media (max-width: 1100px) {
  .masthead .wrap { grid-template-columns: 1fr; gap: calc(var(--u) * 2); }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .with-note { grid-template-columns: minmax(0, 1fr); gap: calc(var(--u) * 3); }
  .with-note.top { gap: calc(var(--u) * 4); }
  .with-note > .game-note { max-width: var(--measure); }
  .sections-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sections-grid > section:nth-child(3) { border-left: 0; padding-left: 0; }
  .sections-grid > section:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .stories-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body { font-size: 1.0625rem; }
  .wrap { padding: 0 calc(var(--u) * 2); }
  .alertbar .wrap { flex-wrap: wrap; gap: 0; padding-bottom: 4px; }
  .alertbar-play { padding-left: 0; }
  .lognav ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lognav li:nth-child(4) { border-left: 0; }
  .lognav li:nth-child(n+4) { border-top: 1px solid oklch(0.55 0.07 250); }
  .lognav a { min-height: calc(var(--u) * 7); padding: var(--u); font-size: 0.875rem; }
  .lognav .label { font-size: 0.6875rem; letter-spacing: 0.03em; }
  .opener .wrap { padding-top: calc(var(--u) * 3); }
  .standfirst { font-size: 1.125rem; }
  .logrow { grid-template-columns: 1fr 1fr; }
  .logrow div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .logrow div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  /* On an article, keep only "Checked against" and "Last checked" so the page's first box
     (often the emergency box) comes up sooner. The breadcrumbs already name the section. */
  .logrow:has(> div:nth-child(4)) > div:nth-child(-n+2) { display: none; }
  .logrow:has(> div:nth-child(4)) > div:nth-child(3) { border-left: 0; padding-left: 0; border-top: 0; }
  .logrow:has(> div:nth-child(4)) > div:nth-child(4) { border-top: 0; border-left: 1px solid var(--rule); padding-left: calc(var(--u) * 2); }
  .opener .standfirst { margin-bottom: calc(var(--u) * 3); }
  .page { padding-top: calc(var(--u) * 4); }
  .rail { grid-template-columns: minmax(0, 1fr); }
  .home-top { grid-template-columns: minmax(0, 1fr); gap: calc(var(--u) * 4); padding-top: calc(var(--u) * 4); }
  .sections-grid { grid-template-columns: minmax(0, 1fr); }
  .sections-grid > section, .sections-grid > section + section { border-left: 0; padding-left: 0; padding-right: 0; }
  .sections-grid > section + section { border-top: 1px solid var(--rule); }
  .stories-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story { grid-template-columns: minmax(0, 1fr); gap: calc(var(--u) * 2); }
  .story-portrait { width: 140px; }
  .directory { grid-template-columns: minmax(0, 1fr); }
  .patch { grid-template-columns: minmax(0, 1fr); gap: var(--u); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .start-here { grid-template-columns: minmax(0, 1fr); }
  .steps > li { grid-template-columns: calc(var(--u) * 4) 1fr; gap: calc(var(--u) * 1.5); }
  th, td { padding: var(--u) calc(var(--u) * 1.25); }
}

@media print {
  .alertbar, .lognav, .rail, .game-note, .start-here, .sitefoot .signup { display: none; }
  .layout, .with-note { display: block; }
}
.note.narrow { max-width: var(--measure); margin-top: 0; }
