/* Joined by scripts/sync-nav.mjs (scripts/lib/asset-bundles.mjs) from /css/fonts.css, /css/base.css, /css/riso.css, /css/header.css, /css/footer.css, /css/guide.css, /css/search.css, /css/theme.css.
   Do not edit: change those and run npm run sync:nav. */
/* /css/fonts.css */
/* ============================================================
   fonts.css: self-hosted Google Fonts

   Generated by scripts/build-fonts.py, do not hand-edit. Serve
   directly from /fonts/ so pages don't depend on Google's CDN.

   Each block keeps its unicode-range so browsers only fetch the
   subset containing glyphs the page actually uses: same behaviour
   as Google Fonts' hosted CSS. A variable font is one block with a
   weight range and one file, so every weight shares one download.
   ============================================================ */


/* ── Bricolage Grotesque ────────────────────────────── */
/* vietnamese */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-300-800-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-300-800-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-300-800-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Instrument Serif ────────────────────────────── */
/* latin-ext */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-400-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-400-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-400-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-400-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Space Mono ────────────────────────────── */
/* vietnamese */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-mono-400-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-mono-400-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-mono-400-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-mono-700-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-mono-700-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-mono-700-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Geist Mono ────────────────────────────── */
/* cyrillic-ext */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* symbols2 */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-symbols2.woff2') format('woff2');
  unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
}
/* vietnamese */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono-400-500-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Cinzel ────────────────────────────── */
/* latin-ext */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/cinzel-400-700-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/cinzel-400-700-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Cormorant Garamond ────────────────────────────── */
/* cyrillic-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-500-italic-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-500-italic-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-500-italic-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-500-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-500-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-600-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-600-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-600-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-600-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-600-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── EB Garamond ────────────────────────────── */
/* cyrillic-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-500-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Manrope ────────────────────────────── */
/* cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/manrope-300-700-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── JetBrains Mono ────────────────────────────── */
/* cyrillic-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400-500-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── DM Mono ────────────────────────────── */
/* latin-ext */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-mono-400-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-mono-400-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/dm-mono-500-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/dm-mono-500-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Atkinson Hyperlegible ────────────────────────────── */
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-400-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-400-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-400-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-400-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-700-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-700-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Rubik ────────────────────────────── */
/* arabic */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* hebrew */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-hebrew.woff2') format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
/* latin-ext */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/rubik-400-600-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* /css/base.css */
/* Riso paper + spot inks */
:root {
  --paper:        #e6f5ee;
  --paper-white:  #f4faf6;
  --ink:          #1a3a2a;
  --ink-dim:      #263b2f;
  --ink-faint:    #557063;

  /* Foreground for text sitting ON a brand fill (a filled button), which
     is a different job from --ink: the fill does not follow the page ground,
     so it needs its own pairing in every palette. */
  --on-brand:     #1a3a2a;
  --riso-pink:        #ff7eb6;
  --riso-pink-deep:   #e3589c;
  --riso-green:       #2db876;
  --riso-green-deep:  #1a8a55;
  --riso-coral:       #ff8a6b;
  --riso-yellow:      #f0c33d;

  --line:         rgba(26, 58, 42, 0.16);
  --line-strong:  rgba(26, 58, 42, 0.32);

  --font-display: "Atkinson Hyperlegible", "Inter Tight", system-ui, sans-serif;
  --font-mono:    "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-serif:   "Atkinson Hyperlegible", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
}

/* Per-element grain.
   The site-wide paper grain is applied to topbar, footer, and `main`
   (the wrapper used on every tab page). The home page's cell stage is
   NOT a `main` -- it's a <section class="stage"> -- so the grain skips
   the cell canvas entirely, keeping the candy plastic look untouched. */
main {
  position: relative;
  z-index: 1;
}
main::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("/img/grain.svg");
  background-repeat: repeat;
  mix-blend-mode: multiply;
  opacity: 0.16;
}
main > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
::selection { background: var(--riso-pink); color: var(--paper); }

img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ── First-paint paper settle ─────────────────────────────────
   Light entrance for the page: main settles in, like a freshly-
   printed sheet landing. The illos do a separate, more detailed riso
   print-pass inside their own SVGs.
   Short and from most of the way there on purpose: it used to fade from
   nothing over half a second, which kept the page's main heading faint
   (and its largest paint late) on every load. Now the text is readable
   in the first frame.
   Opacity-only on purpose: a transform on <main> would turn it into
   a containing block for fixed descendants and break the apps-page
   lightbox during the animation window. */
@keyframes paper-settle {
  from { opacity: 0.85; }
  to   { opacity: 1; }
}
main { animation: paper-settle 0.15s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
}

/* ── Cursor push on the illos ─────────────────────────────────
   Cursor-driven exaggeration of riso misregistration: as the mouse
   moves over an inlined illo, the pink colour layer drifts toward the
   cursor and the green layer drifts away. The ink outline stays put
   so the shape holds together.
   /js/illos.js sets --px / --py on the <svg> from -1 to 1.
   Mouse-only (no transform on touch). */
svg.illo .riso-pink,
svg.illo .riso-green {
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  svg.illo .riso-pink {
    transform: translate(calc(var(--px, 0) * 6px), calc(var(--py, 0) * 6px));
  }
  svg.illo .riso-green {
    transform: translate(calc(var(--px, 0) * -6px), calc(var(--py, 0) * -6px));
  }
}
@media (prefers-reduced-motion: reduce) {
  svg.illo .riso-pink,
  svg.illo .riso-green {
    transform: none !important;
    transition: none !important;
  }
}

/* ── Selection: riso-misregistered swipe ─────────────────────── */
::selection {
  background: var(--riso-pink);
  color: var(--ink);
  text-shadow: 1px 0.5px 0 var(--riso-green);
}

/* ── Cross-document View Transitions: mitosis tab swap ───────
   Chrome 126+ uses this for cross-page navigations (when same-origin
   and same View Transition root). The outgoing main pinches and
   slides one way; the new main buds in from the other side. Falls
   back to instant nav in browsers without support. */
@view-transition { navigation: auto; }
main { view-transition-name: page-content; }
::view-transition-old(page-content) {
  animation: 0.42s cubic-bezier(0.4, 0, 0.6, 1) both bb-mitosis-out;
}
::view-transition-new(page-content) {
  animation: 0.48s cubic-bezier(0.2, 0.7, 0.2, 1) both bb-mitosis-in;
}
@keyframes bb-mitosis-out {
  0%   { transform: scale(1) translateX(0); opacity: 1; }
  30%  { transform: scaleX(1.06) scaleY(0.96) translateX(0); }
  100% { transform: scaleX(0.55) scaleY(0.86) translateX(-22%); opacity: 0; }
}
@keyframes bb-mitosis-in {
  0%   { transform: scaleX(0.55) scaleY(0.86) translateX(22%); opacity: 0; }
  100% { transform: scale(1) translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(page-content),
  ::view-transition-new(page-content) { animation: none; }
}

/* ── Etymology tooltip ──────────────────────────────────────── */
/* Terms wrapped by /js/etymology.js with the Greek/Latin roots in
   data-roots. Hover -> tooltip; the dotted underline signals it's
   interactive without shouting. */
.bio-term {
  border-bottom: 1px dotted var(--riso-pink-deep);
  cursor: help;
  position: relative;
}
.bio-term:hover::after,
.bio-term:focus::after {
  content: attr(data-roots);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper-white);
  padding: 7px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  box-shadow: 2px 2px 0 var(--riso-pink);
}
.bio-term:hover::before,
.bio-term:focus::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
  z-index: 200;
  pointer-events: none;
}

/* ── Ribosome scroll marker (every page with a <main>, injected by JS) ─ */
.scroll-ribosome {
  position: fixed;
  right: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--riso-pink);
  z-index: 80;
  pointer-events: none;
  transition: top 0.08s linear;
}
.scroll-ribosome::after {
  /* Halftone dot pattern inside the ribosome */
  content: "";
  position: absolute; inset: 2px;
  border-radius: 50%;
  background-image: radial-gradient(var(--riso-pink) 1px, transparent 1.6px);
  background-size: 4px 4px;
}
@media (max-width: 760px) {
  .scroll-ribosome { display: none; }
}

/* ── Print stylesheet ────────────────────────────────────────
   Strip the riso furniture so handouts come out as plain readable
   text. Everything interactive disappears; links get their URL
   appended after them for paper trail. */
@media print {
  .topbar, footer,
  .joke-strip-wrap, .roots-strip-wrap, .joke-deck, .joke-actions,
  .joke-card-wrap, .staffroom-download, .roots-download,
  .notfound-actions, .stage, .scroll-ribosome,
  iframe, video, audio, .video-section { display: none !important; }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  body, main {
    background: white !important;
    color: black !important;
    padding: 0 !important;
  }
  main::after { display: none !important; }
  h1, h2, h3, h4 { color: black !important; }
  em { color: #333 !important; font-style: italic; }
  a { color: black; text-decoration: underline; }
  a[href^="http"]::after,
  a[href^="mailto"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
  a[href^="/"]::after { content: ""; }
  .bio-term { border-bottom: none; }
  .post-card, .article-body, .legal-page { break-inside: avoid; }
}

/* ── Accessibility: visible focus rings ──────────────────────
   Keyboard users need a clear hit-state. :focus-visible fires for
   keyboard nav but not mouse clicks, so visual chrome stays clean. */
:focus-visible {
  outline: 2px solid var(--riso-pink-deep);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Buttons / pills already have their own rounding -- tighter offset */
button:focus-visible,
.tab:focus-visible,
.cb:focus-visible, .lchip:focus-visible, .tc:focus-visible,
.joke-pill:focus-visible, .joke-deal:focus-visible,
.roots-strip-deal:focus-visible, .joke-strip-deal:focus-visible {
  outline-offset: 2px;
}

/* ── Skip-to-content link ────────────────────────────────────
   Always the first focusable element on the page. Visually hidden
   until a keyboard user tabs into it, then it slides into view. */
.skip-link {
  position: absolute;
  top: 8px; left: 8px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper-white);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--riso-pink);
  z-index: 1000;
  transform: translateY(-200%);
  transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

/* Visually hidden but still announced by screen readers and seen by
   crawlers. Used for semantic headings that we don't want to render. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Mobile niceties ─────────────────────────────────────────
   Drop the iOS Safari gray tap-flash, replace it with a quick
   opacity dim on press. Subtler, on-brand, less startling. */
* { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  a:active, button:active {
    opacity: 0.65;
    transition: opacity 0.05s;
  }
}

/* ── Konami easter egg flash (home page) ────────────────────
   Small overlay confirming the sequence registered. Pairs with
   the cell explode-and-reassemble triggered by /js/konami.js.  */
.konami-flash {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(8px);
  z-index: 200;
  padding: 14px 22px;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--riso-pink);
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2,0.7,0.2,1);
  pointer-events: none;
}
.konami-flash.is-in { opacity: 1; transform: translateX(-50%) translateY(0); }
.konami-flash.is-out { opacity: 0; transform: translateX(-50%) translateY(-8px); }
.konami-seq {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.konami-note {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--riso-pink);
}

/* Page headings lead with what the page is, then the line in Mr Bradford's
   voice. The descriptor sets small so the italic stays the hero and the
   header does not grow a third and fourth line of display type. */
h1 .h1-what {
  display: block;
  font-family: var(--font-display);
  /* This line is the page's actual title - what it is, and what a search
     result shows. At 0.36em it read as a kicker above the italic rather
     than as the heading. */
  font-size: 0.58em;
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 0.28em;
  text-wrap: balance;
}
@media (max-width: 700px) {
  h1 .h1-what { font-size: 0.66em; margin-bottom: 0.3em; }
}

/* /css/riso.css */
/* ===== RISO UTILITIES =====
   Spot-color helpers, halftone patterns, misregistration text,
   and the standard "riso card" surface with grain overlay.
*/

/* Misregistration, pink text with green ghost behind */
.riso-misreg {
  color: var(--riso-pink);
  text-shadow: 1.5px 1px 0 var(--riso-green-deep);
}
.riso-misreg-green {
  color: var(--riso-green);
  text-shadow: -1px 1.5px 0 var(--riso-pink);
}

/* Halftone surfaces */
.halftone-pink {
  background-image: radial-gradient(var(--riso-pink) 1.4px, transparent 1.8px);
  background-size: 5px 5px;
}
.halftone-pink-dense {
  background-image: radial-gradient(var(--riso-pink) 2px, transparent 2.4px);
  background-size: 4px 4px;
}
.halftone-green {
  background-image: radial-gradient(var(--riso-green) 1.4px, transparent 1.8px);
  background-size: 5px 5px;
}

/* Card surface, white-ish paper, ink outline, grain overlay */
.riso-card {
  position: relative;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
}
.riso-card::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("/img/grain.svg");
  background-repeat: repeat;
  mix-blend-mode: multiply;
  opacity: 0.40;
  pointer-events: none;
  border-radius: inherit;
}
.riso-card > * { position: relative; z-index: 1; }

/* Pink/green stamp pill, for chips and tags */
.riso-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--riso-pink);
}
.riso-pill.green { box-shadow: 2px 2px 0 var(--riso-green); }

/* Hand-drawn-feeling underline for active nav, etc. */
.riso-underline {
  position: relative;
}
.riso-underline::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px; bottom: -4px;
  height: 3px;
  background: var(--riso-pink);
  box-shadow: 1.5px 1.5px 0 var(--riso-green);
  border-radius: 2px;
}

/* /css/header.css */
.topbar {
  position: sticky; top: 0;
  /* Above the cell stage (z:auto) and any tab-page content,
     so the tabs are always reachable on every page. */
  z-index: 150;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 28px;
  background: var(--paper);
  border-bottom: 1.5px solid var(--ink);
  overflow: hidden;
}
.topbar::after {
  /* Riso grain over the topbar itself, since the body grain is gone */
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: url("/img/grain.svg");
  background-repeat: repeat;
  mix-blend-mode: multiply;
  opacity: 0.32;
}
.topbar > * { position: relative; z-index: 1; }

.brand {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Mitosis easter egg: triggered from js/header.js. The original mark
   pinches and slides left, the cloned mark fades in and slides right,
   then both slide back together and fuse. */
.brand-mark.is-mitosing { animation: brand-mitosis-a 1.6s ease-in-out; }
.brand-mark-clone {
  position: absolute;
  top: 50%; left: 0;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
  animation: brand-mitosis-b 1.6s ease-in-out;
}
/* Translate distances use percentages so the animation scales with
   the brand-mark size: ~10px at desktop's 30px mark, ~8px at mobile's
   24px mark. No need for separate keyframes per breakpoint. */
@keyframes brand-mitosis-a {
  0%   { transform: scale(1) translateX(0); }
  20%  { transform: scale(1.12, 1.18) translateX(0); }
  45%  { transform: scale(0.94, 0.88) translateX(-34%); }
  70%  { transform: scale(1) translateX(-20%); }
  100% { transform: scale(1) translateX(0); }
}
@keyframes brand-mitosis-b {
  0%   { opacity: 0; transform: translateY(-50%) scale(1) translateX(0); }
  19%  { opacity: 0; }
  20%  { opacity: 1; transform: translateY(-50%) scale(1.12, 1.18) translateX(0); }
  45%  { opacity: 1; transform: translateY(-50%) scale(0.94, 0.88) translateX(34%); }
  70%  { opacity: 1; transform: translateY(-50%) scale(1) translateX(20%); }
  99%  { opacity: 0.4; transform: translateY(-50%) scale(1) translateX(0); }
  100% { opacity: 0; transform: translateY(-50%) scale(1) translateX(0); }
}
.brand small {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}
.brand-mark {
  width: 30px; height: 30px;
  flex-shrink: 0;
}

.youtube-btn, .instagram-btn {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  background: var(--riso-pink);
  border: none;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  box-shadow: 2px 2px 0 var(--riso-green);
  flex-shrink: 0;
}
.youtube-btn:hover, .instagram-btn:hover {
  background: #ff0000;
  transform: translateY(-2px);
  box-shadow: 2px 2px 0 var(--riso-green), 0 6px 14px rgba(0,0,0,0.12);
}
.instagram-btn:hover { background: #e1306c; }
.youtube-btn svg, .instagram-btn svg {
  width: 26px;
  height: 26px;
}

/* Sign in / signed in: one button in the same place on every page (written
   by scripts/sync-nav.mjs, wired by js/header.js). Which face shows comes
   from <html data-signed>, set by the boot script from the stored session
   before the page draws, so it never flips as the page loads. */
.acct { position: relative; flex-shrink: 0; }
.acct-btn {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px 0 11px;
  border: 1.5px solid var(--ink); border-radius: 8px;
  background: var(--paper-white); color: var(--ink);
  font-family: var(--font-mono); font-size: 14px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
  box-shadow: 2px 2px 0 var(--riso-green); cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
.acct-btn:hover { transform: translateY(-2px); box-shadow: 2px 2px 0 var(--riso-pink), 0 6px 14px rgba(0,0,0,0.12); }
.acct-btn:focus-visible { outline: 2px solid var(--riso-pink-deep); outline-offset: 3px; }
.acct-btn[aria-expanded="true"] { box-shadow: 2px 2px 0 var(--riso-pink); }
.acct-ico { display: flex; }
.acct-ico svg { width: 20px; height: 20px; }
.acct-av { display: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--riso-green); color: #10271c; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.acct-car { display: none; font-size: 12px; opacity: 0.7; }
.acct-in-word { display: none; }
html[data-signed] .acct-btn { padding: 0 11px 0 7px; }
html[data-signed] .acct-ico, html[data-signed] .acct-out-word { display: none; }
html[data-signed] .acct-av { display: grid; }
html[data-signed] .acct-car, html[data-signed] .acct-in-word { display: inline; }

/* Why a button will not do what it says yet, before it is pressed: hovering
   or focusing it shows a bubble. data-tip holds the reason it cannot go yet
   (always shown); data-needs-signin holds why it needs an account (shown
   only signed out). Shown with display, so a hidden bubble never widens the
   page; anchored at the button's right edge, so it grows into the page. */
[data-tip], html:not([data-signed]) [data-needs-signin] { position: relative; }
[data-tip]::after, html:not([data-signed]) [data-needs-signin]::after {
  display: none; position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 70;
  width: max-content; max-width: min(270px, 78vw); padding: 8px 11px;
  border-radius: 10px; background: #1a3a2a; color: #f4faf6; box-shadow: 3px 3px 0 #ff7eb6;
  font: 500 13px/1.4 var(--font-display, system-ui, sans-serif); letter-spacing: 0; text-transform: none; text-align: left; white-space: normal;
  pointer-events: none;
}
html:not([data-signed]) [data-needs-signin]:not([data-tip])::after { content: attr(data-needs-signin); }
/* data-tip-at="card": the bubble spans the nearest positioned box (a room
   card) just above its buttons, where a narrow strip would cut it off. */
html:not([data-signed]) [data-needs-signin][data-tip-at="card"], [data-tip][data-tip-at="card"] { position: static; }
html:not([data-signed]) [data-needs-signin][data-tip-at="card"]::after, [data-tip][data-tip-at="card"]::after { left: 12px; right: 12px; bottom: 50px; width: auto; max-width: none; }
/* data-tip-at="left": anchored at the left edge, growing right, for a
   control near the left of the screen. */
html:not([data-signed]) [data-needs-signin][data-tip-at="left"]::after, [data-tip][data-tip-at="left"]::after { left: 0; right: auto; }
/* A hover lift or glow (a transform or a filter) would make the button the
   bubble's box again, so the bubble stands in for them. */
html:not([data-signed]) [data-needs-signin][data-tip-at="card"]:hover, [data-tip][data-tip-at="card"]:hover { transform: none; filter: none; }
/* A disabled button takes no hover, so its reason sits on a wrapper. */
.tip-wrap { display: inline-flex; }
.tip-wrap > :disabled { pointer-events: none; }
[data-tip]::after { content: attr(data-tip); }
[data-tip]:hover::after, [data-tip]:focus-visible::after,
html:not([data-signed]) [data-needs-signin]:hover::after, html:not([data-signed]) [data-needs-signin]:focus-visible::after { display: block; animation: tip-in .15s ease-out; }
:root[data-theme="dark"] [data-tip]::after, :root[data-theme="dark"] [data-needs-signin]::after { background: #f4faf6; color: #1a3a2a; }
@keyframes tip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { [data-tip]::after, [data-needs-signin]::after { animation: none !important; } }
@media print { [data-tip]::after, [data-needs-signin]::after { display: none !important; } }

/* The panel: sign in from any page, or, signed in, where your things are
   and Sign out. Fixed and placed by js/header.js under the button, in the
   menu host (the bar itself hides what overflows it). */
.acct-menu {
  position: fixed; z-index: 160; width: 300px; box-sizing: border-box;
  padding: 10px; border: 1.5px solid var(--ink); border-radius: 14px;
  background: var(--paper-white); color: var(--ink); box-shadow: 5px 5px 0 var(--riso-pink);
  font-family: var(--font-display); font-size: 14.5px; line-height: 1.4; text-align: left;
}
.acct-menu[hidden] { display: none; }
.acct-menu .acct-hd { display: flex; align-items: center; gap: 10px; padding: 6px 6px 12px; margin-bottom: 6px; border-bottom: 1px dashed var(--ink-faint); min-width: 0; }
.acct-menu .acct-hd .acct-av { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--riso-green); color: #10271c; font-size: 15px; font-weight: 800; text-transform: uppercase; }
.acct-menu .acct-hd b { display: block; font-size: 14.5px; }
.acct-menu .acct-hd span { display: block; font-size: 13px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu a.acct-row, .acct-menu button.acct-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; box-sizing: border-box; padding: 9px 8px; border: 0; border-radius: 8px;
  background: none; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.acct-menu .acct-row small { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.acct-menu a.acct-row:hover, .acct-menu a.acct-row:focus-visible, .acct-menu button.acct-row:hover, .acct-menu button.acct-row:focus-visible { background: color-mix(in srgb, var(--riso-pink) 14%, transparent); outline: none; }
/* Buy credits: the one row that sells, so it reads as a button. */
.acct-menu a.acct-row.acct-buy { background: var(--riso-green); color: #1a3a2a; font-weight: 700; border: 2px solid var(--ink); margin: 4px 0; }
.acct-menu a.acct-row.acct-buy small { color: #1a3a2a; }
.acct-menu a.acct-row.acct-buy:hover, .acct-menu a.acct-row.acct-buy:focus-visible { background: color-mix(in srgb, var(--riso-green) 80%, #fff); }
.acct-menu button.acct-signout { margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--ink-faint); border-radius: 0; color: var(--riso-pink-deep); font-weight: 700; }
/* Have a code? (credit or class), above Sign out */
.acct-menu .acct-code { margin: 6px 0 0; padding: 10px 8px 4px; border-top: 1px dashed var(--ink-faint); }
.acct-menu .acct-code-lbl { display: block; font-size: 13px; color: var(--ink-dim); padding: 2px 0 6px; }
.acct-menu .acct-code-row { display: flex; gap: 6px; }
.acct-menu .acct-code input { flex: 1; min-width: 0; box-sizing: border-box; padding: 7px 10px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--paper); color: var(--ink); font-family: var(--font-mono); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.acct-menu .acct-code input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--font-display); }
.acct-menu .acct-code button { flex: none; padding: 7px 14px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--ink); color: var(--paper-white); font: inherit; font-weight: 700; cursor: pointer; }
.acct-menu .acct-code button:disabled { opacity: .5; cursor: wait; }
.acct-menu .acct-code-msg { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-dim); }
.acct-menu .acct-code-msg.ok { color: var(--riso-green-deep, #1f6b47); }
.acct-menu .acct-code-msg.bad { color: var(--riso-pink-deep); }
.acct-menu .acct-code-msg a { color: inherit; font-weight: 700; }
.acct-menu .acct-code + .acct-signout { margin-top: 8px; }
.acct-menu .acct-form { padding: 4px; }
.acct-menu .acct-form h4 { margin: 2px 2px 4px; font-size: 17px; }
.acct-menu .acct-form p { margin: 0 2px 10px; font-size: 13.5px; color: var(--ink-dim); }
.acct-menu .acct-form p b { color: var(--ink); }
.acct-menu .acct-form input { display: block; width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 10px 12px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; font-size: 16px; }
.acct-menu .acct-form input.acct-code { letter-spacing: 0.2em; font-size: 18px; }
.acct-menu .acct-form .acct-go { display: block; width: 100%; padding: 10px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--riso-green); color: #10271c; font: inherit; font-size: 15px; font-weight: 800; box-shadow: 2px 2px 0 var(--ink); cursor: pointer; }
.acct-menu .acct-form .acct-go:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
.acct-menu .acct-form .acct-go:disabled { opacity: 0.6; cursor: progress; }
/* A button pressed and waiting on the network (js/busy.js): a spinner before
   its words, and never faded out, so the press plainly took. */
.bb-busy { opacity: 1 !important; cursor: progress !important; }
.bb-busy::before { content: ""; display: inline-block; box-sizing: border-box; width: 0.9em; height: 0.9em; margin-right: 0.5em; vertical-align: -0.12em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: bb-spin 0.7s linear infinite; }
@keyframes bb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bb-busy::before { animation-duration: 2.4s; } }
.acct-menu .acct-form .acct-back { display: block; margin: 8px auto 0; border: 0; background: none; color: var(--ink-dim); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.acct-menu .acct-form .acct-err { color: var(--riso-pink-deep); margin-top: 8px; }
.acct-menu .acct-form .acct-free { margin: 10px 2px 0; font-size: 12.5px; }
.acct-menu .acct-form .acct-free b { color: var(--riso-green-deep); }

/* Support the site: the last button in the bar. A heart, with the word
   beside it where the bar has room; it leads to /support. */
.support-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 44px; height: 44px; padding: 0 12px;
  background: var(--riso-pink);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-mono); font-size: 14px; font-weight: 700; letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s;
  box-shadow: 2px 2px 0 var(--riso-green);
  flex-shrink: 0;
}
.support-btn:hover {
  background: var(--riso-green);
  color: var(--on-brand);
  transform: translateY(-2px);
  box-shadow: 2px 2px 0 var(--riso-pink), 0 6px 14px rgba(0,0,0,0.12);
}
.support-btn:focus-visible { outline: 2px solid var(--riso-pink-deep); outline-offset: 3px; }
.support-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
@media (max-width: 1320px) {
  .support-btn { padding: 0; width: 44px; }
  .support-word { display: none; }
}
@media (max-width: 1280px) {
  .acct-word { display: none; }
  .acct-btn { padding: 0 11px; }
  html[data-signed] .acct-btn { padding: 0 9px 0 7px; }
}

/* The tabs take the middle, centred in whatever the brand and the three
   buttons leave; the buttons sit together on the right. */
.tabs {
  margin: 0 auto;
  display: flex; gap: 2px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.tab {
  position: relative;
  white-space: nowrap;
  padding: 8px 14px 10px;
  color: var(--ink-dim);
  border-radius: 999px;
  transition: color 0.18s;
}
.tab .num { color: var(--ink-faint); margin-right: 6px; }
/* Free or paid, at a glance: a green dot on what costs nothing, a pink
   one on what costs money. The words ride along for screen readers. */
.tab-kind {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 7px; vertical-align: 2px;
  background: var(--riso-green);
}
.tab-kind[data-kind="paid"] { background: var(--riso-pink); }
.tabs .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 1px;
  height: 3px;
  background: var(--riso-pink);
  box-shadow: 1.5px 1.5px 0 var(--riso-green);
  border-radius: 2px;
}

/* Laptop widths: six tabs and three buttons are a tight fit, so the
   numbers go first, then the padding, before anything wraps. */
@media (max-width: 1320px) and (min-width: 761px) {
  .tab .num { display: none; }
  .tab { padding: 8px 10px 10px; }
  .tab.active::after { left: 10px; right: 10px; }
}
@media (max-width: 1080px) and (min-width: 761px) {
  .brand small { display: none; }
  .tabs { font-size: 13px; }
  .tab { padding: 8px 7px 10px; }
  .tab.active::after { left: 7px; right: 7px; }
}
@media (max-width: 880px) and (min-width: 761px) {
  .tabs {
    flex: 1; min-width: 0;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent 0, black 10px, black calc(100% - 14px), transparent 100%);
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; }
}

@media (max-width: 760px) {
  .topbar { padding: 10px 14px; gap: 12px; }
  .brand { font-size: 14px; gap: 9px; flex-shrink: 0; }
  .brand-mark { width: 24px; height: 24px; }
  .brand small { display: none; }
  .tabs {
    /* Horizontal scroll when 7 tabs don't fit; hidden scrollbar */
    gap: 2px;
    font-size: 12px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    padding-bottom: 2px;
    mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 12px), transparent 100%);
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    /* 38px min height for touch, meets WCAG target size on mobile. */
    padding: 10px 11px 12px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .tab .num { display: none; }
  .youtube-btn, .instagram-btn { width: 40px; height: 40px; }
  .youtube-btn svg, .instagram-btn svg { width: 23px; height: 23px; }
  .support-btn { min-width: 40px; width: 40px; height: 40px; }
  .acct-btn { height: 40px; }
}

@media (max-width: 760px) {
  /* The toggle joins the tabs row, at its end, so the bar gains no height:
     two rows here as well, brand and buttons above, tabs and toggle below. */
  .topbar {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    grid-template-areas:
      "brand acct youtube instagram support"
      "tabs  aud  aud     aud       aud";
    column-gap: 10px; row-gap: 6px;
    align-items: center;
  }
  .brand { grid-area: brand; }
  .acct { grid-area: acct; justify-self: end; }
  .acct-word, .acct-car { display: none !important; }
  .acct-btn, html[data-signed] .acct-btn { padding: 0; width: 40px; justify-content: center; }
  .youtube-btn { grid-area: youtube; justify-self: end; }
  .instagram-btn { grid-area: instagram; justify-self: end; }
  .support-btn { grid-area: support; justify-self: end; }
  .tabs { grid-area: tabs; width: 100%; }
  .aud-pill { grid-area: aud; justify-self: end; box-shadow: 1.5px 1.5px 0 var(--riso-pink); }
  .aud-pill button { padding: 6px 8px; font-size: 12px; gap: 5px; }
}

@media (max-width: 480px) {
  /* Two-row topbar on phones, declared as a grid so brand and the two
     icon buttons (last in DOM order) can sit on the same row while the
     tab strip spans every column underneath. */
  .topbar {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    grid-template-areas:
      "brand acct youtube instagram support"
      "tabs  aud  aud     aud       aud";
    column-gap: 8px;
    row-gap: 6px;
    padding: 8px 10px 4px;
    align-items: center;
  }
  .brand { grid-area: brand; font-size: 13px; gap: 7px; }
  .brand-mark { width: 22px; height: 22px; }
  .youtube-btn, .instagram-btn {
    justify-self: end;
    width: 34px; height: 34px;
  }
  .youtube-btn { grid-area: youtube; }
  .instagram-btn { grid-area: instagram; }
  .youtube-btn svg, .instagram-btn svg { width: 21px; height: 21px; }
  .acct-btn, html[data-signed] .acct-btn { width: 34px; height: 34px; }
  .acct-av { width: 24px; height: 24px; font-size: 12px; }
  .acct-ico svg { width: 18px; height: 18px; }
  .support-btn {
    grid-area: support;
    justify-self: end;
    min-width: 34px; width: 34px; height: 34px;
  }
  .support-btn svg { width: 17px; height: 17px; }
  .tabs {
    grid-area: tabs;
    width: 100%;
    justify-content: flex-start;
  }
  .tab { padding: 8px 10px 10px; }
  .aud-pill button { padding: 6px 7px; font-size: 12px; }
  .aud-dot { display: none; }
}

/* ── Student / teacher toggle ─────────────────────────────────
   The pill before the sign-in button (written into every page by
   scripts/sync-nav.mjs, wired by js/header.js). Which side is on comes
   from <html data-audience>, set by each page's boot script before it
   draws, so neither the pill nor the content sorted by it ever jumps.
   With no choice made, both sides are off and the site shows everything. */
.aud-pill {
  display: inline-flex; flex: none; align-items: center; gap: 2px;
  padding: 3px; border: 1.5px solid var(--ink); border-radius: 999px;
  background: var(--paper-white); box-shadow: 2px 2px 0 var(--riso-pink);
  font-family: var(--font-mono);
}
.aud-pill button {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12px; letter-spacing: 0.04em; line-height: 1;
  padding: 7px 11px; border: 0; border-radius: 999px;
  background: none; color: var(--ink-dim); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.aud-pill button:hover { color: var(--ink); }
.aud-pill button:focus-visible { outline: 2px solid var(--riso-pink-deep); outline-offset: 2px; }
.aud-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.35; flex: none; }
html[data-audience="student"] .aud-pill [data-aud-set="student"],
html[data-audience="teacher"] .aud-pill [data-aud-set="teacher"] { background: var(--ink); color: var(--paper-white); }
html[data-audience="student"] .aud-pill [data-aud-set="student"] .aud-dot { background: var(--riso-green); opacity: 1; }
html[data-audience="teacher"] .aud-pill [data-aud-set="teacher"] .aud-dot { background: var(--riso-pink); opacity: 1; }

/* What each mode shows. data-aud="student" is for students only and
   data-aud="teacher" for teachers only; untagged is for both. The other
   side's things are hidden, never removed, so they are still in the page
   for search engines and one click away. .aud-more marks what only makes
   sense once a side is chosen: the one-line "also for the other side"
   links, and each side's own wording of a shared item; .aud-none is the
   wording for before a side is chosen. The menus live outside the bar on
   some pages, hence the .nav-dd-panel selectors. */
html[data-audience="student"] [data-aud="teacher"],
html[data-audience="teacher"] [data-aud="student"],
html[data-audience="student"] .nav-dd-panel [data-aud="teacher"],
html[data-audience="teacher"] .nav-dd-panel [data-aud="student"],
html:not([data-audience]) .aud-more,
html:not([data-audience]) .nav-dd-panel .aud-more,
html[data-audience] .aud-none,
html[data-audience] .nav-dd-panel .aud-none { display: none !important; }

/* Laptops: the pill tightens, and the tabs (not the buttons) give way:
   they scroll in their own strip, as they already do on tablets. */
@media (max-width: 1500px) and (min-width: 761px) {
  .aud-pill button { padding: 6px 9px; font-size: 12px; }
  .support-btn { padding: 0; width: 44px; }
  .support-word { display: none; }
}
@media (max-width: 1440px) and (min-width: 761px) {
  .tab .num { display: none; }
  .tab { padding: 8px 10px 10px; }
  .tab.active::after { left: 10px; right: 10px; }
  .tabs {
    flex: 1 1 auto; min-width: 0; justify-content: safe center;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent 0, black 10px, black calc(100% - 14px), transparent 100%);
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; }
  .aud-dot { display: none; }
}
@media (max-width: 1080px) and (min-width: 761px) {
  .aud-pill button { padding: 6px 7px; font-size: 12px; }
}

/* Teacher mode, on the pages a class works from (js/header.js): copies
   this page's link with ?as=student. Bottom left, clear of the display
   button on the right. */
.aud-share {
  position: fixed; left: 16px; bottom: 16px; z-index: 140;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 100px);
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.03em; line-height: 1.3; text-align: left;
  border: 1.5px solid var(--ink); background: var(--paper-white); color: var(--ink);
  box-shadow: 3px 3px 0 var(--riso-pink);
}
.aud-share:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--riso-pink); }
.aud-share:focus-visible { outline: 2px solid var(--riso-pink-deep); outline-offset: 3px; }
.aud-share.is-done { background: var(--riso-green); color: var(--on-brand); }
@media print { .aud-share { display: none !important; } }

/* ── Resources dropdown mega-menu ─────────────────────────────
   Built by js/header.js and appended to <body>, positioned fixed
   so the topbar's overflow:hidden never clips it. */
