/* 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/search.css, /css/exam-maker.css, /css/theme.css, /css/tabs/exam-map.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/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/exam-maker.css */
/* ============================================================
   exam-maker.css: the practice-paper builder (/exam-maker)
   App chrome reads the site tokens (so dark + accessible modes
   work); the paper sheet itself is a print preview and stays
   white-with-black-ink in every theme, like the PDF it becomes.
   ============================================================ */

.em-page {
  max-width: 1560px;
  margin: 0 auto;
  padding: 16px clamp(20px, 4vw, 60px) 80px;
}
@media (max-width: 640px) { .em-page { padding: 22px 16px 50px; } }

/* ---------- stats brag + tips card beside the headline ---------- */
.em-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
/* The papers-built count is the line that earns trust, so it leads the badge
   at full size and the bank counts sit under it as supporting fine print.
   The count arrives from /api/paper-count, so .has-lead is only set once it
   does; without it the fine print grows back to normal size. */
.em-stats {
  display: block;
  max-width: 54ch;
  /* A stadium corner is a quarter circle half the card's height across, so
     it eats into the top right where the number sits. At 18px the digits
     crossed the curve by a pixel and a half. These keep them clear of it. */
  padding: 16px 36px 17px;
  background: var(--ink);
  color: var(--paper-white);
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--riso-green);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  text-align: right;
}
.em-stats-lead {
  display: block;
  font-size: 13.5px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.em-stats-lead b {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--riso-green);
  text-transform: none;
}
.em-stats-sub {
  display: block;
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0.72;
}
.em-stats.has-lead .em-stats-sub {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--paper-white) 22%, transparent);
}
.em-stats:not(.has-lead) .em-stats-sub { font-size: 13.5px; opacity: 0.95; }
.em-stats-sub .nb { white-space: nowrap; }
@media (max-width: 620px) { .em-stats { padding: 15px 30px 16px; } }
.em-stats .dot { opacity: 0.5; }
.em-tips {
  margin-top: 0;
  justify-self: end;
  max-width: 58ch;
  padding: 11px 16px 12px;
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--riso-yellow), 4.5px 4.5px 0 var(--riso-pink);
  transform: rotate(-0.7deg);
}
/* Closed it is a one-line invitation; open it is the full list. It sits in
   the head, so it must not out-shout the headline it sits beside. */
.em-tips-head {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--riso-pink-deep);
}
.em-tips-head::-webkit-details-marker { display: none; }
.em-tips-head::after { content: "▸"; margin-left: auto; font-size: 13.5px; }
.em-tips[open] .em-tips-head::after { content: "▾"; }
.em-tips[open] .em-tips-head { margin-bottom: 10px; }
.em-tips-head:hover { color: var(--ink); }
.em-tips-list { margin: 0; padding-left: 1.1em; font-size: 14px; line-height: 1.55; color: var(--ink-dim); }
.em-tips-list li { margin-bottom: 7px; }
.em-tips-list li:last-child { margin-bottom: 0; }
.em-tips-list li::marker { font-family: var(--font-mono); font-size: 13.5px; color: var(--riso-green-deep); }
.em-tips-list b { color: var(--ink); font-weight: 700; }
/* Once the head stacks to one column the card should fill it, not hang
   off the right with dead space beside it. */
@media (max-width: 980px) {
  .em-tips { justify-self: stretch; max-width: none; margin-top: 8px; transform: rotate(-0.4deg); }
}


.em-card {
  background: var(--paper-white);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--riso-green);
  padding: 16px 18px;
}
.em-card + .em-card { box-shadow: 4px 4px 0 var(--riso-pink); }
.em-card h2 {
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--riso-green-deep);
  margin-bottom: 10px;
}
.em-card h2 + .seg, .em-card fieldset { margin-bottom: 14px; }
.em-card fieldset { border: 0; padding: 0; margin-left: 0; }

.seg { display: flex; border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; background: var(--paper-white); }
.seg label { flex: 1; text-align: center; padding: 7px 4px; font-size: 13.5px; font-weight: 600; cursor: pointer; position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg input:checked + span { display: block; margin: -7px -4px; padding: 7px 4px; background: var(--ink); color: var(--paper-white); }
.seg input:focus-visible + span { outline: 3px solid var(--riso-pink); outline-offset: -3px; }
.seg input:disabled + span { opacity: .35; cursor: not-allowed; }
.seg label:has(input:disabled) { cursor: not-allowed; }

/* Topics list: collapsible A–D theme groups */
.topic-group { border: 1.5px solid var(--ink); border-radius: 10px; background: var(--paper-white); margin-bottom: 8px; overflow: hidden; }
.topic-group > summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 700;
}
.topic-group > summary::-webkit-details-marker { display: none; }
/* The whole summary row toggles the group, but the arrow is what people aim
   at, so give it the size and shape of a real control: a 30px ring that
   clears the 44px touch target once the row's padding is counted. */
.topic-group > summary::after {
  content: "▸";
  margin-left: auto; flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 15px; line-height: 1;
  color: var(--riso-pink-deep);
  border: 1.5px solid var(--riso-pink-deep);
  border-radius: 50%;
  transition: background-color .12s ease, color .12s ease;
}
.topic-group[open] > summary::after { content: "▾"; }
.topic-group > summary:hover::after {
  background: var(--riso-pink-deep);
  color: var(--paper-white);
}
.topic-group > summary:focus-visible { outline: 3px solid var(--riso-pink); outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) { .topic-group > summary::after { transition: none; } }
.topic-group .group-check { width: 15px; height: 15px; accent-color: var(--riso-green-deep); flex: none; }
.group-count { font-weight: 400; color: var(--ink-faint); letter-spacing: 0.02em; text-transform: none; }
.topic-group .opt { padding: 4px 10px; gap: 7px; }
.topic-group .opt:last-child { padding-bottom: 10px; }

.opt { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.opt input { width: 16px; height: 16px; accent-color: var(--riso-pink-deep); flex: none; }
/* The name is the only part of the row that can give way: a flex item will
   not shrink below its min-content unless told to, so a long subtopic name
   pushed the count and the view button out through the side of the card. */
.opt > span:not(.n) { min-width: 0; overflow-wrap: break-word; }
.opt .n { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-faint); margin-left: auto; flex: none; white-space: nowrap; }
.topic-browse {
  border: 1px solid var(--ink); border-radius: 6px;
  background: var(--paper-white); color: var(--riso-pink-deep);
  font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.04em;
  padding: 2px 6px; cursor: pointer; flex: none;
}
.topic-browse:hover { background: var(--riso-pink); color: var(--on-brand); }
/* On touch these are their own targets, not part of the row's label, and at
   41x19 they are under the 24px minimum. Desktop density is left alone. */
@media (pointer: coarse) {
  .topic-browse { min-height: 26px; padding-top: 5px; padding-bottom: 5px; }
}

.slider-row { display: flex; align-items: center; gap: 12px; padding: 4px 0 10px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--riso-green); }
.slider-row output { font-family: var(--font-mono); font-size: 13.5px; min-width: 62px; text-align: right; }

.em-btn[hidden] { display: none; }
.em-btn {
  display: block; width: 100%;
  border: 1.5px solid var(--ink); border-radius: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  padding: 10px; cursor: pointer;
  background: var(--riso-pink); color: var(--on-brand);
  box-shadow: 3px 3px 0 var(--ink);
  /* the lift is instant, the colour swap eases so the pink arrives rather
     than snaps */
  transition: transform 0.06s, box-shadow 0.06s, background-color 0.14s, color 0.14s;
}
/* Hover prints the second plate: the button lifts a hair and a pink offset
   appears under it, the move the toolbar buttons already make. Pressing pushes
   it back into the page, and the offset stays pink so the two read as one
   gesture. Disabled buttons do neither: nothing to promise. */
.em-btn:hover:not(:disabled) {
  background: var(--riso-pink); color: var(--on-brand);
  transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--riso-green);
}
.em-btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--riso-green); }
.em-btn:disabled:hover { transform: none; box-shadow: 3px 3px 0 var(--ink); }
.em-btn:focus-visible { outline: 3px solid var(--riso-green); outline-offset: 2px; }
.em-btn.alt { background: var(--paper-white); color: var(--ink); margin-top: 9px; }
.em-btn + .em-btn { margin-top: 9px; }

.em-share { display: flex; gap: 8px; margin-top: 12px; }
.em-share input {
  flex: 1; min-width: 0; padding: 7px 9px;
  border: 1.5px solid var(--line-strong, var(--ink));
  border-radius: 8px; background: var(--paper);
  font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-dim);
}
.em-share button {
  border: 1.5px solid var(--ink); border-radius: 8px; background: var(--paper-white);
  font-family: var(--font-mono); font-size: 13.5px; padding: 0 10px; cursor: pointer; color: var(--ink);
}
.em-note { margin-top: 8px; }
.em-note > summary { cursor: pointer; font-size: 14px; color: var(--ink-dim); list-style: none; text-decoration: underline; text-decoration-color: var(--riso-pink); text-underline-offset: 3px; }
.em-note > summary::-webkit-details-marker { display: none; }
.em-note[hidden] { display: none; }
.em-note > .em-hint { margin-top: 6px; }
.em-hint { font-size: 14px; color: var(--ink-dim); margin-top: 10px; line-height: 1.5; }
/* The student handover is its own job, so it gets a rule above it rather
   than running straight on from the teacher's own share code. */
.em-send {
  margin-top: 20px; padding-top: 15px;
  border-top: 1.5px dashed var(--ink-faint);
}
.em-send h2 { margin-bottom: 8px; }
.em-send .send-lede { margin-top: 0; }
.em-send .em-btn.alt { margin-top: 10px; }

/* ---------- question picker (Pick mode) ---------- */
/* Pick mode: the picker takes over the desk column at full width; a sticky
   bar swaps between browsing the bank (where questions are added) and the
   paper. One segmented control, the chosen half filled, no offset shadow;
   the My papers shortcut sits at its right. */
.pick-viewbar {
  position: sticky; top: 12px; z-index: 40;
  max-width: 780px; margin: 0 auto 4px; padding: 0 0 8px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px;
  /* Opaque, gap included, so the paper does not show through as it scrolls under. */
  background: var(--paper); box-shadow: 0 -12px 0 var(--paper);
}
.pick-viewbar .pv-seg { flex: 0 1 440px; min-width: 0; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--paper-white); }
.pick-viewbar .pv-seg label { display: flex; padding: 0; font-family: var(--font-display); font-size: 14.5px; font-weight: 650; }
.pick-viewbar .pv-seg label + label { border-left: 1.5px solid var(--ink); }
.pick-viewbar .pv-seg input + span { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; min-height: 40px; margin: 0; padding: 0 12px; }
.pick-viewbar .pv-seg label:hover input:not(:checked) + span { background: var(--paper); }
.pick-viewbar .pv-seg input:checked + span { margin: 0; padding: 0 12px; background: var(--ink); color: var(--paper-white); }
.pick-viewbar .pv-seg input:focus-visible + span { outline: 3px solid var(--riso-pink-deep); outline-offset: -4px; }
.pv-sub { font-family: var(--font-mono); font-size: 13.5px; font-weight: 400; letter-spacing: .04em; opacity: .75; }
.em-mypapers {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--ink); border-radius: 6px; background: var(--paper-white);
  color: var(--ink); font-size: 14px; font-weight: 650; text-decoration: none; white-space: nowrap;
}
.em-mypapers svg { color: var(--riso-green-deep); }
.em-mypapers:hover { background: var(--paper); }
.em-mypapers:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
/* The count of kept papers, signed in. */
.em-mp-n { display: inline-block; min-width: 1.6em; margin-left: 5px; padding: 0 5px; border-radius: 3px; background: var(--riso-green); color: var(--on-brand); font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; line-height: 1.6; text-align: center; text-decoration: none; }
.em-mypapers .em-mp-n { margin-left: 0; }
.em-code-mp { margin: 10px 0 0; }
.em-code-mp a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--riso-green); text-underline-offset: 3px; }
@media (max-width: 560px) {
  .pick-viewbar { flex-wrap: nowrap; gap: 8px; }
  .pick-viewbar .pv-seg { flex: 1 1 auto; }
  .pick-viewbar .pv-seg input + span, .pick-viewbar .pv-seg input:checked + span { padding: 0 8px; }
  .pv-sub { display: none; }
  .em-mypapers { padding: 0 10px; }
}

/* The hidden attribute must always win, even over display rules below. */
.em-page [hidden] { display: none !important; }

/* desk toolbar: length slider + dice, above the sheet */
/* Rides along as you scroll the paper, so length and reroll stay reachable
   while you are reading the questions they change. `top` is set in JS: it sits
   under the site header, and under the view toggle when that is showing too.
   Calm and few: Length and Randomise on the first line; under them one
   joined toolbar, its actions segments with an icon and a word, divided by
   thin lines, ending on the one filled action, Print / PDF. The rarer
   actions wait in More. No offset shadows. */
.em-desktools {
  position: sticky; top: 12px; z-index: 39;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  max-width: 780px; margin: 0 auto 16px;
  padding: 10px 12px;
  background: var(--paper-white);
  border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 6px 18px rgba(17, 30, 24, .07);
}
.em-desktools .slider-row { flex: 1 1 220px; min-width: 0; padding: 0; }
.em-desktools .slider-row input[type=range] { flex: 1 1 80px; min-width: 60px; }
.em-desktools .slider-row output { flex: none; white-space: nowrap; }
.em-desktools .dt-label {
  font-family: var(--font-mono); font-size: 13.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--riso-green-deep);
}
/* Randomise: a plain bordered button beside the slider it goes with. */
.dice {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 40px; padding: 0 14px 0 11px;
  border: 1.5px solid var(--ink); border-radius: 6px;
  background: var(--paper-white); color: var(--ink);
  cursor: pointer;
  transition: background-color 0.14s;
  perspective: 150px; /* the die is a real cube, so give it a camera */
}
.dice:hover { background: var(--paper); }
.dice:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
/* Say what it does: the die alone reads as decoration, and its title tooltip
   never appears on a touch screen. */
.dice-lbl { font-family: var(--font-display); font-size: 14px; font-weight: 650; color: var(--ink); white-space: nowrap; }
/* The joined toolbar. */
.dt-bar {
  position: relative; flex: 1 1 100%;
  display: flex; align-items: stretch;
  border: 1.5px solid var(--ink); border-radius: 6px;
  background: var(--paper-white);
}
.dt-bar > .em-sharewrap, .dt-bar > .dt-morewrap { display: flex; flex: 1 1 auto; position: static; }
.dt-seg {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 0 14px;
  border: 0; border-right: 1px solid var(--line-strong); border-radius: 0;
  background: transparent; color: var(--ink);
  font-family: var(--font-display); font-size: 14px; font-weight: 650; white-space: nowrap; text-decoration: none;
  cursor: pointer; transition: background-color 0.14s, color 0.14s;
}
.dt-bar > .dt-seg:first-child, .dt-bar > :first-child .dt-seg { border-radius: 4.5px 0 0 4.5px; }
.dt-seg:hover, .dt-seg[aria-expanded="true"] { background: var(--paper); }
.dt-seg:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: -3px; position: relative; z-index: 1; }
.dt-ico { flex: none; color: var(--riso-green-deep); }
.dt-chev { flex: none; transition: transform 0.15s; }
.dt-seg[aria-expanded="true"] .dt-chev { transform: rotate(180deg); }
.dt-seg.is-empty { color: var(--ink-dim); pointer-events: none; }
.dt-seg.is-empty .dt-ico { color: inherit; opacity: .6; }
/* Print / PDF: the one filled segment, in the site green, at the end. */
.dt-primary {
  flex: 0 0 auto; margin: -1.5px -1.5px -1.5px 0; padding: 0 18px;
  border: 1.5px solid var(--ink); border-radius: 0 6px 6px 0;
  background: var(--riso-green); color: var(--on-brand); font-weight: 700;
}
.dt-primary .dt-ico { color: inherit; }
.dt-primary:hover { background: var(--riso-green-deep); color: var(--paper-white); }
.dt-primary.is-empty { background: var(--paper); color: var(--ink-dim); }
/* More: the rarer actions, in a small menu under the bar. */
.dt-more-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 41;
  width: min(300px, calc(100vw - 32px));
  padding: 6px; display: grid; gap: 2px;
  background: var(--paper-white); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 6px;
  box-shadow: 0 10px 30px rgba(17, 30, 24, .16);
}
.dt-more-i {
  display: grid; gap: 2px; width: 100%; min-height: 44px; padding: 8px 10px;
  border: 0; border-radius: 4px; background: none; color: var(--ink);
  font: inherit; font-family: var(--font-display); font-size: 14px; font-weight: 650; text-align: left; text-decoration: none; cursor: pointer;
}
.dt-more-i small { font-size: 14px; font-weight: 400; color: var(--ink-dim); }
.dt-more-i:hover { background: var(--paper); }
.dt-more-i:focus-visible { background: var(--paper); outline: 3px solid var(--riso-pink-deep); outline-offset: -3px; }
.dt-more-i.is-empty { opacity: 0.45; pointer-events: none; }
/* A phone: the slider and Randomise share a line (the die alone, named for
   screen readers); the bar's segments stack icon over word, and Print / PDF
   takes a full-width second row. Never a sideways scroll. */
