/* encoding.info: shared stylesheet.
   To change the fonts, edit --font-heading and --font-body here and the @font-face rules below, which load
   the font files in src/fonts/ (served from the site itself, not from Google). */

/* Self-hosted fonts (the owner's choice, 2026-11-16): variable Inter and Space Grotesk from Fontsource 5.3.0,
   weight axis only, split by character range as Google Fonts serves them.  SIL Open Font License; see src/fonts/OFL-*.txt. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-wght-normal.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; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-greek-wght-normal.woff2) format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/space-grotesk-latin-wght-normal.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; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/space-grotesk-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --font-heading: "Space Grotesk", system-ui, sans-serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --bg: #fafaf8; --panel: #ffffff; --surface: #f3f2ee; --text: #1b1b1a; --muted: #5f5e5a;
  --border: #dddbd3; --border-strong: #8a8880;
  --accent: #0f6e56; --accent-fill: #0f6e56; --on-accent: #ffffff; --accent-tint: #e3f2ec; --accent-ink: #0a4f3e;
  --more: #1d9e75; --less: #d85a30; --orig: #888780;
  --more-rgb: 29,158,117; --less-rgb: 216,90,48; --gray-rgb: 136,135,128;
  --p1: #0f6e56; --p2: #1a5fa6; --p3: #6a3ea1; --p4: #b45309;  /* the four Part colors, for the brand mark, header bar and headline */
  --sepia: #e8dcc3; --sepia-line: #cdbf9f; --sepia-ground: #8a7a5c; --horse: #2a2118;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b1a; --panel: #232321; --surface: #2a2a28; --text: #ecebe6; --muted: #a3a29b;
    --border: #3b3b38; --border-strong: #77766f;
    --accent: #5dcaa5; --accent-fill: #17805f; --on-accent: #ffffff; --accent-tint: #17352c; --accent-ink: #9fe1cb;
    --p1: #5dcaa5; --p2: #82b4ec; --p3: #b89ce2; --p4: #f59e42;
  }
}
/* ---------- Part themes ----------
   Each Part of the course has its own accent color, and every unit in a Part shares it.
   build.py puts the class part-N on a lesson page's <body>, on each Part of the lesson plan on the home page,
   and on each unit's block of the encoder map.  To change a Part's color, change its four values here and in
   the dark block below.  The demo colors (--more, --less, --orig) are not part of a theme. */