#tabs .dd-caret { margin-left: 4px; }
.nav-dd-panel {
  position: fixed;
  z-index: 200;
  min-width: 520px;
  max-width: min(640px, calc(100vw / var(--zoom, 1) - 24px));
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--riso-green), 0 14px 32px rgba(26, 58, 42, 0.14);
  padding: 16px 16px 8px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  /* hidden from the keyboard too while closed, once it has faded */
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}
.nav-dd-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; visibility: visible; transition-delay: 0s; }
.nav-dd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.nav-dd-col { min-width: 0; }
.nav-dd-h {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--riso-green-deep);
  padding: 4px 10px 6px;
}
.nav-dd-col:nth-child(2) .nav-dd-h { color: var(--riso-pink-deep); }
.nav-dd-panel a {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-size: 15px; color: var(--ink);
  padding: 8px 10px; border-radius: 8px; text-decoration: none;
  transition: background 0.12s;
}
.nav-dd-panel a:hover { background: var(--paper); }
.nav-dd-panel a:focus-visible { outline: 2px solid var(--riso-green-deep); outline-offset: -2px; }
.nav-dd-panel a .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--riso-green); flex: 0 0 auto; }
.nav-dd-col:nth-child(2) a .dot { background: var(--riso-pink); }
.nav-dd-all {
  display: block; margin-top: 6px; padding: 11px 10px 12px;
  border-top: 1.5px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em;
  color: var(--ink-dim); text-decoration: none;
}
.nav-dd-all:hover { color: var(--ink); }

/* The six-tab menus. */
.nav-dd-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.nav-dd-col:nth-child(3) .nav-dd-h { color: var(--ink-dim); }
.nav-dd-panel .dd-t { display: flex; flex-direction: column; gap: 1px; }
.nav-dd-panel a:has(.dd-t small), .nav-dd-soon { align-items: flex-start; }
.nav-dd-panel a:has(.dd-t small) .dot, .nav-dd-soon .dot { margin-top: 8px; }
.nav-dd-panel .dd-t small { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; color: var(--ink-dim); line-height: 1.35; }
.nav-dd-panel.nav-dd-about, .nav-dd-panel.nav-dd-marking { min-width: 360px; max-width: min(420px, calc(100vw / var(--zoom, 1) - 24px)); }
.nav-dd-panel.nav-dd-store { min-width: 460px; }
.nav-dd-panel.nav-dd-free { min-width: 600px; max-width: min(680px, calc(100vw / var(--zoom, 1) - 24px)); }
.nav-dd-panel.nav-dd-marking a .dot, .nav-dd-panel.nav-dd-store a .dot { background: var(--riso-pink); }
.nav-dd-panel a.nav-dd-feature {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  margin: 0 0 10px; padding: 10px 12px;
  border: 1.5px solid var(--riso-green); border-radius: 10px;
  background: var(--paper);
}
.nav-dd-feature b { font-family: var(--font-display); font-size: 16px; color: var(--riso-green-deep); }
.nav-dd-feature span { font-size: 13px; color: var(--ink-dim); }
.nav-dd-store .dd-deal { color: var(--riso-pink-deep); }
.nav-dd-store small s { opacity: .6; }
.nav-dd-subs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; margin: -4px 0 10px; padding: 0 0 8px; border-bottom: 1px dashed var(--ink-faint); }
@media (max-width: 760px) { .nav-dd-subs { grid-template-columns: 1fr; } }
.nav-dd-soon {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  font-family: var(--font-display); font-size: 15px; color: var(--ink-dim);
}
.nav-dd-soon .dot { width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid var(--riso-pink); flex: 0 0 auto; }
.nav-dd-foot {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; padding: 10px 10px 6px;
  border-top: 1.5px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-dim);
}
.nav-dd-panel .nav-dd-foot a { display: inline; padding: 0; font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); }
.nav-dd-panel .nav-dd-foot a:hover { background: none; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .nav-dd-panel { transition: none; } }

/* Apps dropdown, purple dots (study apps / vesicles accent) */
.nav-dd-panel.nav-dd-apps a .dot { background: #8a5cd9; }

/* Blog dropdown, a compact list of recent posts */
.nav-dd-panel.nav-dd-blog { min-width: 340px; }

/* On phones the menus open on tap; the fixed 430px min-width would spill
   off-screen, so size them to the viewport instead. */
@media (max-width: 760px) {
  .nav-dd-panel,
  .nav-dd-panel.nav-dd-blog { min-width: 0; width: calc(100vw / var(--zoom, 1) - 24px); max-width: calc(100vw / var(--zoom, 1) - 24px); }
  .nav-dd-cols, .nav-dd-cols-3 { grid-template-columns: 1fr; }
  .nav-dd-panel.nav-dd-about, .nav-dd-panel.nav-dd-marking, .nav-dd-panel.nav-dd-store, .nav-dd-panel.nav-dd-free { min-width: 0; }
}
.nav-dd-posts { display: grid; gap: 2px; padding: 2px 0 4px; }
.nav-dd-posts a { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 9px 10px; border-radius: 8px; text-decoration: none; transition: background 0.12s; }
.nav-dd-posts a:hover { background: var(--paper); }
.nav-dd-posts .p-date { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--riso-pink-deep); }
.nav-dd-posts .p-title { font-family: var(--font-display); font-size: 15px; color: var(--ink); line-height: 1.25; }

/* "Coming soon" on the AI marking items, until they open. The same pill is
   used on the pages that point at them; grep for soon-tag to take it off. */
.nav-dd-panel .dd-t .soon-tag { align-self: flex-start; margin: 2px 0 1px; }
.nav-dd-panel .soon-tag { display: inline-block; vertical-align: 2px; margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: var(--riso-pink); color: #fff; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ── Free checks strip: under the top bar, every page ── */
/* Put in place as the page is parsed, by the short script sync-nav writes
   after the top bar, so it is in the first paint; js/header.js keeps it true.
   z-index: the home page pulls its cell stage up under the top bar, and
   without it the stage would paint over the strip. */
.free-strip {
  position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 44px 8px 20px;
  background: var(--riso-green); color: var(--on-brand);
  border-bottom: 1.5px solid var(--ink);
  font-size: 14px; line-height: 1.35; text-align: center;
}
.free-strip p { margin: 0; }
.free-strip b { font-weight: 800; }
.free-strip a { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.free-strip-tag { display: inline-block; margin-right: 4px; padding: 1px 7px; border-radius: 5px; background: var(--on-brand); color: var(--riso-green); font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; vertical-align: 1px; }
.free-strip-x { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--on-brand); font-size: 20px; line-height: 1; cursor: pointer; }
.free-strip-x:hover { background: rgba(0, 0, 0, 0.12); }
.free-strip a:focus-visible, .free-strip-x:focus-visible { outline: 2px solid var(--on-brand); outline-offset: 2px; }
.free-strip-short { display: none; }
.free-strip-book { display: inline; }
.free-strip-sep { margin: 0 6px 0 14px; opacity: .7; }
/* The strip scrolls (sync-nav writes the sentence twice; the second copy is inert). */
.free-strip-view { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.free-strip-track { display: flex; width: max-content; animation: free-strip-scroll 60s linear infinite; }
.free-strip-track p { flex: none; padding-right: 72px; white-space: nowrap; }
.free-strip:hover .free-strip-track, .free-strip:focus-within .free-strip-track { animation-play-state: paused; }
@keyframes free-strip-scroll { to { transform: translateX(-50%); } }
/* Still when it need not move: students (one message), reduced motion, print. */
:root[data-audience="student"] .free-strip-track { animation: none; width: auto; }
:root[data-audience="student"] .free-strip-track p[inert] { display: none; }
:root[data-audience="student"] .free-strip-track p { padding-right: 0; white-space: normal; }
@media (prefers-reduced-motion: reduce) {
  .free-strip-track { animation: none; width: auto; }
  .free-strip-track p[inert] { display: none; }
  .free-strip-track p { padding-right: 0; white-space: normal; }
}
/* Phones get the short lead-in, so the strip still says what it is for */
@media (max-width: 760px) { .free-strip { font-size: 13px; padding: 7px 40px 7px 12px; } .free-strip-long { display: none; } .free-strip-short { display: inline; } }
@media print { .free-strip { display: none !important; } }

/* ── What's new notice (js/header.js): a modal, once per announcement ── */
.news-dlg {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  padding: 22px 24px 20px; margin: auto;
  background: var(--paper-white); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 14px;
  box-shadow: 6px 6px 0 var(--riso-green);
}
.news-dlg::backdrop { background: rgba(20, 32, 27, 0.45); }
.news-eyebrow { margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--riso-pink-deep); }
.news-dlg h2 { margin: 6px 0 12px; font-size: 26px; line-height: 1.1; letter-spacing: -.01em; }
.news-dlg h2 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--riso-green-deep); }
.news-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.news-list li { position: relative; padding-left: 18px; font-size: 14.5px; line-height: 1.45; color: var(--ink-dim); }
.news-list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--riso-pink); }
.news-list b { color: var(--ink); }
.news-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 18px; }
.news-go { display: inline-block; padding: 10px 16px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--riso-green); color: var(--on-brand); font-weight: 700; font-size: 14.5px; text-decoration: none; box-shadow: 3px 3px 0 var(--ink); }
.news-go:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
/* The newsletter notice: an email box and Join, then a line that answers. */
.news-list a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.news-nl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.news-nl[hidden] { display: none; }
.news-nl input[type="email"] { flex: 1 1 200px; min-width: 0; min-height: 44px; padding: 9px 12px; font: inherit; font-size: 16px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--paper-white); color: var(--ink); }
.news-nl input[type="email"]:focus-visible { outline: 2px solid var(--riso-pink); outline-offset: 2px; }
.news-nl button.news-go { cursor: pointer; font-family: inherit; }
.news-nl button.news-go:disabled { opacity: 0.6; cursor: progress; }
.news-nl-trap { position: absolute; left: -5000px; width: 1px; height: 1px; opacity: 0; }
.news-nl-msg { margin: 10px 0 0; font-size: 14px; color: var(--riso-green-deep); }
.news-nl-msg.bad { color: #b3306a; }
.news-nl-msg[hidden] { display: none; }
.news-nl-why { font-size: 14px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.news-close { border: 0; background: none; padding: 8px 4px; font: inherit; font-size: 14px; color: var(--ink-dim); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.news-close:hover { color: var(--ink); }
.news-go:focus-visible, .news-close:focus-visible { outline: 2px solid var(--riso-pink-deep); outline-offset: 3px; }
@media print { .news-dlg { display: none !important; } }

/* ── Support the site (js/header.js): a quiet card, placed by the page ── */
.support-nudge {
  display: flex; align-items: center; gap: 22px;
  max-width: 880px; margin: 40px auto 8px; padding: 20px 24px;
  background: var(--paper-white); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 14px;
  box-shadow: 5px 5px 0 var(--riso-pink);
}
.support-nudge[hidden] { display: none; }
.sn-cover { width: 92px; height: auto; flex-shrink: 0; border: 1.5px solid var(--ink); border-radius: 4px; box-shadow: 3px 3px 0 var(--riso-green); transform: rotate(-3deg); }
.sn-body { min-width: 0; }
.sn-kicker { margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--riso-pink-deep); }
.sn-title { margin: 4px 0 6px; font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.sn-line { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-dim); }
.sn-line b { color: var(--ink); }
.sn-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 14px 0 0; }
.sn-go { display: inline-block; padding: 9px 15px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--riso-green); color: var(--on-brand); font-weight: 700; font-size: 14.5px; text-decoration: none; box-shadow: 3px 3px 0 var(--ink); }
.sn-go:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.sn-more { font-size: 14px; color: var(--ink-dim); text-decoration: underline; text-underline-offset: 3px; }
.sn-more:hover { color: var(--ink); }
.sn-go:focus-visible, .sn-more:focus-visible, .sn-x:focus-visible { outline: 2px solid var(--riso-pink-deep); outline-offset: 3px; }
/* The exam maker's rail: narrow, text only, closable */
.support-nudge.is-rail { position: relative; display: block; max-width: none; margin: 0; padding: 16px 16px 16px; border-radius: 12px; box-shadow: 4px 4px 0 var(--riso-pink); }
.support-nudge.is-rail .sn-line { font-size: 14px; margin-top: 6px; padding-right: 8px; }
.support-nudge.is-rail .sn-go { margin-top: 12px; font-size: 13.5px; padding: 8px 13px; }
.sn-x { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--ink-dim); font-size: 20px; line-height: 1; cursor: pointer; }
.sn-x:hover { background: var(--paper); color: var(--ink); }
@media (max-width: 600px) {
  .support-nudge:not(.is-rail) { flex-direction: column; align-items: flex-start; gap: 14px; margin: 32px 0 8px; padding: 18px; }
  .sn-cover { width: 70px; }
}
@media print { .support-nudge { display: none !important; } }

/* A page shown inside another (a lesson in the Revise view's pop-up, which
   has its own bar): no site bar, no display panel. Set by js/header.js. */
.in-frame .topbar, .in-frame .a11y-controls { display: none !important; }
/* Have you tried Zombio? (js/header.js): the What's new card with a picture on top */
.zb-dlg .zb-pic { display: block; margin: -4px -4px 14px; border: 1.5px solid var(--ink); border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; }
.zb-dlg .zb-pic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.zb-dlg .zb-pic:hover img { transform: scale(1.04); }
.zb-line { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-dim); }
/* Rainy Day Biology Book 2 offer (js/header.js): the cover beside the words. */
.bk-row { display: flex; gap: 18px; align-items: flex-start; }
.bk-pic { flex: 0 0 112px; display: block; border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; box-shadow: 3px 3px 0 var(--riso-pink); }
.bk-pic img { display: block; width: 100%; height: auto; }
.bk-text { min-width: 0; }
.bk-dlg h2 { font-size: 24px; }
.bk-price { margin: 10px 0 0; font-size: 14.5px; font-weight: 700; color: var(--ink); }
@media (max-width: 480px) { .bk-row { gap: 14px; } .bk-pic { flex-basis: 84px; } .bk-dlg h2 { font-size: 21px; } .bk-dlg { padding: 18px 18px 16px; } }

/* Every button says it can be pressed: on hover it lifts a pixel and gains
   a pink offset shadow (on top of any shadow it already has); pressed, it
   settles back. Wrapped whole in :where(), so it weighs nothing: a page's
   own transform, filter or hover rule always wins. Tabs, menus, toggles that
   open something (a topic row, a menu) and disabled buttons are left alone. */
:where(:is(button, input[type="submit"], input[type="button"], a[class*="btn"], a[class*="-go"], a.lessons-hub-link, a.ia-btn, a.mod-btn):not(:disabled):not([aria-disabled="true"]):not([role="tab"]):not([role="menuitem"]):not(.aud-pill button):not([class*="close"]):not([class*="-x"]):not([aria-expanded]):not([aria-controls])) {
  transition: transform .15s ease, filter .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
@media (hover: hover) {
  :where(:is(button, input[type="submit"], input[type="button"], a[class*="btn"], a[class*="-go"], a.lessons-hub-link, a.ia-btn, a.mod-btn):not(:disabled):not([aria-disabled="true"]):not([role="tab"]):not([role="menuitem"]):not(.aud-pill button):not([class*="close"]):not([class*="-x"]):not([aria-expanded]):not([aria-controls]):hover) { transform: translate(-1px, -1px); filter: drop-shadow(2px 2px 0 var(--riso-pink)); }
}
:where(:is(button, input[type="submit"], input[type="button"], a[class*="btn"], a[class*="-go"], a.lessons-hub-link, a.ia-btn, a.mod-btn):not(:disabled):not([aria-disabled="true"]):not([role="tab"]):not([role="menuitem"]):not(.aud-pill button):not([class*="close"]):not([class*="-x"]):not([aria-expanded]):not([aria-controls]):active) { transform: translate(1px, 1px); filter: none; }
@media (prefers-reduced-motion: reduce) {
  :where(:is(button, input[type="submit"], input[type="button"], a[class*="btn"], a[class*="-go"], a.lessons-hub-link, a.ia-btn, a.mod-btn):not(:disabled):not([aria-disabled="true"]):not([role="tab"]):not([role="menuitem"]):not(.aud-pill button):not([class*="close"]):not([class*="-x"]):not([aria-expanded]):not([aria-controls]):hover), :where(:is(button, input[type="submit"], input[type="button"], a[class*="btn"], a[class*="-go"], a.lessons-hub-link, a.ia-btn, a.mod-btn):not(:disabled):not([aria-disabled="true"]):not([role="tab"]):not([role="menuitem"]):not(.aud-pill button):not([class*="close"]):not([class*="-x"]):not([aria-expanded]):not([aria-controls]):active) { transform: none; }
}

/* "First one free" (js/free-start.js): a sticker by the headline, a line under
   the main button, a note on the sign-in card and, once signed in, what was
   given. Shown only while the offer is open (html.ff-open). */
:where(.ia-head, .mod-intro) { position: relative; }
.ff-open :where(.ia-head, .mod-intro) > :is(h1, .meta) { padding-right: 128px; }
.ff-open :where(.ia-head, .mod-intro) > .ia-badge { max-width: calc(100% - 128px); }
.ff-sticker { position: absolute; top: 4px; right: 0; z-index: 1; width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; text-align: center; transform: rotate(8deg); background: var(--riso-pink); color: var(--on-brand); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-family: var(--font-display); font-size: 17px; font-weight: 800; line-height: 1.05; letter-spacing: -0.01em; }
.ff-sticker[hidden] { display: none; }
.ff-sticker small { display: block; margin-top: 5px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; line-height: 1.2; padding: 0 12px; }
.ff-line { margin: 12px 0 0; font-size: 15px; }
.ff-line b { color: var(--riso-green-deep); }
.ff-gift { display: inline-block; margin: 4px 0 10px; padding: 8px 14px; border: 1.5px dashed var(--riso-green-deep); border-radius: 12px; background: color-mix(in srgb, var(--riso-green) 10%, transparent); font-size: 14px; }
.ff-gift b { color: var(--riso-green-deep); font-size: 16px; }
.ff-welcome { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 14px; padding: 10px 14px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--paper-white); font-size: 14.5px; }
.ff-welcome[hidden] { display: none; }
.ff-welcome span { color: var(--ink-dim); }
.ff-chip { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; background: var(--riso-green); color: var(--on-brand) !important; padding: 3px 9px; border-radius: 999px; }
@media (max-width: 640px) {
  .ff-open :where(.ia-head, .mod-intro) > :is(h1, .meta) { padding-right: 0; }
  .ff-open :where(.ia-head, .mod-intro) > .ia-badge { max-width: none; }
  .ff-sticker { position: static; display: inline-grid; width: auto; height: auto; padding: 6px 14px; border-radius: 999px; transform: rotate(-2deg); font-size: 14px; margin: 4px 0 8px; }
  .ff-sticker br { display: none; }
  .ff-sticker small { display: inline; margin: 0 0 0 6px; padding: 0; }
}
.ff-line a { color: inherit; text-decoration: underline; text-decoration-color: var(--riso-green); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ff-line a:hover { color: var(--riso-pink-deep); text-decoration-color: var(--riso-pink); }

/* ── The calm look (a preview) ─────────────────────────────────
   ?look=calm puts <html data-look="calm"> on every page (the boot line,
   LOOK_BOOT in scripts/sync-nav.mjs) and ?look=off takes it away; with no
   flag none of this applies. It answers "the bar is hard to read": one
   readable sans (Atkinson Hyperlegible, already self-hosted) for every
   label and button, dark ink at 16px, no numbers or coloured dots, a quiet
   segmented student / teacher control, one clear Sign in button, plain
   icons, the free checks offer as one quiet line, and menus without the
   offset shadow. Every text here is at least 4.5 to 1 against what is
   behind it; secondary text uses --calm-dim, 7 to 1 or more. The home page
   has its own part in css/landing-calm.css, the footer in css/footer.css. */
:root[data-look="calm"] {
  --calm-sans: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --calm-dim: #344f41;
  --calm-pink: #a62a62;
  --calm-green: #11603a;
  --calm-line: rgba(26, 58, 42, 0.22);
  --calm-hover: rgba(26, 58, 42, 0.07);
}
:root[data-look="calm"][data-theme="dark"] {
  --calm-dim: #c9d7ce;
  --calm-pink: #ffb3d1;
  --calm-green: #7fe9c0;
  --calm-line: rgba(233, 241, 234, 0.24);
  --calm-hover: rgba(233, 241, 234, 0.09);
}
:root[data-look="calm"][data-palette="accessible"] {
  --calm-dim: var(--ink-dim);
  --calm-pink: var(--riso-pink-deep);
  --calm-green: var(--riso-green-deep);
}

/* The bar: a flat ground (the grain stays in the pictures), a hairline under it. */
:root[data-look="calm"] .topbar { background: var(--paper-white); border-bottom: 1px solid var(--calm-line); gap: 12px; }
:root[data-look="calm"] .topbar::after { display: none; }

/* The bar shows which side of the site this is: pink for the student view,
   green for the teacher view, and the plain bar until a side is chosen. The
   saturated colour sits on a thick bottom edge, and the fill is a pale tint
   so the ink on the tabs keeps its contrast. The pill still names the side. */
:root[data-audience="student"] .topbar { background: color-mix(in srgb, var(--riso-pink) 38%, var(--paper-white)); border-bottom: 4px solid var(--riso-pink-deep); }
:root[data-audience="teacher"] .topbar { background: color-mix(in srgb, var(--riso-green) 42%, var(--paper-white)); border-bottom: 4px solid var(--riso-green-deep); }
:root[data-look="calm"][data-audience="student"] .topbar { background: color-mix(in srgb, var(--riso-pink) 38%, var(--paper-white)); border-bottom: 4px solid var(--riso-pink-deep); }
:root[data-look="calm"][data-audience="teacher"] .topbar { background: color-mix(in srgb, var(--riso-green) 42%, var(--paper-white)); border-bottom: 4px solid var(--riso-green-deep); }
:root[data-theme="dark"][data-audience="student"] .topbar,
:root[data-theme="dark"][data-look="calm"][data-audience="student"] .topbar { background: color-mix(in srgb, var(--riso-pink) 24%, var(--paper)); }
:root[data-theme="dark"][data-audience="teacher"] .topbar,
:root[data-theme="dark"][data-look="calm"][data-audience="teacher"] .topbar { background: color-mix(in srgb, var(--riso-green) 24%, var(--paper)); }
:root[data-look="calm"] .brand { font-size: 19px; font-weight: 700; letter-spacing: -.01em; gap: 10px; }
:root[data-look="calm"] .brand small { font-family: var(--font-display); font-size: 19px; font-weight: 500; letter-spacing: -0.01em; color: var(--calm-dim); }

/* The tabs: plain words in sentence case. The numbers and the free / paid
   dots go (the words "(free)" and "(paid)" stay for screen readers). */
:root[data-look="calm"] .tabs { --calm-tab-fs: 16px; font-family: var(--calm-sans); font-size: var(--calm-tab-fs); font-weight: 700; letter-spacing: 0; gap: 2px; }
:root[data-look="calm"] .tab { display: block; padding: 10px 13px 11px; border-radius: 8px; color: var(--ink); line-height: 1.2; transition: background-color 0.15s; }
:root[data-look="calm"] .tab::first-letter { text-transform: uppercase; }
/* "ai marking" reads "AI marking": the words stay for screen readers (at
   no size), the picture of them is drawn after, and not read twice. */
:root[data-look="calm"] .tab .tab-word { font-size: 0; }
:root[data-look="calm"] .tab .tab-word::after { content: "IA marking"; content: "IA marking" / ""; font-size: var(--calm-tab-fs, 16px); }
:root[data-look="calm"] .tab .num,
:root[data-look="calm"] .tab-kind { display: none; }
:root[data-look="calm"] .tab:hover,
:root[data-look="calm"] .tab[aria-expanded="true"] { background: var(--calm-hover); color: var(--ink); }
:root[data-look="calm"] .tab:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: -3px; border-radius: 8px; }
:root[data-look="calm"] .tab.active::after { left: 13px; right: 13px; bottom: 2px; height: 3px; background: var(--riso-pink-deep); box-shadow: none; }
:root[data-look="calm"] #tabs .dd-caret { display: inline-block; margin-left: 5px; font-size: 12px; color: var(--calm-dim); vertical-align: 1px; }

/* Student / teacher: a quiet segmented control, the chosen side filled. */
:root[data-look="calm"] .aud-pill { padding: 3px; gap: 2px; border: 1px solid var(--calm-line); border-radius: 9px; background: var(--paper); box-shadow: none; font-family: var(--calm-sans); }
:root[data-look="calm"] .aud-pill button { display: inline-block; padding: 8px 12px; border-radius: 6px; font-size: 15px; font-weight: 700; letter-spacing: 0; line-height: 1.1; color: var(--calm-dim); }
:root[data-look="calm"] .aud-pill button::first-letter { text-transform: uppercase; }
:root[data-look="calm"] .aud-pill button:hover { background: var(--calm-hover); color: var(--ink); }
:root[data-look="calm"] .aud-pill button:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 1px; }
:root[data-look="calm"] .aud-dot { display: none; }
:root[data-look="calm"][data-audience="student"] .aud-pill [data-aud-set="student"],
:root[data-look="calm"][data-audience="teacher"] .aud-pill [data-aud-set="teacher"] { background: var(--ink); color: var(--paper-white); }

/* Sign in: the one filled button in the bar. Signed in, it steps back to an
   outline, since it is no longer asking for anything. */
:root[data-look="calm"] .acct-btn { height: 44px; padding: 0 16px 0 13px; gap: 8px; border: 1.5px solid var(--ink); border-radius: 9px; background: var(--ink); color: var(--paper-white); font-family: var(--calm-sans); font-size: 16px; font-weight: 700; letter-spacing: 0; box-shadow: none; }
:root[data-look="calm"] .acct-btn:hover { transform: none; filter: none; background: color-mix(in srgb, var(--ink) 86%, var(--paper-white)); box-shadow: none; }
:root[data-look="calm"] .acct-btn[aria-expanded="true"] { box-shadow: none; }
:root[data-look="calm"] .acct-btn:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
:root[data-look="calm"] .acct-word { display: inline-block; }
:root[data-look="calm"] .acct-word::first-letter { text-transform: uppercase; }
:root[data-look="calm"] .acct-ico svg { width: 19px; height: 19px; }
:root[data-look="calm"][data-signed] .acct-btn { padding: 0 12px 0 7px; background: transparent; color: var(--ink); border-color: var(--calm-line); }
:root[data-look="calm"][data-signed] .acct-btn:hover { background: var(--calm-hover); }
:root[data-look="calm"] .acct-av { width: 30px; height: 30px; border-width: 1px; font-family: var(--calm-sans); font-size: 15px; font-weight: 700; }
:root[data-look="calm"] .acct-car { font-size: 12px; color: var(--calm-dim); opacity: 1; }

/* YouTube and support: plain icons in ink, a soft ground on hover. */
:root[data-look="calm"] .youtube-btn, :root[data-look="calm"] .instagram-btn,
:root[data-look="calm"] .support-btn { width: 46px; min-width: 46px; height: 46px; padding: 0; border-radius: 9px; background: transparent; color: var(--ink); box-shadow: none; }
:root[data-look="calm"] .youtube-btn:hover, :root[data-look="calm"] .instagram-btn:hover,
:root[data-look="calm"] .support-btn:hover { background: var(--calm-hover); color: var(--ink); transform: none; filter: none; box-shadow: none; }
:root[data-look="calm"] .youtube-btn:focus-visible, :root[data-look="calm"] .instagram-btn:focus-visible,
:root[data-look="calm"] .support-btn:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 1px; }
:root[data-look="calm"] .youtube-btn svg, :root[data-look="calm"] .instagram-btn svg { width: 28px; height: 28px; }
:root[data-look="calm"] .support-btn svg { width: 24px; height: 24px; }
:root[data-look="calm"] .youtube-btn:hover { color: #e00; }
:root[data-look="calm"] .instagram-btn:hover { color: #e1306c; }
:root[data-look="calm"] .support-btn:hover { color: var(--riso-pink-deep); }
:root[data-look="calm"] .support-word { display: none; }

/* Laptops: the calm bar is narrower than the default one, so the words stay
   longer; they go only where the row would otherwise overflow. */
@media (max-width: 1440px) and (min-width: 761px) {
  :root[data-look="calm"] .tab { padding: 10px 11px 11px; }
  :root[data-look="calm"] .tab.active::after { left: 11px; right: 11px; }
}
@media (max-width: 1280px) and (min-width: 761px) {
  :root[data-look="calm"] .acct-word { display: inline-block; }
  :root[data-look="calm"] .acct-btn { padding: 0 14px 0 11px; }
}
@media (max-width: 1180px) and (min-width: 761px) {
  :root[data-look="calm"] .brand small { display: none; }
}
@media (max-width: 1040px) and (min-width: 761px) {
  :root[data-look="calm"] .acct-word { display: none; }
  :root[data-look="calm"] .acct-btn { padding: 0 12px; }
  :root[data-look="calm"] .tabs { --calm-tab-fs: 15px; }
  :root[data-look="calm"] .tab { padding: 10px 8px 11px; }
}
/* Tablets (an iPad at 820): every tab fits whole, rather than AI marking
   cut off behind the student / teacher pill. */
@media (max-width: 920px) and (min-width: 761px) {
  :root[data-look="calm"] .tabs { --calm-tab-fs: 14px; gap: 0; }
  :root[data-look="calm"] .tab { padding: 10px 6px 11px; }
  :root[data-look="calm"] .brand { font-size: 16px; }
}

/* The teacher bar has six tabs (the student one five), which did not fit
   under about 1330 px: "IA marking" read "IA mar" on most laptops. So in
   teacher mode each thing gives way a step earlier: "by Bradford", then
   YouTube and Instagram (both in the About menu and the footer), then the
   smaller tabs, then the heart; on a tablet the student bar drops the two
   icons too, and both lose the menu carets. */
@media (max-width: 1340px) and (min-width: 761px) {
  :root[data-look="calm"][data-audience="teacher"] .brand small { display: none; }
}
@media (max-width: 1240px) and (min-width: 761px) {
  :root[data-look="calm"][data-audience="teacher"] .youtube-btn,
  :root[data-look="calm"][data-audience="teacher"] .instagram-btn { display: none; }
  :root[data-look="calm"][data-audience="teacher"] .nav-dd-panel .nav-dd-foot a.calm-phone { display: inline; }
}
@media (max-width: 1120px) and (min-width: 761px) {
  :root[data-look="calm"][data-audience="teacher"] .acct-word { display: none; }
  :root[data-look="calm"][data-audience="teacher"] .acct-btn { padding: 0 12px; }
  :root[data-look="calm"][data-audience="teacher"] .tabs { --calm-tab-fs: 15px; }
  :root[data-look="calm"][data-audience="teacher"] .tab { padding: 10px 8px 11px; }
}
@media (max-width: 990px) and (min-width: 761px) {
  :root[data-look="calm"][data-audience="teacher"] .tabs { --calm-tab-fs: 14px; gap: 0; }
  :root[data-look="calm"][data-audience="teacher"] .tab { padding: 10px 6px 11px; }
  :root[data-look="calm"][data-audience="teacher"] .brand { font-size: 16px; }
}
@media (max-width: 900px) and (min-width: 761px) {
  :root[data-look="calm"][data-audience="teacher"] .support-btn,
  :root[data-look="calm"] .youtube-btn, :root[data-look="calm"] .instagram-btn { display: none; }
  :root[data-look="calm"] .nav-dd-panel .nav-dd-foot a.calm-phone { display: inline; }
  :root[data-look="calm"] #tabs .dd-caret { display: none; }
}
@media (max-width: 830px) and (min-width: 761px) {
  :root[data-look="calm"][data-audience="teacher"] .tab { padding: 10px 3px 11px; }
  :root[data-look="calm"][data-audience="teacher"] .aud-pill button { padding: 8px 8px; }
}

/* Phones: brand, the student / teacher control and Sign in above; all five
   tabs below, across the whole row, so none of them hides off the edge.
   YouTube and the heart step out of the bar here: YouTube is in the
   footer, and the About menu gains both (js/header.js, .calm-phone). */
@media (max-width: 760px) {
  :root[data-look="calm"] .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand aud acct"
      "tabs  tabs tabs";
    padding: 8px 10px 4px; column-gap: 8px; row-gap: 2px;
  }
  :root[data-look="calm"] .brand { font-size: 17px; gap: 8px; min-width: 0; }
  :root[data-look="calm"] .youtube-btn, :root[data-look="calm"] .instagram-btn,
  :root[data-look="calm"] .support-btn { display: none; }
  :root[data-look="calm"] .aud-pill { grid-area: aud; justify-self: end; box-shadow: none; }
  :root[data-look="calm"] .aud-pill button { padding: 7px 9px; font-size: 15px; }
  :root[data-look="calm"] .acct { grid-area: acct; }
  :root[data-look="calm"] .acct-btn { width: auto; height: 40px; padding: 0 12px; }
  :root[data-look="calm"] .acct-word { display: inline-block !important; font-size: 15px; }
  :root[data-look="calm"] .acct-ico { display: none; }
  :root[data-look="calm"][data-signed] .acct-btn { width: 40px; padding: 0; }
  :root[data-look="calm"][data-signed] .acct-word { display: none !important; }
  :root[data-look="calm"] .tabs {
    grid-area: tabs; width: 100%; --calm-tab-fs: 15px;
    flex-wrap: wrap; gap: 0; overflow: visible; mask-image: none; -webkit-mask-image: none; padding-bottom: 0;
  }
  /* Each tab as wide as its word plus an even share of what is left, so the
     five fit across a 360px phone in every mode (teachers' "Resources" is
     the longest set). */
  :root[data-look="calm"] .tab { display: block; flex: 1 1 auto; min-height: 44px; padding: 12px 2px 10px; text-align: center; }
  :root[data-look="calm"] .tab.active::after { left: 4px; right: 4px; bottom: 3px; }
  :root[data-look="calm"] #tabs .dd-caret { display: none; }
}
/* The narrowest phones: Sign in as its icon, so the top row still fits. */
@media (max-width: 374px) {
  :root[data-look="calm"] .tabs { letter-spacing: -0.01em; }
  /* The words sit close here, so a hairline tells one tab from the next. */
  :root[data-look="calm"] .tab + .tab::before { content: ""; position: absolute; left: 0; top: 15px; bottom: 15px; width: 1px; background: var(--calm-line); }
  :root[data-look="calm"] .acct-btn { width: 40px; padding: 0; }
  :root[data-look="calm"] .acct-word { display: none !important; }
  :root[data-look="calm"] .acct-ico { display: inline-flex; }
  :root[data-look="calm"] .aud-pill button { padding: 7px 7px; }
}
/* The About menu's YouTube and Support links, for phones in the calm look. */
.nav-dd-panel .nav-dd-foot a.calm-phone { display: none; }
@media (max-width: 760px) {
  :root[data-look="calm"] .nav-dd-panel .nav-dd-foot a.calm-phone { display: inline; }
}

/* The free checks offer: one quiet line on the page, not a green band. */
:root[data-look="calm"] .free-strip { padding: 7px 48px 7px 20px; background: color-mix(in srgb, #000 7%, var(--paper)); color: var(--ink); border-bottom: 1px solid var(--calm-line); font-family: var(--calm-sans); font-size: 15px; line-height: 1.45; }
:root[data-look="calm"] .free-strip b { font-weight: 700; }
:root[data-look="calm"] .free-strip a { color: var(--ink); font-weight: 700; text-decoration-color: var(--riso-pink-deep); text-decoration-thickness: 2px; }
:root[data-look="calm"] .free-strip-tag { margin-right: 2px; padding: 0; background: none; color: var(--calm-green); font-family: var(--calm-sans); font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; vertical-align: 0; }
:root[data-look="calm"] .free-strip-tag::after { content: ":"; }
:root[data-look="calm"] .free-strip-x { color: var(--calm-dim); }
:root[data-look="calm"] .free-strip-x:hover { background: var(--calm-hover); color: var(--ink); }
:root[data-look="calm"] .free-strip a:focus-visible,
:root[data-look="calm"] .free-strip-x:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
@media (max-width: 760px) {
  :root[data-look="calm"] .free-strip { padding: 9px 44px 9px 14px; font-size: 15px; text-align: left; justify-content: flex-start; }
}

/* The menus: the same sans, words in ink, the riso offset shadow traded for
   a soft one, no bullet dots. */
:root[data-look="calm"] .nav-dd-panel { border: 1px solid var(--calm-line); border-radius: 12px; box-shadow: 0 14px 36px rgba(20, 40, 30, 0.16), 0 2px 6px rgba(20, 40, 30, 0.06); padding: 14px 14px 8px; font-family: var(--calm-sans); }
:root[data-look="calm"] .nav-dd-h { font-family: var(--calm-sans); font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--calm-dim); padding: 6px 10px 6px; }
:root[data-look="calm"] .nav-dd-panel a { font-family: var(--calm-sans); font-size: 16px; line-height: 1.3; padding: 8px 10px; }
:root[data-look="calm"] .nav-dd-panel a:hover { background: var(--calm-hover); }
:root[data-look="calm"] .nav-dd-panel a:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: -3px; }
:root[data-look="calm"] .nav-dd-panel a .dot,
:root[data-look="calm"] .nav-dd-soon .dot { display: none; }
:root[data-look="calm"] .nav-dd-panel .dd-t { gap: 2px; }
:root[data-look="calm"] .nav-dd-panel .dd-t small { font-family: var(--calm-sans); font-size: 15px; letter-spacing: 0; line-height: 1.35; color: var(--calm-dim); }
:root[data-look="calm"] .nav-dd-panel .dd-t small::first-letter,
:root[data-look="calm"] .acct-menu .acct-row small::first-letter { text-transform: uppercase; }
:root[data-look="calm"] .nav-dd-panel a.nav-dd-feature { border: 1px solid var(--calm-line); background: var(--paper); padding: 11px 12px; }
:root[data-look="calm"] .nav-dd-feature b { font-family: var(--calm-sans); font-size: 17px; color: var(--ink); }
:root[data-look="calm"] .nav-dd-feature span { font-size: 15px; color: var(--calm-dim); }
:root[data-look="calm"] .nav-dd-subs { border-bottom: 1px solid var(--calm-line); }
:root[data-look="calm"] .nav-dd-all,
:root[data-look="calm"] .nav-dd-foot,
:root[data-look="calm"] .nav-dd-panel .nav-dd-foot a { font-family: var(--calm-sans); font-size: 15px; letter-spacing: 0; color: var(--calm-dim); }
:root[data-look="calm"] .nav-dd-all { border-top: 1px solid var(--calm-line); font-weight: 700; color: var(--ink); }
:root[data-look="calm"] .nav-dd-foot { border-top: 1px solid var(--calm-line); }
:root[data-look="calm"] .nav-dd-panel .nav-dd-foot a { text-decoration: underline; text-underline-offset: 3px; }
:root[data-look="calm"] .nav-dd-soon { font-family: var(--calm-sans); font-size: 16px; color: var(--calm-dim); }
:root[data-look="calm"] .nav-dd-posts .p-date { font-family: var(--calm-sans); font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--calm-pink); }
:root[data-look="calm"] .nav-dd-posts .p-title { font-family: var(--calm-sans); font-size: 16px; }
:root[data-look="calm"] .nav-dd-panel .soon-tag { font-family: var(--calm-sans); font-size: 14px; letter-spacing: 0; text-transform: none; background: none; color: var(--calm-pink); padding: 0; font-weight: 700; }