@media (max-width: 560px) {
  .em-desktools { gap: 8px 10px; padding: 8px 10px; }
  .em-desktools .dt-label { display: none; }
  .dice { padding: 0 11px; }
  .dice-lbl { display: none; }
  /* One row: the hand-out actions as icons (named for screen readers and in
     their titles), ending on Print / PDF with its word, so the bar riding
     over the paper is one slim line, not a third of the screen. */
  .dt-bar { flex-wrap: nowrap; }
  .dt-seg { min-height: 44px; padding: 0 6px; }
  .dt-seg .dt-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .dt-bar > .em-sharewrap, .dt-bar > .dt-morewrap, .dt-bar > .dt-seg { flex: 1 1 0; min-width: 0; }
  .dt-more-btn .dt-chev { display: none; }
  .dt-bar > .dt-primary { flex: 2.2 1 0; gap: 6px; font-size: 14.5px; }
  .dt-bar > .dt-primary .dt-lbl { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  /* The view toggle stays at the top of the paper rather than riding along. */
  .pick-viewbar { position: static; }
}

/* The length slider and die drop out on formats that are not resizable, but
   the bar itself stays so Share is always reachable in the same spot. */
.em-desktools .slider-row[hidden], .em-desktools .dice[hidden] { display: none; }

/* Save: the paper into My papers (exam-maker/keep.js). Saved fills the mark. */
.keep-btn.is-kept { color: var(--riso-green-deep); }
.keep-btn.is-kept .keep-ico path { fill: currentColor; }


/* Share: the paper code and the student link, one click from the paper. The
   panel hangs from the right of the action row, so it never leaves a phone. */
.em-sharewrap { position: static; flex: none; }
.share-ico { flex: none; }
.share-lbl { white-space: nowrap; }
.share-pop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 41;
  width: min(360px, calc(100vw / var(--zoom, 1) - 32px));
  padding: 12px 14px 10px;
  background: var(--paper-white); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 4px;
  box-shadow: 0 10px 30px rgba(17, 30, 24, .16);
}
.share-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.share-row + .share-why { margin-top: 4px; }
.share-why + .share-row { margin-top: 12px; padding-top: 12px; border-top: 1.5px dashed var(--ink-faint); }
.share-k {
  font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--riso-green-deep); white-space: nowrap;
}
.share-v {
  font-family: var(--font-mono); font-size: 13.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.share-copy {
  border: 1.5px solid var(--ink); border-radius: 8px; background: var(--paper-white);
  font-family: var(--font-mono); font-size: 13.5px; padding: 5px 10px; cursor: pointer; color: var(--ink);
  white-space: nowrap;
}
.share-copy:hover { background: var(--riso-green); color: var(--on-brand); }
.share-copy.copied { background: var(--riso-green); color: var(--on-brand); }
.share-why { font-size: 13.5px; color: var(--ink-dim); line-height: 1.45; margin: 0; }
.share-empty { font-size: 14px; color: var(--ink-dim); margin: 0; line-height: 1.45; }

/* Six-sided die built from six positioned faces. Rolling sets --rx/--ry to a
   face angle plus whole turns, so the transition tumbles it and lands on a
   real number rather than spinning a flat icon. */
.die {
  position: relative; width: 20px; height: 20px;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, -14deg)) rotateY(var(--ry, 18deg));
  transition: transform 0.75s cubic-bezier(0.2, 0.75, 0.25, 1);
}
.die .f {
  position: absolute; inset: 0;
  border: 1.2px solid var(--ink); border-radius: 4px;
  background-color: var(--paper-white);
}
.die .f1 { transform: translateZ(10px); }
.die .f6 { transform: rotateY(180deg) translateZ(10px); }
.die .f3 { transform: rotateY(90deg) translateZ(10px); }
.die .f4 { transform: rotateY(-90deg) translateZ(10px); }
.die .f5 { transform: rotateX(90deg) translateZ(10px); }
.die .f2 { transform: rotateX(-90deg) translateZ(10px); }
.die .f1 { background-image: radial-gradient(circle 1.7px at 50% 50%, var(--ink) 98%, transparent 100%); }
.die .f2 { background-image: radial-gradient(circle 1.7px at 28% 28%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 72% 72%, var(--ink) 98%, transparent 100%); }
.die .f3 { background-image: radial-gradient(circle 1.7px at 26% 26%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 50% 50%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 74% 74%, var(--ink) 98%, transparent 100%); }
.die .f4 { background-image: radial-gradient(circle 1.7px at 28% 28%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 72% 28%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 28% 72%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 72% 72%, var(--ink) 98%, transparent 100%); }
.die .f5 { background-image: radial-gradient(circle 1.7px at 26% 26%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 74% 26%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 50% 50%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 26% 74%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 74% 74%, var(--ink) 98%, transparent 100%); }
.die .f6 { background-image: radial-gradient(circle 1.7px at 28% 22%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 28% 50%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 28% 78%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 72% 22%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 72% 50%, var(--ink) 98%, transparent 100%), radial-gradient(circle 1.7px at 72% 78%, var(--ink) 98%, transparent 100%); }
@media (prefers-reduced-motion: reduce) { .die { transition: none; } }

/* one-line contextual nudge under the view toggle */
.em-prompt {
  text-align: center;
  font-family: var(--font-mono); font-size: 13.5px;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  margin: -6px 0 14px;
}
.em-prompt b { color: var(--riso-pink-deep); font-weight: 700; }
.sheet.view-hidden { display: none; }

.pick-summary-btns { display: flex; gap: 8px; }

/* keep the two native filter popups on brand: let the OS render them
   in the page's palette rather than defaulting to a light popup */
.pick-selects select { color-scheme: light; }
:root[data-theme="dark"] .pick-selects select { color-scheme: dark; }
.pick-selects option {
  font-family: var(--font-mono);
  background: var(--paper-white); color: var(--ink);
}

.pick-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-dim);
  border-bottom: 1.5px dashed var(--ink); padding-bottom: 10px; margin-bottom: 10px;
}
.pick-summary b { color: var(--riso-pink-deep); }
.pick-summary button {
  border: 1.5px solid var(--ink); border-radius: 7px; background: var(--paper-white);
  font-family: var(--font-mono); font-size: 13.5px; padding: 4px 9px; cursor: pointer; color: var(--ink);
}

.pick-tools { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pick-tools input[type=search] {
  width: 100%; padding: 8px 11px;
  border: 1.5px solid var(--ink); border-radius: 8px;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-display); font-size: 13.5px;
}
.pick-tools input[type=search]:focus { outline: none; box-shadow: 0 0 0 2.5px var(--riso-pink); }
.pick-selects { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.pick-selects select.dd-native {
  position: absolute; width: 1px; height: 1px; opacity: 0;
  pointer-events: none;
}

/* custom on-brand dropdowns */
.dd { position: relative; }
.dd-btn {
  width: 100%; padding: 7px 26px 7px 10px; text-align: left;
  border: 1.5px solid var(--ink); border-radius: 8px;
  background: var(--paper-white); color: var(--ink);
  font-family: var(--font-mono); font-size: 13.5px; cursor: pointer;
  position: relative;
}
.dd-btn::after {
  content: "▾"; position: absolute; right: 9px; top: 50%;
  transform: translateY(-52%); color: var(--riso-pink-deep); font-size: 13.5px;
}
.dd-btn:focus-visible { outline: none; box-shadow: 0 0 0 2.5px var(--riso-pink); }
.dd-btn[aria-expanded="true"] { box-shadow: 0 0 0 2.5px var(--riso-pink); }
.dd-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  margin: 0; padding: 5px; list-style: none;
  background: var(--paper-white);
  border: 1.5px solid var(--ink); border-radius: 10px;
  box-shadow: 3px 3px 0 var(--riso-pink), 0 12px 26px rgba(0, 0, 0, 0.12);
  max-height: 280px; overflow-y: auto;
}
.dd-list li {
  padding: 6px 9px 6px 24px; border-radius: 6px; position: relative;
  font-family: var(--font-mono); font-size: 13.5px; color: var(--ink);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dd-list li:hover, .dd-list li.dd-active { background: color-mix(in srgb, var(--riso-green) 22%, transparent); }
.dd-list li[aria-selected="true"]::before {
  content: "✓"; position: absolute; left: 8px;
  color: var(--riso-pink-deep); font-weight: 700;
}
.pick-matchcount { font-family: var(--font-mono); font-size: 13.5px; color: var(--riso-pink-deep); }
.pick-row.flt-hidden, .pick-topic.flt-hidden, .pick-theme.flt-hidden { display: none; }

.pick-theme { margin: 14px 0 6px; }
.pick-theme:first-child { margin-top: 2px; }
.pick-theme > summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--riso-green-deep);
  padding: 5px 0; margin-bottom: 6px;
  border-bottom: 1px dashed var(--line, rgba(26, 58, 42, 0.25));
}
.pick-theme > summary::-webkit-details-marker { display: none; }
.pick-theme > summary::before { content: "▸"; font-size: 13.5px; color: var(--riso-pink-deep); }
.pick-theme[open] > summary::before { content: "▾"; }

.pick-topic { border: 1.5px solid var(--ink); border-radius: 10px; background: var(--paper-white); margin-bottom: 10px; overflow: hidden; }
.pick-topic > summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 12px;
  font-size: 13.5px; font-weight: 700;
}
.pick-topic > summary::-webkit-details-marker { display: none; }
.pick-topic > summary::before { content: "▸"; font-size: 13.5px; color: var(--riso-pink-deep); }
.pick-topic[open] > summary::before { content: "▾"; }
.pick-count { margin-left: auto; font-family: var(--font-mono); font-size: 13.5px; font-weight: 400; color: var(--riso-pink-deep); }
.pick-group-all {
  margin-left: auto; align-self: center;
  border: 1.5px solid var(--ink); border-radius: 6px; background: var(--paper-white); color: var(--ink);
  font-family: var(--font-mono); font-size: 13.5px; font-weight: 400; padding: 2px 8px; cursor: pointer;
}
.pick-group-all:hover { background: var(--riso-green); color: var(--on-brand); }
.pick-group-all + .pick-count { margin-left: 0; min-width: 7ch; text-align: right; }