.part-1 { --accent: #0f6e56; --accent-fill: #0f6e56; --accent-tint: #e3f2ec; --accent-ink: #0a4f3e; }  /* Foundations: teal */
.part-2 { --accent: #1a5fa6; --accent-fill: #1a5fa6; --accent-tint: #e3edf8; --accent-ink: #12426f; }  /* The toolbox: blue */
.part-3 { --accent: #6a3ea1; --accent-fill: #6a3ea1; --accent-tint: #eee7f7; --accent-ink: #4a2b72; }  /* How the encoder decides: violet */
.part-4 { --accent: #b45309; --accent-fill: #b45309; --accent-tint: #fbeadb; --accent-ink: #7c2d12; }  /* Real encoders: orange */
@media (prefers-color-scheme: dark) {
  .part-1 { --accent: #5dcaa5; --accent-fill: #17805f; --accent-tint: #17352c; --accent-ink: #9fe1cb; }
  .part-2 { --accent: #82b4ec; --accent-fill: #2565ad; --accent-tint: #1a3350; --accent-ink: #bcd6f4; }
  .part-3 { --accent: #b89ce2; --accent-fill: #7046a8; --accent-tint: #34264f; --accent-ink: #d8c8f1; }
  .part-4 { --accent: #f59e42; --accent-fill: #b45309; --accent-tint: #3b2412; --accent-ink: #fcd3a6; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font-body); }
a { color: var(--accent); }
h1, h2, h3, .brand { font-family: var(--font-heading); font-weight: 600; }

/* ---------- frame ---------- */
.top { background: var(--panel); }
.cbar { height: 5px; background: linear-gradient(90deg, var(--p1), var(--p2) 33%, var(--p3) 67%, var(--p4)); }
.bar { max-width: 1120px; margin: 0 auto; padding: 0 32px; min-height: 64px; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 8px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; letter-spacing: -.01em; color: var(--text); text-decoration: none; padding: 10px 0; }
.brand .word span { color: var(--muted); font-weight: 500; }
.brand .mark { display: grid; grid-template-columns: 11px 11px; gap: 2px; }
.brand .mark i { width: 11px; height: 11px; border-radius: 2px; }
.brand .mark i:nth-child(1) { background: var(--p1); } .brand .mark i:nth-child(2) { background: var(--p2); }
.brand .mark i:nth-child(3) { background: var(--p3); } .brand .mark i:nth-child(4) { background: var(--p4); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.nav a { padding: 12px 14px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; border-radius: 8px; }
.nav a:hover { background: var(--surface); }
.here { background: var(--surface); border-top: 1px solid var(--border); }
.here div { max-width: 1120px; margin: 0 auto; padding: 10px 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 12.5px; }
.here span { color: var(--muted); font-weight: 600; margin-right: 6px; }
.here a { padding: 4px 8px; border-radius: 6px; background: var(--panel); border: 1px solid var(--border); color: var(--muted); text-decoration: none; }
.here a.on { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); font-weight: 600; }
.here a.all { display: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 32px 64px; display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.wrap main { flex: 999 1 560px; min-width: 0; max-width: 760px; }
.wrap aside { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.crumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb b { color: var(--text); font-weight: 400; }
.crumb a:first-child { color: var(--accent); font-weight: 600; }  /* the Part's name, in the Part's color */
.pos { display: flex; align-items: center; gap: 12px; margin-top: 20px; font-size: 14px; color: var(--muted); }
.pips { display: flex; gap: 4px; }
.pips i { width: 28px; height: 5px; border-radius: 3px; background: var(--border); }
.pips i.on { background: var(--accent-fill); }
main h1 { font-size: 40px; line-height: 1.15; margin: 12px 0 4px; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.needs, .related { font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.needs { padding: 12px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 24px; }
.needs b, .related b { font-weight: 600; }
.planned { color: var(--muted); }
.tag { font-size: 12px; border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 5px; margin-left: 4px; color: var(--muted); white-space: nowrap; }
.pn { margin-top: 48px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.pn a { display: block; padding: 16px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
.pn a.next { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); text-align: right; }
.pn small { display: block; font-size: 13px; opacity: .85; }
.pn b { font-weight: 600; }
.related { margin-top: 24px; }
.gapnote { margin: 10px 0 0; font-size: 14px; color: var(--muted); text-align: right; }
.unitbox { background: var(--panel); border: 1px solid var(--border); border-top: 4px solid var(--accent-fill); border-radius: 12px; padding: 20px; }
.unitbox small { font-size: 13px; font-weight: 600; color: var(--muted); }
.unitbox h2 { font-size: 19px; margin: 0; }
.unitbox ol { list-style: none; margin: 12px 0 0; padding: 0; font-size: 15px; line-height: 1.4; }
.unitbox li a, .unitbox li span.p { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.unitbox li a:hover { background: var(--surface); }
.unitbox li a.on { background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }
.unitbox li span.p { color: var(--muted); }
.ad { border: 1.5px dashed var(--border-strong); border-radius: 8px; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 12px; color: var(--muted); font-size: 13px; }
.ad.wide { min-height: 90px; margin: 32px 0; }
.ad.box { min-height: 250px; }
.foot { background: var(--panel); border-top: 1px solid var(--border); }
.foot div { max-width: 1120px; margin: 0 auto; padding: 24px 32px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.foot div > span:last-child { justify-self: end; }
.foot a { color: var(--muted); margin-left: 20px; }
.foot .mid a { margin-left: 0; }

/* ---------- lesson content ---------- */
main h2 { font-size: 24px; margin: 40px 0 8px; }
.lead { font-size: 19px; line-height: 1.6; }
figure { margin: 20px 0; padding: 16px; background: var(--surface); border-radius: 12px; }
figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; }
figure svg { display: block; width: 100%; height: auto; }
figure svg text { fill: var(--text); font-family: var(--font-body); }
figure svg text.q { fill: var(--muted); }
code { font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); padding: 1px 5px; border-radius: 4px; }
figure code { background: var(--bg); }
pre { font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
main table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
main th, main td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
main th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.win td { color: var(--accent); font-weight: 600; }
table.lam td:nth-child(2) { white-space: nowrap; }
.ctl { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 14px; }
.ctl input { flex: 1; accent-color: var(--accent-fill); }
.ctl output { font-weight: 600; min-width: 28px; text-align: right; }
.ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: -8px 0 12px; }
.grids { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.grid div { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 11px; border-radius: 3px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid8 { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px; }
.grid8 div { aspect-ratio: 1; }
.grid8.num div { display: flex; align-items: center; justify-content: center; font-size: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 4px 0 8px; }
.grid4 div { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; font-variant-numeric: tabular-nums; border-radius: 3px; }
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.strip { display: block; width: 100%; height: auto; image-rendering: pixelated; border-radius: 4px; margin: 4px 0 8px; }
.glabel { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.key { font-size: 12px; color: var(--muted); margin-top: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
.lg { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.lg i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 5px; border-radius: 2px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.stats4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--bg); border-radius: 8px; padding: 10px 14px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 21px; font-weight: 600; }
.src { color: var(--muted); font-size: 14px; }
.src a { color: inherit; }
/* The "In Brief:" summary box above a page's lead: a label, then two or three sentences. */
.inbrief { margin: 0 0 22px; padding: 12px 16px; background: var(--surface); border-left: 4px solid var(--accent-fill); border-radius: 8px; }
.inbrief > div:first-child { font-family: var(--font-heading); font-weight: 600; font-size: 13px; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }

/* ---------- glossary and settings index ---------- */
.doc { max-width: 900px; margin: 0 auto; padding: 32px 32px 64px; }
.doc .intro { color: var(--muted); font-size: 18px; margin: 0 0 24px; }
.doc h2 { font-size: 22px; margin: 32px 0 12px; }
.doc td:first-child { white-space: nowrap; }
.doc table.abbr { table-layout: fixed; }
.doc table.abbr th:nth-child(1) { width: 24%; }
.doc table.abbr th:nth-child(2) { width: 44%; }
.doc table.abbr td:first-child { white-space: normal; }
.doc td b { font-weight: 600; }
.doc td small { display: block; color: var(--muted); font-size: 13px; }
.doc .links { display: flex; flex-wrap: wrap; gap: 2px 12px; }
/* the settings index's codec filter: a row of buttons above the table and a count line under them */
.cfilter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.cfilter span { color: var(--muted); font-size: 14px; font-weight: 600; margin-right: 4px; }
.cfilter button { font: inherit; font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text); }
.cfilter button:hover:not([aria-pressed="true"]) { background: var(--surface); }
.cfilter button[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.ccount { color: var(--muted); font-size: 14px; margin: -8px 0 8px; }
.doc table.sett tr[hidden] { display: none; }

/* ---------- search ----------
   The magnifier in the top bar opens search.html; build.py writes the page and its index. */
.find { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 8px; color: var(--text); }
.find:hover { background: var(--surface); }
.search input { width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--panel); color: var(--text); }
.search input:focus { outline: 2px solid var(--accent-fill); outline-offset: 1px; }
.searchcount { color: var(--muted); font-size: 15px; margin: 12px 0 4px; }
.results { list-style: none; margin: 0; padding: 0; }
.results a { display: block; padding: 12px 14px; margin-top: 8px; border: 1px solid var(--border); border-left: 4px solid var(--border-strong);
  border-radius: 10px; background: var(--panel); color: var(--text); text-decoration: none; }
.results a[class^="part-"] { border-left-color: var(--accent-fill); }
.results small { display: block; color: var(--muted); font-size: 13px; }
.results a[class^="part-"] small { color: var(--accent); font-weight: 600; }
.results b { display: block; font-family: var(--font-heading); font-weight: 600; font-size: 18px; }
.results span { display: block; color: var(--muted); font-size: 15px; line-height: 1.5; margin-top: 2px; }
.results mark { background: var(--accent-tint); color: var(--text); border-radius: 2px; }

/* ---------- home ---------- */
.home { max-width: 1120px; margin: 0 auto; padding: 0 32px 64px; }
.hero { padding: 64px 0 40px; }
.hero h1 { font-size: 52px; line-height: 1.1; margin: 0; }
.hero p { font-size: 20px; color: var(--muted); max-width: 720px; margin: 20px 0 0; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--p1), var(--p2) 40%, var(--p3) 70%, var(--p4));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
/* the counts under the hero: plain text with thin rules between, not boxes (boxes looked like buttons; the owner, 2026-11-17) */
/* Each count carries a rule on its left; the list is pulled left by one rule and its padding and the first pixel is clipped,
   so the count that starts a line (the first, or one that wraps on a phone) shows no rule and lines up with the text above. */
.facts { display: flex; flex-wrap: wrap; row-gap: 6px; margin: 24px 0 0 -15px; padding: 0; list-style: none; font-size: 15px; clip-path: inset(0 0 0 1px); }
.facts li { padding: 0 14px; border-left: 1px solid var(--border-strong); color: var(--muted); }
.facts b { color: var(--text); font-weight: 600; font-family: var(--font-heading); font-size: 17px; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 8px; text-decoration: none; font-weight: 600;
  background: var(--panel); color: var(--text); border: 1px solid var(--border-strong); }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); border-color: var(--accent-fill); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 28px; }
#map { position: relative; }
/* hover details for a box on the encoder map */
.maptip { position: absolute; z-index: 5; width: 300px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border);
  border-top: 4px solid var(--accent-fill); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.12); pointer-events: none; font-size: 14px; line-height: 1.45; }
.maptip small { display: block; color: var(--accent); font-weight: 600; font-size: 12.5px; }
.maptip b { display: block; font-family: var(--font-heading); font-size: 17px; margin: 2px 0 4px; }
.maptip p { margin: 0 0 8px; color: var(--muted); }
.maptip ul { margin: 0; padding-left: 18px; }
.maptip li { margin: 2px 0; }
.maptip hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }
.sechead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.sechead h2 { font-size: 26px; margin: 0; }
.sechead p { margin: 0; color: var(--muted); font-size: 15px; }
.machine { display: block; width: 100%; height: auto; }
.machine text { font-family: var(--font-body); fill: var(--text); }
.machine a:hover rect.c { stroke-width: 3; }
.machine a[class^="part-"] rect.c { stroke: var(--accent-fill); stroke-width: 4; }
.machine a[class^="part-"]:hover rect.c { stroke-width: 5; }
.machine a[class^="part-"] text:first-of-type { fill: var(--accent) !important; font-weight: 600; }
/* the key to the encoder map's colors, under the map */
.partkey { display: flex; flex-wrap: wrap; gap: 8px 28px; list-style: none; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); font-size: 15px; color: var(--muted); }
.partkey a { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.partkey a:hover span, .partkey a:hover b { text-decoration: underline; }
.part { scroll-margin-top: 16px; }
.partkey i { width: 14px; height: 14px; border-radius: 3px; background: var(--accent-fill); }
.partkey b { color: var(--accent); font-weight: 600; margin-right: 2px; }
/* the encoder map's motion: frames ride the belt into the machine, bits stream out, arrows flow.
   Driven frame by frame from src/home.html's script (not CSS animations), so it stays smooth at any page zoom.
   Off for reduced motion. */
.machine .flow { stroke-dasharray: 1 5; stroke-linecap: round; }
.maplist { display: none; list-style: none; margin: 0; padding: 0; }
.maplist a { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; color: var(--text); text-decoration: none; background: var(--panel); }
.maplist small { display: block; color: var(--muted); font-size: 13px; }
.maplist a[class^="part-"] { border-left: 4px solid var(--accent-fill); }
.maplist a[class^="part-"] small { color: var(--accent); font-weight: 600; }
.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.ways > * { display: block; padding: 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
.ways b { display: block; font-family: var(--font-heading); font-size: 19px; font-weight: 600; }
.ways span { color: var(--muted); font-size: 15px; }
.ways em { display: block; margin-top: 12px; font-style: normal; font-weight: 600; font-size: 15px; color: var(--accent); }
.home section { margin-top: 56px; }
.bar2 { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.bar2 div { height: 100%; background: var(--accent-fill); }
.part { font-size: 20px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin: 44px 0 14px; font-family: var(--font-heading); font-weight: 600; }
/* a divider in the Part's color above each Part of the lesson plan */
.part::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--accent-fill); margin-bottom: 28px; }
.sechead + .part, .unseenkey + .part { margin-top: 20px; }
.units { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.unit { padding: 20px 24px; background: var(--panel); border: 1px solid var(--border); border-top: 4px solid var(--accent-fill); border-radius: 12px; scroll-margin-top: 16px; }
.unit h3 { font-size: 19px; margin: 0; }
.unit h3 span { color: var(--accent); font-weight: 600; margin-right: 8px; }
.unit p { margin: 2px 0 12px; color: var(--muted); font-size: 15px; }
.unit ul { list-style: none; margin: 0; padding: 0; font-size: 15px; line-height: 1.4; }
.unit li { position: relative; padding: 5px 0 5px 20px; color: var(--muted); }
.unit li::before { content: ""; position: absolute; left: 0; top: 11px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--border-strong); }
.unit li.built::before { background: var(--accent-fill); border-color: var(--accent-fill); }
.unit li.unseen::before { background: var(--less); border-color: var(--less); }
.unit li.unseen a { color: var(--less); }
.unseenkey { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.unseenkey i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--less); margin-right: 7px; }
.unit li a { font-weight: 600; text-decoration: none; }
.unit li small { display: block; color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  .bar, .here div, .wrap, .home, .doc, .foot div { padding-left: 16px; padding-right: 16px; }
  .foot div { grid-template-columns: 1fr; }
  .foot div > span:last-child { justify-self: start; }
  .foot div > span:last-child a:first-child { margin-left: 0; }
  .doc td:first-child { white-space: normal; }
  .cfilter { gap: 6px; } .cfilter span { display: none; } .cfilter button { padding: 6px 11px; }
  .facts { margin-left: -11px; } .facts li { padding: 0 10px; }
  /* the settings index on a phone: two columns, with each setting's page links under its description */
  .doc table.sett, .doc table.sett tbody { display: block; }
  .doc table.sett tr { display: grid; grid-template-columns: 118px minmax(0, 1fr); }
  .doc table.sett th:nth-child(3) { display: none; }
  .doc table.sett td:first-child { grid-row: span 2; }
  .doc table.sett td:nth-child(2) { border-bottom: 0; padding-bottom: 4px; overflow-wrap: anywhere; }
  .doc table.sett td:nth-child(3) { grid-column: 2; padding-top: 0; }
  .wrap { gap: 32px; padding-top: 20px; }
  .nav { width: 100%; max-width: 400px; justify-content: space-between; gap: 0; }
  .nav a { padding: 12px 4px; font-size: 14px; }
  .nav a:first-child { padding-left: 0; }
  .nav a:last-child { padding-right: 0; }
  /* the magnifier sits at the right of the site name, the nav on its own row below */
  .bar { column-gap: 8px; }
  .brand { font-size: 18px; }
  .find { order: 1; width: 32px; margin-left: auto; } .nav { order: 2; margin-left: 0; }
  main h1 { font-size: 30px; }
  .hero { padding: 40px 0 24px; } .hero h1 { font-size: 36px; } .hero p { font-size: 18px; }
  .pips i { width: 18px; }
  .grids, .stats { grid-template-columns: 1fr; }
  .grids > :first-child { order: 2; }  /* stacked: the grid the slider changes sits right under the slider */
  .stats4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid4 div { font-size: 10px; }
  .machine { display: none; } .maplist { display: block; }
  .here a { display: none; } .here a.on { display: inline-block; }
  .here a.all { display: inline-block; margin-left: auto; border: 0; background: none; color: var(--accent); text-decoration: underline; }
  .card { padding: 20px 16px; }
  .ad.box { display: none; }
}

/* A two-column table whose rows stack on a phone: the first cell above the second */
@media (max-width: 720px) {
  main table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  main table.stack, main table.stack tbody, main table.stack tr, main table.stack td { display: block; }
  main table.stack td:first-child { border-bottom: 0; padding-bottom: 2px; }
  main table.stack td:nth-child(2) { padding-top: 2px; }
}

/* ---------- reader feedback ----------
   The box at the bottom of every lesson page and the form on feedback.html.  Markup is written by
   feedback_box() in build.py; src/feedback.js sends it to feedback.php. */
.fb { position: relative; overflow: hidden; margin-top: 40px; padding: 23px 20px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; font-size: 15px; }
.fb::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;   /* the site's four Part colors, as under the header */
  background: linear-gradient(90deg, var(--p1), var(--p2) 33%, var(--p3) 67%, var(--p4)); }
.fb h2 { font-size: 18px; margin: 0 0 10px; }
.fbvote { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.fb button { font: inherit; font-weight: 600; padding: 7px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.fb button:hover:not(:disabled):not([type=submit]):not([aria-pressed="true"]) { border-color: var(--accent); background: var(--accent-tint); }
.fbform button[type=submit]:hover:not(:disabled) { filter: brightness(1.1); }
.fb button[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.fb button:disabled { cursor: default; }
.fb button:disabled:not([aria-pressed="true"]) { opacity: .55; }
.fbthanks { color: var(--muted); }
.fb details { margin-top: 12px; }
.fb summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.fbform { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.fbform label { font-weight: 600; margin-top: 6px; }
.fbform label span { font-weight: 400; color: var(--muted); }
.fbform textarea, .fbform input { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--bg); color: var(--text); }
.fbform textarea { min-height: 120px; resize: vertical; }
.fbform textarea:focus, .fbform input:focus { outline: 2px solid var(--accent-fill); outline-offset: 1px; }
.fbform button[type=submit] { align-self: flex-start; margin-top: 8px; background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.fbform .fbnote { color: var(--muted); font-size: 14px; margin: 0; }
.fbstatus { margin: 4px 0 0; min-height: 1.65em; color: var(--muted); }
.fbtrap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