/* The account panel, in the same type. */
:root[data-look="calm"] .acct-menu { border: 1px solid var(--calm-line); border-radius: 12px; box-shadow: 0 14px 36px rgba(20, 40, 30, 0.16), 0 2px 6px rgba(20, 40, 30, 0.06); font-family: var(--calm-sans); font-size: 16px; }
:root[data-look="calm"] .acct-menu .acct-hd span,
:root[data-look="calm"] .acct-menu .acct-form p { font-size: 15px; color: var(--calm-dim); }
:root[data-look="calm"] .acct-menu .acct-row small { font-family: var(--calm-sans); font-size: 15px; color: var(--calm-dim); }
:root[data-look="calm"] .acct-menu .acct-code label { font-family: var(--calm-sans); font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
:root[data-look="calm"] .acct-menu .acct-form .acct-go { border-radius: 9px; background: var(--ink); color: var(--paper-white); box-shadow: none; font-weight: 700; }
:root[data-look="calm"] .acct-menu .acct-form .acct-back,
:root[data-look="calm"] .acct-menu .acct-form .acct-free,
:root[data-look="calm"] .acct-menu .acct-code-msg { font-size: 15px; }
:root[data-look="calm"] .acct-menu .acct-form .acct-free b { color: var(--calm-green); }

/* The display settings (css/theme.css, js/theme.js): the same sans, words
   at 15px, a soft shadow instead of the riso offset, and folded away it is
   a plain 44px round button. */
:root[data-look="calm"] .a11y-controls { border: 1px solid var(--calm-line); border-radius: 14px; box-shadow: 0 10px 28px rgba(20, 40, 30, 0.16), 0 1px 3px rgba(20, 40, 30, 0.08); font-family: var(--calm-sans); }
:root[data-look="calm"] .a11y-controls.a11y-min { width: auto; height: 44px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px; }
:root[data-look="calm"] .a11y-controls.a11y-min .a11y-tab { display: inline-flex; align-items: center; gap: 8px; width: auto; height: 44px; padding: 0; border-radius: 999px; font-family: var(--calm-sans); }
:root[data-look="calm"] .a11y-tab svg { width: 20px; height: 20px; }
:root[data-look="calm"] .a11y-tab:focus-visible,
:root[data-look="calm"] .a11y-hide:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
:root[data-look="calm"] .a11y-controls-title,
:root[data-look="calm"] .a11y-seg-lbl { font-family: var(--calm-sans); font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--calm-dim); }
:root[data-look="calm"] .a11y-hide { color: var(--calm-dim); }
:root[data-look="calm"] .a11y-btn { font-family: var(--calm-sans); font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; border-width: 1px; border-color: var(--calm-line); border-radius: 9px; }
:root[data-look="calm"] .a11y-btn[aria-pressed="true"] { border-color: var(--ink); }
:root[data-look="calm"] .a11y-seg { border-width: 1px; border-color: var(--calm-line); border-radius: 9px; }
:root[data-look="calm"] .a11y-size { border-right-width: 1px; border-right-color: var(--calm-line); }
:root[data-look="calm"] .a11y-lang-sel { font-family: var(--calm-sans); font-size: 15px; letter-spacing: 0; }
:root[data-look="calm"] .a11y-rule { border-top: 1px solid var(--calm-line); }
.a11y-tab-word { display: none; }
/* On a phone, at the end of the footer (js/header.js moves it there). */
:root[data-look="calm"] footer .a11y-controls.a11y-in-foot { position: static; width: max-content; margin: 22px 0 0; box-shadow: none; }
:root[data-look="calm"] footer .a11y-controls.a11y-in-foot.a11y-min { width: max-content; height: auto; border-radius: 9px; background: var(--paper-white); }
:root[data-look="calm"] footer .a11y-in-foot.a11y-min .a11y-tab { display: inline-flex; gap: 9px; align-items: center; width: auto; height: 44px; padding: 0 14px; border-radius: 9px; font-family: var(--calm-sans); font-size: 16px; font-weight: 700; line-height: 1; color: var(--ink); }
:root[data-look="calm"] footer .a11y-in-foot .a11y-tab-word { display: inline; }

/* A menu item with a line under it: the title is what you click, so it
   leads in bold and the line stays as it is. */
.nav-dd-panel a:has(.dd-t small) .dd-t { font-weight: 700; }
.nav-dd-panel .dd-t small { font-weight: 400; }

/* Grass skirts card (js/header.js): the hub's team sheet, drawn small. */
.gs-pop-pic { flex: 0 0 104px; display: block; padding: 6px 2px 0; }
.gs-pop-pic .gsk { display: block; width: 100%; height: auto; overflow: visible; }
.gsk .band { fill: var(--paper-white); stroke: var(--ink); stroke-width: 2.4; }
.gsk .sh, .gsk .g { fill: var(--riso-green); }
.gsk .p { fill: var(--riso-pink); }
.gsk .y { fill: var(--riso-yellow); }
.gsk .tape { fill: color-mix(in srgb, var(--riso-yellow) 70%, transparent); stroke: color-mix(in srgb, var(--ink) 35%, transparent); }
.gsk .col rect, .gsk .strip { fill: #fff; stroke: #1a3a2a; stroke-width: 1.6; stroke-dasharray: 4 2.4; }
.gsk .nums circle { stroke: #1a3a2a; stroke-width: 1.4; }
.gsk .words path, .gsk .cut .w { stroke: color-mix(in srgb, #1a3a2a 40%, transparent); stroke-width: 2.4; stroke-linecap: round; }
.gsk .cut { filter: drop-shadow(4px 4px 0 var(--riso-pink)); }
.gsk .scissors path { stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; }
.gsk .scissors circle { fill: var(--paper-white); stroke: var(--riso-pink-deep); stroke-width: 3; }
@media (max-width: 480px) { .gs-pop-pic { flex-basis: 72px; } }

/* Students practise from Study, so the exam maker tab is a teacher's: it stays in the page. */
:root[data-audience="student"] .tabs .tab[data-tab="exam-maker"] { display: none; }

/* Exam maker menu (teacher): Make a paper in pink, then My papers (n), Your
   classes and the papers-made count. */
.nav-dd-panel.nav-dd-exam { min-width: 320px; }
:root .nav-dd-panel a.nav-dd-feature.nav-dd-make, :root[data-look] .nav-dd-panel a.nav-dd-feature.nav-dd-make { border: 1.5px solid var(--ink); background: color-mix(in srgb, var(--riso-pink) 28%, var(--paper-white)); }
:root .nav-dd-make b, :root[data-look] .nav-dd-panel .nav-dd-make b { font-size: 18px; color: var(--ink); }
.nav-dd-n { margin-left: -5px; font-family: var(--font-display); font-size: 15px; color: var(--ink-dim); }
.nav-dd-n::before { content: "("; }
.nav-dd-n::after { content: ")"; }
.nav-dd-n[hidden], .nav-dd-made[hidden] { display: none; }
.nav-dd-made { display: flex; align-items: center; justify-content: center; gap: 7px; width: fit-content; margin: 10px auto 4px; padding: 5px 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: color-mix(in srgb, var(--riso-green) 22%, var(--paper-white)); font-family: var(--font-display); font-size: 13.5px; color: var(--ink); }
.nav-dd-made::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--riso-green); flex: none; }

/* Resources menu: rows, and a short list for the rows that group things.
   A laptop shows the list beside the rows; a phone opens it under its row. */
.nav-dd-panel { overflow-y: auto; overscroll-behavior: contain; }
.nav-dd-panel.nav-dd-rm { min-width: 0; width: 520px; max-width: calc(100vw / var(--zoom, 1) - 24px); padding: 12px 12px 8px; }
.nav-dd-rm .rm { position: relative; display: grid; grid-template-columns: 270px minmax(0, 1fr); column-gap: 14px; }
.nav-dd-rm .rm-rows { display: flex; flex-direction: column; gap: 1px; padding-right: 14px; border-right: 1px solid var(--line-strong); }
.nav-dd-panel .rm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-family: var(--font-display); font-size: 15px; font-weight: 700; text-align: left; text-decoration: none; cursor: pointer; }
.nav-dd-panel .rm-row:hover, .nav-dd-panel .rm-group.on { background: var(--paper); }
.nav-dd-panel .rm-row:focus-visible, .nav-dd-panel .rm-sub a:focus-visible, .nav-dd-panel .rm-foot:focus-visible { outline: 2px solid var(--riso-green-deep); outline-offset: -2px; }
.nav-dd-panel a.rm-lead { margin-bottom: 4px; border: 1.5px solid var(--ink); background: var(--riso-green); color: var(--on-brand); box-shadow: 2px 2px 0 var(--riso-pink); }
.nav-dd-panel a.rm-lead:hover { background: var(--riso-green-deep); color: var(--paper-white); }
.nav-dd-rm .rm-car { flex: none; font-size: 15px; line-height: 1; }
.nav-dd-rm .rm-sub { display: none; position: absolute; top: 0; left: 284px; right: 0; flex-direction: column; gap: 1px; }
.nav-dd-rm .rm-group.on + .rm-sub { display: flex; }
.nav-dd-rm .rm-sub-h { padding: 8px 10px 6px; font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--ink-dim); }
.nav-dd-panel .rm-sub a { padding: 7px 10px; font-size: 15px; font-weight: 400; }
.nav-dd-panel a.rm-foot { grid-column: 1 / -1; margin-top: 8px; padding: 10px 10px 6px; border-top: 1px solid var(--line-strong); border-radius: 0; font-size: 14.5px; font-weight: 700; }
@media not all and (hover: hover) and (min-width: 761px) {
  .nav-dd-rm .rm { display: block; }
  .nav-dd-rm .rm-rows { padding-right: 0; border-right: 0; }
  .nav-dd-rm .rm-sub { position: static; margin: 2px 0 6px 10px; padding-left: 10px; border-left: 2px solid var(--riso-green); }
  .nav-dd-rm .rm-sub-h { display: none; }
  .nav-dd-rm .rm-group[aria-expanded="true"] .rm-car { transform: rotate(90deg); }
}

/* The free-account sign-in card (exam-maker/keep.js): kept here, not in
   exam-maker.css, because the guides use it too (js/header.js, teacher gate). */
/* Keep this paper?: a centred dialog over a dimmed page, in its own colours
   so it stands out from the exam maker's green and white cards. A dark card
   with a pink shadow on the light site; a light one on the dark site. */
.keep-card {
  --k-bg: #1a3a2a; --k-fg: #f4faf6; --k-dim: #c9dcd1; --k-soft: #a9c2b5;
  --k-accent: #ff7eb6; --k-em: #7be0b0; --k-field: #f4faf6; --k-field-fg: #1a3a2a;
  --k-shadow: #ff7eb6; --k-go-shadow: #2db876; --k-bad: #ffb3d1;
  width: min(460px, calc(100vw - 32px)); margin: auto; padding: 26px 26px 22px;
  border: 2px solid var(--k-bg); border-radius: 18px;
  background: var(--k-bg); color: var(--k-fg);
  box-shadow: 8px 8px 0 var(--k-shadow);
  animation: keep-in .3s cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="dark"] .keep-card {
  --k-bg: #f4faf6; --k-fg: #1a3a2a; --k-dim: #263b2f; --k-soft: #5d7a6c;
  --k-accent: #b8336e; --k-em: #1a8a55; --k-field: #ffffff; --k-field-fg: #1a3a2a;
  --k-shadow: #ff9ec4; --k-go-shadow: #1a3a2a; --k-bad: #b3306a;
}
.keep-card::backdrop { background: rgba(14, 26, 21, 0.62); }
.keep-eyebrow { margin: 0; font-family: var(--font-mono); font-size: 13.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--k-accent); }
.keep-card h2 { margin: 6px 34px 10px 0; font-size: 26px; line-height: 1.12; letter-spacing: -.01em; color: var(--k-fg); text-wrap: balance; }
.keep-card h2 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--k-em); }
.keep-line, .keep-small { margin: 0; font-size: 15px; line-height: 1.5; color: var(--k-dim); }
.keep-line b { color: var(--k-fg); }
.keep-small { margin-top: 10px; font-size: 13px; color: var(--k-soft); }
.keep-small[hidden], .keep-form[hidden], .keep-no[hidden] { display: none; }
.keep-nl { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: var(--k-dim); cursor: pointer; }
.keep-nl input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: #1a8a55; cursor: pointer; }
.keep-nl b { color: var(--k-ink, inherit); }
.keep-nl[hidden] { display: none; }
.keep-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.keep-form input { flex: 1 1 180px; min-width: 0; min-height: 46px; padding: 9px 14px; font: inherit; font-size: 16px; border: 2px solid var(--k-field); border-radius: 12px; background: var(--k-field); color: var(--k-field-fg); }
.keep-form input::placeholder { color: #6f8a7c; }
.keep-form input:focus-visible { outline: 3px solid var(--k-accent); outline-offset: 2px; }
.keep-go { min-height: 46px; padding: 10px 18px; border: 2px solid var(--k-field-fg); border-radius: 999px; background: #ff7eb6; color: #1a3a2a; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 3px 3px 0 var(--k-go-shadow); }
.keep-go:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--k-go-shadow); }
.keep-go:disabled { opacity: .6; cursor: progress; transform: none; }
.keep-no { margin-top: 12px; padding: 6px 2px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--k-dim); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.keep-no:hover { color: var(--k-fg); }
.keep-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--k-dim); font-size: 22px; line-height: 1; cursor: pointer; }
.keep-x:hover { background: rgba(127, 127, 127, 0.18); color: var(--k-fg); }
.keep-msg { margin: 12px 0 0; font-size: 14.5px; color: var(--k-em); }
.keep-msg.bad { color: var(--k-bad); }
.keep-msg[hidden] { display: none; }
.keep-msg a { color: var(--k-fg); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.keep-toast a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.keep-go:focus-visible, .keep-no:focus-visible, .keep-x:focus-visible { outline: 3px solid var(--k-accent); outline-offset: 3px; }
.keep-toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 61; transform: translateX(-50%);
  padding: 9px 16px; border: 1.5px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--paper-white); font-size: 14px; box-shadow: 3px 3px 0 var(--riso-green);
  white-space: nowrap;
}
.keep-toast[hidden] { display: none; }
.keep-namebtn { margin: 0 0 0 2px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@keyframes keep-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .keep-card { animation: none; } }
@media print { .keep-card, .keep-toast { display: none !important; } }

/* /css/footer.css */
footer {
  border-top: 1.5px solid var(--ink);
  margin-top: 120px;
  padding: 70px 5vw 40px;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}
footer::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: url("/img/grain.svg");
  background-repeat: repeat;
  mix-blend-mode: multiply;
  opacity: 0.32;
}
footer > * { position: relative; z-index: 1; }
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 60px;
  max-width: 1320px; margin: 0 auto;
}
.foot-grid h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 18px;
}
.foot-grid p { color: var(--ink-dim); line-height: 1.6; max-width: 42ch; }
.foot-grid .big {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 32px;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 14px;
  max-width: 22ch;
}
.foot-grid .big em { color: var(--riso-pink); }
.foot-grid ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.foot-grid ul a { color: var(--ink-dim); transition: color 0.18s; }
.foot-grid ul a:hover { color: var(--riso-pink); }

/* Every section of the site, as plain links (scripts/sync-nav.mjs). */
.foot-links {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 28px 28px;
  max-width: 1320px;
  margin: 50px auto 0;
  padding-top: 30px;
  border-top: 1.5px solid var(--line);
}
.foot-links h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 12px;
}
.foot-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.foot-links a { color: var(--ink-dim); font-size: 14px; line-height: 1.35; transition: color 0.18s; }
.foot-links a:hover { color: var(--riso-pink); }
@media (max-width: 1100px) { .foot-links { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .foot-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.foot-bottom {
  max-width: 1320px;
  margin: 50px auto 0;
  padding-top: 24px;
  border-top: 1.5px solid var(--line);
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.foot-legal {
  max-width: 1320px;
  margin: 14px auto 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}
.foot-legal a {
  color: var(--ink-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.foot-legal a:hover { color: var(--riso-pink); }

/* The maker's credit: a colophon line and a two-ink stamp, as on splycr.com. */
.foot-credit {
  max-width: 1320px;
  margin: 14px auto 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-dim);
}
.foot-credit a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.foot-credit a:hover { color: var(--riso-pink); }
.foot-credit .foot-brand { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; text-decoration: none; }
.foot-credit .foot-brand img { display: block; width: 26px; height: 26px; }
.foot-credit .foot-word { font-weight: 800; font-size: 18px; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.foot-credit .foot-stamp { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.foot-credit .foot-stamp span {
  display: inline-block; padding: 3px 11px 4px;
  border: 1.5px solid var(--green-deep, #0E6B4A); border-radius: 999px;
  box-shadow: 2px 2px 0 var(--riso-pink);
  font: 600 12px/1.2 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--green-deep, #0E6B4A);
}
.foot-credit .foot-stamp:hover span, .foot-credit .foot-stamp:focus-visible span { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--riso-pink); }
@media print { .foot-credit { display: none; } }

.visitor-counts {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.visitor-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  box-shadow: 2px 2px 0 var(--riso-pink);
  transition: all 0.15s;
}
.visitor-count::before {
  content: attr(data-count);
  font-weight: 600;
  color: var(--riso-pink);
  min-width: 3ch;
}
.visitor-count:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--riso-green);
}
/* The pills after the first ("all time") in green for variety */
.visitor-count + .visitor-count {
  box-shadow: 2px 2px 0 var(--riso-green);
}
.visitor-count + .visitor-count::before {
  color: var(--riso-green-deep);
}
.visitor-count + .visitor-count:hover {
  box-shadow: 3px 3px 0 var(--riso-pink);
}
/* Middle pill ("back again this month") in coral, after the rules above so
   it wins over the green. The number is coral deepened toward the ink, so
   it reads on the pill in light and dark alike. Hidden until js/count.js
   has a figure to show (and not before November 2026). */
.visitor-count.visitor-count-returning {
  box-shadow: 2px 2px 0 var(--riso-coral);
}
.visitor-count.visitor-count-returning::before {
  color: color-mix(in srgb, var(--riso-coral) 62%, var(--ink));
}
.visitor-count.visitor-count-returning:hover {
  box-shadow: 3px 3px 0 var(--riso-green);
}
.visitor-count[hidden] { display: none; }

@media (max-width: 760px) {
  footer { margin-top: 60px; padding: 50px 5vw 30px; }
  .foot-grid { grid-template-columns: 1fr; gap: 36px; }
  .foot-grid .big { font-size: 26px; }
  .foot-bottom { flex-direction: column; gap: 8px; margin-top: 36px; }
  .visitor-count { font-size: 12px; padding: 5px 12px; }
}

/* ── The calm look (a preview: ?look=calm, see css/header.css) ──
   The footer's small grey mono labels become the readable sans, at 15px
   and up, in ink or --calm-dim; the visitor counts lose their pills. */
:root[data-look="calm"] footer { border-top: 1px solid var(--calm-line); font-family: var(--calm-sans); }
:root[data-look="calm"] footer::after { opacity: 0.14; }
:root[data-look="calm"] .foot-grid h4,
:root[data-look="calm"] .foot-links h4 { font-family: var(--calm-sans); font-size: 16px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
:root[data-look="calm"] .foot-grid p { font-size: 17px; line-height: 1.55; color: var(--calm-dim); }
:root[data-look="calm"] .foot-grid .big { font-size: 32px; color: var(--ink); }
:root[data-look="calm"] .foot-grid .big em { color: var(--calm-pink); }
:root[data-look="calm"] .foot-grid ul a,
:root[data-look="calm"] .foot-links a { font-size: 16px; color: var(--calm-dim); }
:root[data-look="calm"] .foot-grid ul a:hover,
:root[data-look="calm"] .foot-links a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--riso-pink-deep); text-underline-offset: 3px; }
:root[data-look="calm"] footer a:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
:root[data-look="calm"] .foot-links { gap: 28px 32px; border-top: 1px solid var(--calm-line); }
:root[data-look="calm"] .foot-links ul { gap: 9px; }
:root[data-look="calm"] .foot-bottom { border-top: 1px solid var(--calm-line); font-family: var(--calm-sans); font-size: 15px; letter-spacing: 0; color: var(--calm-dim); align-items: center; gap: 12px; }
:root[data-look="calm"] .foot-legal { font-family: var(--calm-sans); font-size: 15px; letter-spacing: 0; color: var(--calm-dim); }
:root[data-look="calm"] .foot-legal a { color: var(--ink); }
:root[data-look="calm"] .visitor-counts { gap: 4px 18px; }
:root[data-look="calm"] .visitor-count { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; font-family: var(--calm-sans); font-size: 15px; letter-spacing: 0; color: var(--calm-dim); }
:root[data-look="calm"] .visitor-count::before,
:root[data-look="calm"] .visitor-count + .visitor-count::before,
:root[data-look="calm"] .visitor-count.visitor-count-returning::before { color: var(--ink); font-weight: 700; min-width: 0; }
:root[data-look="calm"] .visitor-count:hover { transform: none; box-shadow: none; }
/* The newsletter box in the footer (teachers) */
:root[data-look="calm"] footer .newsletter-card.compact { margin-top: 30px; }
:root[data-look="calm"] footer .newsletter-card.compact .nl-title,
:root[data-look="calm"] footer .newsletter-card.compact .nl-title em { font-family: var(--calm-sans); font-size: 16px; font-weight: 700; font-style: normal; letter-spacing: 0; text-transform: none; color: var(--ink); }
:root[data-look="calm"] footer .newsletter-card.compact .nl-sub { font-family: var(--calm-sans); font-size: 16px; line-height: 1.5; letter-spacing: 0; color: var(--calm-dim); }
:root[data-look="calm"] footer .newsletter-card.compact .nl-sub em { font-style: normal; font-weight: 700; color: var(--ink); }
:root[data-look="calm"] footer .newsletter-form input[type="email"] { font-family: var(--calm-sans); font-size: 16px; padding: 10px 12px; border-width: 1px; border-color: var(--calm-dim); }
:root[data-look="calm"] footer .newsletter-form input[type="email"]::placeholder { color: var(--calm-dim); }
:root[data-look="calm"] footer .newsletter-form button { font-family: var(--calm-sans); font-size: 16px; font-weight: 700; letter-spacing: 0; text-transform: none; padding: 10px 16px; border-radius: 9px; box-shadow: none; }
:root[data-look="calm"] footer .newsletter-form button::first-letter { text-transform: uppercase; }
:root[data-look="calm"] footer .newsletter-form button:hover { transform: none; filter: none; box-shadow: none; background: color-mix(in srgb, var(--ink) 86%, var(--paper-white)); }
:root[data-look="calm"] footer .newsletter-card.compact .nl-consent,
:root[data-look="calm"] footer .newsletter-card.compact .newsletter-msg { font-family: var(--calm-sans); font-size: 15px; letter-spacing: 0; color: var(--calm-dim); }

/* /css/guide.css */
/* Interactive guides (guides/<slug>.html, js/guide.js, scripts/build-guides.mjs).
   One look for every guide: the bar with the topic picker and the section
   tabs, the hero, then Learn (chapters with animated figures), the dry lab,
   Check, Downloads and Teacher resources. Figures are drawn for paper (ink on white) in
   either theme, like the revision maps' sheets.

   The look is a notebook's, not an app's: sections are ruled (a line across
   the top, coloured where it means something: pink to predict, yellow to
   remember) rather than boxed; choices are words, the chosen one underlined;
   corners are small (2 to 4 px) and nothing is a pill; one filled button
   where there is a main thing to do, the rest as underlined words; no offset
   shadows (a soft one only on what floats). The colour lives in the figures. */

.gd-page { max-width: 1180px; margin: 0 auto; padding: 18px clamp(16px, 3vw, 32px) 40px; }
.gd-page *, .gd-page *::before, .gd-page *::after { box-sizing: border-box; }

/* ── The bar: topic picker and section tabs ─────────────────── */
.gd-bar { position: sticky; top: var(--gd-top, 64px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 22px; padding: 6px 2px; background: var(--paper); border: 0; border-radius: 0; border-bottom: 1.5px solid var(--ink); }
.gd-pick { position: relative; }
.gd-pick-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 4px; border: 0; border-radius: 0; background: none; color: var(--ink); font: inherit; font-family: var(--font-display); font-size: 16px; font-weight: 650; cursor: pointer; }
.gd-pick-btn small { font-family: var(--font-mono); font-size: 14px; font-weight: 500; letter-spacing: .06em; opacity: 1; color: var(--riso-pink-deep); }
.gd-pick-btn:hover .t { text-decoration: underline; text-underline-offset: 4px; }
.gd-pick-btn svg { width: 12px; height: 12px; flex: none; }
.gd-pick-pop { position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; width: min(760px, calc(100vw - 32px)); max-height: min(70vh, 620px); overflow: auto; padding: 14px; background: var(--paper-white); border: 1px solid var(--ink); border-radius: 4px; box-shadow: 0 10px 30px rgba(17, 30, 24, .16); }
.gd-pick-pop[hidden] { display: none; }
.gd-pick-cs { display: inline-flex; gap: 14px; margin: 0 0 12px; padding: 0; border: 0; border-radius: 0; }
.gd-pick-cs button { padding: 5px 0; border: 0; border-radius: 0; background: transparent; color: var(--ink-dim); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.gd-pick-cs button[aria-selected="true"] { background: none; color: var(--ink); box-shadow: inset 0 -2.5px 0 var(--riso-green); }
.gd-pick-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px 22px; align-items: start; }
.gd-pick-gh { margin: 0 0 4px; padding: 0 6px; font-family: var(--font-display); font-size: 14px; font-weight: 700; }
.gd-pick-gh b { margin-right: 5px; font-family: var(--font-mono); font-weight: 500; color: var(--riso-pink-deep); }
.gd-pick-gh a { color: inherit; text-decoration: none; }
.gd-pick-gh a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gd-pick-unit { margin: 0 0 6px; padding: 0 6px; font-size: 14px; }
.gd-pick-unit a { color: var(--riso-green-deep); font-weight: 650; text-underline-offset: 3px; }
.gd-pick-g ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: max-content minmax(0, 1fr) 2.8em; column-gap: 4px; row-gap: 1px; }
.gd-pick-g li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
.gd-pick-i { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: baseline; padding: 3px 6px; border-radius: 2px; color: var(--ink); font-size: 14px; line-height: 1.3; text-decoration: none; }
a.gd-pick-i:hover { background: var(--paper); }
.gd-pick-i .c { padding-right: 8px; font-family: inherit; font-size: 14px; color: var(--ink-dim); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "zero" 0; }
.gd-pick-i i { font-family: var(--font-mono); font-size: 14px; font-style: normal; color: var(--riso-pink-deep); }
.gd-pick-i.soon { color: var(--ink-faint); }
.gd-pick-i.soon small { font-family: var(--font-mono); font-size: 14px; letter-spacing: .04em; text-align: right; }
.gd-pick-i.here { background: var(--paper); box-shadow: inset 3px 0 0 var(--riso-green); font-weight: 650; }
.gd-pick-i.here .c { color: var(--ink); }
a.gd-pick-i .t, .gd-pick-i.here .t { grid-column: 2 / 4; }
a.gd-pick-i .t { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.gd-pick-all { display: inline-block; margin-top: 12px; font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.gd-pick-wait { margin: 6px; color: var(--ink-dim); font-size: 14px; }
.gd-tabs { display: flex; flex-wrap: wrap; gap: 0 4px; margin-left: auto; }
/* On a laptop the bar keeps to one line: a long title is cut short (an ellipsis) rather than push the tabs to a second
   line. The second line came and went with the chapter count, part way down the page, and a bar that grows after the
   figures were fitted to the window covers the top of every pinned one. */
@media (min-width: 1100px) {
  .gd-bar { flex-wrap: nowrap; }
  .gd-bar > * { flex: none; }
  .gd-bar > .gd-pick { flex: 0 1 auto; min-width: 0; }
  .gd-bar .gd-pick-btn { min-width: 0; }
  .gd-bar .gd-pick-btn small { flex: none; white-space: nowrap; }
  .gd-bar .gd-pick-btn .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gd-tabs { flex-wrap: nowrap; }
}
.gd-tabs a { position: relative; padding: 6px 8px 6px 18px; border-radius: 0; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.gd-tabs a::before { content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border: 0; border-radius: 50%; background: var(--line-strong); }
.gd-tabs a.seen::before { background: var(--riso-green); border-color: var(--riso-green-deep); }
.gd-tabs a.on { background: none; box-shadow: inset 0 -2.5px 0 var(--ink); }
.gd-tabs a:hover { background: none; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--line-strong); }
@media (max-width: 760px) {
  /* One slim row on a phone: the topic as its code, the sections beside it. */
  .gd-bar { top: var(--gd-top, 56px); flex-wrap: nowrap; gap: 6px; margin-bottom: 16px; padding: 4px 0; }
  .gd-pick-btn { flex: none; gap: 5px; font-size: 14px; }
  .gd-pick-btn .t { display: none; }
  .gd-pick-pop { position: fixed; left: 12px; right: 12px; top: calc(var(--gd-stick, 120px) + 6px); width: auto; max-height: calc(100vh - var(--gd-stick, 120px) - 24px); }
  .gd-tabs { flex: 1; min-width: 0; margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .gd-tabs::-webkit-scrollbar { display: none; }
  .gd-tabs a { flex: none; font-size: 14px; }
  .gd-level { flex: none; }
}

/* ── Hero ───────────────────────────────────────────────────── */
.gd-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px 40px; align-items: center; margin: 0 0 40px; }
.gd-eyebrow { font-family: var(--font-mono); font-size: 14px; letter-spacing: .12em; color: var(--ink-dim); }
.gd-hero h1 { margin: 8px 0 12px; font-family: var(--font-display); font-size: clamp(36px, 5.4vw, 64px); line-height: 1; letter-spacing: -.01em; text-wrap: balance; }
.gd-hero h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--riso-pink-deep); }
.gd-lede { margin: 0 0 14px; max-width: 54ch; color: var(--ink-dim); font-size: 18.5px; line-height: 1.6; }
.gd-chips { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 18px; }
.gd-chip { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; border-radius: 0; font-family: var(--font-mono); font-size: 14px; letter-spacing: .04em; color: var(--ink-dim); }
.gd-chip + .gd-chip::before { content: ""; width: 4px; height: 4px; margin: 0 10px 0 10px; background: var(--line-strong); }
.gd-chip.ink { background: none; color: var(--ink); font-weight: 600; }
.gd-goals { display: grid; gap: 0; margin: 0; padding: 10px 0 0; list-style: none; background: none; border: 0; border-radius: 0; border-top: 1.5px solid var(--ink); }
.gd-goals > p { margin: 0 0 2px; font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; color: var(--ink-dim); margin-bottom: 4px; }
.gd-goals li { position: relative; font-size: 16.5px; line-height: 1.55; padding: 7px 0 7px 22px; border-bottom: 1px solid var(--line); }
.gd-goals li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 10px; height: 2px; border: 0; border-radius: 0; background: var(--riso-green-deep); }
.gd-goals li code { font-family: var(--font-mono); font-size: 14px; color: var(--ink-dim); }
.gd-go { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.gd-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper-white); color: var(--ink); font-size: 15px; font-weight: 650; text-decoration: none; transition: transform .12s, box-shadow .12s; }
.gd-btn:hover { background: var(--paper); }
.gd-btn.primary { background: var(--riso-green); color: var(--on-brand); border-color: var(--riso-green-deep); }
.gd-btn.primary:hover { border-color: var(--riso-green-deep); background: var(--riso-green-deep); }
.gd-go .gd-btn:not(.primary) { padding-left: 6px; padding-right: 6px; border-color: transparent; background: none; text-decoration: underline; text-decoration-thickness: 1.5px; text-decoration-color: var(--line-strong); text-underline-offset: 5px; }
.gd-go .gd-btn:not(.primary)::after { content: "\2192"; text-decoration: none; }
.gd-go .gd-btn:not(.primary):hover { text-decoration-color: var(--ink); }
.gd-hero-fig { min-width: 0; }
.gd-hero-fig > .gd-fig { box-shadow: none; }
/* The opening film's title keeps its one line: where the readout beside it grew, the title wrapped to two, and the
   film and its play bar moved 17 px down under the pointer. The readout gives way instead (it is cut with an ellipsis). */