.pick-row {
  position: relative;
  padding: 7px 74px 7px 12px;
  border-top: 1px solid var(--line, rgba(26, 58, 42, 0.15));
}
.pick-row.lvl-hidden { display: none; }
.pick-eye {
  position: absolute; top: 9px; right: 44px;
  color: var(--ink-faint, #8a9a90);
  cursor: help; line-height: 0;
}
.pick-eye svg { width: 17px; height: 17px; }
.pick-eye:hover { color: var(--riso-pink-deep); }
@media (hover: none) { .pick-eye { display: none; } }

.pick-tick {
  position: absolute; top: 10px; right: 12px;
  width: 18px; height: 18px; margin: 0;
  accent-color: var(--riso-pink-deep);
  cursor: pointer;
}
.pick-row.picked { box-shadow: inset 3px 0 0 var(--riso-pink); background: color-mix(in srgb, var(--riso-pink) 6%, transparent); }
.pick-row details summary {
  cursor: pointer; list-style: none;
  display: flex; flex-direction: column; gap: 2px;
}
.pick-row details summary::-webkit-details-marker { display: none; }
.pick-stem { font-size: 13px; line-height: 1.4; }
.pick-chips { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.04em; color: var(--ink-faint); }
.pick-flag { display: none; font-family: var(--font-mono); font-size: 13.5px; color: var(--riso-pink-deep); }
.pick-row.picked .pick-flag { display: inline; }

/* rendered preview panel */
.pick-preview { margin-top: 8px; }
.pick-preview .mini-sheet {
  background: #fff; color: #1a1a1a;
  border: 1px solid #d8d3c5; border-radius: 4px;
  padding: 12px 14px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13px; line-height: 1.45;
}
.pick-preview .mini-sheet .q { margin-bottom: 0; }
.pick-preview .mini-sheet .abox .ln { height: 18px; }
.pick-preview .mini-sheet .drawbox { max-height: 70px; }
.pick-preview .mini-sheet .fig { max-width: 340px; margin-left: 12px; }
.pick-preview .mini-sheet .qtable { margin-left: 12px; font-size: 13.5px; }
.pick-preview .mini-sheet .part { margin-left: 16px; }
.pick-preview .mini-sheet .abox { margin-left: 16px; }
.pick-preview .ms-peek { margin-top: 10px; }
.pick-preview .ms-peek > summary { display: inline-flex; flex-direction: row; white-space: nowrap; width: auto; text-align: left; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; cursor: pointer; font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--riso-green-deep); background: #fff; border: 2px solid var(--riso-green-deep); border-radius: 8px; list-style: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.pick-preview .ms-peek > summary::-webkit-details-marker { display: none; }
.pick-preview .ms-peek > summary::before { content: "Show"; font-weight: 600; }
.pick-preview .ms-peek > summary::after { content: "▾"; font-size: 18px; line-height: 1; }
.pick-preview .ms-peek[open] > summary::before { content: "Hide"; }
.pick-preview .ms-peek[open] > summary::after { content: "▴"; }
.pick-preview .ms-peek > summary:hover { background: var(--riso-green-deep); color: #fff; }
.pick-preview .ms-peek > summary:focus-visible { outline: 3px solid var(--ink-dim); outline-offset: 2px; }
.pick-preview .ms-peek .mini-sheet { margin-top: 5px; background: #fbf9f4; }
.pick-preview .mini-sheet .msq { margin-bottom: 0; font-size: 14px; }
.pick-btn {
  margin-top: 8px;
  border: 1.5px solid var(--ink); border-radius: 8px;
  background: var(--riso-pink); color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  padding: 6px 14px; cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.pick-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }

/* hover peek: floating rendered question beside the compact list */
#hover-preview {
  position: fixed; right: 26px; z-index: 95;
  width: min(520px, 40vw);
  max-height: 76vh; overflow: hidden;
  background: var(--paper-white);
  border: 1.5px solid var(--ink); border-radius: 12px;
  box-shadow: 5px 5px 0 var(--riso-pink), 0 14px 30px rgba(0, 0, 0, 0.14);
  padding: 12px;
  pointer-events: none;
}
#hover-preview .mini-sheet {
  background: #fff; color: #1a1a1a;
  border: 1px solid #d8d3c5; border-radius: 4px;
  padding: 12px 14px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13px; line-height: 1.45;
}
#hover-preview .mini-sheet .q, #hover-preview .mini-sheet .msq { margin-bottom: 0; }
#hover-preview .mini-sheet .abox .ln { height: 14px; }
#hover-preview .mini-sheet .drawbox { max-height: 60px; }
#hover-preview .mini-sheet .fig { max-width: 300px; margin-left: 12px; }
#hover-preview .mini-sheet .qtable { margin-left: 12px; font-size: 13.5px; }
#hover-preview.hp-answer {
  right: auto; left: 20px;
  width: min(400px, 34vw);
}
@media (max-width: 980px) { #hover-preview.hp-answer { left: auto; right: 16px; width: min(400px, 88vw); } }
#hover-preview.hp-answer .mini-sheet { background: #fbf9f4; font-size: 14px; }
#hover-preview .hp-ms { margin-top: 8px; }
#hover-preview .hp-ms .mini-sheet { background: #fbf9f4; font-size: 13.5px; }
#hover-preview .hp-ms-label {
  font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-dim); margin-bottom: 4px;
}
@media (max-width: 940px) { #hover-preview { display: none; } }
.pick-row.picked .pick-btn { background: var(--paper-white); }

/* Multi-select filters: tick several, then commit them together. */
.dd-multi .dd-list li[role=option] { padding-left: 30px; position: relative; }
.dd-multi .dd-list li[role=option]::before {
  content: ''; position: absolute; left: 10px; top: 50%;
  width: 13px; height: 13px; margin-top: -7px;
  border: 1.5px solid #b9b2a0; border-radius: 3px; background: var(--paper-white, #fff);
}
.dd-multi .dd-list li[aria-selected="true"]::before {
  background: var(--riso-green); border-color: var(--riso-green);
}
.dd-multi .dd-list li[aria-selected="true"]::after {
  content: ''; position: absolute; left: 14.5px; top: 50%;
  width: 4px; height: 8px; margin-top: -5px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(43deg);
}
.dd-bar {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 8px 10px; margin-top: 4px;
  border-top: 1px solid var(--hairline, #d8d3c5);
  position: sticky; bottom: 0; background: var(--paper-white, #fff);
}
.dd-bar button {
  font-family: var(--font-mono); font-size: 13.5px; letter-spacing: .04em;
  border-radius: 6px; padding: 5px 11px; cursor: pointer;
}
.dd-clear { border: 1px solid #b9b2a0; background: transparent; color: var(--ink-dim, #6d675a); }
.dd-clear:hover { color: var(--ink, #1a1a1a); border-color: var(--ink, #1a1a1a); }
.dd-apply { border: 1px solid var(--riso-green); background: var(--riso-green); color: #fff; font-weight: 700; }
.dd-apply:hover { filter: brightness(1.08); }

/* AP subtopics inside a unit, shown while browsing the bank */
.topic-group .ced-opt { padding-left: 22px; font-size: 13.5px; }
.topic-group .ced-opt span:first-of-type { color: var(--ink-dim, #6d675a); }
.topic-group .ced-opt input:disabled + span { opacity: 0.45; }
.topic-group .ced-opt:has(input:disabled) { cursor: default; }

/* ---------- the sheet (print preview: fixed white/ink) ---------- */
.em-desk { min-width: 0; }
/* The preview is the page, not an impression of it. A4 at the print margin
   and the print type size, so a line wraps on screen exactly where it wraps
   on paper; --sheet-zoom shrinks the whole page to fit the column without
   touching the measure. Page guides are drawn against --page-content. */
.sheet {
  --page-w: 210mm;
  --page-h: 297mm;
  --page-margin: 18mm;
  --page-content: calc(var(--page-h) - var(--page-margin) * 2);
  position: relative;
  background: #fff;
  color: #1a1a1a;
  /* The frame sits outside the box so the content box is exactly the
     printed text column (210mm less two 18mm margins). A border would
     eat 2px of that and the preview would wrap a word early. */
  outline: 1px solid #d8d3c5;
  width: var(--page-w); max-width: 100%; margin: 0 auto;
  padding: var(--page-margin);
  zoom: var(--sheet-zoom, 1);
  box-shadow: 0 2px 0 #d8d3c5, 10px 12px 0 rgba(45, 184, 118, 0.18), 11px 13px 0 rgba(255, 126, 182, 0.28);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 11pt; line-height: 1.5;
}

/* Where the paper runs out. The dashed rule is the fold, measured against a
   copy of the sheet poured into page-sized columns. The markscheme's own
   break is called out, because a teacher printing this needs to know it never
   shares a page with the questions. */
.page-break {
  position: absolute; left: 0; right: 0;
  border-top: 1px dashed #b9b2a2;
  pointer-events: none;
}
.page-break::after {
  content: attr(data-label);
  position: absolute; right: 0; top: 4px;
  font-family: var(--font-mono); font-size: 8.5pt; letter-spacing: 0.06em;
  text-transform: uppercase; color: #a49c8a; background: #fff; padding-left: 8px;
}
.page-break.forced { border-top-color: var(--riso-pink-deep); }
.page-break.forced::after { color: var(--riso-pink-deep); }
.sheet .mono { font-family: var(--font-mono); font-size: 0.75em; letter-spacing: 0.04em; }
.sheet.sheet-reflow { --page-margin: 14px; width: auto; }
.sheet.sheet-reflow .page-break { display: none; }

/* Mark points that reach outside the subtopic on the paper. Set apart, and
   each one named, so a class that has studied one subtopic can see that the
   marks were all reachable and that the rest is a connection, not a gap. */
.msbeyond-lbl { margin-top: 5px; }
.msbeyond { margin: 2px 0 0; padding-left: 18px; color: #4a4a4a; }
.msbeyond .msout {
  font-family: var(--font-mono); font-size: 0.72em; letter-spacing: 0.04em;
  border: 1px solid #c9c2b0; border-radius: 4px; padding: 0 4px; margin-right: 5px;
  white-space: nowrap;
}


.thinbank {
  background: var(--paper);
  border: 1.5px dashed var(--riso-pink-deep);
  border-radius: 10px;
  font-family: var(--font-display); font-size: 13.5px;
  color: var(--ink); padding: 10px 14px; margin-bottom: 22px;
}
html:not([data-theme="dark"]) .sheet .thinbank { background: #fdf3f8; color: #1a1a1a; }
.thinbank p { margin: 2px 0; }

.cover { position: relative; border: 1.5px solid #1a1a1a; padding: 18px 22px; margin-bottom: 28px; }
/* House lockup, top-right of every generated paper: pushes the brand. */
.cover .exam-brand { position: absolute; top: 16px; right: 20px; display: flex; align-items: center; gap: 8px; }
.cover .exam-brand-mark { width: 26px; height: 26px; display: block; flex: none; }
.cover .exam-brand-name { font-family: var(--font-display); font-size: 14px; font-weight: 600; line-height: 1; color: #1a1a1a; white-space: nowrap; }
.cover .exam-brand-name b { font-family: var(--font-mono, monospace); font-weight: 500; color: #4a463c; }
.cover .exam-title { font-family: var(--font-display); font-weight: 700; font-size: 27px; line-height: 1.15; padding-right: 172px; }
@media (max-width: 520px) { .cover .exam-brand { position: static; margin-bottom: 12px; } .cover .exam-title { padding-right: 0; } }
.cover .exam-sub { font-style: italic; margin: 3px 0 14px; }
.cover .meta { display: flex; flex-wrap: wrap; gap: 5px 32px; font-size: 15px; border-top: 1px solid #1a1a1a; padding-top: 11px; margin-bottom: 12px; }
.cover .covers { font-size: 13px; color: #4a463c; margin: 0 0 12px; line-height: 1.5; }
/* The chip is a button: click copies the code. It must still look like
   part of the paper, so no button chrome, and the hint only shows on screen. */
.cover .code-chip {
  display: inline-flex; align-items: baseline; gap: 7px;
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; border-radius: 4px;
}
.cover .code-chip { max-width: 100%; text-align: left; }
/* A 90-question paper's code is 80 characters with no break in it: wrap it
   inside the cover instead of running off the page. */
.cover .code-chip .mono, .ms h3 .mono { overflow-wrap: anywhere; word-break: break-all; }
.cover .code-chip .mono { text-decoration: underline dotted transparent; text-underline-offset: 3px; transition: text-decoration-color 0.12s; }
.cover .code-chip:hover .mono, .cover .code-chip:focus-visible .mono { text-decoration-color: var(--riso-green-deep); }
.cover .code-chip:focus-visible { outline: 2px solid var(--riso-green); outline-offset: 3px; }
.cover .chip-hint {
  font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: 0.06em;
  color: var(--riso-green-deep); opacity: 0; transition: opacity 0.12s; white-space: nowrap;
}
.cover .code-chip:hover .chip-hint, .cover .code-chip:focus-visible .chip-hint, .cover .code-chip.copied .chip-hint { opacity: 1; }
.cover .code-chip.copied .chip-hint { font-weight: 700; }
.cover .code-lbl {
  font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; border: 1px solid #1a1a1a; border-radius: 4px;
  padding: 1px 5px; white-space: nowrap;
}
/* The code is the paper's recipe, so say so on the paper itself. */
.cover .code-note { font-size: 12.5px; line-height: 1.45; margin: 0 0 12px; }
.cover .covers-lbl { font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #8a8272; margin-right: 6px; }
.cover .instr { font-size: 14.5px; margin: 0 0 14px 20px; }
.cover .instr li { margin-bottom: 2px; }
.cover .cand span { display: inline-block; border-bottom: 1px solid #1a1a1a; min-width: 16rem; }

.secthead { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.02em; border-bottom: 2px solid #1a1a1a; padding-bottom: 4px; margin: 30px 0 6px; }
.rubric { font-size: 14px; font-style: italic; margin-bottom: 18px; }

.q { margin-bottom: 30px; break-inside: avoid; }

/* AP stimulus sets: one lead-in and the shared stimulus once, then the
   questions that refer to it, a bracket down the side joining them. */
.set-head, .q.in-set { border-left: 3px solid var(--riso-green, #2db876); padding-left: 16px; margin-left: 6px; }
.set-head { margin-top: 6px; padding-top: 12px; padding-bottom: 16px; background: linear-gradient(90deg, rgba(45,184,118,0.08), transparent 70%); break-inside: avoid; break-after: avoid; page-break-after: avoid; }
.set-head .set-lead { font-family: var(--font-display); font-weight: 700; font-size: 0.95em; letter-spacing: 0.01em; margin: 0 0 8px; }
.set-head .set-ctx { margin-bottom: 8px; }
.set-head .qtable, .set-head .fig { margin-bottom: 0; }
.q.in-set { margin-bottom: 0; padding-bottom: 22px; }
.q.in-set.set-first { padding-top: 6px; }
.q.in-set.set-last { margin-bottom: 30px; }
.q.in-set .reorder { left: -62px; }
@media print { .set-head, .q.in-set { background: none; } .q.in-set.set-first { break-before: avoid; page-break-before: avoid; } }

/* reorder gutter on the picked paper (screen only) */
.q.reorderable { position: relative; }
.q .reorder {
  position: absolute; top: 0; left: -42px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  opacity: 0.22; transition: opacity 0.12s;
}
.q:hover .reorder, .q .reorder:focus-within { opacity: 1; }
.reorder button {
  border: 1px solid #b9b2a0; border-radius: 5px;
  background: #fbf9f4; color: #1a1a1a;
  font-size: 12px; line-height: 1; padding: 4px 6px; cursor: pointer;
}
.reorder button:disabled { opacity: 0.3; cursor: default; }
.reorder .ro-grip {
  cursor: grab; user-select: none; touch-action: none;
  font-size: 13px; color: #8a8272; padding: 2px 4px;
}
.reorder .ro-remove {
  border: 1px solid #d8b0bd; border-radius: 5px;
  background: #fbf9f4; color: #b23a6b;
  font-size: 12px; line-height: 1; padding: 4px 6px; cursor: pointer;
  margin-top: 2px;
}
.reorder .ro-remove:hover { background: #ff7eb6; color: #fff; border-color: #ff7eb6; }
.reorder .ro-peek {
  border: 1px solid #a9c4b4; border-radius: 5px;
  background: #fbf9f4; color: #2f6b4f;
  padding: 3px 5px; line-height: 0; cursor: pointer;
  margin-top: 2px;
}
.reorder .ro-peek:hover, .reorder .ro-peek:focus-visible { background: var(--riso-green); color: #fff; border-color: var(--riso-green); }
.reorder .ro-grip:active { cursor: grabbing; }
.q.dragging { opacity: 0.35; }
.q.drop-above { box-shadow: 0 -3px 0 #ff7eb6; }
.q.drop-below { box-shadow: 0 3px 0 #ff7eb6; }
@media (max-width: 640px) {
  .q.reorderable { padding-top: 28px; }
  .q.reorderable .reorder {
    left: auto; right: 0; top: 0;
    flex-direction: row; gap: 6px;
    opacity: 1;
  }
  .reorder button { padding: 4px 12px; }
}
.q .stem { display: flex; gap: 11px; }
.q .num { font-family: var(--font-display); font-weight: 700; min-width: 26px; }
.q .stem-body { flex: 1; min-width: 0; }
.q .stem-body p { margin-bottom: 8px; }
.q .marks { font-family: var(--font-display); font-weight: 600; font-size: 13.5px; white-space: nowrap; margin-left: auto; padding-left: 14px; }
/* Numbered statements inside a stem are a list: indented, and clear of the
   question that introduces them, the way a printed paper sets them. */
.q .stem-body .stem-list { list-style: none; margin: 7px 0 0; padding-left: 22px; }
.q .stem-body .stem-list li { margin-bottom: 2px; }

.q ol.opts { list-style: upper-alpha; margin: 6px 0 0 62px; }
.q ol.opts li { margin-bottom: 3px; padding-left: 5px; }

.part { display: flex; gap: 10px; margin: 12px 0 3px 37px; }
.part .plabel { font-style: italic; min-width: 24px; }
.part .ptext { flex: 1; min-width: 0; }

.qtable { border-collapse: collapse; margin: 10px 0 6px 37px; font-size: 14.5px; }
.qtable th, .qtable td { border: 1px solid #1a1a1a; padding: 5px 12px; text-align: center; }
.qtable th { font-weight: 600; background: #f4f2ec; }
.qtable caption { caption-side: top; font-weight: 700; font-size: 13px; letter-spacing: 0.02em; text-align: center; padding: 0 0 6px; }

.fig { margin: 12px 0 4px 37px; max-width: 480px; }
.fig svg { width: 100%; height: auto; display: block; }
.fig img { width: 100%; height: auto; display: block; }
.fig img.fig-photo { border: 1px solid #1a1a1a; }
.figcredit { font-size: 12px; color: #6d675a; margin-top: 3px; font-style: italic; }

/* bordered answer boxes with dotted lines, ~2 lines per mark */
.abox { border: 1px solid #1a1a1a; border-radius: 2px; margin: 8px 0 4px 37px; padding: 10px 12px 12px; }
.abox .ln { border-bottom: 1px dotted #8f897b; height: 27px; }
.abox .slot { display: flex; gap: 10px; align-items: flex-end; }
.abox .slot-label { font-size: 14.5px; padding-bottom: 3px; min-width: 22px; }
.abox .slot .ln { flex: 1; }
.drawbox { border: 1px solid #1a1a1a; border-radius: 2px; margin: 10px 0 4px 37px; }

/* Writing-space nudge: a quiet +/- in the corner of every answer box, so a
   teacher can give a question more room before printing. Screen only. */
.abox, .drawbox, .q.ap-frq .grid-plot { position: relative; }
.sp-adj {
  position: absolute; right: 5px; bottom: 4px;
  display: flex; gap: 3px;
  opacity: 0.15; transition: opacity 0.12s;
}
.q:hover .sp-adj, .sp-adj:hover, .sp-adj:focus-within { opacity: 1; }
.q.ap-frq .grid-plot > .sp-adj { background: #fff; border-radius: 5px; padding: 2px; }
.sp-adj button {
  position: relative;
  border: 1px solid #b9b2a0; border-radius: 5px;
  background: #fbf9f4; color: #1a1a1a;
  font-family: var(--font-display); font-size: 12px; line-height: 1;
  padding: 3px 7px; cursor: pointer;
}
.sp-adj button:hover, .sp-adj button:focus-visible {
  background: var(--riso-green); color: #fff; border-color: var(--riso-green);
}
.sp-adj button::after {
  content: attr(data-tip);
  position: absolute; right: 0; bottom: calc(100% + 7px);
  white-space: nowrap;
  background: #1a1a1a; color: #fbf9f4;
  font-family: var(--font-display); font-size: 12px; line-height: 1.3;
  padding: 4px 8px; border-radius: 4px;
  opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.sp-adj button:hover::after, .sp-adj button:focus-visible::after { opacity: 1; }

.er .er-theme { font-style: italic; }
.er-plan { margin: 10px 0 14px; padding: 10px 14px; border: 2px dashed var(--riso-pink); border-radius: 10px; background: color-mix(in srgb, var(--riso-pink) 7%, var(--paper-white)); }
.er-plan summary { cursor: pointer; font-weight: 700; }
.er-plan p { margin: 6px 0; font-size: 14px; }
.er-plan-box { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 8px; border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--paper-white); }
.er-plan-terms { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; }
@media print { .er-plan { display: none; } }

/* markscheme */
.ms { margin-top: 44px; border-top: 3px double #1a1a1a; padding-top: 22px; }
.ms h3 { font-family: var(--font-display); font-weight: 700; margin-bottom: 6px; }
.msq { margin-bottom: 16px; font-size: 15px; }
.msq .mnum { font-family: var(--font-display); font-weight: 700; }
.msq .msstmt { font-family: var(--font-mono); font-size: 12px; color: #6d675a; }
.msq ul { margin: 2px 0 4px 22px; padding-left: 0; }
.ms .msq ul { margin-left: 38px; }
.msq li { margin-bottom: 3px; }
/* Multi-part markschemes render in the preview and the hover peek as well as
   on the paper, so this cannot stay gated behind .ms. */
.msparts > li { list-style: none; margin-left: -16px; }

.msmax { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; }
.msnote { font-size: 13px; font-style: italic; color: #6d675a; margin: 2px 0 8px 22px; }
.ms .msnote { margin-left: 38px; }

/* ---------- AP Biology: College Board look ---------- */
.q.ap-frq { font-family: Helvetica, Arial, sans-serif; }
.q.ap-frq .frq-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.q.ap-frq .frq-kind { font-weight: 700; font-size: 15px; }
.q.ap-frq .frq-scope { font-size: 13.5px; font-style: italic; color: #444; margin: 6px 0 4px; }
.q.ap-frq .frq-context { font-size: 15px; margin-bottom: 8px; }
.q.ap-frq .frq-part { margin: 12px 0; }
.q.ap-frq .frq-prompt { display: flex; gap: 8px; font-size: 15px; margin-bottom: 6px; }
.q.ap-frq .frq-prompt .plabel { font-weight: 700; }
.q.ap-frq .frq-lines .ln { border-bottom: 1px solid #b9b2a0; height: 1.55rem; }
/* graph-construction grid */
.q.ap-frq .frq-grid {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  grid-template-rows: 1fr 1.4rem;
  gap: 4px; margin: 8px 0 4px; max-width: 600px;
}
.q.ap-frq .grid-yaxis {
  grid-row: 1; grid-column: 1;
  writing-mode: vertical-rl; transform: rotate(180deg);
  text-align: center; font-size: 12px; color: #1a1a1a; align-self: center;
}
.q.ap-frq .grid-plot {
  grid-row: 1; grid-column: 2;
  height: 21rem; border: 1.5px solid #1a1a1a;
  background-image:
    linear-gradient(#c9c3b2 1px, transparent 1px),
    linear-gradient(90deg, #c9c3b2 1px, transparent 1px);
  background-size: calc(100% / var(--gc, 16)) calc(100% / var(--gr, 12));
}
.q.ap-frq .grid-xaxis {
  grid-row: 2; grid-column: 2;
  text-align: center; font-size: 12px; color: #1a1a1a;
}
/* student labels the axis: blank writing line instead of a printed label */
.q.ap-frq .grid-yaxis.unlabelled { border-left: 1px solid #b9b2a0; min-width: 1.2rem; }
.q.ap-frq .grid-xaxis.unlabelled { border-bottom: 1px solid #b9b2a0; min-height: 1.3rem; margin: 2px 15% 0; }
/* Scoring guidelines */
.ap-sg .sg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ap-sg .frq-kind { font-family: Helvetica, Arial, sans-serif; font-weight: 700; font-size: 14px; }
.ap-sg .sg-lo { font-family: var(--font-mono); font-size: 12px; color: #6d675a; }
.ap-sg .sg-part { margin: 0 0 10px 8px; }
.ap-sg .sg-plabel { font-weight: 700; font-family: Helvetica, Arial, sans-serif; }
.ap-sg .sg-point { margin: 4px 0 4px 14px; }
.ap-sg .sg-sp { display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: #b23a6b; border: 1px solid #d8b0bd; border-radius: 4px; padding: 0 4px; margin-right: 5px; }
.ap-sg .sg-task { font-size: 14px; }
.ap-sg .sg-accept { font-size: 13.5px; color: #333; margin: 2px 0 2px 6px; }
.ap-sg .sg-accept ul { margin: 1px 0 2px 20px; }
.ms-model { margin: 8px 0 6px 14px; padding: 8px 10px; border: 1px solid #e3d9c4; border-radius: 8px; background: #fbf8f1; max-width: 520px; break-inside: avoid; }
.ms-model-h { font-family: Helvetica, Arial, sans-serif; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #b23a6b; margin: 0 0 4px; }
.ms-model img { display: block; width: 100%; height: auto; }
.ms-model-notes { margin: 6px 0 0 18px; padding: 0; font-size: 12.5px; color: #333; }
.ms-model-notes li { margin: 2px 0; }
.ap-sg .sg-total { font-size: 12.5px; font-weight: 600; color: #444; margin: 3px 0 0 8px; }
.ap-sg .sg-foot { font-size: 13px; font-weight: 700; margin-top: 4px; }

.sheet-foot { margin-top: 40px; font-size: 12px; color: #6d675a; border-top: 1px solid #d8d3c5; padding-top: 10px; }
.sheet-foot a { color: inherit; word-break: break-all; }
.sheet-foot .mono { font-size: 12px; }

.empty { font-family: var(--font-display); text-align: center; padding: 56px 16px; color: #6d675a; }
/* Until there is a paper the length bar, the view toggle and the paper's
   tools are about a paper that does not exist yet, at any width: the empty
   sheet with its topic finder is the page. */
.em-wrap.is-blank #pick-viewbar, .em-wrap.is-blank #em-prompt,
.em-wrap.is-blank #desktools { display: none; }
.em-wrap.is-blank .empty { padding-top: 28px; }
.empty b { color: var(--riso-pink-deep); font-size: 2em; line-height: 1.15; overflow-wrap: anywhere; }

/* ---------- print: only the paper, plain ink on A4 ---------- */
@media print { .cover .chip-hint { display: none; } }
@media print {
  @page { size: A4; margin: 18mm; }
  html, body { background: #fff !important; }
  .topbar, .em-rail, .em-left, footer, .skip-link, .em-head, .no-print, .a11y-controls,
  #picker-card, .pick-viewbar { display: none !important; }
  .em-wrap { display: block; margin: 0; }
  .sheet { outline: 0; box-shadow: none; width: auto; max-width: none; padding: 0; zoom: 1; font-size: 11pt; display: block !important; }
  .page-break { display: none !important; }
  .ms { page-break-before: always; border-top: 0; padding-top: 0; }
  /* Keep each question together where it fits; where it can't (a long
     data-based or FRQ question), never split an answer box, a figure, a
     table or a part's prompt from its box across the page break. */
  .q { page-break-inside: avoid; break-inside: avoid; }
  .abox, .drawbox, .frq-part, .fig, .qtable, .er .part + .abox { break-inside: avoid; page-break-inside: avoid; }
  /* A multiple-choice question is never split from its options, and the
     options are never split from each other: a choice with A to C on one
     page and D on the next is a different question. */
  .q ol.opts, .q ol.opts li { break-inside: avoid; page-break-inside: avoid; }
  .q ol.opts { break-before: avoid; page-break-before: avoid; }
  /* A data question with a table and a full-width graph can run a few
     lines over a page, and then it has to break somewhere. Cap the figure
     on multiple-choice questions so the whole question fits instead. */
  .q:has(ol.opts) .fig img { width: auto; max-width: 100%; max-height: 65mm; }
  .q:has(ol.opts) .fig svg { max-height: 65mm; }
  .part, .frq-prompt, .q .stem, .secthead, .rubric { break-after: avoid; page-break-after: avoid; }
  .abox .ln { break-inside: avoid; }
  .qtable th { background: #fff; }
  /* A wide data table (six columns of long labels) was set at its natural
     width and ran past the right margin, where the printer cut it off. Hold it
     to the text column: tighter type and padding, and a label that will not
     fit on a line breaks inside the cell rather than pushing the table out. */
  .qtable { max-width: calc(100% - 37px); font-size: 12.5px; }
  .qtable th, .qtable td { padding: 4px 6px; overflow-wrap: anywhere; }
  .abox, .drawbox { box-sizing: border-box; max-width: calc(100% - 37px); }
  /* The grid's squares are drawn as a background-image, not a border, so
     without this the browser's "no background graphics" print default
     leaves a blank bordered box with no plotting grid inside it. */
  .grid-plot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* "Print markscheme only" */
  .print-ms-only .sheet > :not(.ms) { display: none; }
  .print-ms-only .ms { page-break-before: avoid; }
}


/* ---------- mock examination: rail card + dialog ---------- */
.em-start { box-shadow: 4px 4px 0 var(--riso-green); display: grid; gap: 9px; }
.em-start h2 { margin-bottom: 2px; }
/* The four routes are one set of choices, so they share every measurement:
   same padding, same title, same sub-label. Only the fill differs, and only
   on the first, which is the one that asks no questions. Anything that
   varies between them reads as a different kind of thing, not a
   different option. */
.quick-btn, .quiz-btn, .mock-btn, .lib-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 12px 10px; text-align: center; text-decoration: none;
  background: var(--paper-white); color: var(--ink); border: 1.5px solid var(--ink);
}
.quick-btn { background: var(--riso-green); color: var(--on-brand); }
/* The sub-label sits on the button, so it dims from the button's own text
   colour rather than from --ink-dim, which is tuned for the page ground. It
   inherits because three of the four are outlines in dark mode too, where a
   fixed --on-brand would put dark text on a dark button. */
.quick-btn .mock-sub, .quiz-btn .mock-sub, .mock-btn .mock-sub, .lib-btn .mock-sub {
  font-family: var(--font-mono); font-weight: 400; font-size: 13.5px;
  line-height: 1.35; letter-spacing: 0.04em; color: inherit; opacity: 0.75;
}
.mock-btn:disabled, .mock-btn:disabled:hover { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); background: var(--paper-white); color: var(--ink); }
.empty-cta { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-cta .em-btn { width: auto; min-width: 240px; }
.empty-or { font-size: 13px; color: var(--ink-faint); font-style: italic; }
/* the topic finder: one question on the empty sheet */
.em-find { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.em-find-l { font-weight: 700; font-size: 18px; color: var(--ink); }
.em-find input {
  font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--ink); background: var(--paper-white); color: var(--ink); width: 100%;
}
.em-find input:focus-visible { outline: 2px solid var(--riso-pink-deep); outline-offset: 2px; }
.em-find-hits { display: flex; flex-direction: column; gap: 6px; }
.em-find-course { display: flex; border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; background: var(--paper-white); }
.em-find-course button {
  flex: 1 1 0; font: inherit; font-weight: 650; font-size: 14.5px; min-height: 40px; cursor: pointer;
  border: 0; background: none; color: var(--ink);
}
.em-find-course button + button { border-left: 1.5px solid var(--ink); }
.em-find-course button[aria-checked="true"] { background: var(--ink); color: var(--paper-white); }
.em-find-course button:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: -4px; }
.em-find-hit {
  font: inherit; font-size: 15px; text-align: left; cursor: pointer; color: var(--ink);
  display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid var(--line-strong); background: var(--paper-white);
}
.em-find-hit:hover, .em-find-hit:focus-visible { border-color: var(--ink); box-shadow: 3px 3px 0 var(--riso-green); }
.em-find-code { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: .06em; color: var(--riso-green-deep); white-space: nowrap; }
.em-find-name small { display: block; font-size: 14px; color: var(--ink-faint); }
.em-find-frq { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); cursor: pointer; }
.em-find-frq[hidden] { display: none; }
.em-find-note, .em-find-none { font-size: 13px; color: var(--ink-faint); margin: 0; }
.empty-cta .em-link { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; font-style: normal; text-decoration: underline; text-decoration-color: var(--riso-pink); text-underline-offset: 3px; }

.mock-dlg {
  border: 1.5px solid var(--ink); border-radius: 16px; padding: 0;
  background: var(--paper-white); color: var(--ink);
  box-shadow: 6px 6px 0 var(--riso-pink);
  width: min(560px, calc(100vw / var(--zoom, 1) - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  /* base.css zeroes every margin, which strips the browser's own centring
     from a modal dialog and pins it to the top-left corner. */
  margin: auto;
}
.mock-dlg::backdrop { background: rgba(26, 26, 26, 0.45); }
.mock-form { padding: 20px 24px 22px; }
.mock-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.mock-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.mock-x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink-dim); padding: 0 4px; }
.mock-x:hover { color: var(--ink); }
.mock-x:focus-visible { outline: 3px solid var(--riso-green); border-radius: 6px; }
.mock-row { display: grid; grid-template-columns: 84px 1fr; gap: 8px 14px; align-items: start; padding: 11px 0; border-top: 1px dashed var(--ink-faint); }
#mock-ib .mock-row:first-child, #mock-ap .mock-row:first-child { border-top: 1px dashed var(--ink-faint); }
.mock-k { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); padding-top: 9px; }
.mock-dlg .seg { flex-wrap: wrap; }
.mock-dlg .seg label { flex: 1 1 auto; padding: 7px 10px; }
.mock-dlg .seg input:checked + span { margin: -7px -10px; padding: 7px 10px; }
.mock-themes[hidden] { display: none; }
/* Taught-so-far picker: themes that open to their subtopics, so a teacher
   mid-theme can leave out the lessons that have not happened yet. */
.mock-themes { margin-top: 10px; font-size: 13.5px; }
.mock-themes-hint { font-size: 14px; color: var(--ink-dim); line-height: 1.45; margin: 0 0 8px; }
#mock-theme-list { display: grid; gap: 6px; max-height: 244px; overflow-y: auto; padding-right: 4px; }
.mock-theme { border: 1.5px solid var(--ink); border-radius: 9px; background: var(--paper-white); overflow: hidden; }
.mock-theme > summary {
  display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none;
  padding: 8px 11px; font-size: 13.5px; font-weight: 600;
}
.mock-theme > summary::-webkit-details-marker { display: none; }
.mock-theme > summary::after {
  content: "›"; margin-left: 2px; font-family: var(--font-mono); color: var(--ink-faint);
  transition: transform 0.15s; flex: none;
}
.mock-theme[open] > summary::after { transform: rotate(90deg); }
.mock-theme.has-picks > summary { background: var(--paper); }
.mock-theme .mth-name { flex: 1; min-width: 0; }
.mock-theme .mth-count { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-faint); flex: none; }
.mock-themes input { accent-color: var(--riso-pink-deep); width: 15px; height: 15px; flex: none; }
.mock-subs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px;
  padding: 4px 11px 10px 33px; border-top: 1px dashed var(--ink-faint);
}
.mock-subs label { display: flex; gap: 7px; align-items: baseline; cursor: pointer; font-size: 14px; padding: 3px 0; }
.mock-subs label span { min-width: 0; }
@media (max-width: 520px) { .mock-subs { grid-template-columns: 1fr; padding-left: 22px; } }
.mock-ms { border-top: 1px dashed var(--ink-faint); padding-top: 12px; margin-bottom: 2px; }
/* The preview and the build button stay in view while the theme list
   scrolls, so a long syllabus never pushes the action off a phone screen. */
.mock-foot {
  position: sticky; bottom: 0; z-index: 2;
  background: var(--paper-white);
  padding-bottom: 4px;
  box-shadow: 0 -10px 12px -8px var(--paper-white);
}
.mock-preview {
  margin: 10px 0 12px; padding: 11px 13px; border: 1px solid var(--ink); border-radius: 9px;
  background: var(--paper); font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6;
}
.mock-preview b { color: var(--riso-green-deep); }
.mock-warn { color: var(--riso-pink-deep); }
.mock-note { font-size: 14px; color: var(--ink-dim); line-height: 1.5; margin: 12px 0 0; }
@media (max-width: 480px) {
  .mock-row { grid-template-columns: 1fr; gap: 4px; }
  .mock-k { padding-top: 0; }
  .mock-form { padding: 16px 16px 18px; }
}

/* ---------- the student route: Take it on screen ---------- */
/* A segment of the toolbar in student mode (.dt-seg); Student view in More
   for a teacher. Both open the sit page. */

/* ---------- quiet newsletter ask ---------- */
/* Appears at the bottom of the rail only after a couple of papers have been
   built (someone who has got value, not someone who just arrived), and never
   again once joined or dismissed. */
.em-nl { position: relative; }
.em-nl h2 { padding-right: 22px; }
.nl-dismiss {
  position: absolute; top: 8px; right: 10px;
  border: 0; background: none; cursor: pointer;
  font-size: 17px; line-height: 1; color: var(--ink-faint);
  padding: 2px 5px;
}
.nl-dismiss:hover { color: var(--ink); }

/* ---------- topic landing pages (exam-maker/ib/*, exam-maker/ap/*) ----------
   Static pages built by scripts/build-topic-pages.mjs: one per IB subtopic
   and AP unit, each with a pre-rendered paper. They share the exam maker's
   chrome and sheet styles; these classes cover only what is new. */
.tp-crumb { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.04em; color: var(--ink-dim); margin: 4px 0 18px; }
.tp-crumb a { color: inherit; }
.tp-crumb b { color: var(--ink); }
.tp-head { max-width: 860px; margin: 0 0 26px; }
.tp-head .meta { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.06em; color: var(--ink-dim); display: inline-flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.tp-head .meta .pin { width: 12px; height: 12px; border-radius: 50%; background: var(--riso-green); box-shadow: 2px 2px 0 var(--riso-pink); }
.tp-head h1 { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.05; letter-spacing: -.01em; font-weight: 600; margin-bottom: 12px; text-wrap: balance; }
.tp-head h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--riso-green-deep); }
.tp-head .lede { font-size: 16.5px; color: var(--ink-dim); max-width: 66ch; line-height: 1.55; }

.tp-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 18px; margin: 0 0 30px; }
@media (max-width: 860px) { .tp-grid { grid-template-columns: 1fr; } }
.tp-card {
  background: var(--paper-white); border: 1.5px solid var(--ink); border-radius: 14px;
  padding: 16px 18px 14px; box-shadow: 4px 4px 0 var(--riso-green);
}
.tp-card + .tp-card { box-shadow: 4px 4px 0 var(--riso-pink); }
.tp-card h2 { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--riso-green-deep); margin: 0 0 8px; }
.tp-card h3 { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--riso-pink-deep, #c0397a); margin: 16px 0 6px; }
.tp-sub { font-size: 13px; color: var(--ink-dim); line-height: 1.5; margin: 6px 0 0; }
.splycr-card { display: flex; align-items: center; gap: 16px; max-width: 640px; margin: 28px 0 0; padding: 14px 18px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--paper, transparent); box-shadow: 3px 3px 0 var(--riso-pink); color: var(--ink); line-height: 1.4; }
.splycr-logo { display: inline-flex; align-items: center; gap: 9px; flex: none; }
.splycr-logo img { display: block; width: 40px; height: 40px; }
.splycr-word { font-weight: 800; font-size: 24px; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.splycr-text { display: block; font-size: 15px; }
.splycr-label { display: block; margin-bottom: 3px; font: 600 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.splycr-links a { display: inline-block; margin-top: 4px; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.splycr-links a:hover { color: var(--riso-pink); }
@media (max-width: 560px) { .splycr-card { flex-direction: column; align-items: flex-start; gap: 10px; } }
@media print { .splycr-card { display: none; } }
.tp-statements { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 1.45; }
.tp-statements li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 5px 0; border-top: 1px dashed var(--ink-faint); }
.tp-statements li:first-child { border-top: 0; }
/* A link straight to one statement (a lab's syllabus tags use these ids)
   lights that line and leaves room for the top bar above it. */
.tp-statements li { scroll-margin-top: 110px; }
.tp-statements li:target { background: color-mix(in srgb, var(--riso-green) 16%, transparent); box-shadow: -8px 0 0 color-mix(in srgb, var(--riso-green) 16%, transparent), 8px 0 0 color-mix(in srgb, var(--riso-green) 16%, transparent); border-radius: 4px; }
.tp-code-lbl { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-dim); min-width: 4.6em; }
.tp-lvl { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.06em; border: 1px solid var(--ink); border-radius: 4px; padding: 0 4px; line-height: 1.5; white-space: nowrap; }
.tp-lvl.hl { background: var(--ink); color: var(--paper-white); }
.tp-n { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-dim); margin-left: auto; }
.tp-counts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13.5px; }
.tp-counts b { font-family: var(--font-mono); font-size: 15px; color: var(--riso-green-deep); margin-right: 4px; }
.tp-links { list-style: none; margin: 0; padding: 0; font-size: 13.5px; line-height: 1.5; }
.tp-links li { padding: 3px 0; }
.tp-links a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--riso-green); text-underline-offset: 3px; }
.tp-links a:hover { text-decoration-color: var(--riso-pink); }

.tp-h2 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 12px; }
.tp-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; max-width: 780px; margin: 0 auto 14px; }
.tp-btn {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px;
  border: 1.5px solid var(--ink); border-radius: 10px; background: var(--paper-white); color: var(--ink);
  font-family: var(--font-display); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  box-shadow: 2px 2px 0 var(--riso-pink); transition: transform 0.12s, box-shadow 0.12s;
}
.tp-btn.primary { background: var(--riso-green); color: var(--on-brand); box-shadow: 2px 2px 0 var(--ink); }
.tp-btn:hover { transform: translateY(-1px); }
.tp-btn:active { transform: translateY(1px); box-shadow: 1px 1px 0 var(--riso-pink); }
.tp-btn:focus-visible { outline: 3px solid var(--riso-green); outline-offset: 2px; }
/* The SL / HL switch above a library paper. */
.tp-levelbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; max-width: 780px; margin: 0 auto 14px; }
.tp-seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--paper-white); }
.tp-seg button { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.1em; text-transform: uppercase; padding: 8px 16px; background: none; border: 0; color: var(--ink); cursor: pointer; }
.tp-seg button.on { background: var(--ink); color: var(--paper-white); }
.tp-seg button:focus-visible { outline: 3px solid var(--riso-green); outline-offset: -3px; }
.tp-lvl-note { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.06em; color: var(--ink-dim); }
.tp-paper[hidden] { display: none; }
.tp-code { margin-left: auto; font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); }
.tp-code b { font-size: 13.5px; text-transform: none; color: var(--ink); letter-spacing: 0.02em; }
@media (max-width: 560px) { .tp-code { margin-left: 0; width: 100%; } }
.tp-sheet .tp-ms { margin-top: 30px; border-top: 1.5px dashed #1a1a1a; padding-top: 14px; }
.tp-sheet .tp-ms summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.tp-sheet .tp-ms[open] summary { margin-bottom: 8px; }
@media print { .tp-ms summary { display: none; } .tp-ms { break-before: page; border-top: 0; } .tp-ms:not([open]) { display: none; } }
/* A library paper on a phone. The sheet keeps the printed page's 18 mm
   margins and 37 px indents otherwise, which left a 360 px screen a text
   column of about 80 px beside each part label and cut off the right of most
   data tables. Screen only: the printout keeps its margins. A table wider
   than the screen swipes sideways inside its own box, like the sit page's. */
@media screen and (max-width: 640px) {
  .tp-sheet { --page-margin: 14px; }
  .tp-sheet .part, .tp-sheet .abox, .tp-sheet .drawbox, .tp-sheet .fig { margin-left: 0; }
  .tp-sheet .q ol.opts { margin-left: 22px; }
  .tp-sheet table.qtable { display: block; max-width: 100%; overflow-x: auto; margin-left: 0; -webkit-overflow-scrolling: touch; }
  .tp-sheet .qtable th, .tp-sheet .qtable td { padding: 4px 8px; }
}

.tp-more { margin-top: 34px; max-width: 860px; }
.tp-more h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 10px; }
.tp-siblings, .tp-index { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; font-size: 14px; }
.tp-siblings li, .tp-index li { display: flex; flex-direction: column; gap: 2px; padding: 7px 0; border-bottom: 1px dashed var(--ink-faint); }
.tp-siblings a, .tp-index a { color: var(--ink); text-decoration: none; }
.tp-siblings a:hover, .tp-index a:hover { text-decoration: underline; text-decoration-color: var(--riso-pink); text-underline-offset: 3px; }
.tp-siblings span, .tp-index span { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-dim); white-space: nowrap; }
.tp-theme { margin: 0 0 26px; }
.tp-theme h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 8px; }
.tp-theme .tp-index a b { font-family: var(--font-mono); font-weight: 500; color: var(--riso-green-deep); margin-right: 4px; }


/* ---------- quiz dialog: one question first, the rest after ---------- */
.quiz-dlg .mock-form { min-width: min(440px, 92vw); }
.quiz-ask { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-dim); text-align: center; margin: 6px 0 12px; }
.quiz-courses { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 6px; }
.quiz-course {
  border: 1.5px solid var(--ink); border-radius: 12px; background: var(--paper-white); color: var(--ink);
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  padding: 22px 12px; cursor: pointer; display: grid; gap: 4px; justify-items: center;
  box-shadow: 3px 3px 0 var(--ink); transition: background-color .12s, color .12s;
}
.quiz-course span { font-family: var(--font-mono); font-size: 13.5px; font-weight: 400; opacity: 0.7; }
.quiz-course:hover { background: var(--riso-green); color: var(--on-brand); }
.quiz-course:focus-visible { outline: 3px solid var(--riso-pink); outline-offset: 2px; }
.quiz-chosen b { font-family: var(--font-display); font-size: 15px; }
.quiz-change {
  border: 1px solid var(--ink); border-radius: 6px; background: var(--paper-white); color: var(--riso-pink-deep);
  font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.05em;
  padding: 2px 8px; margin-left: 8px; cursor: pointer;
}
.quiz-change:hover { background: var(--riso-pink); color: var(--on-brand); }
@media (prefers-reduced-motion: reduce) { .quiz-course { transition: none; } }

/* ---------- first-run hint above the paper ---------- */
.what-now {
  position: relative;
  border: 1.5px solid var(--ink); border-radius: 12px;
  background: var(--paper-white);
  box-shadow: 4px 4px 0 var(--riso-pink);
  padding: 13px 40px 14px 16px; margin: 0 0 16px;
}
.what-now .wn-head { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.what-now .wn-body { font-size: 14.5px; color: var(--ink-dim); line-height: 1.5; max-width: 68ch; }
.what-now-x {
  position: absolute; top: 8px; right: 9px;
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid var(--ink); border-radius: 50%;
  background: var(--paper-white); color: var(--ink);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.what-now-x:hover { background: var(--riso-pink); color: var(--on-brand); }
.what-now-x:focus-visible { outline: 3px solid var(--riso-pink); outline-offset: 2px; }
.empty-cta .quick-cta { background: var(--riso-green); color: var(--on-brand); }
.em-link { background: none; border: 0; padding: 0; font: inherit; color: var(--riso-pink-deep);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.em-link:hover { color: var(--ink); }
/* A build button that cannot yet run must not look pressable. */
.quiz-dlg .em-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: 3px 3px 0 var(--ink); }
.quiz-dlg .em-btn:disabled:hover { background: var(--paper-white); color: var(--ink); }

.quiz-courses-3 { grid-template-columns: repeat(3, 1fr); }
.quiz-courses-3 .quiz-course { padding: 20px 8px; font-size: 19px; }
/* display:grid on .quiz-courses would otherwise beat the hidden attribute */
.quiz-courses[hidden] { display: none; }
/* display:grid on .mock-row would otherwise beat the hidden attribute */
.mock-row[hidden] { display: none; }
.mock-themes[hidden] { display: none; }
/* AP units use the same dropdown rows as the IB themes, so the two courses
   feel like one control rather than two different pickers. */
#quiz-unit-list { display: grid; gap: 6px; max-height: 244px; overflow-y: auto; padding-right: 4px; }
.mock-theme-flat { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; }
.quiz-course.is-last { box-shadow: inset 0 0 0 2px var(--riso-pink-deep); }

/* ============================================================
   The funnel (2026-11): a first screen, then the building page.
   body[data-em] is first, build or ms (a kept paper's markscheme).
   ============================================================ */
body[data-em="first"] #em-build, body[data-em="first"] .em-dock,
body[data-em="first"] #em-hand, body[data-em="first"] #em-scrim { display: none !important; }
body:not([data-em="first"]) #em-first, body[data-em="first"] .em-orig { display: none !important; }
.em-ctl-hidden { display: none !important; }

/* ---------- the first screen ---------- */
.em-first { padding-top: 10px; }
.em-fn .fn-top { flex-wrap: wrap; }
.em-fn-k { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 700; color: var(--ink-faint); }
.em-fn-mp { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--riso-pink); text-underline-offset: 3px; }
.em-fn-mp .em-mp-n { background: none; color: var(--ink-faint); font-weight: 400; min-width: 0; padding: 0; margin-left: 4px; }
.em-fn-mp .em-mp-n::before { content: "("; }
.em-fn-mp .em-mp-n::after { content: ")"; }
.em-made { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; color: var(--ink-faint); white-space: nowrap; }
.em-made::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--riso-green); flex: none; }
.em-made b { color: var(--ink); font-weight: 700; }
.em-fn-bul { margin: -4px 0 0; padding-left: 20px; font-size: 16.5px; line-height: 1.5; color: var(--ink-dim); }
.em-fn-bul li { margin: 2px 0; }
.em-fn-ask { display: flex; align-items: baseline; gap: 10px; margin-bottom: -6px; }
.em-fn-ask .fn-ask { display: flex; align-items: baseline; gap: 8px; }
.em-fn-ask .fn-ask i { font-style: normal; font-size: 12.5px; letter-spacing: .08em; color: var(--riso-green-deep); }
.em-fn-ask small { margin-left: auto; font-size: 13.5px; color: var(--ink-faint); }
.em-fn .em-fn-course { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.em-fn-course .fn-opt { align-items: center; text-align: center; padding: 12px 8px; gap: 2px; }
.em-fn-course .fn-opt b { font-size: 22px; }
.em-fn-course .fn-opt span { font-size: 13.5px; color: var(--ink-faint); }
.em-fn-course .fn-opt[aria-checked="true"] { background: var(--ink); color: var(--paper-white); box-shadow: 4px 4px 0 var(--riso-green); }
.em-fn-course .fn-opt[aria-checked="true"] span { color: var(--paper-white); opacity: .8; }
.em-fn-course .fn-opt:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
.em-fn-in { width: 100%; box-sizing: border-box; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper-white); color: var(--ink); padding: 12px 14px; font: inherit; font-size: 16.5px; }
.em-fn-in:focus { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
.em-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.em-chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper-white); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer;
}
.em-chip small { font-size: 13px; font-weight: 400; color: var(--ink-faint); }
.em-chip:hover { background: color-mix(in srgb, var(--riso-green) 14%, var(--paper-white)); }
.em-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--riso-green) 34%, var(--paper-white)); }
.em-chip[aria-pressed="true"]::before { content: "\2713"; font-size: 13px; }
.em-chip:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
.em-chip-ghost { border-style: dashed; font-weight: 400; color: var(--ink-dim); }
.em-fn-none { text-align: left; }
.em-fn-subs { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; padding: 2px 4px 4px 2px; }
.em-fn-subh { margin: 8px 0 4px; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.em-fn .fn-go { width: 100%; }
.em-fn .fn-cost b { color: var(--ink); }
.em-fn-help { border-top: 1px dashed var(--line-strong); padding-top: 13px; }
.em-fn-code { margin-top: 14px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: 12px; background: color-mix(in srgb, var(--riso-pink) 12%, var(--paper-white)); }
.em-code-lbl { display: block; font-weight: 700; font-size: 15px; color: var(--ink); }
.em-fn-code .em-share, .code-pop .em-share { margin-top: 8px; }
.em-fn-code .em-share input, .code-pop .em-share input { font-size: 15px; padding: 9px 11px; }
.em-fn-code .em-share button, .code-pop .em-share button { font-family: inherit; font-size: 15px; font-weight: 700; padding: 0 16px; background: var(--ink); color: var(--paper-white); }
.em-codewrap { position: relative; display: flex; flex: 1 1 auto; }
.em-codewrap > .dt-seg { flex: 1 1 auto; }
.code-pop { right: auto; left: 0; display: block; }
.em-fn-code .em-hint:empty { display: none; }
.em-first .em-fn-under { margin-top: 22px; font-size: 13.5px; line-height: 1.7; }
.em-dlg-acts { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.em-dlg-acts .fn-go { margin: 0; text-decoration: none; }
.em-dlg-close { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-faint); text-decoration: underline; cursor: pointer; }
.fn-dlg { max-width: min(620px, calc(100vw - 32px)); background: var(--paper-white); color: var(--ink); padding: 22px 24px; }
.fn-dlg p { font-size: 15px; line-height: 1.55; color: var(--ink-dim); margin: 0 0 10px; }
.fn-dlg .em-class-steps { padding-left: 20px; font-size: 15px; line-height: 1.5; color: var(--ink-dim); }
.fn-dlg .em-class-steps li { margin-bottom: 8px; }
.em-first .em-rev, .em-first .em-check-line, .em-first .em-try { margin-bottom: 16px; }
@media (max-width: 560px) {
  .em-first { padding: 4px 0 24px; }
  .em-fn { padding: 18px 16px; gap: 13px; box-shadow: 4px 4px 0 var(--ink); }
  .em-fn .fn-h1 { font-size: 31px; }
  .em-fn-bul { font-size: 15px; }
  .em-fn .em-fn-course { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .em-fn-course .fn-opt { padding: 10px 4px; border-radius: 12px; }
  .em-fn-course .fn-opt b { font-size: 19px; }
  .em-fn-ask small { display: none; }
  .em-chip { font-size: 13.5px; padding: 6px 10px; }
}

/* ---------- building: three columns ---------- */
@media screen { .em-wrap { display: block; margin-top: 4px; } }
.em-desk { min-width: 0; }
.em-crumb { display: flex; align-items: center; gap: 12px; min-height: 30px; margin: 0 0 8px; font-size: 14.5px; color: var(--ink-dim); }
.em-crumb-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-crumb-t b { color: var(--ink); }
.em-crumb .em-made { margin-left: auto; }
.em-crumb-new { flex: none; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--riso-pink); text-underline-offset: 3px; white-space: nowrap; }
.em-crumb .em-made[hidden] + .em-crumb-new { margin-left: auto; }

/* The rails: tall sheets that run past the foot of the screen, each its own
   scroll, with a thin visible track, a fade and a "more below" button while
   there is more. */
.em-side { position: relative; min-width: 0; display: flex; flex-direction: column; background: var(--paper-white); color: var(--ink); border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: 4px 0 0 var(--riso-green); }
.em-rail.em-side { box-shadow: 4px 0 0 var(--riso-pink); }
.rail-h { flex: none; display: flex; align-items: baseline; gap: 10px; padding: 13px 16px 11px; border-bottom: 1.5px solid var(--ink); }
.rail-h > b { font-size: 13.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--riso-green-deep); margin-right: auto; }
.rail-done { display: none; }
.rail-in { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 14px 24px 46px 16px; }
.rail-in::-webkit-scrollbar { display: none; }
.rail-in > h3, .rail-in > div > h3 { margin: 18px 0 8px; font-family: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--riso-green-deep); }
.rail-trk { position: absolute; z-index: 3; right: 5px; top: 50px; bottom: 0; width: 7px; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--ink) 13%, transparent); pointer-events: none; }
.rail-trk i { position: absolute; left: 0; right: 0; top: 0; border-radius: 4px; background: var(--ink); min-height: 24px; }
.em-side::after { content: ""; position: absolute; left: 0; right: 16px; bottom: 0; height: 54px; background: linear-gradient(color-mix(in srgb, var(--paper-white) 0%, transparent), var(--paper-white) 85%); pointer-events: none; transition: opacity .2s; }
.rail-down { position: absolute; z-index: 4; right: 22px; bottom: 12px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: var(--paper-white); font-size: 14px; line-height: 1; cursor: pointer; box-shadow: 2px 2px 0 var(--riso-pink); transition: opacity .2s; }
.em-side.at-end::after, .em-side.at-end .rail-down { opacity: 0; pointer-events: none; }

/* This paper */
.em-glance p { margin: 0; font-size: 15px; line-height: 1.4; }
.em-glance p b { color: var(--ink); }
.em-mix { display: flex; height: 10px; margin: 9px 0 2px; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
.em-mix i { display: block; flex: 1 1 0; }
.em-mix .d1 { background: color-mix(in srgb, var(--riso-green) 32%, var(--paper-white)); }
.em-mix .d2 { background: var(--riso-green); }
.em-mix .d3 { background: var(--riso-pink); }
.em-mix[hidden] { display: none; }
.em-len { display: flex; flex-direction: column; gap: 6px; }
.em-len input[type=range] { width: 100%; accent-color: var(--riso-green-deep); cursor: pointer; margin: 4px 0 0; }
.em-len input[type=range]:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 3px; }
.em-len output { font-size: 15px; font-weight: 700; color: var(--ink); }
.em-fmt { display: flex; flex-direction: column; gap: 6px; }
.em-fmt label { position: relative; cursor: pointer; }
.em-fmt input { position: absolute; opacity: 0; }
.em-fmt span, .em-fmt-on {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; box-sizing: border-box;
  padding: 8px 11px; border: 1.5px solid var(--line-strong); border-radius: 9px; background: var(--paper-white); color: var(--ink);
  font: inherit; font-size: 14.5px; font-weight: 700; text-align: left;
}
.em-fmt em { font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; }
.em-fmt label:hover span { border-color: var(--ink); }
.em-fmt input:checked + span, .em-fmt-on { border-color: var(--ink); background: color-mix(in srgb, var(--riso-green) 30%, var(--paper-white)); box-shadow: 2px 2px 0 var(--ink); }
.em-fmt-on { cursor: pointer; }
.em-fmt input:focus-visible + span { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }
.em-fmt input:disabled + span { opacity: .4; cursor: not-allowed; }
.em-seg3 { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 8px; }
.em-tog { align-items: flex-start; gap: 10px; padding: 7px 0; font-size: 14.5px; line-height: 1.35; }
.em-tog input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--riso-pink-deep); }
.em-fresh-note { margin: 2px 0 4px 28px; font-size: 13px; line-height: 1.4; color: var(--riso-pink-deep); }
.em-ghost { display: block; width: 100%; margin-top: 10px; padding: 9px 11px; border: 1.5px solid var(--ink); border-radius: 9px; background: var(--paper-white); color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 700; text-align: left; cursor: pointer; }
.em-ghost small { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-faint); }
.em-ghost:hover { background: color-mix(in srgb, var(--riso-green) 14%, var(--paper-white)); }
.em-code { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--paper-white); font-size: 13px; }
.em-code b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 12.5px; font-weight: 400; }
.em-code button { flex: none; border: 0; background: none; padding: 0; color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.em-side .em-nl { margin-top: 18px; }

/* Topics */
.em-lvt { display: inline-flex; align-items: baseline; gap: 11px; font-size: 14px; }
.em-lvt-c, .em-lvt-ap { font-weight: 700; color: var(--ink-faint); text-decoration: none; font-size: 14px; }
.em-lvt-ap { text-decoration: underline; color: var(--ink); }
.em-lvt button { border: 0; border-bottom: 3px solid transparent; background: none; padding: 0 0 2px; color: var(--ink-faint); font: inherit; font-weight: 700; cursor: pointer; }
.em-lvt button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--riso-pink); }
.em-lvt button:disabled { opacity: .4; cursor: not-allowed; }
.em-tin { width: 100%; box-sizing: border-box; margin: 0 0 10px; padding: 8px 10px; border: 1.5px solid var(--ink); border-radius: 9px; background: var(--paper-white); color: var(--ink); font: inherit; font-size: 14.5px; }
.em-tin:focus { outline: 3px solid var(--riso-pink-deep); outline-offset: 1px; }
#topics { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.em-rail .topic-group { border: 1.5px solid var(--ink); border-radius: 9px; margin: 0 0 7px; }
.em-rail .topic-group > summary { padding: 8px 8px 8px 10px; gap: 9px; font-family: inherit; font-size: 14px; letter-spacing: 0; text-transform: none; line-height: 1.3; }
.em-rail .topic-group > summary::after, .em-rail .topic-group > summary:hover::after { content: "\25B8"; display: block; width: 22px; height: auto; margin-left: 0; border: 0; border-radius: 0; background: none; font-size: 20px; text-align: center; color: var(--ink); line-height: 1; }
.em-rail .topic-group > summary > span:first-of-type { flex: 1 1 auto; min-width: 0; }
.em-rail .topic-group .opt { font-size: 14px; line-height: 1.3; padding: 6px 10px; }
.em-rail .topic-group[open] > summary::after { content: "\25BE"; }
.em-rail .group-count { margin-left: auto; font-size: 12.5px; }
.em-rail .opt .n { display: none; }
.em-rail .topic-browse { opacity: 0; margin-left: auto; transition: opacity .12s; }
.em-rail .opt:hover .topic-browse, .em-rail .topic-browse:focus-visible { opacity: 1; }
@media (hover: none) { .em-rail .topic-browse { opacity: 1; } }

/* The toolbar: one joined bar, [Paper | Browse bank] [Randomise] [Share]
   [More] [Print / PDF]. It rides along under the site bar. */
.em-desktools { position: sticky; z-index: 39; max-width: none; margin: 0 0 14px; padding: 8px 0 6px; background: var(--paper); border: 0; border-radius: 0; box-shadow: none; display: block; }
.em-desktools .dt-bar { border-radius: 11px; box-shadow: 4px 4px 0 var(--ink); overflow: visible; }
.dt-bar > .pv-seg { display: flex; flex: 2 1 auto; border-right: 3px solid var(--ink); }
.dt-bar > .pv-seg label { flex: 1; display: flex; position: relative; cursor: pointer; }
.dt-bar > .pv-seg label + label { border-left: 1px solid var(--line-strong); }
.dt-bar > .pv-seg input { position: absolute; opacity: 0; }
.dt-bar > .pv-seg span { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 12px; font-family: var(--font-display); font-size: 14px; font-weight: 650; white-space: nowrap; }
.dt-bar > .pv-seg label:first-child span { border-radius: 9.5px 0 0 9.5px; }
.dt-bar > .pv-seg input:checked + span { background: var(--ink); color: var(--paper-white); }
.dt-bar > .pv-seg label:hover input:not(:checked) + span { background: var(--paper); }
.dt-bar > .pv-seg input:focus-visible + span { outline: 3px solid var(--riso-pink-deep); outline-offset: -4px; }
.em-desktools .dt-seg { padding: 0 11px; gap: 6px; min-width: 0; }
.em-desktools .dt-bar > .em-sharewrap, .em-desktools .dt-bar > .dt-morewrap { flex: 1 1 auto; min-width: 0; }
.em-desktools .dt-bar > .em-sharewrap > .dt-seg, .em-desktools .dt-bar > .dt-morewrap > .dt-seg { flex: 1 1 auto; }
.em-desktools .dt-primary { margin: -1.5px -1.5px -1.5px 0; flex: 1.2 1 auto; }
.dt-bar .dice { border: 0; border-right: 1px solid var(--line-strong); border-radius: 0; min-height: 42px; padding: 0 14px; font-family: var(--font-display); font-size: 14px; font-weight: 650; }
.dt-bar .dice[hidden] { display: none; }
.dt-bar > .dt-primary { border-radius: 0 10px 10px 0; }
.dt-bar .em-sharewrap, .dt-bar .dt-morewrap { position: relative; }
.share-pop, .dt-more-pop { border-width: 2px; border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); }
.share-pop { right: auto; left: 0; display: grid; gap: 10px; }
.share-row .share-copy { border: 0; background: none; padding: 0; font-family: inherit; font-weight: 700; text-decoration: underline; }
.share-row .share-copy:hover, .share-row .share-copy.copied { background: none; color: var(--riso-green-deep); }
.share-k { width: 78px; }
.dt-more-pop { right: 0; }

/* Browse bank */
.em-desk #picker-card { box-shadow: none; border-width: 1.5px; border-radius: 12px; margin-bottom: 16px; }
.pick-selects { grid-template-columns: 1fr 1fr; }
.pick-selects .dd-btn { border-radius: 999px; }
.pick-tools input[type=search] { border-radius: 10px; }
.pick-add {
  flex: none; width: 76px; padding: 6px 0; border: 1.5px solid var(--ink); border-radius: 9px;
  background: var(--paper-white); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 700; text-align: center; cursor: pointer;
}
.pick-add:hover { background: color-mix(in srgb, var(--riso-green) 18%, var(--paper-white)); }
.pick-add[aria-pressed="true"] { background: var(--riso-green); color: var(--on-brand); }
.pick-add:focus-visible { outline: 3px solid var(--riso-pink-deep); outline-offset: 2px; }

/* On the paper: the eye shows the answer; the move and remove tools wait
   for a hover, as do the answer-space - and + buttons. */
.q > .ro-peek {
  position: absolute; top: -2px; right: -40px; z-index: 2;
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 8px; background: none; color: #2f6b4f; cursor: help;
}
.q > .ro-peek:hover, .q > .ro-peek:focus-visible { background: rgba(45, 184, 118, .2); outline: none; }
.q { position: relative; }
@media (hover: hover) {
  .q .reorder { opacity: 0; }
  .q:hover .reorder, .q .reorder:focus-within { opacity: 1; }
  .sp-adj { opacity: 0; }
  .abox:hover .sp-adj, .drawbox:hover .sp-adj, .sp-adj:focus-within { opacity: 1; }
}

/* The markscheme view: a kept paper opened on its markscheme from My papers. */
body[data-em="ms"] .em-side, body[data-em="ms"] #em-crumb, body[data-em="ms"] #desktools,
body[data-em="ms"] #picker-card, body[data-em="ms"] .em-dock, body[data-em="ms"] #em-hand { display: none !important; }
body[data-em="ms"] #ms-head { display: flex !important; }
body[data-em="ms"] .sheet > :not(.ms) { display: none !important; }
body[data-em="ms"] .sheet > .ms { border-top: 0; margin-top: 0; padding-top: 0; page-break-before: avoid; break-before: avoid; }
.em-msview { align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 14px; font-size: 14.5px; }
.em-msview a { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--riso-pink); text-underline-offset: 3px; }
.em-msview #ms-title { font-weight: 700; color: var(--ink); flex: 1; min-width: 0; }
.em-msview .fn-go { padding: 9px 16px; font-size: 16px; }

/* The dock and the hand-out sheet exist only under the three-column width. */
.em-dock, .em-hand, .em-scrim { display: none; }

@media screen and (min-width: 1080px) {
  body:not([data-em="first"]) .em-page { padding-left: 24px; padding-right: 24px; }
  .em-wrap { display: grid; grid-template-columns: 272px minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
  .em-left { grid-column: 1; grid-row: 1; }
  .em-desk { grid-column: 2; grid-row: 1; }
  .em-rail { grid-column: 3; grid-row: 1; }
  .em-side { position: sticky; top: calc(var(--topbar-h, 70px) + 14px); height: calc(100vh - var(--topbar-h, 70px) - 10px); margin-top: 38px; }
  body[data-em="ms"] .em-wrap { display: block; max-width: 860px; margin: 0 auto; }
}

/* Under it: one column, the rails are sheets from the dock. */
@media screen and (max-width: 1079.98px) {
  .em-wrap { padding-bottom: 86px; }
  .em-side { display: none; }
  .em-side.open {
    display: flex; position: fixed; z-index: 220; left: 0; right: 0; bottom: 64px;
    height: min(560px, calc(100vh - 140px)); border-radius: 18px 18px 0 0; border-width: 2px 0 0;
    box-shadow: 0 -6px 0 rgba(26, 58, 42, .18);
  }
  .em-side.open .rail-h { padding-top: 16px; }
  .em-side.open .rail-h::before { content: ""; position: absolute; left: 50%; top: 6px; width: 42px; height: 4px; margin-left: -21px; border-radius: 3px; background: var(--line-strong); }
  .em-side.open .rail-done { display: inline-block; margin-left: auto; padding: 5px 14px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--riso-green); color: var(--on-brand); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
  .em-side.open .rail-trk { top: 56px; }
  .em-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 210; background: rgba(26, 58, 42, .35); }
  body.side-open { overflow: hidden; }
  body.side-open .a11y-controls { display: none !important; }
  /* main > * opens a stacking context each (base.css), which would trap a
     sheet under the scrim; lift the paper's column while one is open. */
  body.side-open .em-wrap, body.side-open .em-hand, body.side-open .em-dock { z-index: 220; }
  .em-hand .rail-in { display: flex; flex-direction: column; gap: 9px; }
  .em-hand .em-ghost { margin: 0; }
  body:not([data-em="first"]):not([data-em="ms"]) .em-dock {
    display: grid; grid-template-columns: 1fr 1fr 1fr 1.3fr; position: fixed; z-index: 230; left: 0; right: 0; bottom: 0;
    background: var(--paper-white); border-top: 2px solid var(--ink); padding-bottom: env(safe-area-inset-bottom);
  }
  /* The Display tab steps up over the dock, as on the sit page. */
  body[data-em="build"] .a11y-controls { bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important; }
  .em-dock button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 62px; padding: 9px 2px 8px; border: 0; border-right: 1.5px solid var(--ink); background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
  .em-dock button:last-child { border-right: 0; }
  .em-dock .em-dock-pri { background: var(--riso-green); color: var(--on-brand); }
  .em-dock button[aria-pressed="true"] { background: var(--ink); color: var(--paper-white); }
  /* The bar keeps only the view toggle; the dock has the rest. */
  .em-desktools .dt-bar > :not(.pv-seg) { display: none !important; }
  .em-desktools .dt-bar > .pv-seg { border-right: 0; }
  .dt-bar > .pv-seg label:last-child span { border-radius: 0 9.5px 9.5px 0; }
  .em-desktools .dt-bar { box-shadow: 3px 3px 0 var(--ink); }
  .em-crumb { position: sticky; top: var(--topbar-h, 0px); z-index: 40; margin: 0 -16px 0; padding: 8px 16px; background: var(--paper); border-bottom: 1.5px solid var(--ink); font-size: 13.5px; }
  .em-desktools { top: calc(var(--topbar-h, 0px) + 44px) !important; }
  .em-crumb .em-made-l { display: none; }
  .q > .ro-peek { right: auto; left: -6px; top: -2px; }
  .share-pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: 80px; width: auto; z-index: 240; }
}
@media (prefers-reduced-motion: reduce) { .em-side::after, .rail-down, .em-rail .topic-browse { transition: none; } }

/* On screen the exam maker folds the cover to one line (coverToggle in
   exam-maker/main.js): the title, then minutes, marks and the paper code.
   Show cover opens it. Screen only: print and PDF keep the full cover. */
.cover-tog { display: none; }
@media screen {
  #sheet .cover-tog { display: block; position: absolute; top: 10px; right: 14px; border: 1px solid #1a1a1a; border-radius: 6px; background: #fff; color: #1a1a1a; font: 600 12.5px/1 var(--font-display); padding: 6px 10px; cursor: pointer; }
  #sheet .cover-tog:hover { background: #f1f1ec; }
  #sheet .cover-tog:focus-visible { outline: 2px solid var(--riso-pink-deep); outline-offset: 2px; }
  #sheet:not(.cover-slim) .cover .exam-brand { top: 46px; }
  #sheet.cover-slim .cover { padding: 12px 18px 10px; margin-bottom: 20px; }
  #sheet.cover-slim .cover .exam-brand, #sheet.cover-slim .cover .exam-sub, #sheet.cover-slim .cover .code-note,
  #sheet.cover-slim .cover .covers, #sheet.cover-slim .cover .instr, #sheet.cover-slim .cover .cand { display: none; }
  #sheet.cover-slim .cover .exam-title { font-size: 20px; padding-right: 110px; margin-bottom: 6px; }
  #sheet.cover-slim .cover .meta { border-top: 0; padding-top: 0; margin-bottom: 0; font-size: 14px; }
}

/* On a phone screen the paper's cover box crowds the display: it keeps
   only the paper's name. Screen only, so a printed or PDF paper keeps its
   full cover. */
@media screen and (max-width: 640px) {
  .cover { border: 0; padding: 0; margin-bottom: 14px; }
  .cover .exam-brand, .cover .exam-sub, .cover .meta, .cover .code-note,
  .cover .covers, .cover .instr, .cover .cand { display: none; }
  .cover .exam-title { font-size: 20px; line-height: 1.2; }
  #sheet .cover-tog { display: none; }
  #sheet.cover-slim .cover .exam-title { padding-right: 0; }
}

/* /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; }

/* /css/tabs/exam-map.css */
/* What the IB set (exam map): every rule sits inside .xm so nothing touches the rest of the site. */
.xm{
  --card:var(--paper-white); --ink-faint:#5d7568;
  --green:var(--riso-green); --green-deep:#14784a; --pink:var(--riso-pink); --pink-deep:#c42a73;
  --gold:#e0a82e; --blue:#5b6fe0; --on-fill:#10241a; --hatch:rgba(196,42,115,.28);
  --f-display:var(--font-display); --f-body:var(--font-display);
  --e1:#d6f2e4; --e2:#9fdfbf; --e3:#3fbf83; --e4:#15804d; --e5:#0b3a24; --e-on:#10241a; --e-on-hi:#ffffff;
  --s-SP:#7c8a83; --s-M25:#3d6fc4; --s-N25:#b9781c; --s-M26:#14996a; --s-N26:#d0307c;
}
:root[data-theme="dark"] .xm{
  --ink-faint:#8ea397; --green-deep:#6fe6b8; --pink-deep:#ffb3d1; --gold:#f2cf5c; --blue:#9aa8ff; --hatch:rgba(255,158,196,.30);
  --e1:#21392e; --e2:#2b5e47; --e3:#2f9566; --e4:#55dca4; --e5:#c4f7df; --e-on:#e9f1ea; --e-on-hi:#0d2018;
  --s-SP:#a6b5ad; --s-M25:#8fb0f0; --s-N25:#f0b960; --s-M26:#46d99f; --s-N26:#ff8fc0;
}
.xm *{box-sizing:border-box}
.xm{background:var(--paper);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.5;
  padding-inline:max(16px,env(safe-area-inset-left,0px)) max(16px,env(safe-area-inset-right,0px));padding-block:0 64px}
.xm h1, .xm h2, .xm h3{font-family:var(--f-display);line-height:1.1;margin:0;text-wrap:balance}
.xm h1{font-size:clamp(2rem,5.4vw,3.6rem);font-weight:800;letter-spacing:-.02em}
.xm h2{font-size:clamp(1.4rem,3vw,2rem);font-weight:700;letter-spacing:-.01em}
.xm h3{font-size:1.1rem;font-weight:700}
.xm .wrap{max-width:1180px;margin:0 auto}
.xm section{padding-block:44px 8px}
.xm .lede{max-width:66ch;color:var(--ink-dim);margin:10px 0 0}
.xm .kicker{font-family:var(--f-display);font-weight:700;font-size:.8rem;letter-spacing:.09em;text-transform:uppercase;color:var(--pink-deep)}
.xm button, .xm select, .xm input{font:inherit;color:inherit}
.xm :focus-visible{outline:3px solid var(--pink-deep);outline-offset:2px}
.xm .num{font-variant-numeric:tabular-nums}
.xm .hero{padding-block:36px 8px}
.xm .hero h1 span{color:var(--pink-deep)}
.xm .bar{position:sticky;top:env(safe-area-inset-top,0px);z-index:20;background:var(--paper);border-bottom:2px solid var(--ink);margin-inline:calc(-1*max(16px,env(safe-area-inset-left,0px)));padding:10px max(16px,env(safe-area-inset-left,0px))}
.xm .bar .wrap{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center}
.xm .chk{display:inline-flex;gap:6px;align-items:center;font-size:.9rem;color:var(--ink-dim);cursor:pointer}
.xm .chk input{accent-color:var(--green-deep);width:18px;height:18px}
.xm .lab{font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-faint);font-weight:700;margin-right:6px}
.xm .cell{display:flex;flex-direction:column;gap:6px;min-width:0}
.xm .tile{position:relative;text-align:left;border:2px solid var(--ink);border-radius:10px;padding:7px 9px 8px;cursor:pointer;background:var(--card);min-height:76px;display:flex;flex-direction:column;justify-content:space-between;gap:2px;overflow:hidden}
.xm .tile .c{font-size:.74rem;font-weight:700;letter-spacing:.04em;opacity:.85}
.xm .tile .n{font-size:.86rem;line-height:1.15;overflow-wrap:anywhere}
.xm .tile .v{font-family:var(--f-display);font-size:1.5rem;font-weight:800;line-height:1}
.xm .tile .v small{font-family:var(--f-body);font-size:.72rem;font-weight:700;margin-left:6px;opacity:.85}
.xm .tile.zero{background-image:repeating-linear-gradient(135deg,transparent 0 6px,var(--hatch) 6px 8px);border-style:dashed}
.xm .tile.off{opacity:.45;border-style:dotted;background:transparent;cursor:default}
.xm .tile[aria-pressed="true"]{outline:4px solid var(--pink-deep);outline-offset:1px}
.xm .legend{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:center;margin-top:14px;font-size:.85rem;color:var(--ink-dim)}
.xm .sw{display:inline-block;width:16px;height:16px;border:2px dashed var(--ink);border-radius:4px;background-image:repeating-linear-gradient(135deg,transparent 0 4px,var(--hatch) 4px 6px);vertical-align:-3px;margin-right:5px}
.xm .detail{margin-top:20px;background:var(--card);border:2px solid var(--ink);border-radius:16px;padding:18px 20px;box-shadow:5px 5px 0 var(--green)}
.xm .detail[hidden]{display:none!important}
.xm .dhead{display:flex;flex-wrap:wrap;gap:8px 22px;align-items:baseline;justify-content:space-between}
.xm .chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.xm .chip{display:inline-block;border:1.5px solid var(--line-strong);border-radius:999px;padding:1px 9px;font-size:.8rem;background:var(--paper);white-space:nowrap}
.xm .chip.p{border-color:var(--pink-deep);color:var(--pink-deep);font-weight:700}
.xm .chip.g{border-color:var(--green-deep);color:var(--green-deep);font-weight:700}
.xm .hl{font-size:.68rem;font-weight:800;border-radius:4px;padding:0 4px;background:var(--pink);color:#2a0f1c;margin-left:6px;vertical-align:1px}
.xm .rows{display:grid;gap:6px;margin-top:18px}
.xm .key{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.85rem;color:var(--ink-dim);margin-top:12px;align-items:center}
.xm .key i{display:inline-block;width:14px;height:10px;border-radius:2px;margin-right:5px}
.xm .ao3{background:var(--pink)}
.xm .sm{font-size:.86rem;color:var(--ink-dim)}
.xm .tw{overflow-x:auto;border:2px solid var(--ink);border-radius:12px;background:var(--card);margin-top:14px;max-width:100%}
.xm table{border-collapse:collapse;width:100%;font-size:.88rem}
.xm th, .xm td{padding:6px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.xm th{position:sticky;top:0;background:var(--card);font-family:var(--f-display);font-size:.78rem;letter-spacing:.05em;text-transform:uppercase;border-bottom:2px solid var(--ink);white-space:nowrap}
.xm td.r, .xm th.r{text-align:right}
.xm td.t{min-width:220px}
.xm .mk{display:inline-flex;gap:3px;align-items:flex-end;height:22px}
.xm .mk i{display:block;width:12px;background:var(--green);border-radius:2px 2px 0 0;min-height:2px}
.xm .mk i.z{background:var(--line)}
.xm .filters{display:flex;flex-wrap:wrap;gap:8px 12px;margin-top:16px;align-items:center}
.xm .filters select, .xm .filters input{border:2px solid var(--ink);border-radius:8px;background:var(--card);padding:5px 8px;min-width:0}
.xm .btn{border:2px solid var(--ink);background:var(--pink);color:#2a0f1c;border-radius:999px;font-weight:700;padding:6px 16px;cursor:pointer;box-shadow:3px 3px 0 var(--ink)}
.xm .btn:active{transform:translate(2px,2px);box-shadow:1px 1px 0 var(--ink)}
.xm .flag{color:var(--pink-deep);font-weight:800}
.xm .note{background:var(--card);border:2px solid var(--ink);border-radius:16px;padding:16px 18px 18px;min-width:0}
.xm .note h3{margin-bottom:6px}
.xm .note p{margin:6px 0 0;color:var(--ink-dim)}
.xm .note .try{margin-top:10px;font-size:.9rem;border-top:1.5px dashed var(--line-strong);padding-top:8px}
.xm .note .try b{color:var(--pink-deep)}
.xm .xm-method{margin-top:50px;padding-top:16px;border-top:2px solid var(--ink);font-size:.86rem;color:var(--ink-dim);max-width:80ch}
.xm details>summary{cursor:pointer;font-weight:700}
@media (max-width:760px){
.xm .cell{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
.xm .cell::before{content:attr(data-lvl);grid-column:1/-1;font-size:.74rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-faint)}
}
@media (prefers-reduced-motion:no-preference){
.xm .tile{transition:transform .12s}
.xm .tile:not(.off):hover{transform:translateY(-2px)}
}
.xm .tabs{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}
.xm .tab{border:2px solid var(--ink);background:var(--card);border-radius:12px;padding:8px 14px;cursor:pointer;text-align:left;font-weight:700;min-width:0}
.xm .tab small{display:block;font-weight:400;color:var(--ink-dim);font-size:.8rem}
.xm .tab[aria-selected="true"]{background:var(--ink);color:var(--paper);box-shadow:4px 4px 0 var(--pink)}
.xm .tab[aria-selected="true"] small{color:var(--paper);opacity:.85}
.xm .none{background:var(--card);color:var(--ink)}
.xm .mx td, .xm .mx th{text-align:center}
.xm .mx td:first-child, .xm .mx th:first-child{text-align:left}
.xm .mx button{width:100%;min-height:36px;border:2px solid var(--ink);border-radius:8px;cursor:pointer;font-weight:800;color:var(--on-fill);background:var(--card)}
.xm .mx button.z{border-style:dashed;border-color:var(--line);color:var(--ink-faint);cursor:default;font-weight:400}
.xm .drill{margin-top:20px;background:var(--card);border:2px solid var(--ink);border-radius:16px;padding:16px 18px;box-shadow:5px 5px 0 var(--green)}
.xm .dr{display:grid;grid-template-columns:110px 1fr;gap:4px 12px;padding:8px 0;border-top:1px solid var(--line)}
.xm .dr:first-of-type{border-top:0}
.xm .dr .m{font-size:.8rem;color:var(--ink-dim)}
@media(max-width:600px){
.xm .dr{grid-template-columns:1fr}
}
.xm .yrs{display:inline-flex;border:2px solid var(--ink);border-radius:999px;overflow:hidden;background:var(--card)}
.xm .yrs button{border:0;background:transparent;padding:6px 12px;cursor:pointer;font-weight:700}
.xm .yrs button[aria-pressed="true"]{background:var(--pink-deep);color:var(--paper)}
.xm .atlas{display:grid;grid-template-columns:130px repeat(4,minmax(0,1fr));gap:8px;margin-top:18px}
.xm .atile{border:2px solid var(--ink);border-radius:10px;padding:7px 9px;background:var(--card);cursor:pointer;text-align:left;display:flex;flex-direction:column;gap:3px;min-height:92px;min-width:0}
.xm .atile.zero{background-image:repeating-linear-gradient(135deg,transparent 0 6px,var(--hatch) 6px 8px);border-style:dashed}
.xm .atile.off{opacity:.4;cursor:default;border-style:dotted}
.xm .atile[aria-pressed="true"]{outline:4px solid var(--pink-deep);outline-offset:1px}
.xm .atile .c{font-size:.72rem;font-weight:700}
.xm .atile .n{font-size:.84rem;line-height:1.15;overflow-wrap:anywhere}
.xm .atile .row{display:flex;justify-content:space-between;align-items:flex-end;gap:6px;margin-top:auto}
.xm .atile .v{font-family:var(--f-display);font-size:1.45rem;font-weight:800;line-height:1}
.xm .spark{display:flex;gap:3px;align-items:flex-end;height:26px}
.xm .spark i{display:block;width:9px;background:var(--ink);opacity:.35;border-radius:2px 2px 0 0;min-height:2px}
.xm .spark i.on{opacity:1;background:var(--pink-deep)}
.xm .colh2{font-family:var(--f-display);font-weight:700;font-size:.92rem;border-bottom:2px solid var(--ink);padding-bottom:2px}
.xm .rowh2{font-family:var(--f-display);font-weight:700;display:flex;flex-direction:column;justify-content:center}
.xm .rowh2 em{font-style:normal;color:var(--pink-deep);font-size:1.5rem;line-height:1}
.xm .smx{border-collapse:collapse;width:100%;font-size:.88rem}
.xm .smx td, .xm .smx th{border-bottom:1px solid var(--line);padding:5px 8px;vertical-align:middle}
.xm .smx th{font-size:.74rem;text-transform:uppercase;letter-spacing:.05em;text-align:center}
.xm .smx td.d{text-align:center;width:84px}
.xm .sd{width:22px;height:22px;border-radius:50%;border:2px dashed var(--line-strong);background:transparent;cursor:pointer;padding:0;vertical-align:middle}
.xm .sd.p{background:var(--green);border:2px solid var(--ink)}
.xm .sd.s{background:color-mix(in srgb,var(--green) 40%,var(--card));border:2px solid var(--ink)}
.xm .sd:disabled{cursor:default}
.xm .lname{border:0;background:none;text-align:left;cursor:pointer;padding:0;color:var(--ink);font:inherit}
.xm .lname:hover{text-decoration:underline;text-decoration-color:var(--pink-deep)}
.xm .ledger{border-collapse:collapse;width:100%;font-size:.9rem;min-width:640px}
.xm .ledger th, .xm .ledger td{padding:4px 6px;border-bottom:1px solid var(--line)}
.xm .ledger th{font-family:var(--f-display);font-size:.78rem;letter-spacing:.05em;text-transform:uppercase;text-align:center;border-bottom:2px solid var(--ink);position:sticky;top:0;background:var(--card)}
.xm .ledger th.sel{color:var(--pink-deep)}
.xm .ledger td.lc{text-align:center;width:92px}
.xm .ledger td.lc button{width:100%;min-height:30px;border:2px solid var(--ink);border-radius:7px;font-weight:800;cursor:pointer;color:var(--on-fill);background:var(--card)}
.xm .ledger td.lc button.z{border-style:dashed;border-color:var(--line-strong);color:var(--ink-faint);font-weight:400;background-image:repeating-linear-gradient(135deg,transparent 0 5px,var(--hatch) 5px 7px)}
.xm .ledger td.lc.sel button{outline:3px solid var(--pink-deep);outline-offset:1px}
.xm .ledger tr.th td{background:color-mix(in srgb,var(--ink) 8%,var(--card));font-family:var(--f-display);font-weight:700}
.xm .badge{font-size:.7rem;font-weight:800;border-radius:999px;padding:1px 7px;border:1.5px solid var(--ink);white-space:nowrap}
.xm .badge.all3{background:var(--green);color:var(--on-fill)}
.xm .badge.none{background:var(--pink);color:#2a0f1c}
.xm .exp td{background:color-mix(in srgb,var(--pink) 8%,var(--card))}
.xm .sess{margin-top:22px}
.xm .sess h3{display:flex;gap:12px;align-items:baseline;flex-wrap:wrap}
.xm .sess h3 small{font-family:var(--f-body);font-weight:400;color:var(--ink-dim);font-size:.85rem}
.xm .pstrip{display:grid;grid-template-columns:96px 1fr;gap:8px;align-items:center;margin-top:6px}
.xm .pstrip>b{font-size:.85rem}
.xm .pblocks{display:flex;flex-wrap:wrap;gap:3px}
.xm .pb{height:30px;border:1.5px solid var(--ink);border-radius:5px;cursor:pointer;padding:0;font-size:.62rem;font-weight:800;color:var(--on-fill);overflow:hidden;min-width:14px}
.xm .pb.none{background:var(--card);color:var(--ink)}
.xm .pb.secB{border-style:dashed}
.xm .pb[aria-pressed="true"]{outline:3px solid var(--pink-deep);outline-offset:1px}
.xm .e1{background:var(--e1)!important;color:var(--e-on)!important}
.xm .e2{background:var(--e2)!important;color:var(--e-on)!important}
.xm .e3{background:var(--e3)!important;color:#0b2418!important}
.xm .e4{background:var(--e4)!important;color:var(--e-on-hi)!important}
.xm .e5{background:var(--e5)!important;color:var(--e-on-hi)!important}
.xm .caveat{margin-top:22px;max-width:78ch;border:2px solid var(--ink);border-radius:14px;background:color-mix(in srgb,var(--pink) 18%,var(--card));padding:14px 18px;box-shadow:4px 4px 0 var(--ink)}
.xm .caveat p{margin:4px 0 0}
.xm .caveat b.h{font-family:var(--f-display);font-size:1.05rem}
.xm .rec{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.xm .rec button{border:1.5px solid var(--ink);border-radius:999px;background:var(--e1);color:var(--e-on);padding:2px 10px;font-size:.8rem;cursor:pointer;text-align:left}
.xm .rec button b{margin-right:4px}
.xm .swing{display:grid;grid-template-columns:1fr auto;gap:4px 10px;align-items:center;font-size:.86rem;padding:5px 0;border-top:1px solid var(--line)}
.xm .swing:first-of-type{border-top:0}
.xm .swing button{border:0;background:none;padding:0;text-align:left;cursor:pointer;font:inherit;color:inherit}
.xm .swing button:hover{text-decoration:underline;text-decoration-color:var(--pink-deep)}
.xm .ramp5{display:inline-flex;border:2px solid var(--ink);border-radius:6px;overflow:hidden}
.xm .ramp5 i{width:auto;padding:1px 7px;font-style:normal;font-size:.72rem;font-weight:700;display:block}
.xm .ramp5 i.z{background-image:repeating-linear-gradient(135deg,transparent 0 4px,var(--hatch) 4px 6px);color:var(--ink-faint)}
.xm .ledger td.lc button{font-size:.92rem}
.xm .ledger td.lc{width:84px}
.xm .ledger td{vertical-align:middle}
.xm .radars{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,440px),1fr));gap:14px;margin-top:16px}
.xm .radar{background:var(--card);border:2px solid var(--ink);border-radius:16px;padding:12px 12px 8px;min-width:0}
.xm .radar h3{font-size:1rem}
.xm .radar h3 small{font-family:var(--f-body);font-weight:400;color:var(--ink-dim);font-size:.78rem;margin-left:6px}
.xm .radar svg{width:100%;height:auto;display:block;overflow:visible}
.xm .radar .ax{cursor:pointer;font:700 12px var(--f-body);fill:var(--ink-dim)}
.xm .radar .ax:hover{fill:var(--pink-deep)}
.xm .sleg{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:12px;font-size:.86rem;align-items:center}
.xm .sleg button{border:2px solid var(--ink);border-radius:999px;background:var(--card);padding:2px 12px 2px 8px;cursor:pointer;font-weight:700;display:inline-flex;gap:6px;align-items:center}
.xm .sleg button[aria-pressed="false"]{opacity:.45;text-decoration:line-through}
.xm .sleg i{display:inline-block;width:18px;height:4px;border-radius:2px}
.xm .pb{background:var(--card);color:var(--ink-faint)}
.xm .pb.on{background:var(--pink-deep);color:var(--paper);border-color:var(--ink)}
.xm .drill{scroll-margin-top:120px}
@media(max-width:600px){
.xm .bar{position:static}
.xm .nm{display:none}
.xm .ovt th, .xm .ovt td{padding:7px 8px}
}
.xm .tabs2{display:flex;gap:2px;flex-wrap:wrap;border-bottom:0;flex-basis:100%}
.xm .tabs2 button{border:0;background:none;padding:8px 12px 7px;font-family:var(--f-display);font-weight:700;font-size:1rem;cursor:pointer;border-bottom:3px solid transparent;color:var(--ink-dim)}
.xm .tabs2 button[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--pink-deep)}
.xm .tabs2 button:hover{color:var(--ink)}
.xm .sels{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;flex-basis:100%}
.xm .sels label{display:inline-flex;gap:6px;align-items:center;font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-faint);font-weight:700}
.xm .sels select, .xm .filters select{border:1.5px solid var(--line-strong);border-radius:8px;background:var(--card);padding:4px 8px;font-size:.9rem;text-transform:none;letter-spacing:0;color:var(--ink);font-weight:400;max-width:100%}
.xm .filters label{display:inline-flex;gap:6px;align-items:center}
.xm .h2s{margin-top:34px;font-size:1.35rem}
.xm .ovt{border-collapse:collapse;width:100%;font-size:.94rem}
.xm .ovt th, .xm .ovt td{padding:8px 12px;border-bottom:1px solid var(--line);text-align:right;vertical-align:middle}
.xm .ovt thead th{position:static;text-align:right;font-family:var(--f-display);font-size:.8rem;letter-spacing:.05em;text-transform:uppercase;border-bottom:2px solid var(--ink)}
.xm .ovt thead th:first-child, .xm .ovt tbody th{text-align:left}
.xm .ovt tbody th{font-weight:400;position:static;background:none;text-transform:none;letter-spacing:0;font-family:var(--f-body);font-size:.94rem;border-bottom:1px solid var(--line);white-space:normal}
.xm .ovt td{font-variant-numeric:tabular-nums;font-weight:700}
.xm .ovt .sel{background:color-mix(in srgb,var(--pink) 14%,var(--card))}
.xm .ovt thead th.sel{color:var(--pink-deep)}
.xm .ovt tr.grp th, .xm .ovt tr.grp td{border-top:2px solid var(--line-strong)}
.xm .ovt tr:last-child th, .xm .ovt tr:last-child td{border-bottom:0}
.xm .ovt tr.click{cursor:pointer}
.xm .ovt tr.click:hover th{text-decoration:underline;text-decoration-color:var(--pink-deep)}
.xm .rect td{width:80px}
.xm .cellv{display:inline-block;min-width:40px;text-align:center;border-radius:6px;padding:1px 6px}
.xm .cellv.z{color:var(--ink-faint);font-weight:400;background-image:repeating-linear-gradient(135deg,transparent 0 4px,var(--hatch) 4px 6px)}
.xm .more{margin-top:22px}
.xm .lnk{border:0;background:none;padding:0;color:var(--pink-deep);font-weight:700;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.xm .sleg span{display:inline-flex;gap:6px;align-items:center;font-weight:700}
.xm .bar{padding-block:4px 10px}
.xm section[hidden]{display:none}
.xm .tring{position:fixed;z-index:60;border-radius:12px;box-shadow:0 0 0 4px var(--pink-deep),0 0 0 9999px rgba(10,30,20,.45);pointer-events:none;transition:all .25s}
.xm .tcard{position:fixed;z-index:61;width:min(340px,calc(100vw - 32px));background:var(--card);color:var(--ink);border:2px solid var(--ink);border-radius:14px;padding:14px 16px;box-shadow:5px 5px 0 var(--pink-deep)}
.xm .tcard h3{font-size:1.05rem;margin-bottom:4px}
.xm .tcard p{margin:0;font-size:.92rem;color:var(--ink-dim)}
.xm .tcard .tnav{display:flex;gap:8px;align-items:center;margin-top:12px}
.xm .tcard .tnav span{font-size:.8rem;color:var(--ink-faint);margin-right:auto}
.xm .tcard button.tb{border:2px solid var(--ink);border-radius:999px;padding:4px 14px;font-weight:700;cursor:pointer;background:var(--card)}
.xm .tcard button.tb.go{background:var(--ink);color:var(--paper)}
@media (prefers-reduced-motion:reduce){
.xm .tring{transition:none}
}
.xm .qlh{margin-top:26px;display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.xm .qlh small{font-family:var(--f-body);font-weight:400;font-size:.85rem;color:var(--ink-dim)}
.xm .qlt th, .xm .qlt td, .xm .qlt thead th{text-align:left!important;font-weight:400;font-size:.88rem;vertical-align:top}
.xm .qlt td:nth-child(-n+2){font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:700}
.xm .qlt td:last-child{min-width:260px}
.xm .qlt tr.secb td{background:color-mix(in srgb,var(--ink) 4%,var(--card))}
.xm section{padding-block:28px 8px}
.xm .bar{position:static;margin-inline:0;padding-inline:0;border-bottom:2px solid var(--ink)}
.xm .hero{padding-block:8px 4px}
.xm .hero .meta{font-size:12px;letter-spacing:.06em;color:var(--ink-dim);display:inline-flex;gap:10px;align-items:center;margin-bottom:14px}
.xm .hero .meta .pin{width:12px;height:12px;border-radius:50%;background:var(--riso-green);box-shadow:2px 2px 0 var(--riso-pink)}
.xm .hero h1 em{font-style:italic;font-weight:400;color:var(--riso-green);text-shadow:2px 1px 0 var(--riso-pink)}
.xm .wrap{max-width:none}
.xm .xm-method{margin-top:40px;padding-top:14px;border-top:2px solid var(--ink);font-size:.86rem;color:var(--ink-dim);max-width:80ch}
.xm .tring{z-index:200}.xm .tcard{z-index:201}