@media (min-width: 861px) { .gd-hero-fig .gd-scene-h > span { flex: 0 0 auto; max-width: 100%; } }
/* The hero column is narrow on a desktop: its film's buttons go to icons, so the row fits the card. */
@media (min-width: 861px) { .gd-hero-fig .gd-scene-ctl .gd-tour-btn span, .gd-hero-fig .gd-scene-ctl .gd-max-btn span:not(.gd-sw) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .gd-hero-fig .gd-scene-ctl .gd-tour-btn { min-width: 36px; min-height: 36px; justify-content: center; } }
.gd-goals.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 28px; margin: -14px 0 44px; }
.gd-goals.wide > p { grid-column: 1 / -1; }
.gd-pick-static { cursor: default; }
@media (max-width: 860px) { .gd-hero { grid-template-columns: minmax(0, 1fr); } .gd-goals.wide { margin-top: 0; } }

/* ── Sections ───────────────────────────────────────────────── */
/* How this was made: a ruled note at the foot of the page, for everyone. */
.gd-made { max-width: 78ch; margin: 8px 0 0; padding: 14px 0 0; border-top: 1.5px solid var(--line-strong, var(--line)); color: var(--ink-dim); font-size: 14px; line-height: 1.55; }
.gd-made b { color: var(--ink); font-weight: 650; }
.gd-made a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.gd-sec { margin: 0 0 56px; scroll-margin-top: calc(var(--gd-top, 64px) + 70px); }
.gd-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1.5px solid var(--ink); }
.gd-h h2 { margin: 0; font-family: var(--font-display); font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.01em; }
.gd-h h2 b { margin-right: 10px; font-family: var(--font-mono); font-size: .45em; font-weight: 500; letter-spacing: .08em; color: var(--riso-pink-deep); vertical-align: .35em; }
.gd-h h2 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--riso-pink-deep); }
.gd-h p { margin: 0; flex: 1 1 340px; color: var(--ink-dim); font-size: 16.5px; line-height: 1.55; }

/* ── Learn: the chapters, listed, then each in turn ──────────── */
.gd-toc { display: flex; flex-wrap: wrap; gap: 0 22px; margin: 0 0 30px; padding: 0; list-style: none; counter-reset: none; border-top: 1px solid var(--line); }
.gd-toc a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 0; border: 0; border-radius: 0; background: none; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.gd-toc a span { display: inline-grid; place-items: center; width: auto; height: auto; border-radius: 0; background: none; color: var(--riso-pink-deep); font-family: var(--font-mono); font-size: 14px; }
.gd-toc a:hover { text-decoration: underline; text-underline-offset: 4px; }

.gd-ch { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr); gap: 22px 34px; align-items: start; margin: 0 0 46px; scroll-margin-top: calc(var(--gd-top, 64px) + 70px); }
.gd-ch.flip > .gd-fig { order: -1; }
.gd-ch.wide { grid-template-columns: minmax(0, 1fr); }
.gd-ch.wide > .gd-fig.gd-el { justify-self: center; width: 100%; max-width: 880px; }   /* a tool keeps the scene band's measure */
/* a chapter figure too tall for the window is narrowed to fit it, centred (fitPage() in js/guide.js sets its max-width) */
.gd-ch > .gd-fig.gd-fit:not(.gd-max), .gd-ch-scene > .gd-fig.gd-fit:not(.gd-max) { justify-self: center; width: 100%; margin-inline: auto; }
.gd-fig.gd-fit.gd-max { max-width: none !important; }   /* full screen: as large as the window allows */
/* a narrow film's Show me how, Copy link and Full screen keep their icons only, so the row never runs out of the figure */
.gd-ch > .gd-scene.gd-tight:not(.gd-max) .gd-scene-ctl .gd-tour-btn span, .gd-ch > .gd-scene.gd-tight:not(.gd-max) .gd-scene-ctl .gd-max-btn span:not(.gd-sw), .gd-ch-scene > .gd-scene.gd-tight:not(.gd-max) .gd-scene-ctl .gd-tour-btn span, .gd-ch-scene > .gd-scene.gd-tight:not(.gd-max) .gd-scene-ctl .gd-max-btn span:not(.gd-sw) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gd-ch > .gd-scene.gd-tight:not(.gd-max) .gd-scene-ctl .gd-tour-btn, .gd-ch-scene > .gd-scene.gd-tight:not(.gd-max) .gd-scene-ctl .gd-tour-btn { min-width: 36px; min-height: 36px; justify-content: center; }
.gd-ch-text { min-width: 0; }
.gd-code { display: inline-block; margin: 0 0 6px; font-family: var(--font-mono); font-size: 14px; letter-spacing: .08em; color: var(--ink-dim); }
.gd-code b { margin-right: 6px; padding: 0 6px; border: 1px solid var(--ink); border-radius: 2px; font-weight: 500; color: var(--ink); }
.gd-code b.hl { background: var(--riso-pink); border-color: var(--ink); color: var(--on-brand); }
.gd-ch h3 { margin: 0 0 10px; font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 28px); line-height: 1.12; letter-spacing: -.01em; }
.gd-ch h3 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--riso-green-deep); }
.gd-ch p { margin: 0 0 12px; font-size: 18px; line-height: 1.7; }
/* a tool placed in a wide chapter keeps its own type: no chapter paragraphs inside it */
.gd-ch:where(.wide) :where(.gd-el-live) p { margin: 0; font-size: inherit; line-height: inherit; }
/* numbered steps and plain lists in a chapter: indented inside the column, spaced like paragraphs */
.gd-ch-text > :is(ol, ul):not([class]) { margin: 0 0 12px; padding-left: 1.5em; font-size: 18px; line-height: 1.65; }
.gd-ch-text > :is(ol, ul):not([class]) > li { margin: 0 0 5px; padding-left: 2px; }
.gd-ch-text > ol:not([class]) > li::marker { font-weight: 700; color: var(--riso-green-deep); }
/* an equation set apart from the running text */
.gd-eq { margin: 6px 0 14px; padding: 8px 14px; border-left: 3px solid var(--riso-green-deep); background: color-mix(in srgb, var(--riso-green) 10%, transparent); font-size: 17px; font-weight: 700; }
.gd-keys { display: grid; gap: 6px; margin: 4px 0 12px; padding: 0; list-style: none; }
.gd-keys li { position: relative; padding-left: 22px; font-size: 17px; line-height: 1.5; }
.gd-keys li::before { content: ""; position: absolute; left: 2px; top: .78em; width: 10px; height: 2px; background: var(--riso-green-deep); border: 0; border-radius: 0; }
.gd-myth { margin: 12px 0; padding: 2px 0 2px 16px; border: 0; border-radius: 0; background: none; font-size: 17px; line-height: 1.5; border-left: 3px solid var(--riso-pink); }
.gd-myth > b:first-child { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: .1em; color: var(--riso-pink-deep); }
.gd-eg { margin: 12px 0; padding: 2px 0 2px 16px; border: 0; border-radius: 0; font-size: 17px; line-height: 1.5; border-left: 3px dotted var(--riso-green-deep); }
.gd-eg > b:first-child { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: .1em; color: var(--riso-green-deep); }
dfn[data-def] { font-style: normal; font-weight: 650; text-decoration: underline dotted var(--riso-green-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: help; }
dfn[data-def]:focus-visible { outline: 2px solid var(--riso-pink-deep); outline-offset: 2px; border-radius: 3px; }
/* A link in running text looks like one (base.css takes the underline off every link): solid, where a key term's is dotted. */
:is(.gd-ch-text, .gd-answer, .gd-myth, .gd-eg, .gd-lab-intro, .gd-box) a:not([class]) { text-decoration: underline; text-decoration-color: var(--riso-green); text-decoration-thickness: 2px; text-underline-offset: 3px; }
:is(.gd-ch-text, .gd-answer, .gd-myth, .gd-eg, .gd-lab-intro, .gd-box) a:not([class]):hover { text-decoration-color: var(--ink); }
.gd-tip { position: absolute; z-index: 60; max-width: 300px; padding: 9px 12px; background: var(--ink); color: var(--paper-white); border-radius: 4px; font-size: 14px; line-height: 1.45; box-shadow: 0 8px 24px rgba(17, 30, 24, .22); }
.gd-tip b { color: var(--riso-yellow); }
.gd-tip[hidden] { display: none; }
@media (min-width: 861px) {
  /* Two figures on one chapter stack in the figure column beside the text, so no gap opens up beside a long text */
  .gd-ch:not(.wide):has(> .gd-fig ~ .gd-fig:not(.gd-scene)) > .gd-ch-text { grid-column: 1; grid-row: 1 / span 2; }
  .gd-ch:not(.wide):has(> .gd-fig ~ .gd-fig:not(.gd-scene)) > .gd-fig { grid-column: 2; }
  .gd-ch.flip:not(.wide):has(> .gd-fig ~ .gd-fig:not(.gd-scene)) > .gd-ch-text { grid-column: 2; }
  .gd-ch.flip:not(.wide):has(> .gd-fig ~ .gd-fig:not(.gd-scene)) > .gd-fig { grid-column: 1; }
  /* The 16px gap above a pinned figure is paper-coloured, so the text scrolling past does not show through it */
  .gd-ch > .gd-stick, .gd-ch > .gd-side > .gd-stick { position: sticky; top: calc(var(--gd-stick, 120px) + 16px); align-self: start; box-shadow: 0 -16px 0 0 var(--paper); }
  /* a guide's own box of figures beside the words fills its row, so its last figure can travel down it while pinned (js pin) */
  .gd-ch > .gd-side { align-self: stretch; align-content: start; }
  .gd-ch > .gd-side > * { align-self: start; }
  /* opened full screen, a pinned figure fills the window like any other */
  .gd-ch > .gd-fig.gd-stick.gd-max { position: fixed; inset: 0 !important; box-shadow: none; }
  .gd-ch > .gd-fig.gd-squeeze > svg, .gd-ch > .gd-fig.gd-squeeze .gd-svg, .gd-ch > .gd-side > .gd-fig.gd-squeeze > svg, .gd-ch > .gd-side > .gd-fig.gd-squeeze .gd-svg { width: auto; max-width: 100%; max-height: var(--gd-svg-max); margin: 0 auto; }
}
@media (max-width: 860px) {
  .gd-ch { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* The text's parts join the chapter's one column, so the figure can come
     straight after the opening paragraph instead of after every box. */
  .gd-ch > .gd-ch-text { display: contents; }
  .gd-ch > .gd-ch-text > * { order: 3; }
  .gd-ch > .gd-ch-text > .gd-code, .gd-ch > .gd-ch-text > h3 { order: 0; }
  .gd-ch > .gd-ch-text > h3 + p { order: 1; }
  .gd-ch > .gd-fig, .gd-ch.flip > .gd-fig { order: 2; margin: 6px 0 16px; }
  .gd-ch > .gd-fig ~ .gd-fig { order: 4; }
  .gd-ch > .gd-fig ~ .gd-fig ~ .gd-ch-text > * { order: 5; }
  /* A chapter whose first figure would answer its predict (an animated figure plays to its last step,
     at once under reduced motion) opts in with predict-first: the figure waits until after the first
     predict, the rest of the text follows it, and any later figure comes last. */
  .gd-ch.predict-first > .gd-ch-text > .gd-predict ~ * { order: 5; }
  .gd-ch.predict-first > .gd-fig { order: 4; }
  .gd-ch.predict-first > .gd-fig ~ .gd-fig { order: 6; }
}

/* ── Figures: drawn for paper in either theme ───────────────── */
.gd-fig { --ink-p: #1a3a2a; --dim-p: #263b2f; --pink-p: #ff7eb6; --pinkd-p: #e3589c; --green-p: #2db876; --greend-p: #1a8a55; --tint-p: #e8f6ee; margin: 0; min-width: 0; padding: 12px 12px 10px; background: #fbfdfb; color: #1a3a2a; border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: none; }
.gd-fig.pink { box-shadow: none; border: 1px solid var(--line-strong); border-radius: 4px; }
.gd-fig > svg, .gd-fig .gd-svg { display: block; width: 100%; height: auto; overflow: visible; }
.gd-fig svg text { font-family: var(--font-display); }
.gd-fig svg .mono { font-family: var(--font-mono); }
.gd-fig figcaption { margin: 8px 2px 0; color: #263b2f; font-size: 14px; line-height: 1.45; }
/* Moving parts ease into place; hidden ones fade. */
.gd-anim [data-at], .gd-anim [data-only], .gd-anim [data-on], .gd-anim [data-tr], .gd-anim [data-op] {
  transition: opacity .55s ease, transform .95s cubic-bezier(.3, .75, .2, 1); transform-box: fill-box; transform-origin: center; }
.gd-fig .gd-off { pointer-events: none; }
.gd-anim.gd-calm [data-at], .gd-anim.gd-calm [data-only], .gd-anim.gd-calm [data-on], .gd-anim.gd-calm [data-tr], .gd-anim.gd-calm [data-op] { transition: none; }
.gd-play { display: flex; align-items: center; gap: 6px; margin: 10px 2px 2px; }
.gd-pb { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1.5px solid #1a3a2a; border-radius: 4px; background: #fff; color: #1a3a2a; cursor: pointer; }
.gd-pb svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.gd-pp { width: 40px; height: 40px; background: #1a3a2a; color: #fff; }
.gd-pp svg { width: 17px; height: 17px; }
.gd-pp .i-play { fill: currentColor; stroke: none; }
.gd-pp .i-pause, .gd-pp .i-again, .gd-play.playing .gd-pp .i-play, .gd-play.end .gd-pp .i-play { display: none; }
.gd-play.playing .gd-pp .i-pause { display: block; }
.gd-play.end .gd-pp .i-again { display: block; }
.gd-pb:focus-visible { outline: 2.5px solid #e3589c; outline-offset: 2px; }
.gd-dots { display: inline-flex; gap: 5px; margin-left: 4px; }
.gd-dot { width: 24px; height: 16px; padding: 0; border: 0; border-radius: 0; background: linear-gradient(#cfe2d7, #cfe2d7) center / 100% 4px no-repeat; cursor: pointer; }
.gd-dot.done { background-image: linear-gradient(#5fbf8f, #5fbf8f); }
.gd-dot.on { background-image: linear-gradient(#e3589c, #e3589c); background-size: 100% 6px; }
.gd-stepn { white-space: nowrap; margin-left: auto; font-family: var(--font-mono); font-size: 14px; color: #263b2f; }
.gd-cap { position: relative; margin: 6px 2px 0; padding: 0; list-style: none; min-height: 3.2em; }
.gd-cap li { display: none; font-size: 17px; line-height: 1.45; color: #1a3a2a; }
.gd-cap li.on { display: block; animation: gd-cap .45s ease; }
.gd-cap li b { color: #1a8a55; }
@keyframes gd-cap { from { opacity: 0; transform: translateY(4px); } }
/* Reduced motion keeps one caption a step too (all at once overflowed the window): the steps change without moving. */
.gd-calm .gd-cap li.on { animation: none; }
/* Things that keep moving: molecules jostle, bubbles rise. */
.gd-jig { animation: gd-jig 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.gd-jig.b { animation-duration: 2.3s; animation-delay: -.7s; }
.gd-jig.c { animation-duration: 1.5s; animation-delay: -1.1s; }
@keyframes gd-jig { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(2px, -2px) rotate(3deg); } 50% { transform: translate(-1px, 2px) rotate(-2deg); } 75% { transform: translate(-2px, -1px) rotate(2deg); } }
.gd-float { animation: gd-float 3.2s ease-in-out infinite; transform-box: fill-box; }
@keyframes gd-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.gd-rise { animation: gd-rise 2.6s linear infinite; transform-box: fill-box; }
@keyframes gd-rise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-70px); opacity: 0; } }
.gd-pulse { animation: gd-pulse 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes gd-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.gd-spin { animation: gd-spin 6s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes gd-spin { to { transform: rotate(360deg); } }
.gd-dash { stroke-dasharray: 6 6; animation: gd-dash 1.2s linear infinite; }
@keyframes gd-dash { to { stroke-dashoffset: -12; } }
@media (prefers-reduced-motion: reduce) { .gd-jig, .gd-float, .gd-rise, .gd-pulse, .gd-spin, .gd-dash { animation: none !important; } }
/* A figure you explore: tap a part, it lights and the rest fade. */
.gd-explore [data-part] { cursor: pointer; transition: opacity .3s; }
.gd-explore.picked [data-part]:not(.lit) { opacity: .25; }
.gd-readout { min-height: 3em; margin: 8px 2px 0; padding: 8px 10px; border-radius: 2px; background: #e8f6ee; color: #1a3a2a; font-size: 17px; line-height: 1.45; box-shadow: inset 3px 0 0 #2db876; }
.gd-readout b { color: #1a8a55; }
.gd-seg { display: inline-flex; flex-wrap: wrap; gap: 2px 16px; margin: 8px 2px 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: inset 0 -1px 0 #c3dccf; }
.gd-seg button { padding: 6px 0; border: 0; border-radius: 0; background: transparent; color: #263b2f; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.gd-seg button[aria-pressed="true"] { background: none; color: #1a3a2a; box-shadow: inset 0 -3px 0 #2db876; }
.gd-fig [data-when] { transition: opacity .45s ease; }
.gd-explore [data-part]:focus { outline: none; }
.gd-explore [data-part]:focus-visible { outline: 2.5px solid #e3589c; outline-offset: 2px; }
.gd-explore [data-part].lit { filter: drop-shadow(0 0 3px rgba(227, 88, 156, .55)); }
.gd-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 2px 0; color: #1a3a2a; font-size: 14px; font-weight: 600; }
.gd-range { flex: 1 1 180px; accent-color: #1a8a55; min-height: 28px; }
.gd-ctl output, .gd-ctl [data-val] { font-family: var(--font-mono); font-size: 14px; }

/* ── Games: a game after a chapter, ruled like a section ─────── */
.gd-game { max-width: 980px; margin: 0 auto; padding-top: 10px; border-top: 3px solid var(--riso-green); }
.gd-game-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.gd-game-h p { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.gd-game-h p b { margin-right: 10px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--riso-green-deep); vertical-align: .2em; }
.gd-game.gd-lab-wait .gd-game-body { min-height: 420px; border: 1px dashed var(--line-strong); border-radius: 4px; }
/* A dry lab placed in Learn (a second bench) gets a game's head, ruled the same way. */
.gd-lab-h { max-width: 980px; margin: 0 auto 10px; padding-top: 10px; border-top: 3px solid var(--riso-green); }
/* A game's or a lab's still (the build bakes it from the module's still()): it shows until the
   live one starts, then steps aside; print shows it again in place of the live one. */
.gd-game > .gd-still { margin: 0 0 4px; }
/* css-pair-ok: gd-still-on is set by js/guide.js */
.gd-still-on > .gd-still { display: none; }
@media print {
  .gd-still-on > .gd-still { display: block !important; }
  .gd-game.gd-still-on > .gd-game-body, .gd-lab.gd-still-on > :not(.gd-still) { display: none !important; }
  .gd-still .gd-off { display: none !important; }
}

/* ── Elements: shared interactives (guides/elements/) ─────────── */
/* A still the build wrote (an animated figure), and over it, once the module
   loads, the live element: a head, its host, its live line. The plate is
   paper in both themes, so everything inside uses the paper colours. */
.gd-el-h { display: flex; align-items: center; gap: 10px; margin: 0 2px 8px; font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: #263b2f; }
.gd-el-h > span { flex: 1; min-width: 0; }
.gd-el-h b { margin-right: 8px; font-weight: 600; color: #1a8a55; }
.gd-el-h i { font-style: normal; color: #1a8a55; white-space: nowrap; }
.gd-el-h .gd-max-btn { color: #1a3a2a; font-family: var(--font-display); letter-spacing: 0; text-transform: none; }
.gd-el-h .gd-tour-btn { color: #1a3a2a; }
.gd-el-h .gd-max-btn:focus-visible { outline-color: #e3589c; }
.gd-el-h .gd-sw { width: 26px; height: 40px; }
@media (max-width: 600px) { .gd-el-h { flex-wrap: wrap; row-gap: 2px; } .gd-el-h > span { flex: 1 1 60%; } .gd-el-h i { order: 3; flex-basis: 100%; } }
/* css-pair-ok: gd-el-on and gd-max are set by js/guide.js */
.gd-el.gd-el-on > .gd-el-still, .gd-el.gd-el-on > .gd-play, .gd-el.gd-el-on > .gd-cap { display: none; }
/* a still with a phone drawing (gd-el-n, set by the build): the phone one under 600 px, never in print */
.gd-el > .gd-el-still.gd-el-still-n { display: none; }
@media screen and (max-width: 599px) {
  .gd-el.gd-el-n:not(.gd-el-on) > .gd-el-still:not(.gd-el-still-n) { display: none; }
  .gd-el.gd-el-n:not(.gd-el-on) > .gd-el-still.gd-el-still-n { display: block; }
}
.gd-el-say { min-height: 2.9em; margin: 8px 2px 0; color: #1a3a2a; font-size: 17px; line-height: 1.45; }
.gd-el-say b { color: #1a8a55; }
/* a bare element (a hero) has no controls to speak of, so no room for a line */
.gd-el.gd-bare .gd-el-say:empty { display: none; }
/* full screen; position and inset beat pin()'s sticky class and inline top */
.gd-fig.gd-el.gd-max { position: fixed !important; inset: 0 !important; z-index: 300; width: auto; max-width: none !important; margin: 0 !important; padding: calc(var(--gd-bar, 50px) + 8px) max(16px, 3vw) 20px; overflow: auto; border: 0; border-radius: 0; background: #fbfdfb; }
.gd-el.gd-max .gd-el-h .gd-max-btn { display: none; }
.gd-el.gd-max .gd-svg { max-height: none; }
@media (prefers-reduced-motion: reduce) { .gd-el-live *, .gd-el-live *::before, .gd-el-live *::after { transition: none !important; animation: none !important; } }
@media print {
  .gd-el .gd-el-live, .gd-el .gd-el-h, .gd-el .gd-el-say { display: none !important; }
  .gd-el.gd-el-on > .gd-el-still, .gd-el.gd-el-on > .gd-cap { display: block !important; }
  .gd-el.gd-el-on > .gd-el-still.gd-el-still-n, .gd-el > .gd-el-still.gd-el-still-n { display: none !important; }
  .gd-el .gd-el-still .gd-off { display: none !important; }
}

/* ── Remember it: mnemonic tiles ────────────────────────────── */
.gd-mnem { margin: 14px 0 0; padding: 10px 0 0; background: none; border: 0; border-radius: 0; border-top: 3px solid var(--riso-yellow); }
.gd-mnem .gd-mnem-h { margin: 0 0 10px; font-size: 15px; line-height: 1.45; }
.gd-mnem-h > b:first-child { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: .1em; color: color-mix(in srgb, var(--riso-yellow) 55%, var(--ink)); text-transform: uppercase; }
.gd-mnem-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 84px), 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.gd-tile { position: relative; display: grid; width: 100%; min-height: 104px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; perspective: 600px; }
.gd-tile > .f, .gd-tile > .k { grid-area: 1 / 1; min-width: 0; display: grid; align-content: center; justify-items: center; gap: 2px; padding: 8px 4px; border: 1px solid transparent; border-radius: 3px; text-align: center; backface-visibility: hidden; transition: transform .5s cubic-bezier(.3, .75, .2, 1), opacity .3s; }
.gd-tile > .f { background: var(--riso-yellow); color: #1a3a2a; }
.gd-tile > .k { background: var(--paper); transform: rotateY(180deg); border-color: var(--line-strong); }
.gd-tile[aria-pressed="true"] > .f { transform: rotateY(-180deg); }
.gd-tile[aria-pressed="true"] > .k { transform: rotateY(0); }
.gd-tile > .f, .gd-tile > .k { overflow-wrap: anywhere; }
.gd-tile .l { font-family: var(--font-display); font-size: 38px; font-weight: 800; line-height: 1; }
.gd-tile .f .w { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.gd-tile .t { max-width: 100%; font-family: var(--font-display); font-size: 14px; font-weight: 750; line-height: 1.15; overflow-wrap: break-word; hyphens: auto; letter-spacing: -.01em; }
.gd-tile .t::first-letter { color: var(--riso-pink-deep); }
.gd-tile .d { font-size: 14px; line-height: 1.3; color: var(--ink-dim); }
@media (max-width: 480px) { .gd-tile { min-height: 96px; } .gd-tile .l { font-size: 32px; } .gd-tile .f .w { font-size: 14px; } .gd-tile .t { font-size: 14px; } .gd-tile .d { font-size: 14px; } }
.gd-tile:focus-visible { outline: 2.5px solid var(--riso-pink-deep); outline-offset: 3px; border-radius: 3px; }
.gd-mnem .gd-mnem-go { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 10px 0 0; font-size: 14px; color: var(--ink-dim); }
.gd-mnem-go button { padding: 6px 2px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  .gd-tile > .f, .gd-tile > .k { transition: opacity .2s; transform: none !important; }
  .gd-tile > .k { opacity: 0; } .gd-tile[aria-pressed="true"] > .k { opacity: 1; } .gd-tile[aria-pressed="true"] > .f { opacity: 0; }
}

/* ── Scenes: films that play in view ────────────────────────── */
/* A scene after a chapter's own figure takes the chapter's full width. */
.gd-ch > .gd-fig ~ .gd-fig.gd-scene { order: 5; grid-column: 1 / -1; justify-self: center; width: 100%; max-width: 880px; margin-top: 6px; }
.gd-ch-scene { max-width: 880px; margin: -18px auto 46px; }
/* Landscape in the page (js inlineFit): the film takes the page's width, its caption and settings in a column beside it */
.gd-ch-scene:has(> .gd-scene.gd-inline) { max-width: none; }
.gd-ch > .gd-fig ~ .gd-fig.gd-scene.gd-inline { max-width: none; }
.gd-scene.gd-inline.gd-max-side { grid-template-columns: var(--gd-col) var(--gd-side); grid-template-rows: minmax(0, 1fr) max-content max-content minmax(0, 1fr); row-gap: 0; column-gap: 28px; align-content: stretch; }
.gd-scene.gd-inline > .gd-scene-stage { justify-self: start; }
.gd-scene.gd-inline .gd-scene-side { height: auto; min-height: 0; justify-content: center; }
.gd-scene { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.gd-scene-wait { min-height: 260px; background: repeating-linear-gradient(-45deg, #fbfdfb 0 10px, #eef6f1 10px 11px); }
.gd-scene-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; padding: 0 2px; font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: #263b2f; }
.gd-scene-h > span { flex: 0 1 auto; min-width: 0; }
/* the running label is never cut short: where it will not fit beside the title it takes a line of its own, and wraps there
   (the kelp film's count ended "24 URCHINS, K...", so the kelp figure could not be read) */
.gd-scene-h b { font-weight: 600; color: #1a8a55; text-align: right; margin-left: auto; flex: 0 1 auto; min-width: 0; }
.gd-scene-stage { position: relative; width: 100%; overflow: hidden; border-radius: 2px; background: #fbfdfb; border: 1px solid #b9d3c5; }
.gd-scene-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* A film drawn in SVG (api.svg()): the same plate, with parts that can be tapped. */
.gd-scene-stage > .gd-scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.gd-scene-cap { min-height: 2.9em; margin: 0 2px; font-size: 15px; line-height: 1.45; color: #1a3a2a; }
.gd-scene-cap b { color: #1a8a55; }
.gd-scene-ctl { display: flex; align-items: center; gap: 8px; margin: 0 2px; }
.gd-scene-ctl > :not(.gd-scene-prog) { flex-shrink: 0; }
@media (max-width: 480px) { .gd-scene-ctl .gd-max-btn span:not(.gd-sw) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
/* On a phone, and in full screen's side column, a film's row (play, again, the scrubber, Show me how, Full screen)
   is too narrow for the tour's words: the tour keeps its icon, and its words stay for a screen reader. */
.gd-scene.gd-max-side .gd-scene-ctl .gd-tour-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 480px) { .gd-scene-ctl .gd-tour-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.gd-scene.gd-max-side .gd-scene-ctl .gd-tour-btn { min-width: 36px; min-height: 36px; justify-content: center; }
@media (max-width: 480px) { .gd-scene-ctl .gd-tour-btn { min-width: 36px; min-height: 36px; justify-content: center; } }
.gd-scene .gd-pp .i-pause { display: none; }
.gd-scene.playing .gd-pp .i-play { display: none; }
.gd-scene.playing .gd-pp .i-pause { display: block; }
/* The scrubber: the slim pink-on-grey bar is the slider's track; the whole
   row's height is its hit area (44 px on touch), and its knob is the film's
   moment. Dragged, it shows the time above the knob. --p is the film's
   place, 0 to 1 (js/guide.js). */
.gd-scene-prog { --p: 0; position: relative; flex: 1; min-width: 64px; height: 28px; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; outline: none; }
.gd-scene-prog[hidden] { display: none; }
.gd-scene-prog::before, .gd-scene-prog i { content: ""; position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; }
.gd-scene-prog::before { right: 0; background: #dcebe2; }
.gd-scene-prog i { width: calc(var(--p) * 100%); background: #ff7eb6; }
.gd-scene-prog b { position: absolute; top: 50%; left: calc(var(--p) * 100%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border: 2px solid #1a3a2a; border-radius: 50%; background: #ff7eb6; box-sizing: border-box; transition: transform .12s ease; }
.gd-scene-prog:hover b, .gd-scene-prog.gd-drag b, .gd-scene-prog:focus-visible:not(.gd-ptr) b { transform: scale(1.3); }
.gd-scene-prog:focus-visible:not(.gd-ptr)::before { box-shadow: 0 0 0 2px #fbfdfb, 0 0 0 4.5px #e3589c; }
.gd-scene-prog.gd-drag::after { content: attr(data-t); position: absolute; bottom: calc(50% + 12px); left: calc(var(--p) * 100%); transform: translateX(-50%); padding: 2px 6px; border-radius: 2px; background: #1a3a2a; color: #fbfdfb; font-family: var(--font-mono); font-size: 14px; line-height: 1.3; white-space: nowrap; pointer-events: none; }
.gd-scene-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px 16px; margin: 2px 2px 0; color: #1a3a2a; }
.gd-scene-opts:empty { display: none; }
.gd-scene-c { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; font-size: 14px; font-weight: 600; }
.gd-scene-c input[type="range"] { width: 100%; min-height: 32px; accent-color: #1a8a55; }
.gd-scene-c output { min-width: 3.6em; font-family: var(--font-mono); font-size: 14px; font-weight: 500; text-align: right; }
.gd-scene-toggle button { grid-column: 1 / -1; justify-self: start; padding: 7px 0 7px 26px; position: relative; border: 0; border-radius: 0; background: none; color: #1a3a2a; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.gd-scene-toggle button::before { content: ""; position: absolute; left: 0; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 1.5px solid #1a3a2a; border-radius: 2px; background: #fff; }
.gd-scene-toggle button[aria-pressed="true"]::before { background: #2db876; box-shadow: inset 0 0 0 3px #fff; }
.gd-scene-choice { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); }
.gd-scene-choice .gd-seg { margin: 0; justify-self: start; }
@media (max-width: 480px) { .gd-scene-c { grid-template-columns: minmax(0, 1fr) auto; } .gd-scene-c input[type="range"] { grid-column: 1 / -1; grid-row: 2; } .gd-scene-cap { font-size: 14px; } .gd-scene-choice { grid-template-columns: minmax(0, 1fr); } .gd-scene-choice .gd-seg { grid-column: 1; } }

/* ── A figure, full screen on a phone ──────────────────────── */
.gd-fig { position: relative; }
.gd-zoom-btn { display: grid; place-items: center; position: absolute; top: 4px; right: 4px; z-index: 2; width: 34px; height: 44px; padding: 0; border: 0; border-radius: 3px; background: none; cursor: pointer; }
.gd-zoom-btn:focus-visible { outline: 2.5px solid #e3589c; outline-offset: 1px; }
.gd-zoom-btn .gd-sw { width: 26px; height: 38px; }
@media (max-width: 700px) { .gd-zoom-btn { width: 38px; height: 48px; } }
.gd-zoom { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: #fbfdfb; color: #1a3a2a; }
.gd-zoom[hidden] { display: none; }
.gd-zoom-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1.5px solid #1a3a2a; font-family: var(--font-mono); font-size: 14px; letter-spacing: .06em; }
.gd-zoom-top .gd-max-btn { color: #1a3a2a; font-family: var(--font-display); letter-spacing: 0; }
.gd-zoom-say { flex: 1; min-width: 0; }
.gd-zoom-more { padding: 6px 2px; border: 0; background: none; color: #1a3a2a; font-family: var(--font-display); font-size: 14px; font-weight: 650; letter-spacing: 0; text-decoration: underline; text-decoration-color: #2db876; text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; }
.gd-zoom-more[hidden] { display: none; }
.gd-zoom-more:focus-visible { outline: 2.5px solid #e3589c; outline-offset: 2px; }
/* Fitted (js zoomFit sizes the drawing to the room left by its player and caption), centred */
.gd-zoom-body { flex: 1; display: grid; place-items: center; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px; }
.gd-zoom-body > .gd-fig { width: min(100%, 1240px); margin: 0; border: 0; box-shadow: none; padding: 0; background: transparent; }
/* Zoom in: the drawing at its reading size, dragged around */
.gd-zoom.gd-zoom-in .gd-zoom-body { place-items: start; }
.gd-zoom.gd-zoom-in .gd-zoom-body > .gd-fig { width: auto; }
.gd-zoom.gd-zoom-in .gd-zoom-body > .gd-fig > svg, .gd-zoom.gd-zoom-in .gd-zoom-body > .gd-fig .gd-svg { width: max(calc(100vw - 24px), 760px); max-width: none; height: auto; }
@media (max-height: 520px) { .gd-zoom-top { padding: 2px 12px; } .gd-zoom-body { padding: 6px 12px; } }
.gd-zoom-body > .gd-fig .gd-zoom-btn { display: none; }
/* Beside (a wide, short window): the drawing on the left at the window's
   height, its player, caption and buttons in a column of their own. */
.gd-zoom-body > .gd-fig.gd-zoom-beside { display: flex; align-items: center; justify-content: center; gap: 24px; width: 100%; }
.gd-zoom-beside > svg, .gd-zoom-beside > .gd-svg { flex: none; }
.gd-zoom-side { flex: 0 1 var(--gd-zs, 300px); min-width: 0; max-height: var(--gd-zh, 100%); overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.gd-zoom-side > *, .gd-scene-side > * { flex-shrink: 0; }
.gd-zoom-side > :first-child { margin-top: auto; }
.gd-zoom-side > :last-child { margin-bottom: auto; }
/* More below: a full-screen box or side column that scrolls says so at its
   foot while there is more under it (gd-below, set by js/guide.js). */
.gd-below::after { content: "More below \2193"; content: "More below \2193" / ""; position: sticky; bottom: 0; z-index: 3; display: block; flex: none; grid-column: 1 / -1; align-self: stretch; margin: -44px 0 0; height: 44px; padding-top: 24px; box-sizing: border-box; text-align: center; font-family: var(--font-mono); font-size: 14px; letter-spacing: .08em; color: #1a3a2a; background: linear-gradient(transparent, var(--gd-fade, #fbfdfb) 62%); pointer-events: none; }
.gd-game.gd-max, .gd-lab.gd-max { --gd-fade: var(--paper); }
html.gd-zoomed, html.gd-zoomed body { overflow: hidden; }

/* ── Full screen: a lab or a scene takes the window ────────── */
/* The control is a light switch: a cream plate with two screws and a lever
   that flicks down, its pilot light glowing when on. The plate stays cream in
   either theme, like the real thing on a wall. */
.gd-max-btn { display: inline-flex; align-items: center; gap: 10px; padding: 2px 2px; border: 0; border-radius: 3px; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.gd-max-btn:focus-visible { outline: 2.5px solid var(--riso-pink-deep); outline-offset: 3px; }
.gd-sw { position: relative; flex: none; width: 30px; height: 46px; border: 1px solid rgba(26, 58, 42, .38); border-radius: 5px; background: linear-gradient(160deg, #ffffff 0%, #eef3ef 70%, #e3ebe5 100%); box-shadow: 0 1px 2px rgba(26, 58, 42, .3), inset 0 -1px 0 rgba(26, 58, 42, .08); transition: box-shadow .3s; }
.gd-sw::before, .gd-sw::after { content: ""; position: absolute; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c9d6cd, #7d9586); }
.gd-sw::before { top: 3px; }
.gd-sw::after { bottom: 3px; }
/* the slot the lever runs in, and the lever: up is off, down is on, and it
   overshoots a little as it snaps over */
.gd-sw b { position: absolute; left: 34%; right: 34%; top: 22%; bottom: 22%; border-radius: 3px; background: linear-gradient(#1f3128, #3f5447); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55); }
.gd-sw i { position: absolute; z-index: 1; left: 23%; right: 23%; top: 15%; height: 36%; border: 1px solid rgba(26, 58, 42, .6); border-radius: 3px; background: linear-gradient(#ffffff, #cfdcd3); box-shadow: 0 4px 0 -1px rgba(26, 58, 42, .3); transform: perspective(60px) rotateX(24deg); transition: top .26s cubic-bezier(.3, 1.7, .45, 1), transform .26s cubic-bezier(.3, 1.7, .45, 1), background .2s, box-shadow .2s; }
.gd-sw i::after { content: ""; position: absolute; left: 50%; bottom: 22%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #b6c6bc; transition: background .2s .12s, box-shadow .2s .12s; }
.gd-max-btn:not([aria-checked="true"]):hover .gd-sw i, .gd-zoom-btn:not([aria-checked="true"]):hover .gd-sw i { top: 19%; }
.gd-max-btn:not([aria-checked="true"]):active .gd-sw i, .gd-zoom-btn:not([aria-checked="true"]):active .gd-sw i { top: 25%; transform: perspective(60px) rotateX(12deg); }
.gd-max-btn[aria-checked="true"] .gd-sw i, .gd-zoom-btn[aria-checked="true"] .gd-sw i { top: 49%; transform: perspective(60px) rotateX(-24deg); background: linear-gradient(#cfdcd3, #ffffff); box-shadow: 0 -4px 0 -1px rgba(26, 58, 42, .3); }
.gd-max-btn[aria-checked="true"] .gd-sw i::after, .gd-zoom-btn[aria-checked="true"] .gd-sw i::after { background: #ffcb45; box-shadow: 0 0 5px 1px rgba(255, 186, 40, .95), 0 0 12px 2px rgba(255, 200, 70, .55); }
.gd-max-btn[aria-checked="true"] .gd-sw, .gd-zoom-btn[aria-checked="true"] .gd-sw { box-shadow: 0 1px 2px rgba(26, 58, 42, .3), 0 0 14px 2px rgba(255, 190, 40, .45); }
/* A yellow pulse behind every full-screen switch (a figure's, a film's, a lab's or a game's) invites the
   press; each stops once it has been pressed (guide.js adds .gd-clicked). */
/* (the switch no longer glows: with a figure on every screen it never stopped) */
@keyframes gd-sw-call { 0%, 100% { box-shadow: 0 1px 2px rgba(26, 58, 42, .3), 0 0 0 0 rgba(255, 190, 40, 0); } 50% { box-shadow: 0 1px 2px rgba(26, 58, 42, .3), 0 0 0 5px rgba(255, 200, 60, .45), 0 0 18px 6px rgba(255, 190, 40, .6); } }
.gd-h .gd-max-btn { margin-left: auto; align-self: center; }
.gd-scene .gd-max-btn { margin-left: 6px; color: #1a3a2a; font-size: 14px; }
.gd-scene .gd-sw, .gd-max-bar .gd-sw, .gd-zoom-top .gd-sw { width: 26px; height: 40px; }
.gd-scene-ctl .gd-max-btn span { white-space: nowrap; }
.gd-lab.gd-max, .gd-scene.gd-max, .gd-game.gd-max { position: fixed; inset: 0; z-index: 300; width: auto; max-width: none !important; margin: 0 !important; padding: calc(var(--gd-bar, 50px) + 8px) max(16px, 3vw) 20px; overflow: auto; border: 0; border-radius: 0; }
.gd-lab.gd-max, .gd-game.gd-max { background: var(--paper); }
.gd-game.gd-max .gd-game-h .gd-max-btn { display: none; }
.gd-scene.gd-max .gd-scene-ctl .gd-max-btn { display: none; }
/* A film, full screen (js fitScene): the stage gets its own width (its height
   follows its shape), letterboxed in the window, in a centred column (--gd-col) with its title,
   caption, controls and settings, or (gd-max-side) with the caption and
   settings in a column beside it (--gd-side). On a tall, narrow screen
   (gd-max-long) the settings sit below, a scroll away. */
.gd-scene.gd-max { padding: var(--gd-top, 58px) var(--gd-x, 24px) var(--gd-bot, 18px); background: #fbfdfb; grid-template-columns: var(--gd-col, 100%); grid-auto-rows: max-content; justify-content: center; align-content: center; }
.gd-scene.gd-max.gd-max-long { align-content: start; }
@supports (align-content: safe center) { .gd-scene.gd-max { align-content: safe center; } .gd-scene.gd-max.gd-max-long { align-content: start; } }
.gd-scene.gd-max > .gd-scene-stage { justify-self: center; max-width: none; }
.gd-scene.gd-max .gd-scene-cap { min-height: var(--gd-cap, 2.9em) !important; }
/* beside: the film and its controls centred in the window's height, the column the window's whole height */
.gd-scene.gd-max.gd-max-side { grid-template-columns: var(--gd-col) var(--gd-side); grid-template-rows: minmax(0, 1fr) max-content max-content minmax(0, 1fr); row-gap: 0; column-gap: 28px; align-content: stretch; }
.gd-scene.gd-max-side > .gd-scene-stage { grid-column: 1; grid-row: 2; }
.gd-scene.gd-max-side > .gd-scene-ctl { grid-column: 1; grid-row: 3; margin-top: 8px; }
/* the side column takes no height of its own (the rows are the window's) and scrolls if it must */
.gd-scene-side { grid-column: 2; grid-row: 1 / -1; height: 0; min-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.gd-scene-side > .gd-scene-h { flex-wrap: wrap; row-gap: 2px; }
.gd-scene-side > :first-child { margin-top: auto; }
.gd-scene-side > :last-child { margin-bottom: auto; }
.gd-scene-side > .gd-scene-cap { margin: 0 2px; font-size: 16px; }
.gd-scene-side > .gd-scene-opts { grid-template-columns: minmax(0, 1fr); }
/* (a choice whose options would wrap beside its label goes under it: gd-choice-stack, set where shorter) */
.gd-scene-side .gd-scene-choice.gd-choice-stack { grid-template-columns: minmax(0, 1fr); }
.gd-scene-side .gd-scene-choice.gd-choice-stack .gd-seg { grid-column: 1; }
.gd-scene-side > figcaption { margin: 0 2px; }
/* Touch screens: every shared control a full 44 px to tap. The look stays the same; the
   step dots keep their thin bar and gain height, the tabs gain height and a minimum width. */
@media (pointer: coarse) {
  .gd-pb, .gd-pp { flex: none; width: 44px; height: 44px; }
  .gd-dots { gap: 3px; }
  .gd-dot { height: 44px; }
  .gd-seg button { min-height: 44px; min-width: 44px; padding: 0 4px; text-align: center; }
  .gd-scene-toggle button, .gd-scene-choice button { min-height: 44px; }
  .gd-scene-c input[type="range"], .gd-ctl input[type="range"] { min-height: 44px; }
  .gd-max-btn { min-height: 44px; }
  .gd-scene-prog { height: 44px; }
  .gd-scene-prog b { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
}
/* While something is full screen the page's own layers step aside (main > *
   has z-index 1, and the page's view-transition-name makes it a layer of its
   own), so it sits over the site's bar and the dimmer; every child, since the
   hero's film is in the header, under the goals and the guide's bar. */
html.gd-zoomed .gd-page { z-index: auto; view-transition-name: none; animation: none; }
html.gd-zoomed .gd-page > * { z-index: auto; }
/* (main's paper-settle fade fills forwards, which kept it a layer of its own
   under the page's fixed buttons) and the page's own buttons step out */
html.gd-zoomed .gd-back, html.gd-zoomed .a11y-controls, html.gd-zoomed .aud-share, html.gd-zoomed .scroll-ribosome { visibility: hidden; }
/* the room goes dark behind the lab as it lights up */
.gd-dim { position: fixed; inset: 0; z-index: 299; background: rgba(6, 14, 10, .66); pointer-events: none; }
.gd-max-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 301; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 14px; background: #1a3a2a; color: #fbfdfb; font-family: var(--font-mono); font-size: 14px; letter-spacing: .06em; animation: gd-cap .35s .25s both; }
.gd-max-bar[hidden] { display: none; }
.gd-max-t { display: none; }
/* A short window (a phone on its side): a slimmer bar, a game's title in it
   in place of its own title row, and less margin round a game or an element,
   so its drawing and what goes with it have the room. */
@media (max-height: 520px) {
  .gd-max-bar { padding: 1px 12px; }
  .gd-max-bar .gd-sw { width: 24px; height: 36px; }
  .gd-max-bar.gd-max-titled > span:first-child { display: none; }
  .gd-max-bar.gd-max-titled > .gd-max-t { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: 0; }
  .gd-game.gd-max > .gd-game-h { display: none; }
  .gd-game.gd-max, .gd-fig.gd-el.gd-max { padding-top: calc(var(--gd-bar, 40px) + 4px); padding-bottom: 8px; }
}
.gd-max-bar .gd-max-btn { color: #fbfdfb; font-family: var(--font-display); letter-spacing: 0; }
@media (max-width: 600px) { .gd-max-bar > span { font-size: 14px; } .gd-max-btn > span:last-child { font-size: 14px; } .gd-max-bar > span:first-child, .gd-max-bar .gd-max-btn > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .gd-max-bar { justify-content: flex-end; } }
@media (prefers-reduced-motion: reduce) { .gd-sw, .gd-sw i, .gd-sw i::after { transition: none; } .gd-max-bar { animation: none; } .gd-sw, .gd-bz, .gd-bz::before { animation: none !important; transition: none; } }

/* The book view: a link in the bar where the guide has one (not on a phone) */
.gd-booklink { display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.gd-booklink svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.gd-booklink:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--line-strong); }
.gd-displaylink { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; padding: 4px 2px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.gd-displaylink svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.gd-displaylink:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--line-strong); }
.gd-displaylink:focus-visible { outline: 2.5px solid var(--riso-pink-deep); outline-offset: 2px; border-radius: 3px; }
/* With Display in the guide bar, the floating button stays tucked away; the panel itself still opens bottom right. */
@media (min-width: 761px) { html.gd-has-display .a11y-controls.a11y-min { display: none !important; } }
@media (max-width: 760px) { .gd-displaylink { display: none; } }   /* (but see P2 at the foot: on a phone it is in the bar as an icon) */
@media (max-width: 760px) { .gd-booklink { display: none; } }

/* ── SL or HL ───────────────────────────────────────────────── */
html[data-gd-level="sl"] .gd-hl { display: none !important; }
.gd-sl-note, .gd-sl-only { display: none; }
html[data-gd-level="sl"] .gd-sl-only { display: inline; }
html[data-gd-level="sl"] .gd-sl-note { display: block; margin: 0 0 24px; padding: 2px 0 2px 16px; border-left: 3px solid var(--riso-pink); font-size: 15px; line-height: 1.5; }
.gd-sl-note button { margin-left: 4px; padding: 0; border: 0; background: none; color: var(--riso-pink-deep); font: inherit; font-weight: 650; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.gd-hlb { display: inline-block; margin: 0 2px; padding: 0 5px; border: 0; border-radius: 2px; background: var(--riso-pink); color: var(--on-brand); font-family: var(--font-mono); font-size: 14px; font-weight: 600; line-height: 1.5; letter-spacing: .04em; vertical-align: .12em; }
.gd-level { display: inline-flex; gap: 10px; padding: 0 2px; border: 0; border-radius: 0; }
.gd-level button { padding: 4px 0; border: 0; border-radius: 0; background: transparent; color: var(--ink-faint); font-family: var(--font-mono); font-size: 14px; font-weight: 600; cursor: pointer; }
.gd-level button[aria-pressed="true"] { background: none; color: var(--ink); box-shadow: inset 0 -2.5px 0 var(--ink); }
.gd-level button[data-level="hl"][aria-pressed="true"] { background: none; color: var(--riso-pink-deep); box-shadow: inset 0 -2.5px 0 var(--riso-pink); }

/* ── The goals: the contents ────────────────────────────────── */
.gd-goals, .gd-fig[id], .gd-game[id], .gd-lab[id] { scroll-margin-top: calc(var(--gd-stick, 120px) + 16px); }
.gd-goals > p span { margin-left: 8px; letter-spacing: 0; text-transform: none; color: var(--ink-faint); }
.gd-goal a { color: inherit; text-decoration: none; }
.gd-goal a:hover { text-decoration: underline; text-decoration-color: var(--riso-green); text-underline-offset: 3px; }
.gd-goal-go { white-space: nowrap; font-family: var(--font-mono); font-size: 14px; color: var(--riso-pink-deep); }
/* Back: at the end of each chapter, and a pill after a jump */
.gd-up { margin: 14px 0 0; }
.gd-up a { font-family: var(--font-mono); font-size: 14px; letter-spacing: .04em; color: var(--ink-dim); text-decoration: none; }
.gd-up a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.gd-back { position: fixed; left: 14px; bottom: 14px; z-index: 40; max-width: calc(100vw - 28px); padding: 8px 14px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--ink); color: var(--paper-white); font: inherit; font-size: 14px; font-weight: 650; box-shadow: 0 8px 26px rgba(17, 30, 24, .28); cursor: pointer; animation: gd-cap .3s ease; }
.gd-back[hidden] { display: none; }

/* ── Predict, then reveal ───────────────────────────────────── */
.gd-predict { margin: 14px 0 0; padding: 10px 0 0; background: none; border: 0; border-radius: 0; box-shadow: none; border-top: 3px solid var(--riso-pink); }
.gd-predict > p:first-child { margin: 0 0 8px; font-weight: 650; font-size: 17px; line-height: 1.45; }
.gd-predict > p:first-child::before { content: "Predict"; display: block; margin-bottom: 3px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: .1em; color: var(--riso-pink-deep); }
.gd-distil .gd-predict > p:first-child::before { content: "Check"; }
.gd-opts { display: grid; gap: 0; margin: 0 0 8px; margin-bottom: 10px; border-top: 1px solid var(--line); }
.gd-opt { display: block; width: 100%; padding: 9px 6px 9px 30px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-size: 17px; line-height: 1.4; text-align: left; cursor: pointer; position: relative; border-bottom: 1px solid var(--line); }
.gd-opt::before { content: ""; position: absolute; left: 4px; top: 11px; width: 15px; height: 15px; border: 1.5px solid var(--line-strong); border-radius: 50%; }
.gd-opt:hover:not(:disabled) { background: color-mix(in srgb, var(--paper-white) 60%, transparent); }
.gd-opt[aria-pressed="true"] { background: none; }
.gd-opt[aria-pressed="true"]::before { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3px var(--paper); }
.gd-opt.right { background: color-mix(in srgb, var(--riso-green) 16%, transparent); }
.gd-opt.right::before { border-color: var(--riso-green-deep); background: var(--riso-green-deep); box-shadow: inset 0 0 0 3px var(--paper); }
.gd-opt:disabled { cursor: default; }
.gd-reveal { padding: 7px 14px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--ink); color: var(--paper-white); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.gd-reveal:disabled { opacity: .45; cursor: not-allowed; }
/* The buzzer: a domed arcade button for the moments a student commits (show the answer, run
   the lab, start the round). Grey until it can be pressed, then lit and softly pulsing. */
.gd-buzz, html .gd-buzz.gd-buzz { display: inline-flex; flex: 0 0 auto; width: auto; min-width: 0; justify-content: flex-start; align-items: center; gap: 11px; min-height: 44px; padding: 0 6px 0 0; border: 0; border-radius: 26px; background: none; color: var(--ink); font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gd-bz { position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle at 50% 58%, #33463b 0 60%, #142019 62% 100%); box-shadow: 0 2px 0 rgba(26, 58, 42, .3); }
.gd-bz::before { content: ""; position: absolute; left: 6px; right: 6px; top: 4px; bottom: 8px; border-radius: 50%; background: radial-gradient(circle at 36% 30%, #ffe1ee 0 7%, #ff8fc0 26%, #e9579c 66%, #b33a74 100%); box-shadow: 0 4px 0 #87295a, 0 5px 3px rgba(0, 0, 0, .28); transition: transform .07s ease-out, box-shadow .07s ease-out, filter .25s; }
html .gd-buzz.gd-buzz:hover, html .gd-buzz.gd-buzz:active, html .gd-buzz.gd-buzz:disabled { border: 0; background: none; color: var(--ink); box-shadow: none; text-decoration: none; }
.gd-buzz svg { display: none; }
.gd-buzz:hover:not(:disabled) .gd-bz::before { filter: brightness(1.06); }
.gd-buzz:active:not(:disabled) .gd-bz::before, .gd-buzz.hit .gd-bz::before { transform: translateY(3px); box-shadow: 0 1px 0 #87295a, 0 1px 2px rgba(0, 0, 0, .3); }
html .gd-buzz.gd-buzz:disabled, html .gd-buzz.gd-buzz[aria-disabled="true"] { opacity: 1; color: #6f8a7c; cursor: not-allowed; }
.gd-buzz:disabled .gd-bz::before, .gd-buzz[aria-disabled="true"] .gd-bz::before { filter: grayscale(1) brightness(1.12) contrast(.85); }
.gd-buzz:not(:disabled):not([aria-disabled="true"]) .gd-bz { animation: gd-bz-call 2.2s ease-in-out infinite; }
.gd-buzz:focus-visible { outline: 2.5px solid #e3589c; outline-offset: 3px; }
@keyframes gd-bz-call { 0%, 100% { box-shadow: 0 2px 0 rgba(26, 58, 42, .3), 0 0 0 0 rgba(233, 87, 156, 0); } 50% { box-shadow: 0 2px 0 rgba(26, 58, 42, .3), 0 0 0 5px rgba(233, 87, 156, .14), 0 0 16px 4px rgba(233, 87, 156, .3); } }
.gd-answer { margin: 4px 0 0; font-size: 17px; line-height: 1.55; }
.gd-answer::before { content: "What happens"; display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: .1em; color: var(--riso-green-deep); }

/* ── Dry lab ────────────────────────────────────────────────── */
.gd-lab-intro { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; margin: 0 0 16px; }
.gd-lab-intro > div { padding: 10px 0 0; border: 0; border-radius: 0; background: none; font-size: 17px; line-height: 1.5; border-top: 1.5px solid var(--ink); }
.gd-lab-intro b { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; color: var(--ink-dim); }
.gd-lab-wait { min-height: 420px; border: 1.5px dashed var(--line-strong); border-radius: 4px; background: repeating-linear-gradient(-45deg, transparent 0 10px, var(--line) 10px 11px); }
.gd-lab-err { padding: 30px; text-align: center; color: var(--ink-dim); }

/* ── Check: the exam practice link ─────────────────────────── */
.gd-next { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 14px 24px; align-items: center; margin: 24px 0 0; padding: 18px 20px; background: var(--ink); color: var(--paper-white); border-radius: 4px; }
.gd-next .k { margin: 0 0 4px; font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--riso-yellow); }
.gd-next h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 22px; }
.gd-next p { margin: 0; font-size: 17px; line-height: 1.5; color: color-mix(in srgb, var(--paper-white) 82%, transparent); }
.gd-next .gd-go { margin: 0; justify-content: flex-end; }
.gd-next .gd-btn:not(.primary) { background: transparent; color: var(--paper-white); border-color: transparent; text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 5px; }
@media (max-width: 760px) { .gd-next { grid-template-columns: minmax(0, 1fr); } .gd-next .gd-go { justify-content: flex-start; } }
.gd-more { display: flex; flex-wrap: wrap; gap: 0 22px; margin: 18px 0 0; }
.gd-more a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; border: 0; border-radius: 0; background: none; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.gd-more a::after { content: "\2192"; }
.gd-more a:hover { text-decoration-color: var(--ink); }

/* ── Teacher resources ───────────────────────────────────────
   The guide is the students'; this block at its foot is the teacher's: a
   row a lesson in a ruled table (its codes, its focus, the chapters it uses,
   its lesson plan PDF and its slides), the teacher's downloads once, and the
   Practise and revise card. The timed plans are in the PDFs and the decks. On
   a phone each row stacks, the two downloads on the right. */
.gd-lessons-wrap { margin: 0 0 22px; }
.gd-lessons { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.gd-lessons thead th { padding: 9px 14px 7px 0; border-bottom: 1px solid var(--line-strong); font-family: var(--font-mono); font-size: 14px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); text-align: left; }
.gd-lessons tbody th, .gd-lessons td { padding: 13px 16px 13px 0; vertical-align: top; text-align: left; font-weight: 400; }
.gd-lessons tbody tr + tr > * { border-top: 1px solid var(--line); }
.gd-lessons tbody th { width: 30%; font-family: var(--font-display); font-size: 16px; font-weight: 650; line-height: 1.3; }
.gd-lessons tbody th .n { display: inline-block; min-width: 1.5em; font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--riso-pink-deep); }
.gd-lessons .cv { width: 15%; font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.gd-lessons small { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 14px; color: var(--ink-faint); }
.gd-lessons .fo { color: var(--ink-dim); }
.gd-lessons .ch { width: 10%; font-family: var(--font-mono); font-size: 14px; }
.gd-lessons .pl { width: 1%; padding-right: 18px; white-space: nowrap; }
.gd-lessons .pl.sd { padding-right: 0; }
.gd-lessons .pl a { font-weight: 650; }
.gd-lessons .ch a { white-space: nowrap; }
.gd-lessons a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--riso-green-deep); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.gd-lessons a:hover { text-decoration-color: var(--ink); }
.gd-teach-dls { margin: 0 0 6px; }
.gd-teach-more { margin: 0 0 26px; color: var(--ink-dim); font-size: 14.5px; }
.gd-teach-more a { color: var(--ink); text-underline-offset: 3px; }
@media (max-width: 760px) {
  .gd-lessons thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gd-lessons, .gd-lessons tbody { display: block; }
  .gd-lessons tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 13px 0; }
  .gd-lessons tbody tr + tr { border-top: 1px solid var(--line); }
  .gd-lessons tbody tr > * { padding: 0; border: 0 !important; }
  .gd-lessons tbody th, .gd-lessons tbody .cv, .gd-lessons tbody .ch, .gd-lessons tbody .pl { width: auto; }
  .gd-lessons tbody th { grid-column: 1 / -1; }
  .gd-lessons .cv { grid-column: 1; }
  .gd-lessons .cv small { display: inline; margin-left: 8px; }
  .gd-lessons .pl { grid-column: 2; grid-row: 2; align-self: start; text-align: right; }
  .gd-lessons .pl.sd { grid-row: 3 / span 2; }
  .gd-lessons .fo, .gd-lessons .ch { grid-column: 1; }
  .gd-lessons .ch:not(:empty)::before { content: attr(data-l) " "; color: var(--ink-faint); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
}

/* The activity cards (the Practise and revise card, and a dry lab's tasks). */
.gd-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 26px 28px; margin: 0 0 22px; }
.gd-act { display: grid; align-content: start; gap: 6px; padding: 12px 0 0; background: none; border: 0; border-radius: 0; box-shadow: none; border-top: 1.5px solid var(--ink); }
.gd-act-pic { display: block; width: 100%; height: auto; max-height: 120px; margin: 0 0 4px; padding: 6px; background: #fbfdfb; border: 1px solid var(--line-strong); border-radius: 4px; }
.gd-act.gd-practise { grid-column: 1 / -1; }
.gd-practise-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 6px 32px; }
.gd-practise-cols ul { margin: 4px 0 0; }
.gd-practise-cols .need { margin: 6px 0 0; font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.gd-act .k { font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; color: var(--riso-pink-deep); text-transform: uppercase; }
.gd-act h4 { margin: 0; font-family: var(--font-display); font-size: 18px; }
.gd-act p, .gd-act li { margin: 0; font-size: 17px; line-height: 1.5; }
.gd-act ul, .gd-act ol { margin: 0; padding-left: 1.2em; display: grid; gap: 3px; }
.gd-act .need { color: var(--ink-dim); font-size: 14px; }
.gd-act-more summary { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; list-style: none; text-decoration: underline; text-decoration-color: var(--riso-green-deep); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.gd-act-more summary::-webkit-details-marker { display: none; }
.gd-act-more summary::after { content: "+"; font-family: var(--font-mono); color: var(--riso-pink-deep); }
.gd-act-more[open] summary::after { content: "\2212"; }
.gd-act-more[open] { display: grid; gap: 6px; }
.gd-act a, .gd-box a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--riso-green-deep); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.gd-act a:hover, .gd-box a:hover { text-decoration-color: var(--ink); }
.gd-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 26px 28px; }
.gd-box { padding: 12px 0 0; background: none; border: 0; border-radius: 0; border-top: 1.5px solid var(--ink); }
.gd-box h4 { margin: 0 0 8px; font-family: var(--font-display); font-size: 17px; }
.gd-box ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 17px; line-height: 1.5; }
.gd-box li b { font-weight: 650; }

/* ── Downloads ──────────────────────────────────────────────── */
.gd-dls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 28px; }
.gd-dl { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 0; background: none; border: 0; border-radius: 0; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .12s; border-top: 1px solid var(--line-strong); }
.gd-dl:hover b { text-decoration: underline; text-underline-offset: 4px; }
.gd-dl .ico { display: grid; place-items: center; width: 46px; height: 56px; border: 1px solid var(--ink); border-radius: 2px 10px 2px 2px; background: var(--riso-green); color: var(--on-brand); font-family: var(--font-mono); font-size: 14px; font-weight: 700; }
.gd-dl.pink .ico { background: var(--riso-pink); }
.gd-dl.yellow .ico { background: var(--riso-yellow); }
.gd-dl b { display: block; font-family: var(--font-display); font-size: 17px; }
.gd-dl small { font-family: var(--font-mono); font-size: 14px; color: var(--ink-faint); white-space: nowrap; }
.gd-whole { margin: 14px 0 0; font-size: 15px; }
.gd-whole a { font-weight: 650; color: var(--ink); text-underline-offset: 3px; }
.gd-dl span { display: block; margin-top: 2px; color: var(--ink-dim); font-size: 14px; line-height: 1.45; }

/* ── The guides hub (/guides) ───────────────────────────────── */
.gd-hub-h { margin: 6px 0 22px; }
.gd-hub-h h1 { margin: 6px 0 10px; font-family: var(--font-display); font-size: clamp(36px, 5.4vw, 62px); line-height: 1; letter-spacing: -.01em; }
.gd-hub-h h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--riso-pink-deep); }
.gd-hub-h p { max-width: 66ch; color: var(--ink-dim); font-size: 17px; line-height: 1.55; }
.gd-hub { display: grid; gap: 26px; }
.gd-hub { gap: 34px; margin-bottom: 40px; }
/* The table of elements: IB themes across and levels of organisation down, an AP unit a block; a guide is a tile.
   Under 820px a theme or unit is a row that drops open (hubFolds in js/guide.js). */
.gd-pt-c h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 26px; }
.gd-pt-key { margin: 0 0 12px; max-width: 66ch; color: var(--ink-dim); font-size: 15px; line-height: 1.45; }
.gd-pt-th { --t: var(--riso-green); min-width: 0; }
.gd-pt-th.thB { --t: var(--riso-yellow); } .gd-pt-th.thC { --t: var(--riso-pink); } .gd-pt-th.thD { --t: #7fb6e8; }
:root[data-palette="accessible"] .gd-pt-th.thD { --t: var(--riso-coral); }
/* an AP unit has a colour of its own, so a unit reads as a block the way a theme does */
.gd-pt-th.u1 { --t: #2aa7a0; } .gd-pt-th.u2 { --t: #f08a3c; } .gd-pt-th.u3 { --t: #9bbf2f; } .gd-pt-th.u4 { --t: #8f7bd8; }
.gd-pt-th.u5 { --t: #e5605a; } .gd-pt-th.u6 { --t: #5b8def; } .gd-pt-th.u7 { --t: #c79a3a; } .gd-pt-th.u8 { --t: #4c9a5e; }
.gd-pt { display: grid; grid-template-columns: 80px repeat(4, minmax(0, 1fr)); grid-template-rows: auto repeat(4, auto); gap: 0 8px; }
.gd-pt > .gd-pt-th, .gd-pt-lv { display: grid; grid-row: 1 / span 5; grid-template-rows: subgrid; }
.gd-pt-h { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 0 8px; margin: 0; padding: 8px 0 10px; border-top: 5px solid var(--t); font-size: 15px; font-weight: 500; line-height: 1.25; color: var(--ink-dim); }
.gd-pt-h b { font-family: var(--font-display); font-size: 26px; line-height: 1; color: var(--ink); }
.gd-pt-h i { grid-column: 1 / -1; font-style: normal; font-size: 14px; color: var(--ink-faint); }
.gd-pt-lv span { display: flex; flex-direction: column; justify-content: center; padding: 8px 6px 8px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.25; color: var(--ink-dim); }
.gd-pt-lv span:first-child { border: 0; }
.gd-pt-lv b { font-family: var(--font-display); font-size: 20px; line-height: 1.1; color: var(--ink); }
.gd-pt-cell { padding: 8px 0 12px; border-top: 1px solid var(--line); min-width: 0; }
.gd-pt-l { display: none; margin: 0 0 6px; font-size: 14px; font-weight: 650; color: var(--ink-dim); }
/* a tile is a bar the width of its cell: the code as its symbol on the left, the title leading, the count on the right */
.gd-els { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.gd-el-t { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 2px 9px; min-width: 0; min-height: 56px; padding: 6px 9px 6px 0; background: color-mix(in srgb, var(--t) 20%, transparent); border: 1.5px solid var(--t); border-radius: 3px; color: var(--ink); text-decoration: none; }
a.gd-el-t:hover, a.gd-el-t:focus-visible { background: color-mix(in srgb, var(--t) 38%, transparent); outline: 2.5px solid var(--ink); outline-offset: 1px; }
.gd-el-t .k { grid-column: 1; grid-row: 1 / span 2; align-self: stretch; display: grid; place-items: center; padding: 0 4px; border-right: 1.5px solid var(--t); font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; text-align: center; }
.gd-el-t .n { grid-column: 3; grid-row: 1 / span 2; justify-self: end; font-size: 14px; line-height: 1; color: var(--ink-dim); }
.gd-el-t .t { grid-column: 2; grid-row: 1 / span 2; font-size: 16px; font-weight: 600; line-height: 1.22; overflow-wrap: break-word; hyphens: auto; hyphenate-limit-chars: 14 6 4; }
.gd-el-t .hl { grid-column: 3; grid-row: 1; justify-self: end; align-self: end; padding: 0 5px; border: 1px solid currentColor; border-radius: 2px; font-size: 14px; line-height: 1.35; white-space: nowrap; }
.gd-el-t:has(.hl) .n { grid-row: 2; align-self: start; }
.gd-el-t.soon .k { border-right-color: var(--ink-faint); }
.gd-el-t.soon { background: none; border-style: dashed; border-color: var(--ink-faint); color: var(--ink-faint); }
.gd-pt-ap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 8px; }
.gd-pt-ap .gd-el-t { grid-template-columns: 76px minmax(0, 1fr) auto; }
.gd-pt-ap .gd-el-t .k { font-size: 14px; }
@media (min-width: 821px) { .gd-pt-ap .gd-pt-h { min-height: 74px; align-content: start; } }
@media (max-width: 1100px) { .gd-pt-ap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gd-pt-unit { margin: 8px 0 0; font-size: 14px; }
.gd-pt-unit a { color: var(--riso-green-deep); font-weight: 650; text-underline-offset: 3px; }
@media (max-width: 820px) {
  .gd-pt { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 10px; }
  .gd-pt > .gd-pt-th { display: block; grid-row: auto; }
  .gd-pt-lv { display: none; }
  .gd-pt-l { display: block; }
  .gd-pt-ap { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .gd-pt-h { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; padding: 10px 0; }
  .gd-pt-h i { grid-column: auto; }
  .gd-pt-h[role="button"] { grid-template-columns: auto minmax(0, 1fr) auto auto; cursor: pointer; }
  .gd-pt-h[role="button"]::after { content: ""; width: 9px; height: 9px; margin: 0 4px 4px 6px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
  .gd-pt-h[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -4px; }
  .gd-pt-h[aria-expanded="false"] ~ .gd-pt-cell { display: none; }
  .gd-pt-h:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; }
}
@media print { .gd-pt-h[aria-expanded="false"] ~ .gd-pt-cell { display: block; } }

/* The hub's demo: what a guide does, beside a scene playing */
.gd-hub-demo { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 20px 34px; align-items: start; margin: 0 0 34px; }
.gd-hub-demo h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 26px; }
.gd-hub-demo p { margin: 0 0 10px; color: var(--ink-dim); font-size: 17px; line-height: 1.55; }
.gd-hub-demo ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.gd-hub-demo li { position: relative; padding-left: 22px; font-size: 17px; line-height: 1.45; }
.gd-hub-demo li::before { content: ""; position: absolute; left: 3px; top: .75em; width: 10px; height: 2px; background: var(--riso-pink-deep); border: 0; border-radius: 0; }
.gd-hub-demo .gd-go { margin-top: 14px; }
@media (max-width: 860px) { .gd-hub-demo { grid-template-columns: minmax(0, 1fr); } }

/* ── The IA coach's planning sheet (the still; UNIT4_SHARED.md 1.11) ── */
.gd-coach { max-width: 980px; margin: 28px auto 0; }
.gd-coach-still { padding-top: 10px; border-top: 3px solid var(--riso-yellow); font-size: 17px; line-height: 1.5; }
.gd-coach-still .gd-coach-k { margin: 0; font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--riso-green-deep); }
.gd-coach-still .gd-coach-h { margin: 2px 0 6px; font-size: 20px; }
.gd-coach-crit { margin: 12px 0; padding-top: 8px; border-top: 1px solid var(--line-strong); break-inside: avoid; }
.gd-coach-crit h4, .gd-coach-th { margin: 0 0 4px; font-size: 15.5px; }
.gd-coach-crit h4 b { margin-right: 6px; color: var(--riso-pink-deep); font-family: var(--font-mono); font-weight: 500; }
.gd-coach-crit > p { margin: 0 0 6px; color: var(--ink-dim); }
.gd-coach-ticks { margin: 0; padding: 0; list-style: none; columns: 2 18em; column-gap: 24px; }
.gd-coach-ticks li { position: relative; margin: 0 0 4px; padding-left: 24px; break-inside: avoid; }
.gd-coach-ticks li::before { content: ""; position: absolute; left: 0; top: .25em; width: 13px; height: 13px; border: 1.5px solid var(--ink); border-radius: 2px; }
.gd-coach-th { margin-top: 14px; }
.gd-coach-blank { width: 100%; margin: 4px 0 8px; border-collapse: collapse; font-size: 14px; }
.gd-coach-blank th, .gd-coach-blank td { height: 30px; padding: 4px 6px; border: 1px solid var(--line-strong); text-align: left; vertical-align: top; }
.gd-coach-blank thead th { height: auto; font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--ink-dim); }
.gd-coach-blank tbody th { width: 34%; font-weight: 600; }
.gd-coach-foot { margin: 8px 0 0; font-size: 14px; color: var(--ink-dim); }
@media (max-width: 600px) { .gd-coach-blank { display: block; overflow-x: auto; } }

/* ── Print: the notes, every step of every figure ───────────── */
@media print {
  .gd-max-btn, .gd-up, .gd-back, .gd-goal-go, .gd-zoom-btn, .gd-scene-ctl, .gd-scene-opts, .gd-bar, .gd-play, .gd-predict .gd-reveal, #lab > :not(.gd-coach), #check, #downloads, .gd-more, .gd-tip, .gd-toc, .gd-go { display: none !important; }
  /* the IA coach: the write-up once something is written (coach.css), else its planning sheet */
  .gd-coach.gd-coach-on:not(.cch-has) > .gd-coach-still { display: block !important; }
  .gd-coach-still { break-before: page; }
  .gd-predict .gd-answer { display: block !important; }
  .gd-mnem-go { display: none !important; }
  .gd-tile { min-height: 0; perspective: none; }
  .gd-tile > .f, .gd-tile > .k { position: static; transform: none !important; opacity: 1 !important; backface-visibility: visible; }
  .gd-tile > .k { margin-top: 4px; }
  .gd-anim [data-at], .gd-anim [data-only], .gd-anim [data-on] { opacity: 1 !important; }
  .gd-cap li { display: block !important; }
  /* a game's or an element's still prints one step, so only that step's caption */
  .gd-still .gd-cap li:not(.on), .gd-el .gd-cap li:not(.on) { display: none !important; }
  .gd-ch, .gd-fig, .gd-act { break-inside: avoid; }
  .gd-fig, .gd-act, .gd-predict { box-shadow: none !important; }
}

/* Nudge: a pink pulse on what a student has to touch (handles, tokens, hotspots, switches, the play and
   Show me buttons), until that figure, lab, game or question has been used once (guide.js adds .gd-used).
   A still glow if motion is reduced. */
@keyframes gd-nudge-glow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(227, 88, 156, 0)); transform: scale(1); } 50% { filter: drop-shadow(0 0 3px #e3589c) drop-shadow(0 0 9px rgba(227, 88, 156, .85)); transform: scale(1.14); } }
/* a piece a sim moves by its own CSS transform (the bond bench's molecules) glows without the scale,
   which would override its transform and throw it to the corner of its drawing */
@keyframes gd-nudge-glow-still { 0%, 100% { filter: drop-shadow(0 0 0 rgba(227, 88, 156, 0)); } 50% { filter: drop-shadow(0 0 3px #e3589c) drop-shadow(0 0 9px rgba(227, 88, 156, .85)); } }
@keyframes gd-nudge-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(227, 88, 156, 0); } 50% { box-shadow: 0 0 0 4px rgba(227, 88, 156, .75), 0 0 14px 4px rgba(227, 88, 156, .45); } }
:is(.gd-fig, .gd-lab, .gd-game).gd-nudge:not(.gd-used) svg :is([role="slider"], [role="button"], [role="checkbox"], [role="switch"], [draggable="true"]) { transform-box: fill-box; transform-origin: center; animation: gd-nudge-glow 1.8s ease-in-out infinite; }
:is(.gd-fig, .gd-lab, .gd-game).gd-nudge:not(.gd-used) svg :is([role="slider"], [role="button"], [role="checkbox"], [role="switch"], [draggable="true"]):is([style*="transform"], .gb-pc) { animation-name: gd-nudge-glow-still; }
:is(.gd-fig, .gd-lab, .gd-game, .gd-predict).gd-nudge:not(.gd-used) :is(div, span, li, label, p)[role="button"], :is(.gd-fig, .gd-lab, .gd-game).gd-nudge:not(.gd-used) :is(div, span, li)[role="slider"], :is(.gd-fig, .gd-lab, .gd-game).gd-nudge:not(.gd-used) [draggable="true"]:not(svg *), :is(.gd-fig, .gd-lab, .gd-game, .gd-predict).gd-nudge:not(.gd-used) :is(.gd-reveal:not(:disabled), .gd-play) { border-radius: 4px; animation: gd-nudge-ring 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  :is(.gd-fig, .gd-lab, .gd-game).gd-nudge:not(.gd-used) svg :is([role="slider"], [role="button"], [role="checkbox"], [role="switch"], [draggable="true"]) { animation: none; filter: drop-shadow(0 0 4px rgba(227, 88, 156, .9)); }
  :is(.gd-fig, .gd-lab, .gd-game, .gd-predict).gd-nudge:not(.gd-used) :is(div, span, li, label, p)[role="button"], :is(.gd-fig, .gd-lab, .gd-game).gd-nudge:not(.gd-used) [draggable="true"]:not(svg *), :is(.gd-fig, .gd-lab, .gd-game, .gd-predict).gd-nudge:not(.gd-used) :is(.gd-reveal:not(:disabled), .gd-play) { animation: none; box-shadow: 0 0 0 3px rgba(227, 88, 156, .5); }
}
@media print { .gd-fig *, .gd-lab *, .gd-game * { animation: none !important; filter: none !important; } }

/* Sims directory: index cards */
.sm-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 22px; }
.sm-filters .sm-sep { width: 1.5px; align-self: stretch; margin: 0 6px; background: var(--ink); opacity: .25; }
.sm-q { flex: 1 1 100%; max-width: 360px; padding: 7px 14px; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; }
.sm-f { padding: 5px 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sm-f[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.sm-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 34px 16px 14px; background: var(--paper-white); border: 1.5px solid var(--ink); border-radius: 3px; box-shadow: 3px 3px 0 var(--ink); background-image: repeating-linear-gradient(transparent 0 25px, rgba(45, 184, 118, .16) 25px 26px); background-position: 0 30px; background-repeat: no-repeat; background-size: 100% calc(100% - 30px); }
.sm-card::before { content: ""; position: absolute; left: 0; right: 0; top: 26px; height: 2px; background: var(--riso-pink-deep); }
.sm-card[hidden] { display: none; }
.sm-k { position: absolute; top: 7px; left: 16px; margin: 0; font-family: var(--font-mono); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.sm-card h3 { margin: 6px 0 0; font-family: var(--font-display); font-size: 18px; line-height: 1.2; }
.sm-b { margin: 0; font-size: 14px; line-height: 1.45; }
.sm-t { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.sm-t span { padding: 1px 7px; border-radius: 2px; background: var(--paper); font-family: var(--font-mono); font-size: 14px; }
.sm-w { margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--ink-dim); font-size: 14px; }
.sm-w p { margin: 0 0 3px; font-family: var(--font-mono); font-size: 14px; text-transform: uppercase; color: var(--ink-dim); }
.sm-w a { display: block; padding: 2px 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--riso-green); text-underline-offset: 2px; }
.sm-w a b { font-family: var(--font-mono); font-size: 14px; }
.sm-w a:first-of-type::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.sm-w a:not(:first-of-type) { position: relative; z-index: 2; }
.sm-share { position: absolute; z-index: 3; top: 5px; right: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px; border: 0; border-radius: 3px; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.sm-share svg, .gd-share-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.sm-share:hover span, .gd-share-btn:hover span { text-decoration: underline; text-underline-offset: 4px; }
.sm-share:focus-visible { outline: 2.5px solid var(--riso-pink-deep); outline-offset: 2px; }
.sm-share.gd-share-done, .gd-share-btn.gd-share-done { color: var(--riso-green-deep, #1f7a52); }
.gd-share-btn { margin-left: 14px; }
.gd-h .gd-share-btn { margin-left: 14px; }
.gd-max-bar .gd-share-btn { order: 1; margin-left: 12px; }
.gd-max-bar .gd-share-btn.gd-share-done { color: #fbfdfb; }
@media print { .sm-share, .gd-share-btn { display: none !important; } }
.sm-card:hover { box-shadow: 5px 5px 0 var(--ink); }
.sm-card:focus-within { outline: 2px solid var(--riso-green); outline-offset: 2px; }
.sm-none { padding: 24px 0; color: var(--ink-dim); }

/* Check yourself: the questions at the end of a sim's full screen (js/guide.js, scripts/guides/REVIEW.md) */
.gd-max-bar .gd-rv-btn { order: 1; margin-left: auto; padding: 5px 12px; border: 1.5px solid #fbfdfb; border-radius: 4px; background: transparent; color: #fbfdfb; font: inherit; font-family: var(--font-display); font-size: 14px; font-weight: 650; letter-spacing: 0; cursor: pointer; }
.gd-max-bar .gd-rv-btn:hover { background: #fbfdfb; color: #1a3a2a; }
.gd-max-bar .gd-rv-btn[aria-expanded="true"] { background: var(--riso-pink); border-color: var(--riso-pink); color: #1a3a2a; }
.gd-max-bar .gd-rv-btn:focus-visible { outline: 2.5px solid var(--riso-pink); outline-offset: 3px; }
.gd-max-bar .gd-max-btn { order: 2; margin-left: 14px; }
.gd-rv { position: fixed; left: 0; right: 0; bottom: 0; top: var(--gd-bar, 50px); z-index: 302; overflow: auto; background: var(--paper); color: var(--ink); -webkit-overflow-scrolling: touch; }
.gd-rv[hidden] { display: none; }
.gd-rv-in { max-width: 760px; margin: 0 auto; padding: 28px 20px 56px; font-size: 16px; line-height: 1.5; }
.gd-rv-in h2 { margin: 2px 0 6px; font-size: 28px; line-height: 1.15; outline: none; }
.gd-rv-k { margin: 0; font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--riso-pink-deep); }
.gd-rv-lede { margin: 0 0 18px; color: var(--ink-dim); font-size: 14.5px; }
.gd-rv-qs { list-style: none; display: grid; gap: 18px; margin: 0 0 8px; padding: 0; }
.gd-rv-q { padding-top: 10px; border-top: 3px solid var(--riso-pink); }
.gd-rv-qt { margin: 0 0 8px; font-weight: 650; }
.gd-rv-opts { display: grid; gap: 6px; }
.gd-rv-opt { display: flex; gap: 10px; align-items: baseline; width: 100%; padding: 9px 12px; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--paper-white); color: var(--ink); font: inherit; font-size: 17px; line-height: 1.4; text-align: left; cursor: pointer; }
.gd-rv-opt b { font-family: var(--font-mono); font-size: 14px; color: var(--ink-faint); }
.gd-rv-opt:hover:not(:disabled) { border-color: var(--ink); }
.gd-rv-opt:focus-visible { outline: 2.5px solid var(--riso-pink-deep); outline-offset: 2px; }
.gd-rv-opt:disabled { cursor: default; }
.gd-rv-opt.right { border-color: var(--riso-green-deep); background: color-mix(in srgb, var(--riso-green) 16%, var(--paper-white)); }
.gd-rv-opt.wrong { border-color: var(--riso-pink-deep); background: color-mix(in srgb, var(--riso-pink) 22%, var(--paper-white)); }
.gd-rv-why { margin: 8px 0 0; font-size: 17px; }
.gd-rv-why.ok b { color: var(--riso-green-deep); }
.gd-rv-why.no b { color: var(--riso-pink-deep); }
.gd-rv-score { margin: 6px 0 0; font-weight: 650; font-size: 14.5px; }
.gd-rv-x { margin-top: 30px; padding: 16px 18px 18px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--paper-white); box-shadow: 3px 3px 0 var(--riso-pink); }
.gd-rv-stem { margin: 8px 0 12px; }
.gd-rv-tw { overflow-x: auto; margin: 0 0 6px; }
.gd-rv-table { border-collapse: collapse; font-size: 14px; }
.gd-rv-table th, .gd-rv-table td { padding: 5px 12px; border: 1px solid var(--line-strong); text-align: left; }
.gd-rv-table thead th { background: color-mix(in srgb, var(--riso-green) 14%, var(--paper-white)); }
.gd-rv-note { margin: 4px 0 12px; color: var(--ink-faint); font-size: 14px; }
.gd-rv-part { margin: 14px 0 0; }
.gd-rv-pq { margin: 0 0 6px; }
.gd-rv-m { font-family: var(--font-mono); font-size: 14px; color: var(--ink-faint); white-space: nowrap; }
.gd-rv-part textarea { display: block; width: 100%; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.45; resize: vertical; }
.gd-rv-part textarea:focus-visible { outline: 2.5px solid var(--riso-pink-deep); outline-offset: 1px; }
.gd-rv-ms { margin: 8px 0 0; padding: 8px 12px; border-left: 4px solid var(--riso-green-deep); background: color-mix(in srgb, var(--riso-green) 10%, var(--paper-white)); }
.gd-rv-ms[hidden], .gd-rv-total[hidden], .gd-rv-show[hidden], .gd-rv-why[hidden] { display: none; }
.gd-rv-msh { margin: 0 0 4px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--riso-green-deep); }
.gd-rv-ms ul { list-style: none; margin: 0; padding: 0; }
.gd-rv-ms li { margin: 3px 0; font-size: 17px; }
.gd-rv-ms label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.gd-rv-ms input { flex: none; accent-color: var(--riso-green-deep); }
.gd-rv-show, .gd-rv-back { margin: 16px 0 0; padding: 9px 16px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--ink); color: var(--paper-white); font: inherit; font-size: 14.5px; font-weight: 650; cursor: pointer; box-shadow: 2px 2px 0 var(--riso-pink); }
.gd-rv-show:focus-visible, .gd-rv-back:focus-visible { outline: 2.5px solid var(--riso-pink-deep); outline-offset: 3px; }
.gd-rv-back { display: block; margin-top: 26px; background: transparent; color: var(--ink); box-shadow: none; }
.gd-rv-total { margin: 12px 0 0; font-weight: 650; font-size: 14.5px; }
@media (max-width: 600px) { .gd-rv-in { padding: 20px 14px 48px; } .gd-rv-in h2 { font-size: 23px; } .gd-max-bar .gd-rv-btn { padding: 4px 9px; font-size: 14px; } .gd-max-bar .gd-max-btn { margin-left: 8px; } .gd-rv-x { padding: 12px 12px 14px; } }
@media print { .gd-rv, .gd-rv-btn { display: none !important; } }

/* Show me how: the guided first run of a sim (js/guide.js, scripts/guides/TOUR.md) */
.gd-tour-btn { display: inline-flex; align-items: center; gap: 7px; padding: 2px 2px; border: 0; border-radius: 3px; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.gd-tour-btn svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.gd-tour-btn:hover span, .gd-tour-btn[aria-pressed="true"] span { text-decoration: underline; text-underline-offset: 4px; }
.gd-tour-btn:focus-visible { outline: 2.5px solid var(--riso-pink-deep); outline-offset: 3px; }
.gd-tour-btn.gd-tour-new svg { color: var(--riso-pink-deep); }
.gd-tour-btn.gd-tour-new { animation: gd-tour-nudge 2.4s ease-in-out 3; }
.gd-h .gd-tour-btn { margin-left: auto; align-self: center; }
.gd-tour-btn + .gd-max-btn { margin-left: 14px !important; }
.gd-max-bar .gd-tour-bar { order: 1; margin-left: auto; padding: 5px 4px; color: #fbfdfb; font-family: var(--font-mono); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.gd-max-bar .gd-tour-bar:focus-visible { outline-color: var(--riso-pink); }
.gd-max-bar .gd-tour-bar + .gd-rv-btn { margin-left: 12px; }
.gd-max-bar .gd-tour-bar ~ .gd-max-btn { order: 3; }
.gd-tour-ring { position: fixed; z-index: 309; box-sizing: border-box; border: 3px solid var(--riso-pink); border-radius: 8px; background: rgba(255, 126, 182, .08); box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 0 22px 6px rgba(255, 126, 182, .55); pointer-events: none; animation: gd-tour-glow 1.8s ease-in-out infinite; }
.gd-tour-ring[hidden] { display: none; }
.gd-tour-pop { position: fixed; z-index: 310; box-sizing: border-box; width: min(340px, calc(100vw - 24px)); padding: 14px 16px 12px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--paper-white); color: var(--ink); font-size: 15px; line-height: 1.45; box-shadow: 0 10px 30px rgba(17, 30, 24, .28); }
.gd-tour-pop.gd-tour-dock { left: 50%; right: auto; top: auto; bottom: 12px; transform: translateX(-50%); }
.gd-tour-n { margin: 0 0 4px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--riso-pink-deep); }
.gd-tour-pop h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 18px; line-height: 1.2; }
.gd-tour-t { margin: 0; }
.gd-tour-do { margin: 6px 0 0; font-size: 14px; color: var(--ink-dim); }
.gd-tour-btns { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.gd-tour-btns button { padding: 6px 2px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.gd-tour-btns .gd-tour-skip { margin-right: auto; font-weight: 500; color: var(--ink-dim); }
.gd-tour-btns .gd-tour-next { padding: 7px 16px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--ink); color: var(--paper-white); text-decoration: none; }
.gd-tour-btns button:focus-visible { outline: 2.5px solid var(--riso-pink-deep); outline-offset: 3px; }
@keyframes gd-tour-glow { 0%, 100% { box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 0 14px 3px rgba(255, 126, 182, .4); } 50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 0 28px 9px rgba(255, 126, 182, .75); } }
@keyframes gd-tour-nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .gd-tour-ring, .gd-tour-btn.gd-tour-new { animation: none; } }
@media print { .gd-tour-btn, .gd-tour-ring, .gd-tour-pop { display: none !important; } }

/* Navigation: the goals and the chapter list fold away, closed to start with.
   The summary pulses softly until one has been opened (guide.js sets .seen). */
.gd-nav { margin: 0; }
.gd-nav > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 0; cursor: pointer; list-style: none; border-top: 1.5px solid var(--ink); font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; color: var(--ink-dim); }
.gd-nav > summary::-webkit-details-marker { display: none; }
.gd-nav-k { padding: 1px 7px; border: 1px solid var(--ink); border-radius: 2px; color: var(--ink); text-transform: uppercase; font-size: 14px; }
.gd-nav-t { color: var(--ink); font-weight: 600; }
.gd-nav-hint { letter-spacing: 0; color: var(--ink-faint); }
.gd-nav-chev { width: 14px; height: 14px; margin-left: auto; align-self: center; color: var(--riso-pink-deep); transition: transform .2s; }
.gd-nav[open] > summary .gd-nav-chev { transform: rotate(180deg); }
.gd-nav[open] > summary .gd-nav-hint { display: none; }
.gd-nav > summary:hover .gd-nav-t, .gd-nav > summary:focus-visible .gd-nav-t { text-decoration: underline; text-underline-offset: 4px; }
.gd-nav:not([open]):not(.seen) > summary .gd-nav-k { animation: gd-nav-glow 2.4s ease-in-out 3; }
.gd-nav:not([open]):not(.seen) > summary .gd-nav-chev { animation: gd-nav-bob 2.4s ease-in-out 3; }
@keyframes gd-nav-glow { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--riso-pink) 45%, transparent); } }
@keyframes gd-nav-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .gd-nav > summary .gd-nav-k, .gd-nav > summary .gd-nav-chev { animation: none !important; } }
.gd-nav > .gd-goals { border-top: 0; padding-top: 0; }
.gd-nav.wide { margin: -14px 0 20px; }
.gd-nav.wide > .gd-goals.wide { margin: 0; }
.gd-nav-toc { margin: 0 0 30px; }
.gd-nav-toc > .gd-toc { margin: 0; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .gd-nav.wide { margin-top: 0; } }
@media print { .gd-nav > summary { display: none; } }
.gd-fs-prompt { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 0; padding: 10px 12px; border: 0; border-top: 1.5px solid var(--ink); background: color-mix(in srgb, var(--riso-pink) 18%, var(--paper, #fff)); color: var(--ink); font: 600 14px/1.2 var(--font-body, inherit); cursor: pointer; }
.gd-fs-prompt svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gd-fs-prompt:hover { background: var(--riso-pink, #f48fb9); }
/* A wide window must not blow the hero film up: it keeps a comfortable size beside the title. */
.gd-hero-fig > .gd-fig.gd-scene { max-width: 560px; margin-inline: auto; }

/* Full screen shows a figure at its own size: the laptop fit (zoomPage in guide.js) is for the page only */
.gd-max.gd-fig, .gd-max.gd-lab, .gd-max.gd-game { zoom: 1 !important; max-width: none !important; margin-inline: 0 !important; }
.gd-max .gd-capped { max-height: none !important; }
/* Full screen on a laptop (fsFit in js/guide.js): the drawing's column is sized to the window, so when the column
   of controls beside it is the longer one the drawing stays in view under the bar while the controls scroll by. */
/* css-pair-ok: gd-fs, gd-fs-pin and gd-fs-up are set by js/guide.js */
/* (a tool whose own box is a grid of its own, written after this file, kept its own columns: here the column is the fit's) */
.gd-max.gd-fs.gd-land > :is(.gd-el-live, .gd-game-body):not(:has(> .gd-land-in)) { grid-template-columns: var(--gd-lcol, 60%) minmax(0, 1fr) !important; }
.gd-bx.gd-max .gd-bx-rail { --gd-fade: var(--bx-bg, #fbfdfb); }   /* (a dry lab's rail says More below too: see settle) */
/* A wide, shallow drawing the page had laid out landscape is bigger upright across the window: its two columns are
   stacked as one (gd-fs-stack), by these rules alone, so the page's layout is untouched when Full screen ends. */
/* css-pair-ok: gd-fs-stack is set by js/guide.js */
.gd-max.gd-fs-stack.gd-land > :is(.gd-el-live, .gd-game-body):not(:has(> .gd-land-in)), .gd-max.gd-fs-stack.gd-land .gd-land-in, .gd-max.gd-fs-stack .gd-lgrid { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: none !important; }
.gd-max.gd-fs-stack.gd-land > :is(.gd-el-live, .gd-game-body) > .gd-land-side, .gd-max.gd-fs-stack.gd-land .gd-land-in > .gd-land-side { grid-column: 1 !important; grid-row: auto !important; }
.gd-max.gd-fs-stack .gd-lgrid > *, .gd-max.gd-fs-stack .gd-lgrid > .gd-lgrid-art { grid-area: auto / 1 / auto / auto !important; }
.gd-max.gd-fs-pin.gd-land > :is(.gd-el-live, .gd-game-body) > .gd-land-stage:not(.gd-land-in), .gd-max.gd-fs-pin.gd-land .gd-land-in > .gd-land-art, .gd-max.gd-fs-pin .gd-lgrid > .gd-lgrid-art { position: sticky; top: 0; align-self: start; }   /* (top: from the box's own padding, which already clears the bar) */
/* beside the film in the page, a slider takes the column's width under its label */
.gd-scene.gd-inline .gd-scene-side .gd-scene-c:not(.gd-scene-choice) { grid-template-columns: minmax(0, 1fr) auto; }
.gd-scene.gd-inline .gd-scene-side .gd-scene-c:not(.gd-scene-choice) input[type="range"] { grid-column: 1 / -1; grid-row: 2; }
/* An element or game, landscape in the page (js landFit): the drawing left, the rest in a column right */
.gd-ch-scene:has(> .gd-land, > .gd-pw) { max-width: none; }
.gd-ch.wide > .gd-fig.gd-el.gd-land { max-width: none; }
.gd-land > :is(.gd-el-live, .gd-game-body) { display: grid; grid-template-columns: var(--gd-lcol, 60%) minmax(0, 1fr); grid-template-rows: var(--gd-lkt, none); column-gap: 28px; align-items: start; }
.gd-land > :is(.gd-el-live, .gd-game-body) > :not(.gd-land-stage, .gd-land-side) { grid-column: 1; }
.gd-land > :is(.gd-el-live, .gd-game-body) > .gd-land-stage { grid-column: 1; grid-row: calc(var(--gd-lk, 0) + 1); min-width: 0; }
.gd-land > :is(.gd-el-live, .gd-game-body) > .gd-land-side { grid-column: 2; grid-row: 1 / span calc(var(--gd-lk, 0) + 1); min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; align-self: stretch; }
.gd-land-side > * { flex-shrink: 0; max-width: 100%; }
/* Where the parts in the side column came from inside the tool's own box, the column stays inside that box (a tool's
   script finds its parts and hears their presses from the box: js landFit) and the box is the two columns. */
.gd-land > :is(.gd-el-live, .gd-game-body):has(> .gd-land-in) { display: block; }
.gd-land .gd-land-in { display: grid !important; grid-template-columns: var(--gd-lcol, 60%) minmax(0, 1fr) !important; grid-template-rows: var(--gd-lrowt, none) !important; column-gap: 28px; align-items: start; }
.gd-land .gd-land-in > :not(.gd-land-side) { grid-column: 1 !important; min-width: 0; }
.gd-land .gd-land-in > .gd-land-wide, .gd-land > :is(.gd-el-live, .gd-game-body) > .gd-land-wide { grid-column: 1 / -1 !important; margin-top: 12px; }
.gd-land .gd-land-in > .gd-land-side { grid-column: 2; grid-row: 1 / span var(--gd-lrows, 1); min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; align-self: stretch; }
/* A dry lab takes the page's width, and keeps its words readable (js zoomOne: not below 85%) */
.gd-ch-scene:has(> .gd-lab) { max-width: none; }

/* ── Reading page: white ground, mint kept for the bars; roomier text ──
   Light theme only (dark and the accessible palette keep their own grounds).
   Body text was already 11:1 on mint; this lifts the small pink and green
   text (3:1 before) past 4.5:1 and the smallest labels to 14px. */
:root[data-theme="light"]:not([data-palette]):has(.gd-page) {
  --paper: #fff; --paper-white: #fff; --gd-mint: #e6f5ee;
  --riso-pink-deep: #c4357f; --riso-green-deep: #17784a;
}
:root[data-theme="light"]:not([data-palette]):has(.gd-page) :is(header.topbar, .gd-bar, footer, .gd-pick-pop) { background: var(--gd-mint); }
:root[data-theme="light"]:not([data-palette]):has(.gd-page) :is(a.gd-pick-i:hover, .gd-pick-i.here, .gd-btn:hover, .gd-tile > .k) { background: var(--gd-mint); }
:root[data-theme="light"]:not([data-palette]):has(.gd-page) .gd-fig { background: #f6fbf8; }
.gd-ch-text :is(p, li) { letter-spacing: .012em; word-spacing: .06em; }
.gd-ch-text { max-width: 68ch; }

/* ── The boxed dry lab (scripts/guides/LABBOX.md; js boxUp) ──────────────
   One box that fits a laptop window: a head that asks the lab's question,
   then what you change | the bench | a panel of steps. The lab's own css
   lays its parts out inside the zones, under .gd-bx. */
.gd-lab[data-box] { --bx-h: clamp(540px, calc(100dvh - var(--gd-stick, 120px) - 28px), 780px); --bx-ink: #1a3a2a; --bx-bg: var(--paper-white); scroll-margin-top: calc(var(--gd-stick, 120px) + 12px); }
.gd-lab.gd-bx-wait { min-height: var(--bx-h); }
/* While a boxed lab loads, its still stays out of the way: at its own size it is taller than the box, and the page would
   shrink under the reader (a "cutscene") when the box mounted. The room is held, the box fills it. */
@media screen { .gd-lab.gd-bx-wait { height: var(--bx-h); overflow: hidden; border: 1.5px dashed var(--line-strong); border-radius: 4px; } .gd-lab.gd-bx-wait > .gd-still { visibility: hidden; } }
@media screen { .gd-bx-on > .gd-bx-src { display: none; } }
.gd-bx-ex { margin: 18px 0 0; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 4px; }
.gd-bx-ex b { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.gd-bx-ex p { margin: 0; }
.gd-lab.gd-bx { position: relative; height: var(--bx-h); margin: 6px 7px 34px 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--bx-bg); color: var(--ink); border: 2px solid var(--bx-ink); border-radius: 14px; box-shadow: 7px 7px 0 var(--riso-pink); font-family: var(--font-display); font-size: 15px; line-height: 1.4; text-align: left; }
.gd-bx *, .gd-bx *::before, .gd-bx *::after { box-sizing: border-box; }
.gd-bx button { font: inherit; color: inherit; cursor: pointer; }
.gd-bx :is(button, summary, textarea):focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
.gd-bx .gd-bx-out { display: none !important; }

.gd-bx-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; align-items: center; padding: 12px 16px 13px 18px; background: var(--bx-ink); color: #fff; border-radius: 11px 11px 0 0; }
.gd-bx-meta { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13.5px; color: #cfe3d8; white-space: nowrap; }
.gd-bx-tag { padding: 4px 8px; border-radius: 4px; background: #ff7eb6; color: #1a3a2a; font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.gd-bx-meta b { color: #fff; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.gd-bx-meta i { font-style: normal; opacity: .6; }
.gd-bx-hook { grid-column: 1; margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(19px, 1.75vw, 25px); line-height: 1.2; letter-spacing: -.01em; color: #fff; }
.gd-bx-hook em { font-style: normal; color: #ff7eb6; }
.gd-bx-tools { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 6px 14px; position: relative; }
.gd-bx-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 13px; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 7px; background: none; color: #fff !important; font-weight: 650; font-size: 14.5px; }
.gd-bx-btn:hover, .gd-bx-btn[aria-expanded="true"] { background: #fff; color: #1a3a2a !important; }
.gd-bx-btn svg, .gd-bx-zoom svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gd-bx-tools .gd-max-btn, .gd-bx-tools .gd-tour-btn { margin: 0; color: #fff; font-family: var(--font-display); letter-spacing: 0; text-transform: none; }
.gd-bx-tools :is(.gd-max-btn, .gd-tour-btn, .gd-bx-btn):focus-visible { outline-color: #ff7eb6; }
.gd-bx-tools .gd-tour-btn { min-width: 36px; min-height: 36px; justify-content: center; }
.gd-bx-tools .gd-tour-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gd-bx-brief { position: absolute; top: calc(100% + 12px); right: 0; z-index: 20; width: min(840px, 78vw); max-height: calc(var(--bx-h) - 110px); overflow: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 18px; padding: 16px 18px; background: var(--bx-bg); color: var(--ink); border: 2px solid var(--bx-ink); border-radius: 10px; box-shadow: 5px 5px 0 var(--riso-green); font-size: 14.5px; line-height: 1.5; font-weight: 400; }
.gd-bx-brief[hidden] { display: none; }
.gd-bx-brief > div > b, .gd-bx-task h4 { display: block; margin: 0 0 3px; font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--riso-green-deep); }
.gd-bx-brief .gd-bx-task { grid-column: span 3; padding-top: 12px; border-top: 1px solid var(--line); }
.gd-bx-task ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 28px; }
.gd-bx-task li { margin: 0 0 4px; break-inside: avoid; }
.gd-bx-brief .gd-bx-note { grid-column: 1 / -1; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-faint); }

.gd-bx-b { position: relative; min-height: 0; overflow: auto; border-radius: 0 0 11px 11px; }
.gd-bx .gd-bx-root { height: 100%; display: grid; grid-template-columns: 232px minmax(0, 1.1fr) minmax(340px, 1fr); gap: 0; font-size: 15px; }
.gd-bx-k { margin: 0 0 6px; font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.gd-bx-rail { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px 12px 16px; border-right: 1px solid var(--line); overflow: auto; min-height: 0; }
.gd-bx-rail > .gd-bx-k { margin-bottom: -4px; }
.gd-bx-fold { font-size: 13.5px; }
.gd-bx-fold summary { cursor: pointer; font-weight: 650; }
.gd-bx-rail > .gd-bx-fold:last-child { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.gd-bx-stage { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 8px; padding: 14px 18px 12px; min-width: 0; min-height: 0; background: color-mix(in srgb, var(--riso-green) 5%, var(--bx-bg)); }
.gd-bx-art { min-height: 0; min-width: 0; display: grid; }
.gd-bx-art > svg, .gd-bx-art > canvas { display: block; width: 100%; height: 100%; max-width: none; min-height: 0; border-radius: 8px; }
.gd-bx-go { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px; }
.gd-bx-go p { margin: 0; }
.gd-bx-go .gd-bx-main { min-height: 48px; min-width: 210px; padding: 8px 30px; border: 2px solid var(--bx-ink); border-radius: 9px; background: #ff7eb6; color: #1a3a2a !important; font-weight: 800; font-size: 17px; box-shadow: 3px 3px 0 var(--bx-ink); text-decoration: none; }
.gd-bx-go .gd-bx-main:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--bx-ink); }
.gd-bx-go .gd-bx-main:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--bx-ink); }
.gd-bx-go .gd-bx-main:disabled { opacity: .5; cursor: default; }
.gd-bx .gd-bx-status { min-height: 2.8em; max-width: 54ch; margin: 0; justify-self: center; text-align: center; font-size: 14px; color: var(--ink-dim); }

.gd-bx-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; min-width: 0; border-left: 1px solid var(--line); }
.gd-bx-tabs { display: grid; border-bottom: 2px solid var(--bx-ink); }
.gd-bx-tabs button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 4px 10px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: color-mix(in srgb, var(--ink) 5%, var(--bx-bg)); color: var(--ink-faint); font-weight: 700; font-size: 14.5px; }
.gd-bx-tabs button:last-child { border-right: 0; }
.gd-bx-tabs button[aria-selected="true"] { background: var(--bx-bg); color: var(--ink); box-shadow: inset 0 -4px 0 var(--riso-pink); }
.gd-bx-num { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--ink-faint); color: var(--bx-bg); font-size: 12px; }
.gd-bx-tabs button[aria-selected="true"] .gd-bx-num { background: var(--ink); }
.gd-bx-tabs button[data-done] .gd-bx-num { background: var(--riso-green-deep); }
.gd-bx-tabs button[data-ping] .gd-bx-num { background: var(--riso-pink-deep); animation: gd-bx-ping 1.6s ease-in-out infinite; }
@keyframes gd-bx-ping { 50% { box-shadow: 0 0 0 5px rgba(227, 88, 156, .28); } }
@media (prefers-reduced-motion: reduce) { .gd-bx-tabs button[data-ping] .gd-bx-num { animation: none; } }
.gd-bx-panes { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); }
.gd-bx-pane { min-height: 0; min-width: 0; overflow: auto; padding: 14px 16px 12px; }
.gd-bx-pane[hidden] { display: none; }
.gd-bx-pane p { margin: 0; }

.gd-bx-qn { margin: 0 0 4px !important; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--riso-pink-deep); }
.gd-bx-q { margin: 0 0 10px !important; font-weight: 700; font-size: 16.5px; line-height: 1.3; }
.gd-bx-opts { display: grid; gap: 6px; }
.gd-bx-opt { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 9px; align-items: start; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--bx-bg); text-align: left; font-size: 14px; line-height: 1.35; }
.gd-bx-opt[hidden] { display: none; }
.gd-bx-opt > b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--ink); font-size: 12.5px; }
.gd-bx-opt:hover:not(:disabled) { border-color: var(--ink); }
.gd-bx-opt[aria-pressed="true"] { border-color: var(--ink); background: color-mix(in srgb, var(--riso-yellow) 22%, var(--bx-bg)); box-shadow: 2px 2px 0 var(--ink); }
.gd-bx-opt[aria-pressed="true"] > b { background: var(--ink); color: var(--bx-bg); }
.gd-bx-opt[data-mark="right"] { border-color: var(--riso-green-deep); background: color-mix(in srgb, var(--riso-green) 16%, var(--bx-bg)); }
.gd-bx-opt[data-mark="right"] > b { background: var(--riso-green-deep); border-color: var(--riso-green-deep); color: var(--bx-bg); }
.gd-bx-opt:disabled { cursor: default; color: var(--ink); }
.gd-bx-say { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 5%, var(--bx-bg)); font-size: 14px; }
.gd-bx-say p { margin: 0 0 7px; }
.gd-bx-say p:last-child { margin-bottom: 0; }
.gd-bx-verdict b { font-variant-numeric: tabular-nums; }
/* a settled prediction is long (the pick, the answer, the data, the reason): on a laptop the options
   the reader did not pick, other than the right one, fold to a line. The question and the reader's own
   pick are never cut: they are what the feedback beside them is about, and could not be read again. */
@media (min-width: 980px) {
  .gd-bx:not(.gd-max) .gd-bx-pane:has(.gd-bx-verdict) .gd-bx-opt:not([data-mark="right"], [aria-pressed="true"]) > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
  .gd-bx:not(.gd-max) .gd-bx-verdict { font-size: 13.5px; line-height: 1.42; }
}
/* (some labs' own sheets cut both to one line, shown whole only under a mouse: this holds for every lab) */
.gd-bx [data-bx-pane="predict"] .gd-bx-q, .gd-bx [data-bx-pane="predict"] .gd-bx-opt[aria-pressed="true"] > span { display: block !important; -webkit-line-clamp: none !important; line-clamp: none !important; overflow: visible !important; }
.gd-bx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gd-bx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--bx-bg); font-weight: 650; font-size: 13.5px; }
.gd-bx-chip::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink); }
.gd-bx-chip[data-done] { background: color-mix(in srgb, var(--riso-green) 18%, var(--bx-bg)); }
.gd-bx-chip[data-done]::before { border-color: #1a8a55; background: #1a8a55 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.8 6.3l2.2 2.1 4.2-4.6' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/10px no-repeat; }
.gd-bx-next { display: inline-block; margin-top: 10px; min-height: 40px; padding: 6px 16px; border: 2px solid var(--ink); border-radius: 8px; background: var(--ink); color: var(--bx-bg) !important; font-weight: 700; }
.gd-bx-next:disabled { opacity: .45; cursor: default; }
.gd-bx-next[hidden] { display: none; }
.gd-bx-lock { margin: 0 0 8px !important; font-size: 13.5px; color: var(--ink-faint); }
.gd-bx-pane textarea { display: block; width: 100%; min-height: 96px; margin: 0 0 10px; padding: 9px 11px; border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--bx-bg); color: var(--ink); font: inherit; font-size: 14.5px; resize: vertical; }
.gd-bx-model { margin: 10px 0 0 !important; padding: 10px 12px; border-left: 4px solid var(--riso-green); background: color-mix(in srgb, var(--riso-green) 9%, var(--bx-bg)); font-size: 14px; }

.gd-bx-pane[data-bx-pane="results"] { display: grid; gap: 10px; align-content: start; }
.gd-bx-pane[data-bx-pane="results"][hidden] { display: none; }
.gd-bx-pane[data-bx-pane="results"] > :has(table):not(details) { min-height: 92px; }
.gd-bx-go .gd-bz { display: none; }
.gd-bx-graph { position: relative; min-width: 0; }
.gd-bx-gh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.gd-bx-zoom { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--bx-bg); font-weight: 650; font-size: 12.5px; }
.gd-bx-zoom svg { width: 13px; height: 13px; }
.gd-bx-graph > svg, .gd-bx-graph > canvas { display: block; width: 100%; max-width: none; height: auto; max-height: calc(var(--bx-h) - 350px); border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; }
.gd-bx-gt { display: none; position: absolute; top: 14px; left: 28px; margin: 0; font-weight: 700; font-size: 17px; }
.gd-bx .gd-bx-acts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; }
.gd-bx[data-bx-gmax] .gd-bx-graph { position: absolute; inset: 0; z-index: 10; display: grid; grid-template-rows: minmax(0, 1fr); padding: 52px 28px 20px; background: var(--bx-bg); }
.gd-bx[data-bx-gmax] .gd-bx-graph > :is(svg, canvas) { width: 100%; height: 100%; max-height: none; border: 0; cursor: zoom-out; }
.gd-bx[data-bx-gmax] .gd-bx-gh { position: absolute; top: 10px; right: 16px; margin: 0; }
.gd-bx[data-bx-gmax] .gd-bx-acts { display: none; }
.gd-bx[data-bx-gmax] .gd-bx-zoom { padding: 7px 13px; font-size: 14px; }
.gd-bx[data-bx-gmax] .gd-bx-gt { display: block; }
.gd-bx[data-bx-gmax] :is(.gd-bx-panel, .gd-bx-pane) { position: static; }

.gd-bx-stem { margin: 0 0 8px !important; font-size: 14px; }
.gd-bx-xtw { overflow-x: auto; }
.gd-bx-xt { width: 100%; margin: 0 0 4px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.gd-bx-xt th, .gd-bx-xt td { padding: 4px 6px; border: 1px solid var(--line-strong); text-align: left; vertical-align: top; }
.gd-bx-xt th { background: color-mix(in srgb, var(--ink) 5%, var(--bx-bg)); font-weight: 650; }
.gd-bx-part { margin: 10px 0 5px !important; font-size: 14.5px; }
.gd-bx-part span { color: var(--ink-faint); white-space: nowrap; }
.gd-bx-pane .gd-bx-part + textarea { min-height: 52px; margin-bottom: 6px; }
.gd-bx-ms { margin: 0 0 4px; padding: 8px 10px; list-style: none; border-left: 4px solid var(--riso-green); background: color-mix(in srgb, var(--riso-green) 9%, var(--bx-bg)); font-size: 13.5px; }
.gd-bx-ms[hidden] { display: none; }
.gd-bx-ms label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.gd-bx-score { margin: 10px 0 0 !important; font-size: 14.5px; }

/* full screen: the lab's own switch; the box takes the window under the bar */
.gd-lab.gd-bx.gd-max { position: fixed; inset: 0; z-index: 300; width: auto; max-width: none !important; display: grid; height: 100dvh; --bx-h: calc(100dvh - var(--gd-bar, 50px)); margin: 0 !important; padding: var(--gd-bar, 50px) 0 0; overflow: hidden; border: 0; border-radius: 0; box-shadow: none; background: var(--bx-bg); }
.gd-bx.gd-max .gd-bx-h, .gd-bx.gd-max .gd-bx-b { border-radius: 0; }
.gd-bx.gd-max .gd-bx-tools .gd-max-btn { display: none; }
.gd-bx.gd-max .gd-bx-root { grid-template-columns: 250px minmax(0, 1fr) minmax(400px, 34vw); font-size: 16px; }
.gd-bx.gd-max :is(.gd-bx-opt, .gd-bx-say) { font-size: 15.5px; }
.gd-bx.gd-max .gd-bx-q { font-size: 19px; }
.gd-bx.gd-max .gd-bx-graph > :is(svg, canvas) { max-height: calc(100dvh - 30vh - 250px); }
.gd-bx.gd-max[data-bx-gmax] .gd-bx-graph > :is(svg, canvas) { max-height: none; }

/* a short laptop window */
@media (max-height: 760px) {
  .gd-bx:not(.gd-max) .gd-bx-h { padding-block: 8px 9px; }
  .gd-bx:not(.gd-max) .gd-bx-hook { font-size: 19px; }
  .gd-bx:not(.gd-max) .gd-bx-go .gd-bx-main { min-height: 42px; font-size: 16px; }
  .gd-bx:not(.gd-max) .gd-bx-pane { padding-top: 10px; }
  .gd-bx:not(.gd-max) .gd-bx-opt { padding-block: 6px; font-size: 13.5px; }
  .gd-bx:not(.gd-max) .gd-bx-q { font-size: 15px; margin-bottom: 7px !important; }
  .gd-bx:not(.gd-max) .gd-bx-say { margin-top: 8px; padding: 8px 10px; font-size: 13.5px; }
}
/* narrower than a laptop: the bench first, then what you change, then the panel; the box grows */
@media (max-width: 980px) {
  .gd-lab.gd-bx:not(.gd-max), .gd-lab.gd-bx-wait { height: auto; min-height: 0; }
  .gd-lab.gd-bx.gd-max { overflow: auto; display: block; }
  .gd-bx .gd-bx-root, .gd-bx.gd-max .gd-bx-root { grid-template-columns: minmax(0, 1fr); height: auto; }
  .gd-bx-b { overflow: visible; }
  .gd-bx-stage { order: -1; grid-template-rows: auto auto auto; padding: 10px 8px 12px; }
  .gd-bx-art > svg, .gd-bx-art > canvas { height: auto; }
  .gd-bx-rail { border-right: 0; border-block: 1px solid var(--line); }
  .gd-bx-panel { border-left: 0; border-top: 1px solid var(--line); }
  .gd-bx-pane { overflow: visible; }
  .gd-bx-h { grid-template-columns: minmax(0, 1fr); }
  .gd-bx-tools { grid-column: 1; grid-row: auto; flex-wrap: wrap; }
  .gd-bx-meta { flex-wrap: wrap; white-space: normal; }
  .gd-bx-brief { grid-template-columns: minmax(0, 1fr); left: 0; right: auto; width: min(100%, 92vw); max-height: 70vh; }
  .gd-bx-brief .gd-bx-task { grid-column: auto; }
  .gd-bx-task ul { columns: 1; }
  .gd-bx-graph > svg, .gd-bx-graph > canvas { max-height: none; }
}
@media print { .gd-lab.gd-bx { height: auto; border: 0; box-shadow: none; } }
.gd-bx-lock:empty { display: none; }
.gd-lab.gd-bx .gd-bx-opt:disabled { opacity: 1 !important; cursor: default; }
/* once the model answer shows, the student's draft box gives it room */
@media (max-height: 900px) and (min-width: 981px) {
  .gd-bx:not(.gd-max) .gd-bx-pane:has(.gd-bx-model:not([hidden])) textarea { min-height: 52px; height: 52px; }
  /* the hint has done its work once the model answer shows: an empty draft box no longer scrolls its placeholder */
  .gd-bx:not(.gd-max) .gd-bx-pane:has(.gd-bx-model:not([hidden])) textarea::placeholder { color: transparent; }
}
@media (max-width: 979px) { .gd-bx-status:empty { min-height: 0; } }

/* ── Book layout rules (docs/BOOK-LAYOUT-RULES.md; checked by scripts/check-book-layout.mjs) ──
   One place, for every guide: nothing here is per figure. */
@media (min-width: 861px) {
  /* B1. A pinned figure needs room to travel. With two figures stacked beside the text, the second one
     (the one that pins) sat in a row exactly its own height, so "sticky" had nowhere to go and it
     scrolled away with the text. The last row takes the rest of the chapter. */
  .gd-ch:not(.wide):has(> .gd-fig ~ .gd-fig:not(.gd-scene)) { grid-template-rows: auto 1fr; }
  /* B2. A chapter that has gone full width keeps its text on a reading measure, centred over the
     figure's own band, not hard left with a dead right side. */
  .gd-ch.wide > .gd-ch-text { margin-inline: auto; }
}
/* B3. Words in a figure follow one scale, 15 px, whatever p rule the chapter text has (the chapter's 18 px
   paragraph size had leaked into figure stage lines and readouts), and a figure's own p never takes the
   chapter's paragraph margin. */
.gd-ch .gd-fig p:not([class*="gd-big"]) { font-size: 15px; line-height: 1.5; margin: 0 0 8px; letter-spacing: 0; word-spacing: 0; }
/* B4. Controls in a figure are buttons: a link-styled button row (underlined, bold, at body size) read as
   body text. Any button in a figure's control row gets the site's button, unless it carries its own class
   of look (.gd-opt, .gd-seg, icon buttons). */
.gd-fig .gd-ctl > button:not([class*="gd-opt"]):not(.gd-zoom-btn):not([role="switch"]):not([role="tab"]) {
  min-height: 36px; padding: 6px 14px; border: 1.5px solid var(--ink); border-radius: 4px; background: #fff; color: var(--ink);
  font: 650 14px/1.2 var(--font-display); text-decoration: none; cursor: pointer;
}
.gd-fig .gd-ctl > button:not([class*="gd-opt"]):not(.gd-zoom-btn):not([role="switch"]):not([role="tab"]):hover { background: var(--gd-mint, #e6f5ee); }
.gd-fig .gd-ctl > button[hidden] { display: none; }
/* B5. The Full screen toggle sits in a figure's top right corner: the first line beside it leaves it room. */
.gd-fig > .gd-zoom-btn + :is(p, h4, .gd-fig-t) { padding-right: 46px; }
.gd-fig > .gd-zoom-btn + table > caption { padding-right: 46px; }

/* ── Landscape figures (splitFit in js/guide.js; book rule R1) ──
   A figure too tall for one window beside its text goes full width: its biggest part (.gd-split-stage) on the
   left, at the height the window allows, the rest of it (controls, steps, caption) in a second column. It is a
   flex column that wraps at the height splitFit sets, so no part of the figure is moved in the page. */
@media (min-width: 861px) {
  .gd-ch:not(.wide) > .gd-fig.gd-split-side { display: flex; flex-flow: column nowrap; align-content: center; column-gap: 18px; max-width: none; }
  .gd-ch:not(.wide) > .gd-fig.gd-split-side.gd-split-wrap { flex-flow: column wrap; height: var(--gd-split-fh, auto); }
  .gd-ch:not(.wide) > .gd-fig.gd-split-side.gd-split-wrap > .gd-split-stage { margin-bottom: 4000px; }
  .gd-ch.wide > .gd-fig.gd-split { justify-self: stretch; width: 100%; max-width: none; margin-inline: 0; display: flex; flex-flow: column nowrap; align-content: center; column-gap: 28px; }
  .gd-ch.wide > .gd-fig.gd-split.gd-split-wrap { flex-flow: column wrap; height: var(--gd-split-fh, auto); }
  .gd-fig.gd-split > :not(.gd-zoom-btn):not(.gd-split-stage):not(script):not(style) { flex: none; width: min(var(--gd-split-rw, 460px), 100%); }
  .gd-fig.gd-split > .gd-split-stage { order: -1; width: auto; max-width: 62%; }
  .gd-fig.gd-split > table.gd-split-stage { width: max-content; }
  .gd-fig.gd-split > svg.gd-split-stage { height: var(--gd-split-h); }
  .gd-fig.gd-split table :is(td, th) { padding-top: 3px; padding-bottom: 3px; }
  .gd-fig.gd-split > p { margin-bottom: 6px; }
}
@media (min-width: 861px) {
  /* a figure left in a chapter that went full width for another figure sits centred, at a figure's own measure */
  .gd-ch.wide.gd-widened > .gd-fig:not(.gd-split):not(.gd-scene):not(.gd-el):not(.gd-max) { justify-self: center; width: 100%; max-width: min(100%, 640px); }
}
@media (min-width: 861px) { .gd-fig.gd-split > .gd-split-first { padding-right: 44px; } }
/* the stage's margin is taller than any window, so it stands alone in the first column and the rest wrap to the second */
@media (min-width: 861px) { .gd-ch.wide > .gd-fig.gd-split-wrap > .gd-split-stage { margin-bottom: 4000px; } }
/* a drawing in the second column is kept to under half the figure's height, centred, so the column fits beside the stage */
@media (min-width: 861px) { .gd-fig.gd-split > svg:not(.gd-split-stage) { width: auto; height: auto; max-width: 100%; max-height: calc(var(--gd-split-h, 440px) * .45); margin-inline: auto; } }

.gd-hero-fig > .gd-fig.gd-fit:not(.gd-max) { justify-self: center; width: 100%; margin-inline: auto; }

/* A hero film on a short window: the full-screen nudge gives up its row (the play bar has Full screen). */
.gd-hero-fig > .gd-fig.gd-hero-short > .gd-fs-prompt { display: none; }
.gd-hero-fig:has(> .gd-fig.gd-hero-short) { align-self: start; }
/* A play bar in a narrow side column wraps its step dots under its buttons; a button never gives up its size. */
.gd-pb { flex: none; }
.gd-fig.gd-split-side > .gd-play { flex-wrap: wrap; row-gap: 8px; }
@media (min-width: 861px) { .gd-fig.gd-split-side > .gd-split-first { padding-right: 0; margin-top: 42px; } }

/* An element laid out landscape in its own box (gridFit in js/guide.js): drawing left, its other parts down the right. */
@media (min-width: 861px) {
  /* (a tool whose own box is already a grid with named areas, the neuron's "svg" over "bar", kept those placements:
     its bar stayed in the drawing's column, under or over the drawing, where a press landed on the drawing. The
     landscape grid owns every placement, so the tool's areas, rows and columns are all set aside while it is on.) */
  .gd-lgrid { display: grid !important; grid-template-columns: minmax(0, var(--gd-gcol, 1.45fr)) minmax(250px, 1fr) !important; grid-template-rows: none !important; grid-template-areas: none !important; grid-auto-flow: row !important; column-gap: 24px; row-gap: 0 !important; align-items: start; align-content: start; }
  .gd-lgrid > * { grid-area: auto / 2 / auto / auto !important; min-width: 0; margin-top: 0; margin-bottom: 10px; }
  .gd-lgrid > .gd-lgrid-art { grid-area: 1 / 1 / span 40 / auto !important; margin-bottom: 0; }
  /* a results graph or record table stays under both columns, across the tool (LAND_WIDE in guide.js) */
  .gd-lgrid > .gd-land-wide { grid-area: auto / 1 / auto / -1 !important; margin-top: 12px; }
  /* A tool laid out landscape that is still taller than the window (its words are never shrunk to make it fit: MIN_SCALE
     in js/guide.js) is scrolled: its drawing stays in view under the bars while the column of controls beside it goes by. */
  .gd-tall.gd-lgrid-on:not(.gd-max) .gd-lgrid > .gd-lgrid-art, .gd-tall.gd-land:not(.gd-max) > :is(.gd-el-live, .gd-game-body) > .gd-land-stage:not(.gd-land-in), .gd-tall.gd-land:not(.gd-max) .gd-land-in > .gd-land-art { position: sticky; top: calc(var(--gd-stick, 120px) + 12px); align-self: start; }
}
/* (measured, landCols in js/guide.js, with nothing stuck) */
.gd-measure .gd-lgrid-art, .gd-measure .gd-land-stage, .gd-measure .gd-land-art { position: static !important; }
/* (a landscape tool taller than the window is read from its top: its side column starts at the top too, where centred
   it left a hole beside the tool's first rows) */
@media (min-width: 861px) { .gd-tall.gd-land:not(.gd-max) .gd-land-side { justify-content: flex-start; } }
/* B1, with a heading or note between the two figures: it takes a row of its own, the second figure still the flexible one that stays in view */
@media (min-width: 861px) {
  .gd-ch:not(.wide):has(> .gd-fig + :not(.gd-fig):not(.gd-ch-text) + .gd-fig:not(.gd-scene)) { grid-template-rows: auto auto 1fr; }
  .gd-ch:not(.wide):has(> .gd-fig + :not(.gd-fig):not(.gd-ch-text) + .gd-fig:not(.gd-scene)) > .gd-ch-text { grid-row: 1 / span 3; }
  .gd-ch:not(.wide):has(> .gd-fig + :not(.gd-fig):not(.gd-ch-text) + .gd-fig:not(.gd-scene)) > :not(.gd-ch-text) { grid-column: 2; }
  .gd-ch.flip:not(.wide):has(> .gd-fig + :not(.gd-fig):not(.gd-ch-text) + .gd-fig:not(.gd-scene)) > :not(.gd-ch-text) { grid-column: 1; }
}

/* The distilled view (pilot, js distil()): core points for each statement, the rest in a Go deeper fold. */
.gd-core, .gd-more { display: none; }
.gd-distil .gd-more { display: block; }
.gd-more h4 { margin: 16px 0 6px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--riso-green-deep); }
.gd-more h4:first-child { margin-top: 4px; }
.gd-more h4.w { color: var(--riso-pink-deep); }
.gd-more ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.gd-more li { position: relative; padding-left: 22px; font-size: 17px; line-height: 1.5; letter-spacing: .012em; }
.gd-more li::before { content: ""; position: absolute; left: 2px; top: .78em; width: 10px; height: 2px; background: var(--riso-green-deep); }
.gd-more h4.w + ul li::before { background: var(--riso-pink); }
.gd-more ul + h4 { padding-top: 12px; border-top: 1px solid var(--line, #d7e3da); }
.gd-distil .gd-core { display: grid; gap: 9px; margin: 2px 0 14px; padding: 0; list-style: none; }
.gd-distil .gd-core li { position: relative; padding-left: 26px; font-size: 18.5px; line-height: 1.5; letter-spacing: .012em; }
.gd-distil .gd-core li::before { content: ""; position: absolute; left: 3px; top: .56em; width: 9px; height: 9px; border-radius: 50%; background: var(--riso-green-deep); }
.gd-distil .gd-core li b { font-weight: 700; }
.gd-ch-n { display: inline-block; margin-right: 10px; font-family: var(--font-display); font-size: 22px; letter-spacing: 0; line-height: 1; color: var(--riso-pink-deep); vertical-align: -2px; }
.gd-deeper { margin: 16px 0 0; }
.gd-deeper > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 0; cursor: pointer; list-style: none; border-top: 1.5px solid var(--ink); }
.gd-deeper > summary::-webkit-details-marker { display: none; }
.gd-deeper-k { font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.gd-deeper-t { font-size: 15px; color: var(--ink-dim); }
.gd-deeper-chev { width: 14px; height: 14px; margin-left: auto; align-self: center; color: var(--riso-pink-deep); transition: transform .2s; }
.gd-deeper[open] > summary .gd-deeper-chev { transform: rotate(180deg); }
.gd-deeper > summary:hover .gd-deeper-k, .gd-deeper > summary:focus-visible .gd-deeper-k { text-decoration: underline; text-underline-offset: 4px; }
.gd-deeper-body { padding: 6px 0 4px; }
.gd-deeper-body > p { font-size: 17px; line-height: 1.65; }
.gd-deeper-body > :last-child { margin-bottom: 0; }
.gd-where { margin-left: auto; font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; color: var(--ink-dim); white-space: nowrap; }
.gd-where + .gd-tabs { margin-left: 14px; }
.gd-where-line { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--riso-green-deep); transform: scaleX(0); transform-origin: left; transition: transform .3s ease-out; pointer-events: none; }
button.gd-where { appearance: none; border: 0; background: none; padding: 6px 4px; cursor: pointer; }
button.gd-where:empty { display: none; }
button.gd-where:hover, button.gd-where:focus-visible, button.gd-where[aria-expanded="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.gd-where i { display: none; font-style: normal; }
@media (max-width: 1000px) { .gd-where { margin-left: 0; letter-spacing: 0; } .gd-where span { display: none; } .gd-where i { display: inline; } }
/* The chapter rail: numbers down the left edge of the window, the chapters read filled in, the one being read marked.
   Hover or focus opens the titles. With no margin to stand in, it is a list the chapter count in the bar opens. */
.gd-rail { position: fixed; left: 8px; top: calc(50% + 40px); transform: translateY(-50%); z-index: 19; display: flex; flex-direction: column; max-height: calc(100vh - var(--gd-stick, 120px) - 40px); font-family: var(--font-mono); transition: opacity .25s; }
.gd-rail.off { opacity: 0; pointer-events: none; }
.gd-rail-pct { flex: none; width: 36px; margin: 0 0 4px; text-align: center; font-size: 11px; letter-spacing: .04em; color: var(--ink-dim); }
.gd-rail ol { list-style: none; margin: 0; padding: 4px 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid transparent; border-radius: 10px; }
.gd-rail li { flex: 0 1 24px; min-height: 12px; display: flex; margin: 0; }
.gd-rail a { display: flex; align-items: center; width: 100%; color: var(--ink-dim); text-decoration: none; white-space: nowrap; border-left: 4px solid var(--line-strong); }
.gd-rail a.read { border-left-color: var(--riso-green-deep); }
.gd-rail i { flex: none; width: 32px; text-align: center; font-style: normal; font-size: 12px; line-height: 1; }
.gd-rail a.at { color: var(--ink); border-left-color: var(--riso-pink-deep); }
.gd-rail a.at i { font-weight: 700; font-size: 13px; }
.gd-rail span { display: none; padding-right: 16px; font-family: var(--font-display); font-size: 14px; color: var(--ink); }
.gd-rail span b { margin-left: 6px; padding: 1px 5px; border-radius: 3px; background: var(--riso-pink); font-family: var(--font-mono); font-size: 10px; }
.gd-rail a:hover span, .gd-rail a:focus-visible span { text-decoration: underline; text-underline-offset: 3px; }
.gd-rail:hover ol, .gd-rail:focus-within ol, .gd-rail.open ol { overflow-y: auto; background: var(--paper-white); border-color: var(--ink); box-shadow: 4px 4px 0 var(--line-strong); }
.gd-rail:hover li, .gd-rail:focus-within li, .gd-rail.open li { flex: none; height: 28px; }
.gd-rail:hover span, .gd-rail:focus-within span, .gd-rail.open span { display: inline; }
@media (max-width: 1239px) {
  .gd-rail { display: none; top: calc(var(--gd-stick, 120px) + 6px); transform: none; max-height: calc(100dvh - var(--gd-stick, 120px) - 20px); max-width: calc(100vw - 16px); }
  .gd-rail.open { display: flex; }
  .gd-rail.open span { white-space: normal; }
  .gd-rail.open li { height: auto; min-height: 34px; }
  .gd-rail-pct { width: auto; text-align: left; padding: 2px 8px; background: var(--paper-white); border-radius: 6px; align-self: flex-start; }
}
html.gd-zoomed .gd-rail { display: none; }
@media print { .gd-rail { display: none; } }
@media (min-width: 861px) {
  .gd-distil .gd-ch.gd-cored.wide:not(.gd-widened) { grid-template-columns: minmax(280px, .5fr) minmax(0, 1fr); }
  .gd-distil .gd-ch.gd-cored.wide:not(.gd-widened) > .gd-ch-text { grid-column: 1; grid-row: 1 / span var(--gd-side-n, 1); align-self: start; margin-inline: 0; }
  .gd-distil .gd-ch.gd-cored.wide:not(.gd-widened) > :not(.gd-ch-text) { grid-column: 2; min-width: 0; }
  /* (a film that follows a drawing is set last in its chapter, order 5: what goes under the words comes after it still,
     or the film dropped under the tool and left the column beside the words empty) */
  .gd-distil .gd-ch.gd-cored.wide:not(.gd-widened) > .gd-under { grid-column: 1 / -1; order: 6; }
  .gd-distil .gd-ch.gd-cored.wide:not(.gd-widened) > .gd-ch-text.gd-under { grid-row: auto; margin-inline: auto; }
  /* a small figure a guide floats beside its paragraphs: the slim column has no room to float it, so it takes the column */
  .gd-distil .gd-ch.gd-cored.wide:not(.gd-widened):not(.gd-solo) > .gd-ch-text > figure.gd-fig { float: none; width: auto; margin: 4px 0 18px; }
  .gd-distil .gd-ch.gd-cored.wide.gd-solo, html[data-gd-level="sl"].gd-distil .gd-ch.gd-cored.wide.gd-solo-sl { grid-template-columns: minmax(0, 1fr); }
  .gd-distil .gd-ch.gd-cored.wide.gd-solo > .gd-ch-text, html[data-gd-level="sl"].gd-distil .gd-ch.gd-cored.wide.gd-solo-sl > .gd-ch-text { grid-row: auto; margin-inline: auto; }
  /* no figure to set beside the words: the points keep the left of the spread and the Check (or, with no Check, the
     Remember it tiles) takes the right, so the chapter fills the page's width as every other spread does */
  .gd-distil .gd-ch.gd-cored.gd-solo, html[data-gd-level="sl"].gd-distil .gd-ch.gd-cored.gd-solo-sl { grid-template-columns: minmax(0, 1fr); }
  .gd-distil .gd-ch.gd-cored.gd-solo > *, html[data-gd-level="sl"].gd-distil .gd-ch.gd-cored.gd-solo-sl > * { grid-column: 1 / -1 !important; grid-row: auto !important; }   /* over the flip chapters' own columns, whose rules count their figures */
  .gd-distil .gd-ch.gd-cored.gd-solo > .gd-ch-text:first-of-type:has(> .gd-predict, > .gd-mnem), html[data-gd-level="sl"].gd-distil .gd-ch.gd-cored.gd-solo-sl > .gd-ch-text:first-of-type:has(> .gd-predict, > .gd-mnem) { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); column-gap: 40px; align-content: start; max-width: none !important; width: 100%; margin-inline: 0; }
  .gd-distil .gd-ch.gd-cored:is(.gd-solo, .gd-solo-sl) > .gd-ch-text:first-of-type:has(> .gd-predict, > .gd-mnem) > * { grid-column: 1; min-width: 0; }
  .gd-distil .gd-ch.gd-cored.gd-solo > .gd-ch-text:first-of-type:not(.gd-bal) > .gd-predict, html[data-gd-level="sl"].gd-distil .gd-ch.gd-cored.gd-solo-sl > .gd-ch-text:first-of-type:not(.gd-bal) > .gd-predict,
  .gd-distil .gd-ch.gd-cored.gd-solo > .gd-ch-text:first-of-type:not(.gd-bal):not(:has(> .gd-predict)) > .gd-mnem, html[data-gd-level="sl"].gd-distil .gd-ch.gd-cored.gd-solo-sl > .gd-ch-text:first-of-type:not(.gd-bal):not(:has(> .gd-predict)) > .gd-mnem { grid-column: 2; grid-row: 1 / span 12; align-self: start; margin-top: 0; }
  /* (max-width is important: a few guides cap one chapter's words by its id, at 760 px, for the single column they
     were written in; in two columns that left the right third of the page blank) */
  /* a second Check in such a chapter stays under the points on the left: both in the right column sat one over the other */
  .gd-distil .gd-ch.gd-cored:is(.gd-solo, .gd-solo-sl, .gd-widened) > .gd-ch-text:first-of-type:not(.gd-bal) > .gd-predict ~ .gd-predict { grid-column: 1; grid-row: auto; margin-top: 18px; }
  /* the same where the words stand above a figure that takes the page's width (gd-widened): in one column down the
     middle they left a blank third either side, so the points keep the left and the Check the right there too */
  .gd-distil .gd-ch.gd-cored.wide.gd-widened > .gd-ch-text:first-of-type:has(> .gd-predict, > .gd-mnem) { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); column-gap: 40px; align-content: start; max-width: none !important; width: 100%; margin-inline: 0; }
  .gd-distil .gd-ch.gd-cored.wide.gd-widened > .gd-ch-text:first-of-type:has(> .gd-predict, > .gd-mnem) > * { grid-column: 1; min-width: 0; }
  .gd-distil .gd-ch.gd-cored.wide.gd-widened > .gd-ch-text:first-of-type:not(.gd-bal) > .gd-predict:not(.gd-predict ~ .gd-predict),
  .gd-distil .gd-ch.gd-cored.wide.gd-widened > .gd-ch-text:first-of-type:not(.gd-bal):not(:has(> .gd-predict)) > .gd-mnem { grid-column: 2; grid-row: 1 / span 12; align-self: start; margin-top: 0; }
  /* Once the pieces are measured (textCols in js/guide.js marks the words gd-bal) the right column holds whatever
     leaves the two columns nearest the same length: the first Check always, and a second Check or the tiles under it
     where the points beside them would otherwise run on down a page with a blank strip at their side. Each piece on
     the right (gd-r) spans every row and is set down by the height of the ones above it (--gd-rt), so the columns
     run independently; the last row is the flexible one, so a long right column never opens gaps between the points */
  .gd-distil .gd-ch.gd-cored:is(.gd-solo, .gd-solo-sl, .gd-widened) > .gd-ch-text:first-of-type.gd-bal { grid-template-rows: repeat(11, auto) 1fr; }
  .gd-distil .gd-ch.gd-cored:is(.gd-solo, .gd-solo-sl, .gd-widened) > .gd-ch-text:first-of-type.gd-bal > .gd-r { grid-column: 2; grid-row: 1 / span 12; align-self: start; margin-top: var(--gd-rt, 0px); }
  /* a piece of the guide's own (a table, model answers) set across both columns, under them (its row is set by textCols) */
  .gd-distil .gd-ch.gd-cored:is(.gd-solo, .gd-solo-sl, .gd-widened) > .gd-ch-text:first-of-type.gd-bal > .gd-w { grid-column: 1 / -1; margin-top: 18px; max-width: none; }
  /* a Check whose options would run past four lines each in the thinner strip: the two columns are set even */
  .gd-distil .gd-ch.gd-cored:is(.gd-solo, .gd-solo-sl, .gd-widened) > .gd-ch-text:first-of-type.gd-bal.gd-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* a film too wide for its column takes the whole row: the core points still open the chapter */
  .gd-distil .gd-ch.gd-cored.flip.gd-widened > .gd-fig { order: 0; }
}
@media (max-width: 860px) {
  .gd-distil .gd-ch > .gd-ch-text > .gd-core { order: 1; }
  .gd-distil .gd-core li { font-size: 17.5px; }
}
@media print { .gd-where, .gd-where-line { display: none; } }
/* the cover: the film wide across the first screen with the title over it, then it settles (js cover()) */
.gd-hero.gd-cover { display: block; position: relative; overflow: hidden; }
.gd-hero.gd-cover .gd-hero-text { display: none; }
.gd-hero.gd-cover .gd-hero-fig { position: absolute; inset: 0; }
.gd-hero.gd-cover .gd-hero-fig > .gd-fig { width: 100% !important; max-width: none !important; zoom: 1 !important; margin: 0; padding: 0; border: 0; background: none; }
.gd-hero.gd-cover .gd-hero-fig > .gd-fig > :not(.gd-scene-stage):not(.gd-cover-stage) { display: none !important; }
.gd-hero.gd-cover .gd-scene-stage { border: 0; border-radius: 0; }
.gd-hero.gd-cover .gd-hero-fig > .gd-fig { height: 100%; }
.gd-hero.gd-cover .gd-cover-stage { display: block; width: 100%; height: 100%; max-width: none; max-height: none; }
.gd-hero.gd-cover-out { position: relative; overflow: hidden; transition: height 1.1s cubic-bezier(.6, 0, .2, 1); }
.gd-hero.gd-cover-out .gd-hero-fig { position: relative; z-index: 2; transition: transform 1.1s cubic-bezier(.6, 0, .2, 1); will-change: transform; }
.gd-hero.gd-cover-out .gd-hero-text, .gd-hero.gd-cover-out .gd-hero-fig > .gd-fig > :not(.gd-scene-stage):not(.gd-cover-stage) { opacity: 0; }
.gd-hero.gd-cover-go .gd-hero-text, .gd-hero.gd-cover-go .gd-hero-fig > .gd-fig > :not(.gd-scene-stage):not(.gd-cover-stage) { opacity: 1; transition: opacity .6s .55s; }
.gd-cover-title { position: absolute; z-index: 3; left: 0; bottom: 0; display: grid; gap: 8px; max-width: min(760px, 70%); padding: 18px 26px 20px 0; background: var(--paper, #fff); animation: gd-cover-in .7s .15s both cubic-bezier(.2, .7, .2, 1); pointer-events: none; }
.gd-cover-title span { font-family: var(--font-mono); font-size: 13px; letter-spacing: .12em; color: var(--ink-dim); }
.gd-cover-title b { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 4.6vw, 62px); line-height: 1.02; letter-spacing: -.015em; }
.gd-cover-title b em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--riso-pink-deep); }
.gd-cover-out .gd-cover-title { opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s; }
@keyframes gd-cover-in { from { opacity: 0; transform: translateY(18px); } }

/* ── The phone ──────────────────────────────────────────────── */
/* P1. A drawing whose words would be under R3 on a phone is shown at the size that passes (js panPage): either it
   takes the figure's padding (gd-pan-bleed, inline widths only) or it sits in a frame that scrolls sideways. The
   frame runs to the figure's edges; a shadow marks each edge with more beyond it, and the line under it says so. */
.gd-pan { position: relative; }
.gd-pan-in { display: flex; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none; }
.gd-pan-in::-webkit-scrollbar { display: none; }
.gd-pan-in:focus-visible { outline: 2.5px solid #e3589c; outline-offset: -3px; }
.gd-pan-in > svg, .gd-pan-in > .gd-svg { display: block; flex: none; height: auto; overflow: visible; }
.gd-pan::before, .gd-pan::after { content: ""; position: absolute; top: 0; bottom: 29px; z-index: 1; width: 18px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.gd-pan::before { left: 0; background: linear-gradient(90deg, rgba(26, 58, 42, .3), rgba(26, 58, 42, 0)); }
.gd-pan::after { right: 0; background: linear-gradient(270deg, rgba(26, 58, 42, .3), rgba(26, 58, 42, 0)); }
.gd-pan.gd-pan-l::before, .gd-pan.gd-pan-r::after { opacity: 1; }
.gd-pan-tag { display: flex; align-items: center; justify-content: flex-end; gap: 7px; height: 24px; margin-top: 5px; padding: 0 12px; font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #1a8a55; }
.gd-fig .gd-pan-tag svg { flex: none; width: 24px !important; height: 12px !important; max-width: none; margin: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gd-pan:not(.gd-pan-used) .gd-pan-tag svg { animation: gd-pan-nudge 1.6s ease-in-out 3; }
.gd-pan.gd-pan-used .gd-pan-tag { color: #5d7568; }
@keyframes gd-pan-nudge { 0%, 100% { transform: none; } 40% { transform: translateX(-6px); } 70% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .gd-pan-tag svg { animation: none !important; } }
@media print {
  .gd-pan { margin: 0 !important; } .gd-pan::before, .gd-pan::after, .gd-pan-tag { display: none; }
  .gd-pan-in { display: block; overflow: visible; padding: 0 !important; }
  .gd-pan-in > svg, .gd-fig svg.gd-pan-bleed { width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; }
}
/* P6. A Full screen switch that would sit on a word of the drawing, or on the line under it, takes a row (js swRoom). */
@media (max-width: 860px) {
  .gd-fig.gd-sw-row > .gd-zoom-btn { position: relative; top: auto; right: auto; margin: -8px -8px 0 auto; }
  .gd-fig.gd-sw-row > .gd-zoom-btn + :is(p, h4, .gd-fig-t) { padding-right: 0; }
}
/* P2. Display lives in the guide bar on a phone (js displayBtn): its icon, at the bar's right end, a full 40 px to
   tap. The site's floating button is gone until Display is pressed, when its sheet opens as before. */
@media (min-width: 761px) { .gd-displaylink.gd-display-ph { display: none; } }
@media (max-width: 760px) {
  html.gd-has-display-ph .a11y-controls.a11y-min { display: none !important; }
  .gd-bar .gd-displaylink { display: inline-flex; order: 9; flex: none; justify-content: center; width: 40px; height: 40px; margin: 0; padding: 0; }
  .gd-bar .gd-displaylink svg { width: 21px; height: 21px; }
  .gd-bar .gd-displaylink span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* P3. A lab or game placed in a chapter: its title on a line of its own, then Show me how, Copy link and Full screen
   in one row under it (they had squeezed the title to a word a line and pushed Full screen off the screen). */
@media (max-width: 600px) {
  .gd-game-h { flex-wrap: wrap; justify-content: flex-start; gap: 0 12px; }
  .gd-game-h > p { flex: 1 1 100%; min-width: 0; }
  .gd-game-h > :is(.gd-tour-btn, .gd-share-btn, .gd-max-btn) { margin-left: 0 !important; white-space: nowrap; }
}
/* (Show me how and Copy link were 21 px tall to a finger: a full 44 px, like the switch beside them) */
@media (pointer: coarse) { .gd-tour-btn, .gd-share-btn { min-height: 44px; } }
/* P4. A film's tag (its scene, or a live count) had been cut with an ellipsis beside the title: on a phone it takes
   the line under the title, whole. A stepped figure's dots give way before its step count leaves the frame. */
@media (max-width: 600px) {
  .gd-scene-h { flex-wrap: wrap; row-gap: 0; }
  .gd-scene-h > span { flex: 1 1 100%; }
  .gd-scene-h b { flex: 1 1 100%; text-align: left; white-space: normal; overflow: visible; text-overflow: clip; }
  .gd-play { flex-wrap: wrap; row-gap: 2px; }
  .gd-play .gd-dots { flex: 1 1 40px; min-width: 0; }
  .gd-play .gd-dot { flex: 1 1 24px; width: auto; min-width: 9px; max-width: 24px; }
}
/* P5. Nothing runs past the phone's edge. A drawing with parts outside its own viewBox (A2.2's hypha) is cut at its
   figure's edge, not left to run off the page; mnemonic tiles go three to a row, so a long word stays on its tile. */
@media (max-width: 860px) {
  .gd-ch > .gd-fig:not(.gd-max), .gd-ch-scene > .gd-fig:not(.gd-max) { overflow-x: clip; }
  /* a film or lab placed inside a chapter (not between two) had no place in the phone's one column, so it came
     straight under the heading, pulled 18 px up into it (C2.2's conduction lab): it follows the text, like a second figure */
  .gd-ch > .gd-ch-scene { order: 4; margin: 6px 0 16px; }
}
/* P7. A stepped figure's captions are of different lengths, so the figure grew and shrank a line or two as its steps
   played, and the page under it with them (Safari on an iPhone does not hold a reader's place when that happens above
   them). The captions are stacked in one cell, so the figure keeps the height of its longest from the start. */
@media screen and (max-width: 860px) {
  .gd-anim > .gd-cap { display: grid; }
  .gd-anim > .gd-cap > li { display: block; grid-area: 1 / 1; min-width: 0; visibility: hidden; }
  .gd-anim > .gd-cap > li.on { visibility: visible; }
}
/* P8. A stepped drawing on a phone is cut to the band its step has drawn (js cropStep); the cut glides. */
.gd-fig svg.gd-crop { transition: margin-top .35s ease, margin-bottom .35s ease, clip-path .35s ease; }
.gd-calm .gd-fig svg.gd-crop { transition: none; }
@media (prefers-reduced-motion: reduce) { .gd-fig svg.gd-crop { transition: none; } }
@media print { .gd-fig svg.gd-crop { margin-top: 0 !important; margin-bottom: 0 !important; clip-path: none !important; } .gd-fig.gd-cropped { min-height: 0 !important; } }
/* P9. A small button or link in a figure, lab or game, under a finger: 40 px to tap, its look and its row as they were (js taps). */
.gd-tap { position: relative; }
.gd-tap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 40px; min-width: 40px; transform: translateY(-50%); }
@media (max-width: 480px) { .gd-mnem-tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 96px), 1fr)); } }
/* (a film's position bar was a 64 px stub between the buttons on a phone: it takes the row above them) */
@media (max-width: 480px) {
  .gd-scene-ctl { flex-wrap: wrap; row-gap: 0; }
  .gd-scene-ctl > .gd-scene-prog:not([hidden]) { order: -1; flex: 1 1 100%; }
  .gd-scene-ctl > .gd-scene-prog:not([hidden]) + * { margin-left: auto; }
}

/* ── Full screen ────────────────────────────────────────────── */
/* F3. On a phone the way out of full screen was a switch with no word on it: it says Close. */
.gd-max-x { display: none; }
@media (max-width: 600px) {
  .gd-max-bar .gd-max-btn > .gd-max-x, .gd-zoom-top .gd-max-btn > .gd-max-x { display: inline; font-size: 15px; font-weight: 700; }
  .gd-zoom-top .gd-max-btn > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gd-zoom-top { justify-content: flex-end; }
  .gd-zoom-top .gd-max-btn, .gd-max-bar .gd-max-btn { padding: 0 4px 0 10px; border: 1.5px solid currentColor; border-radius: 6px; }
}
/* (the bar's Show me how and Copy link wrapped to three lines beside Close on a phone: their icons, the words for a screen reader) */
@media (max-width: 600px) {
  .gd-max-bar .gd-tour-btn span, .gd-max-bar .gd-share-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gd-max-bar .gd-tour-btn, .gd-max-bar .gd-share-btn { min-width: 40px; justify-content: center; }
}
/* a figure taller than the phone's screen starts at its top in the viewer (centred, its top could not be reached) */
.gd-zoom.gd-zoom-long .gd-zoom-body { place-items: start center; }
/* (the hero film's "Watch it full screen" nudge has done its job once the film is full screen) */
.gd-scene.gd-max > .gd-fs-prompt { display: none; }

/* A landscape tool taller than the window: its column of controls is cut to the room and the rest folds behind one
   button (foldOn in js/guide.js). Full screen and the open fold show it all. */
.gd-folded:not(.gd-max, .gd-unfolded) .gd-fold { max-height: var(--gd-fold-h); overflow: hidden; position: relative; align-self: start !important; justify-content: flex-start !important; }
.gd-fold-btn { font: inherit; font-weight: 600; font-size: 14px; color: inherit; background: var(--gd-fold-bg, #fff); border: 1.5px solid currentColor; border-radius: 8px; padding: 9px 14px; min-height: 40px; cursor: pointer; margin-top: 8px; }
.gd-folded:not(.gd-max, .gd-unfolded) .gd-fold > .gd-fold-btn { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; margin: 0; box-shadow: 0 -14px 14px 4px var(--gd-fold-bg, #fff); }
.gd-lgrid.gd-fold > .gd-fold-btn { grid-column: 2 !important; }
/* (cut, the grid is a scroll box, so its drawing must not stick inside it: it slid down by the height of the bars.
   And the button, out of the flow, is placed against the whole grid, not against the column of controls.) */
.gd-folded:not(.gd-max, .gd-unfolded) .gd-lgrid.gd-fold > .gd-lgrid-art { position: relative !important; top: auto !important; }
.gd-folded:not(.gd-max, .gd-unfolded) .gd-lgrid.gd-fold > .gd-fold-btn { grid-area: auto / 1 / auto / -1 !important; }
.gd-max .gd-fold-btn { display: none; }
@media print { .gd-fold { max-height: none !important; overflow: visible !important; } .gd-fold-btn { display: none; } }

/* A lab's results fold holds a table that can be wider than the pane: the fold keeps to the pane's width and the
   table scrolls sideways inside it, so the graph and the buttons beside it are never pushed out or cut. */
.gd-bx-fold { min-width: 0; max-width: 100%; }
.gd-bx-fold[open] > :not(summary) { max-width: 100%; overflow-x: auto; }
[data-bx-pane] > * { min-width: 0; }

/* Teacher pass: lesson 2 onward's plans and slides (lib/premium.mjs) */
.gd-lock { display: inline-block; vertical-align: -1px; margin-right: 5px; color: var(--riso-pink-deep); }
.gd-pass-note { margin: 0 0 10px; font-size: 14.5px; color: var(--ink-dim); }
.gd-pass-note a { color: var(--ink); font-weight: 650; text-underline-offset: 3px; }

/* links to the neighbouring guides */
.gd-nextguides h2 { font-size: 20px; margin: 0 0 12px; }
.gd-nextguides div { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.gd-nextguides a { display: block; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 10px; color: var(--ink); font-weight: 600; text-decoration: none; }
.gd-nextguides a:hover { border-color: var(--ink); }
.gd-nextguides small { display: block; margin-bottom: 2px; color: var(--ink-dim); font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
@media print { .gd-nextguides { display: none; } }

/* Hub: a compact head, a small course switch top right and a one-time chooser. The other course is hidden with CSS only, so both stay in the page for crawlers. */
.gd-hub-h { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 16px; margin: 6px 0 6px; }
.gd-hub-h .gd-eyebrow { grid-column: 1 / -1; }
.gd-hub-h h1 { margin: 2px 0 0; }
.gd-cx { grid-column: 2; grid-row: 2; display: flex; align-items: baseline; gap: 14px; padding-bottom: 6px; font: 700 15px/1 var(--font-mono); }
.gd-cx small { font: 600 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.gd-cx button { all: unset; cursor: pointer; padding: 4px 0 5px; border-bottom: 3px solid transparent; color: var(--ink-dim); }
.gd-cx button:hover { color: var(--ink); }
.gd-cx button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.gd-cx button[aria-pressed="true"] { color: var(--ink); border-color: var(--bk); }
.gd-cx button[data-c="ib"], .gd-cx-links a[data-c="ib"], .gd-cx-two button[data-c="ib"] { --bk: var(--riso-pink-deep); }
.gd-cx button[data-c="ap"], .gd-cx-links a[data-c="ap"], .gd-cx-two button[data-c="ap"] { --bk: var(--riso-green-deep); }
.gd-cx .gd-cx-all { font-weight: 600; font-size: 13px; color: var(--ink-faint); text-decoration: underline; text-underline-offset: 3px; }
html[data-course="ib"] #ap, html[data-course="ap"] #ib { display: none; }
html[data-course] .gd-pt-c > h2, html[data-course] .gd-pt-c > .gd-pt-key { display: none; }
html[data-course="ib"] .gd-cx-links a[data-c="ap"], html[data-course="ap"] .gd-cx-links a[data-c="ib"] { display: none; }
.gd-cx-rev { margin: 28px 0 30px; padding: 18px 20px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper-white); box-shadow: 5px 5px 0 var(--ink); display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.gd-cx-rev h2 { margin: 0 0 4px; font: 800 clamp(20px, 4vw, 26px)/1.1 var(--font-display); }
.gd-cx-rev p { margin: 0; max-width: 52ch; font-size: 15px; color: var(--ink-dim); }
.gd-cx-links { display: flex; flex-wrap: wrap; gap: 10px; }
.gd-cx-links a { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 190px; min-height: 92px; padding: 12px 14px 12px 34px; border: 2px solid var(--ink); border-radius: 3px 10px 10px 3px; background: var(--paper-white); color: var(--ink); font: 700 15px/1.2 var(--font-mono); text-decoration: none; box-shadow: 4px 4px 0 var(--ink); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.gd-cx-links a::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 20px; border-right: 2px solid var(--ink); background: var(--bk); }
.gd-cx-links a[data-c="ib"] { --bk: var(--riso-pink); }
.gd-cx-links a[data-c="ap"] { --bk: var(--riso-green); }
.gd-cx-links a[data-c]:hover { background: var(--bk); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.gd-cx-links a small { font: 600 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }
.gd-cx-links a b { font: 800 20px/1.05 var(--font-display); }
.gd-cx-links .gd-cx-sims { min-height: 0; min-width: 0; align-self: flex-end; padding: 8px 12px; border-width: 0 0 2px; border-radius: 0; background: none; box-shadow: none; }
.gd-cx-links .gd-cx-sims::before { display: none; }
.gd-cx-ov { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(26, 58, 42, .45); }
html:not([data-course]):not([data-skip]) .gd-cx-ov { display: flex; }
.gd-cx-card { width: min(560px, 100%); padding: 22px 22px 16px; border: 2px solid var(--ink); border-radius: 16px; background: var(--paper); box-shadow: 6px 6px 0 var(--ink); }
.gd-cx-card h2 { margin: 0 0 6px; font: 800 clamp(24px, 5vw, 32px)/1.05 var(--font-display); }
.gd-cx-card p { margin: 0 0 16px; font-size: 15px; color: var(--ink-dim); }
.gd-cx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gd-cx-two button { all: unset; box-sizing: border-box; cursor: pointer; position: relative; min-height: 104px; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; padding: 12px 12px 12px 30px; border: 2px solid var(--ink); border-radius: 3px 10px 10px 3px; background: var(--paper-white); box-shadow: 5px 5px 0 var(--ink); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.gd-cx-two button::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 18px; border-right: 2px solid var(--ink); background: var(--bs); }
.gd-cx-two button[data-c="ib"] { --bs: var(--riso-pink); }
.gd-cx-two button[data-c="ap"] { --bs: var(--riso-green); }
.gd-cx-two button:hover { background: var(--bs); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.gd-cx-two button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.gd-cx-two b { font: 800 clamp(22px, 5vw, 28px)/1 var(--font-display); }
.gd-cx-two span { font: 600 13px/1.3 var(--font-mono); color: var(--ink-dim); }
.gd-cx-skip { all: unset; cursor: pointer; display: block; margin: 14px auto 0; font-size: 14px; color: var(--ink-dim); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) { .gd-hub-h .gd-eyebrow { display: none; } .gd-hub-h { grid-template-columns: 1fr; } .gd-cx { grid-column: 1; grid-row: auto; margin-top: 4px; } .gd-cx-two { gap: 10px; } .gd-cx-two button { padding-left: 26px; } }
@media print { .gd-cx, .gd-cx-ov { display: none !important; } }

/* the guide's body waits out a tab jump (js anchors(): gd-jump), so the page never swells and shrinks on the way */
@media screen { html.gd-jump .gd-page > :not(.gd-bar) { visibility: hidden; } }

/* /css/search.css */
/* ── Search overlay (Cmd/Ctrl+K) ───────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 5vw 5vh;
}
.search-overlay.is-open { display: flex; }
body.search-open { overflow: hidden; }

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 58, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.search-modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--riso-pink), 0 24px 56px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: search-in 0.18s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes search-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .search-modal { animation: none; }
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.search-glyph {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--ink-faint);
  width: 22px;
  text-align: center;
}
.search-input {
  flex: 1;
  font-family: var(--font-display);
  font-size: 19px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  padding: 4px 0;
}
.search-input::placeholder { color: var(--ink-faint); }
.search-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}
kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink-dim);
  margin: 0 2px;
}

.search-results {
  max-height: 56vh;
  overflow-y: auto;
  padding: 8px 8px 10px;
}
.search-result {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 4px 14px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s;
  cursor: pointer;
}
.search-result.is-selected {
  background: rgba(255, 126, 182, 0.14);
  outline: 1.5px solid var(--riso-pink-deep);
}
.search-kind {
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--riso-pink-deep);
  text-align: left;
}
.search-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}
.search-desc {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.4;
}
.search-empty {
  padding: 30px 14px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.search-foot {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  background: var(--paper);
}

/* Tiny "/" hint in the topbar -- subtle visible cue that search exists */
.search-hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  margin-left: auto;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.search-hint-pill:hover {
  color: var(--ink);
  border-color: var(--ink);
}
@media (max-width: 760px) {
  .search-hint-pill { display: none; }
}

@media (max-width: 540px) {
  .search-overlay { padding: 6vh 4vw; }
  .search-result { grid-template-columns: 56px 1fr; }
  .search-foot { gap: 14px; font-size: 12px; }
}

/* /css/theme.css */
/* ============================================================
   theme.css: four independent display axes, all opt-in.
   Loaded site-wide via each page's head + js/theme.js.

   Axis 1  data-theme="dark"        light  <->  dark
   Axis 2  data-palette="accessible" riso  <->  high-contrast, colourblind-safe
   Axis 3  data-textsize="lg|xl"     everything a size up, or two
   Axis 4  data-font="reading"       a face built to be unambiguous, with air

   Everything is driven by redefining the ~12 core tokens from
   base.css. Because the site's chrome and components read those tokens
   (var(--ink), var(--paper), var(--riso-pink)…), overriding them here
   restyles the whole page with no per-component work.

   The default (no attributes) stays the riso brand exactly as it was.
   ============================================================ */

/* ── DARK · riso identity, dark ground ─────────────────────── */
:root[data-theme="dark"] {
  --paper:            #14201b;
  --on-brand:         #14201b;   /* brand fills are light here, so dark text */
  --paper-white:      #1b2a24;
  --ink:              #e9f1ea;
  --ink-dim:          #b1c3b8;
  --ink-faint:        #7d8f85;

  --riso-pink:        #ff9ec4;
  --riso-pink-deep:   #ffb3d1;   /* emphasis reads *lighter* on dark */
  --riso-green:       #46d99f;
  --riso-green-deep:  #6fe6b8;
  --riso-coral:       #ff9e80;
  --riso-yellow:      #f2cf5c;

  --line:             rgba(233, 241, 234, 0.18);
  --line-strong:      rgba(233, 241, 234, 0.34);
}

/* ── ACCESSIBLE · light ────────────────────────────────────
   High contrast (near-black ink on white, AA+), and the pink/green
   pairing, the red-green colourblind trap, is replaced by
   blue/orange, which stays distinguishable in every common colour-
   vision deficiency. Hue never carries meaning alone on this site
   (labels, borders and shape do too), which is what makes the swap
   safe rather than merely different. */
:root[data-palette="accessible"] {
  --paper:            #ffffff;
  --on-brand:         #ffffff;   /* accessible fills are deep, so light text */
  --paper-white:      #ffffff;
  --ink:              #111418;
  --ink-dim:          #3d444d;   /* AA on white */
  --ink-faint:        #5a626c;   /* lifted from the faint riso tone */

  --riso-pink:        #c2410c;   /* orange, was pink */
  --riso-pink-deep:   #9a3412;
  --riso-green:       #1d63c9;   /* blue, was green */
  --riso-green-deep:  #174ea6;
  --riso-coral:       #b45309;   /* amber-brown, third distinct hue */
  --riso-yellow:      #a16207;   /* darkened so it holds on white */

  --line:             rgba(17, 20, 24, 0.30);
  --line-strong:      rgba(17, 20, 24, 0.52);
}

/* ── ACCESSIBLE · dark ─────────────────────────────────────
   Same blue/orange logic, brightened to hold contrast on a near-black
   neutral ground. */
:root[data-theme="dark"][data-palette="accessible"] {
  --paper:            #0c0e12;
  --on-brand:         #0c0e12;   /* fills lighten again on dark */
  --paper-white:      #15181e;
  --ink:              #f4f6f9;
  --ink-dim:          #c3ccd6;
  --ink-faint:        #98a2ae;

  --riso-pink:        #ff9e5c;   /* orange */
  --riso-pink-deep:   #ffb784;
  --riso-green:       #6ba6f5;   /* blue */
  --riso-green-deep:  #9cc4fb;
  --riso-coral:       #f0a35e;
  --riso-yellow:      #e2c14e;

  --line:             rgba(244, 246, 249, 0.22);
  --line-strong:      rgba(244, 246, 249, 0.40);
}

/* Smooth the switch, but never fight reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  body { transition: background-color 0.18s ease, color 0.18s ease; }
}

/* ============================================================
   The control. A small fixed panel, bottom-right, legible in all four
   modes because it too is built from tokens.
   ============================================================ */
.a11y-controls {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--riso-green);
}
.a11y-tab { display: none; border: 0; background: none; color: var(--ink); cursor: pointer; padding: 2px; line-height: 0; }
.a11y-tab svg { width: 18px; height: 18px; }
/* The closed button says what it is: a bare half-moon was missed by readers who came looking for text size. */
.a11y-tab-lbl { display: none; font-family: var(--font-body, inherit); font-size: 14px; font-weight: 700; color: var(--ink); }
.a11y-controls.a11y-min .a11y-tab { display: inline-flex; align-items: center; gap: 7px; }
.a11y-controls.a11y-min .a11y-tab-lbl { display: inline; }
.a11y-controls.a11y-min { border-radius: 999px; padding: 9px 14px; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.a11y-hide { border: 0; background: none; color: var(--ink-faint); cursor: pointer; padding: 0 2px 2px; line-height: 0; }
.a11y-hide:hover { color: var(--ink); }
@media (pointer: coarse) {
  .a11y-hide { min-width: 26px; min-height: 26px; padding: 6px; line-height: 0; }
}
.a11y-hide svg { width: 12px; height: 12px; }
.a11y-controls.a11y-min .a11y-head,
.a11y-controls.a11y-min .a11y-btn,
.a11y-controls.a11y-min .a11y-rule,
.a11y-controls.a11y-min .a11y-seg-lbl,
.a11y-controls.a11y-min .a11y-seg,
.a11y-controls.a11y-min .a11y-lang-sel { display: none; }

.a11y-controls-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 2px 2px;
}
.a11y-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.a11y-btn:hover { border-color: var(--ink); }
.a11y-btn svg { width: 15px; height: 15px; flex: none; }
.a11y-btn .on-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  margin-left: auto;
}
/* Pressed = this mode is active. */
.a11y-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-white);
  border-color: var(--ink);
}
.a11y-btn[aria-pressed="true"] .on-dot { background: var(--riso-green); border-color: var(--paper-white); }
.a11y-btn:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }

/* Text size: three stops, not a slider; a slider invites fiddling, three
   stops is a decision. The letters are drawn at the sizes they stand for. */
.a11y-rule { border: 0; border-top: 1px dashed var(--line-strong); margin: 8px 2px 7px; }
.a11y-seg-lbl {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); padding: 0 2px 4px;
}
.a11y-seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.a11y-size {
  border: 0; border-right: 1.5px solid var(--line-strong);
  background: var(--paper); color: var(--ink);
  font-family: var(--font-display); font-weight: 700; line-height: 1;
  padding: 7px 0 8px; cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.a11y-size { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.a11y-size-w { font-family: var(--font-body, inherit); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.a11y-size:last-child { border-right: 0; }
.a11y-size:hover { background: var(--paper-white); }
.a11y-size[aria-checked="true"] { background: var(--ink); color: var(--paper-white); }
.a11y-size:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: -3px; }
/* Language is a dropdown: one row however many languages there are. */
.a11y-seg-lbl[for] { display: block; }
.a11y-lang-sel {
  display: block; width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-body, inherit); font-size: 14px;
  padding: 6px 12px; cursor: pointer;
}
.a11y-lang-sel:hover { background: var(--paper-white); }
.a11y-lang-sel:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }

/* The moon shows in light, the sun in dark: mirrors the games' toggle. */
.a11y-btn .icon-sun { display: none; }
:root[data-theme="dark"] .a11y-btn .icon-sun { display: block; }
:root[data-theme="dark"] .a11y-btn .icon-moon { display: none; }

@media (max-width: 560px) {
  /* A phone gets the whole panel, as a sheet along the bottom: labels, text
     size and language included. A student who needs bigger text is the
     student on a phone, so none of it is left to a wider screen. The small
     round button (a11y-min) still keeps it out of the page until pressed. */
  .a11y-controls { right: 10px; bottom: 10px; padding: 8px; }
  .a11y-controls:not(.a11y-min) { left: 10px; max-height: 80vh; overflow-y: auto; padding: 14px; gap: 10px; }
  .a11y-controls:not(.a11y-min) .a11y-btn { padding: 12px 14px; font-size: 14px; }
  .a11y-controls:not(.a11y-min) .a11y-size { padding: 12px 0; }
  .a11y-controls:not(.a11y-min) .a11y-lang-sel { padding: 11px 12px; font-size: 16px; }
  .a11y-controls.a11y-min { min-height: 44px; display: inline-flex; align-items: center; }
  .a11y-controls.a11y-min .a11y-tab { min-height: 44px; }
}

/* Cosmetic leak handling: the lesson-card icons are external two-tone
   (green/pink) SVG images, so page tokens can't reach inside them. In
   the accessible palette that green/pink clashes with the blue/orange
   scheme, so neutralise them to a quiet monochrome - decorative only,
   no meaning is carried by their colour. */
:root[data-palette="accessible"] .lesson-card-icon { filter: grayscale(1) contrast(0.95); }

/* Flat type in the accessible palette. The riso "misregistration" offset
   (a coloured text-shadow ghost behind headings) is a brand flourish, but
   it doubles the letterforms and lowers legibility - the opposite of what
   a high-contrast mode is for. Strip it so accessible type is crisp. */
:root[data-palette="accessible"] * { text-shadow: none !important; }
:root[data-palette="accessible"] main::after { opacity: 0 !important; }


/* ── TEXT SIZE · scale the surface, don't stretch the type ──
   The exam maker is drawn in fixed pixels, so growing only the words would
   burst its buttons and squeeze its option letters. Zooming the whole body
   keeps every proportion the design already has: bigger words in bigger
   boxes, with the same air between them.

   Two things zoom does not do for us. Media queries still measure the real
   viewport, so a desktop layout does not fall back to its phone one just
   because it got 30% bigger; the steps are therefore gentler the narrower
   the screen. And viewport units are not scaled, so `100vw` inside a zoomed
   body paints wider than the window; --zoom is published here for the
   handful of rules that need to divide it back out. */
:root { --zoom: 1; }
/* Steps sized for a reader who needs them, eased on a narrower window: the top
   bar is about 900px wide before zoom, and media queries do not see the zoom, so
   a big step on a small window pushed the bar off the screen. */
:root { --zoom: 1; }
:root[data-textsize="lg"] { --zoom: 1.25; }
:root[data-textsize="xl"] { --zoom: 1.5; }
:root[data-textsize="lg"] body { zoom: 1.25; }
:root[data-textsize="xl"] body { zoom: 1.5; }
@media (max-width: 1450px) {
  :root[data-textsize="xl"] { --zoom: 1.3; }
  :root[data-textsize="xl"] body { zoom: 1.3; }
}
@media (max-width: 1200px) {
  :root[data-textsize="lg"] { --zoom: 1.12; }
  :root[data-textsize="lg"] body { zoom: 1.12; }
  :root[data-textsize="xl"] { --zoom: 1.2; }
  :root[data-textsize="xl"] body { zoom: 1.2; }
}
@media (max-width: 1000px) {
  :root[data-textsize="lg"] { --zoom: 1.05; }
  :root[data-textsize="lg"] body { zoom: 1.05; }
  :root[data-textsize="xl"] { --zoom: 1.1; }
  :root[data-textsize="xl"] body { zoom: 1.1; }
}
@media (max-width: 820px) {
  :root[data-textsize="lg"] { --zoom: 1.2; }
  :root[data-textsize="lg"] body { zoom: 1.2; }
  :root[data-textsize="xl"] { --zoom: 1.35; }
  :root[data-textsize="xl"] body { zoom: 1.35; }
}
/* Zoom can leave a few pixels of a wide child past the edge; a reader at this size should never have to scroll sideways for them. */
:root[data-textsize], :root[data-textsize] body { overflow-x: clip; }
/* Wider spacing: the British Dyslexia Association's guidance is wider letter,
   word and line spacing; this is the whole of it, left to the reader to turn on. */
:root[data-spacing="wide"] body { letter-spacing: 0.04em; word-spacing: 0.12em; }
:root[data-spacing="wide"] p, :root[data-spacing="wide"] li, :root[data-spacing="wide"] td { line-height: 1.8; }
/* A lesson's own switches (HL, theme) are a fixed corner toolbar that zoom pushes past the right edge: let it scroll with the page, inside it. */
:root[data-textsize] .toolbar { position: absolute; left: .5rem; right: .5rem; justify-content: flex-end; }
/* Paper is paper: the setting is about this screen, not the printout. */
@media print { :root[data-textsize] body { zoom: 1 !important; } }

/* ── READING FONT · unambiguous letterforms, and room to breathe ──
   Not a "dyslexia font": those do not survive testing. What does help is a
   face whose b/d/p/q and I/l/1 cannot be confused, more space between the
   letters and the lines, and a shorter line to return from. Atkinson
   Hyperlegible was drawn for low vision by the Braille Institute; the rest
   is spacing. The stylesheet is fetched by js/theme.js only when the switch
   is on, so nobody downloads a font they never asked for. */
:root[data-font="reading"] {
  --font-display: 'Atkinson Hyperlegible', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --sans: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --serif: 'Atkinson Hyperlegible', system-ui, sans-serif;
}
:root[data-font="reading"] body {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  letter-spacing: 0.012em;
  word-spacing: 0.08em;
  line-height: 1.65;
}
/* The exam paper is set in a serif on purpose, it is a facsimile of a real
   paper, so it changes with everything else rather than staying the odd
   one out. */
:root[data-font="reading"] .sheet,
:root[data-font="reading"] .sheet .q,
:root[data-font="reading"] .qdemo,
:root[data-font="reading"] .lede,
:root[data-font="reading"] .sub,
:root[data-font="reading"] .figcap,
:root[data-font="reading"] .mis,
:root[data-font="reading"] h1, :root[data-font="reading"] h2, :root[data-font="reading"] h3 {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
}
:root[data-font="reading"] .sheet .q,
:root[data-font="reading"] .sheet .stem,
:root[data-font="reading"] .sheet .part,
:root[data-font="reading"] .sheet .opts li { line-height: 1.7; }
/* A long line is the other half of the problem: the eye has to find the
   start of the next one. */
:root[data-font="reading"] .sheet .stem-body,
:root[data-font="reading"] .sheet .ptext,
:root[data-font="reading"] .passage,
:root[data-font="reading"] .card p,
:root[data-font="reading"] .sub { max-width: 62ch; }
/* Mono stays mono: codes, units and the paper code are read character by
   character, and that is what a monospace is for. */
:root[data-font="reading"] .mono,
:root[data-font="reading"] code, :root[data-font="reading"] kbd,
:root[data-font="reading"] .sit-clock, :root[data-font="reading"] .code-chip { font-family: var(--font-mono); letter-spacing: 0; }


/* ── LANGUAGE · support around the question, never inside it ──
   The paper stays in the language of the exam. What arrives beside it is a
   translated rubric, a bilingual command term, and a glossary the reader can
   tap: in two modes, because the exam allows the word and not the
   definition. */
.i18n-rubric { display: block; font-family: var(--font-body, system-ui), system-ui, sans-serif; font-style: normal; color: var(--riso-green-deep); margin-top: 3px; }
.sheet .gl, .gl {
  font-weight: inherit; border-bottom: 1.8px dotted var(--riso-pink-deep);
  cursor: help; background: none;
}
.sheet .gl:hover, .gl:hover { background: color-mix(in srgb, var(--riso-pink) 22%, transparent); }
.gl-pop {
  position: absolute; z-index: 60; width: min(340px, calc(100vw / var(--zoom, 1) - 24px));
  background: var(--paper-white); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 11px; box-shadow: 4px 4px 0 var(--riso-pink);
  padding: 11px 13px; font-family: var(--font-body, system-ui), system-ui, sans-serif; font-size: 13.5px; line-height: 1.5;
}
.gl-w { font-weight: 700; font-size: 15px; }
.gl-w span { color: var(--riso-pink-deep); }
.gl-d { color: var(--ink-dim); font-size: 12.8px; margin-top: 5px; }
.gl-mode { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-top: 6px; }
/* The paper prints as the exam prints: no dots, no glosses. */
@media print { .sheet .gl { border-bottom: 0; } .gl-pop, .i18n-offer { display: none !important; } }

/* Offered once, to a browser that is already set to the language. */
.i18n-offer {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 70;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  max-width: min(680px, calc(100vw / var(--zoom, 1) - 24px));
  background: var(--paper-white); border: 1.5px solid var(--ink); border-radius: 12px;
  box-shadow: 4px 4px 0 var(--riso-green); padding: 11px 14px; font-size: 13.5px; color: var(--ink);
}
.i18n-offer-en { color: var(--ink-dim); }
.i18n-offer button {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 7px 12px; cursor: pointer;
  background: var(--paper); color: var(--ink);
}
.i18n-offer .i18n-yes { background: var(--riso-green); color: var(--on-brand); font-weight: 700; }
.i18n-offer button:hover { background: var(--riso-pink); color: var(--on-brand); }
@media (max-width: 560px) { .i18n-offer { left: 10px; right: 10px; transform: none; max-width: none; } }

/* ---------------------------------------------------------------- Chinese
   Two things the Latin-tuned chrome gets wrong for a language written in
   characters: a line can break between any two of them, so a nav tab or a
   button label splits down the middle; and the tracking that opens up small
   uppercase Latin labels only pushes hanzi apart. Both are fixed on the
   chrome, never on the paper; the questions stay English and keep their own
   typography.  */
:root[data-lang="zh"] .topbar,
:root[data-lang="zh"] .em-rail,
:root[data-lang="zh"] .em-start,
:root[data-lang="zh"] .dt-actions,
:root[data-lang="zh"] .a11y-controls,
:root[data-lang="zh"] .sit-top,
:root[data-lang="zh"] .sit-how { letter-spacing: normal; }

:root[data-lang="zh"] .topbar a,
:root[data-lang="zh"] .tab,
:root[data-lang="zh"] .em-btn,
:root[data-lang="zh"] .share-lbl,
:root[data-lang="zh"] .dice-lbl,
:root[data-lang="zh"] .take-btn,
:root[data-lang="zh"] .a11y-lang,
:root[data-lang="zh"] .sit-mini { white-space: nowrap; }

