/* === r5/01-shapes/style.css · round-5 homepage, 01-calm with solid shape icons · 2026-11-27 ===
 * 01-calm (the owner's pick from round 4) with: a solid flat icon (the round-3 brand marks' style: ink + one accent color)
 * above each section heading and on each "More in Molkit" tile; no spec lines; the journal styles shown as six
 * figures at printed size, named only; the script recording cropped to the canvas and the script box. */

/* dev 2026-11-29: burnt orange, kept apart from ReShiki (whose site has a near-identical rust, white text on it, a warm
   off-white page, and an orange hexagon mark): a softer, brighter orange #EC8A4D with INK text on it (6.9:1; dev: "soften just a tad"), a white page,
   neutral grays, the logo in ink; a darker #A8470F (5.9:1) only where orange is read as text (--accent-text). Gold was
   tried the same day and the dev missed the orange. Every framed box is white (--surface); the alternate sections are
   a neutral light gray band (--band). */
:root {
  --bg: #FFFFFF; --surface: #FFFFFF; --band: #F5F5F4; --ink: #1A1A1A; --muted: #5A5A5A; --line: #E5E5E2;
  --accent: #EC8A4D; --accent-fill: #EC8A4D; --accent-text: #A8470F; --link: #1A1A1A; --mustard: #6B7A2E; --teal: #2E5E5A;
  --on-accent: #1A1A1A; --code-bg: #F5F4F0; --focus: #A8470F;
  --head: "Outfit", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
.mk-dark {
  --bg: #131313; --surface: #1C1C1C; --band: #1A1A1A; --ink: #EDEDED; --muted: #A6A6A6; --line: #2C2C2C;
  --accent: #F6AD5C; --accent-fill: #F6AD5C; --accent-text: #F6AD5C; --link: #F6AD5C; --mustard: #B9C77A; --teal: #8CC4B9;
  --on-accent: #131313; --code-bg: #202020; --focus: #F6AD5C;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.65 var(--body); overflow-x: hidden; }
img, video { max-width: 100%; display: block; }
a { color: var(--link); text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--head); line-height: 1.1; letter-spacing: -0.015em; margin: 0; text-wrap: balance; color: var(--ink); }
h1 { font-weight: 700; }
h2 { font-weight: 700; font-size: clamp(1.85rem, 2.7vw, 2.5rem); margin-bottom: 1.1rem; }
p { margin: 0 0 1rem; max-width: 36em; text-wrap: pretty; }
b { font-weight: 600; }
sub, sup { line-height: 0; }
code { font-family: var(--mono); font-size: 0.9em; }
figure { margin: 0; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; z-index: 10; background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.narrow { max-width: 50rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.center p { margin-left: auto; margin-right: auto; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem 1.5rem; flex-wrap: wrap; }

/* ---- buttons */
.btn { font: 600 0.95rem/1 var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.55rem 0.9rem; min-height: 36px; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.quiet { background: transparent; }
.btn.primary { font: 600 1.125rem/1 var(--head); letter-spacing: 0.005em; color: var(--on-accent); background: var(--accent); border-color: var(--accent);
  border-radius: 10px; padding: 0.95rem 1.5rem 0.95rem 1.3rem; min-height: 52px; }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary svg { width: 15px; height: 15px; }
.btn.small { font-size: 0.875rem; min-height: 32px; padding: 0.4rem 0.75rem; }
.more { font-weight: 600; margin-top: 1.4rem; }
.more a { text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.more a::after { content: " \2192"; }
.more a:hover { border-bottom-width: 2px; }

.mk-loading, .mk-missing { display: grid; place-items: center; min-height: 100%; margin: 0; padding: 2rem; text-align: center; max-width: none; color: var(--muted); font-size: 1rem; }
.mk-missing { min-height: 8rem; }

/* ---- the spec line: exact facts under each figure, set like a legend */
.spec { display: flex; flex-wrap: wrap; gap: 0.35rem 1.6rem; margin: 0.9rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--line); font-family: var(--mono); }
.spec div { display: flex; align-items: baseline; gap: 0.5rem; }
.spec dt { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.spec dd { margin: 0; font-size: 0.8rem; color: var(--ink); }

/* ---- header */
header.top .bar { padding-top: 1.2rem; padding-bottom: 1.2rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font: 700 1.45rem/1 var(--head); letter-spacing: -0.02em; min-height: 36px; }
.brand svg { width: 28px; height: 28px; color: var(--ink); }   /* ink with an orange center (dev 2026-11-29): an all-orange hexagon is ReShiki's mark */
header nav { display: flex; align-items: center; gap: 1.6rem; font-weight: 600; font-size: 0.98rem; }
header nav a { color: var(--ink); text-decoration: none; padding: 0.4rem 0; }
header nav a:hover { color: var(--accent-text); }

/* ---- hero */
.hero { padding: clamp(1.25rem, 2.6vw, 2.25rem) 0 0; }
.hero h1 { font-size: clamp(2.15rem, 3.9vw, 3.3rem); line-height: 1.08; letter-spacing: -0.025em; max-width: 21em; margin: 0 auto 1.1rem; }
.hero .sub { font-size: clamp(1.06rem, 1.3vw, 1.18rem); color: var(--muted); max-width: 48em; }
.act { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.75rem 1.4rem; margin: 1.5rem auto 0; max-width: none; }
.status { font-size: 0.9rem; color: var(--muted); }
.status a { color: inherit; }   /* the release line (data-release): gray like the status it replaces, the accent underline */
.hero .narrow { max-width: 68rem; }
.wide { max-width: 1140px; margin-top: clamp(1.75rem, 3vw, 2.25rem); }

/* the player: one frame for the slot and its control bar */
.player { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; outline: 2px solid transparent; outline-offset: 4px; transition: outline-color 0.2s; }
.mk-light .player { box-shadow: 0 1px 2px rgba(28, 27, 25, 0.04), 0 12px 32px -18px rgba(28, 27, 25, 0.18); }
.slot { position: relative; display: grid; background: var(--surface); }
.slot.has-video { aspect-ratio: 16 / 9; }
.slot video { display: none; width: 100%; height: 100%; object-fit: contain; background: #000; }
.slot.has-video video { display: block; }
.slot.has-video .slot-fallback { display: none; }
.slot-fallback { display: grid; grid-template-rows: auto 1fr; align-items: center; padding: 0.9rem clamp(0.5rem, 3vw, 2.25rem) clamp(1rem, 2.2vw, 1.75rem); }
.slot-fallback > div { width: 100%; }
.soon { justify-self: start; margin: 0 0 0.5rem; max-width: none; font-size: 0.86rem; line-height: 1.45; color: var(--muted); }
.bar-ctl { position: relative; display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 0.6rem 1rem; margin-top: 0; padding: 0.8rem 1.1rem 0.8rem 0.9rem; border-top: 1px solid var(--line); }
/* max-width: none: the track is a span in the figcaption, and `figcaption > span` caps spans at 40em, so the line ran only
   to about half the frame (dev 2026-11-27: "stops roughly just past half-way") */
.track { position: absolute; left: 0; right: 0; top: -1px; height: 3px; overflow: hidden; max-width: none !important; }
.track .fill { position: absolute; inset: 0; background: var(--accent-fill); transform-origin: 0 50%; transform: scaleX(0); }
.btn.ctl { flex: none; min-width: 5.2rem; justify-content: center; }
.bar-ctl .cap { flex: 1 1 20rem; }
.bar-ctl .spec { margin: 0; padding: 0; border: 0; flex: 0 1 auto; min-width: 0; }
.cap { font-size: 0.92rem; line-height: 1.5; color: var(--muted); }
.cap-video { display: none; }
.player:has(.has-video) .cap-video { display: inline; }
/* Play / Pause / Replay: an icon in a square button (dev 2026-11-27); the word is its aria-label */
.btn.mk-media-btn, .mk-media-btn { display: inline-grid; place-items: center; width: 2rem; height: 2rem; min-width: 2rem; padding: 0; flex: none; }
.mk-media-btn .mk-media-icon { width: 1rem; height: 1rem; display: block; }
.player:has(.has-video) .cap-svg, .player:has(.has-video) [data-anim-btn] { display: none; }
.tick { display: inline-flex; gap: 2px; margin-right: 0.6rem; vertical-align: 0.2em; }
.tick i { display: block; width: 9px; height: 4px; border-radius: 1px; background: var(--accent-fill); }
.tick i:nth-child(2) { background: var(--mustard); }
.tick i:nth-child(3) { background: var(--teal); }

/* ---- the four rows */
.row { padding: clamp(3.5rem, 6.5vw, 6rem) 0; }
.hero + .row { padding-top: clamp(3.25rem, 6vw, 5rem); }
.row + .row { border-top: 1px solid var(--line); }
.row-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.row.flip .row-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.row.even .row-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
/* the practice editor switches to its compact layout (tools on top) below about 560 px; 7/12 of the row was 536 px at a
   1070 px window (dev 2026-11-29), so its row gives the editor 8/12 */
[data-practice-scope] .row-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.row.flip .txt { order: 2; }
.txt p { color: var(--ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 2.4vw, 2rem); }
figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem 1rem; flex-wrap: wrap; margin-top: 0.85rem; font-size: 0.92rem; line-height: 1.5; color: var(--muted); }
figcaption > span { flex: 1 1 16rem; max-width: 40em; }
figcaption a { color: var(--muted); }
.e2-panel { padding: clamp(1.25rem, 2.4vw, 2rem) clamp(0.75rem, 1.6vw, 1.25rem); }

/* clean up: before / after (the top layer is opaque, so the two never double-expose) */
.compare-panel { padding-bottom: 1rem; }
.compare { position: relative; aspect-ratio: 265 / 128; }
.compare .layer { position: absolute; inset: 0; }
.compare .after { clip-path: inset(0 0 0 var(--cut, 50%)); background: var(--surface); }
.compare .handle { position: absolute; top: -6px; bottom: -6px; left: var(--cut, 50%); width: 2px; margin-left: -1px; background: var(--accent-fill); pointer-events: none; }
.compare .handle span { position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 2px; background: var(--accent-fill); box-shadow: 0 0 0 3px var(--surface); }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 8px; border-radius: 4px; }
.ba { display: flex; justify-content: space-between; margin-top: 1rem; font: 600 0.8rem/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* script */
.code { display: block; background: var(--code-bg); border-radius: 10px; padding: 1rem 1.1rem; margin: 1.4rem 0 0; font: 400 0.84rem/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; counter-reset: ln; color: var(--ink); }
.code .ln { display: block; counter-increment: ln; padding-left: 2.1em; text-indent: -2.1em; }
.code .ln::before { content: counter(ln); display: inline-block; text-indent: 0; width: 1.2em; margin-right: 0.9em; text-align: right; color: var(--muted); }
.code .c { color: var(--accent-text); font-weight: 600; }
.shot-panel { padding: 0.5rem; }
/* the recording cropped to the canvas and the script box (source 1440 x 900; crop x 76-800, y 143-850): no tool
   strip, tab row, log panel or status bar. scripts/site-script-demo.cjs draws the figure left of x 795 for this crop. */
.crop { position: relative; overflow: hidden; aspect-ratio: 724 / 707; border-radius: 8px; background: #fff; }
.crop .shot { position: absolute; width: 198.895%; max-width: none; height: auto; left: -10.497%; top: -20.226%; }
/* the drawing recording: already cropped by scripts/site-draw-demo.cjs (1100 x 879: from the top of the tab bar, the
   left toolbar to just under the sum button, and the canvas, the drawing centered in it), shown whole */
.draw-crop { aspect-ratio: 1100 / 879; }
.draw-crop .shot { width: 100%; left: 0; top: 0; }
.mk-dark .crop { box-shadow: inset 0 0 0 1px var(--line); }
.mk-dark .crop .shot { filter: brightness(0.88); }
.shot.full { display: block; width: 100%; height: auto; border-radius: 8px; }
.mk-dark .shot.full { filter: brightness(0.88); }
.takes { min-width: 0; }
.takes .fig[hidden] { display: none; }

/* viewer: the page's own colors on its chrome, the accent for the selected view. .mkw.mkw.mkw: the Viewer's own
   theme rule is :root [data-mkw-theme] .mkw.mkw (0,4,0), which beat the old .mkw.mkw, so its teal showed (2026-11-29) */
.host { height: 30rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; position: relative; }
html body .host .mkw.mkw.mkw { --mkw-accent: #EC8A4D; --mkw-accent-fg: #1A1A1A; --mkw-accent-weak: #FCE9DD; --mkw-bg: #FFFFFF; --mkw-surface: #FFFFFF; --mkw-border: #E5E5E2; --mkw-text: #1A1A1A; --mkw-muted: #5A5A5A; }
html.mk-dark body .host .mkw.mkw.mkw { --mkw-accent: #F6AD5C; --mkw-accent-fg: #131313; --mkw-accent-weak: #2D2019; --mkw-bg: #1C1C1C; --mkw-surface: #181818; --mkw-border: #2C2C2C;
  --mkw-text: #EDEDED; --mkw-muted: #A6A6A6; --mkw-3d-bg: #17191A; --mkw-card-bg: #202325; --mkw-card-border: #2C2F32; --mkw-card-head: #ECEAE6; --mkw-card-text: #D9D6D1; --mkw-card-strong: #ECEAE6; --mkw-card-muted: #A39E97; }
/* the 3D bar's toggles and style menu hard-code the Viewer's blue (#2d6cdf, not --mkw-accent): the page's accent here (2026-11-29 audit) */
html body .host .mk3d-toggle[aria-pressed="true"], html body .host .mk3d-stylemenu button[aria-checked="true"] { background: var(--accent-fill); color: var(--on-accent); border-color: var(--accent-fill); }
html.mk-dark body .host .mkw-3dtoggle { background: rgba(28, 30, 32, 0.85); }

/* ---- the icons: solid flat shapes, ink + one accent color (the round-3 marks' style) */
.ic, .ti { display: block; --fg: var(--ink); --ac: var(--accent-fill); }   /* --bg inherits from the page (a self-reference made it invalid: every cut-out vanished) */
/* dark: OUTLINE icons (dev 2026-11-29): a filled light body under an orange part had no contrast ("where the colors
   overlap look bad"), so the ink parts become thin cream outlines and every orange part sits on the dark page */
.mk-dark .ic, .mk-dark .ti { --fg: #E6D6C6; --fg-fill: none; --fg-line: #D9CCBE; --fg-lw: 3.5; --fg-fold: none; --fg-cut: #D9CCBE; }
.ic { width: 48px; height: 48px; margin: 0 0 1.1rem; }
.center .ic { margin-left: auto; margin-right: auto; }
.presets .ic { --bg: var(--band); }

/* ---- full-width sections (the acetal, the standards, the calculations) */
.wide-sec { padding: clamp(3.5rem, 6.5vw, 6rem) 0; border-top: 1px solid var(--line); }
.wide-sec .narrow p { color: var(--muted); font-size: 1.05rem; }
.acetal { max-width: 920px; margin: 2.5rem auto 0; }
.acetal-panel { padding: clamp(1rem, 2.4vw, 1.75rem); }
.std { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; max-width: 940px; margin: 2.5rem auto 0; padding: 0; }
.std li { display: grid; grid-template-rows: 11rem auto; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem 1.5rem 1.25rem; }
.std .sfig { display: grid; place-items: center; min-height: 0; height: 11rem; overflow: hidden; }
.std p { margin: 0; font-size: 0.95rem; line-height: 1.5; color: var(--ink); }
/* one chart at a time, near its own size: side by side their labels were 6 px */
.calc-pick { display: flex; justify-content: center; gap: 0.5rem; margin: 2.25rem 0 1rem; }
.calc-pick .btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.calc { max-width: 1000px; margin: 0 auto; }
.palette-sec .fig { max-width: 1000px; margin: 2.25rem auto 0; }
.calc figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.calc img { width: 100%; height: auto; }
.calc figcaption { color: var(--muted); }
.calc .calc-eq { max-width: 700px; margin: 0.25rem auto 0.75rem; }
.calc .newmans { list-style: none; margin: 0.5rem auto 1.1rem; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; max-width: 900px; }
.calc .newmans li { display: grid; justify-items: center; gap: 0.3rem; }
.calc .newmans li > div { width: 100%; }
.calc .newmans span { font-size: 1rem; color: var(--muted); }
@media (max-width: 520px) { .calc .newmans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* the charts are light app screenshots: in dark mode the card is the same white, so no seam shows */
/* dark (dev 2026-11-29 "keep them dark"): the drawings follow the theme; the chart pictures are light PNGs, inverted with their hues kept */
.mk-dark .calc figure img, .mk-dark .crystal-panel img { filter: invert(0.92) hue-rotate(180deg); }
/* the inverted white of those pictures (255 x 0.08 = #141414) is the card color, so no box shows round them */
.mk-dark .calc figure:not(.calc-ir), .mk-dark .crystal-panel:not(.cr-svg) { background: #141414; }

/* AI chat: the thread beside the drawing it made (app screenshots: they stay light) */
/* the AI row's three clips (site-ai-compose.cjs, 1220 x 1068): the whole frame, white like the app */
.ai-clip { display: block; width: 100%; height: auto; aspect-ratio: 1220 / 1068; border-radius: 8px; background: #fff; }
.mk-dark .ai-clip { box-shadow: inset 0 0 0 1px var(--line); filter: brightness(0.88); }
.ai-panel { display: grid; gap: 1rem; padding: 1rem; background: #fff; }
.ai-thread { width: 100%; max-width: 30rem; height: auto; justify-self: center; border: 1px solid #e6e1da; border-radius: 8px; }
.ai-result { width: 100%; height: auto; }
.mk-dark .ai-panel { background: #fff; border-color: transparent; }

/* LaTeX solution: the file takes the page's text color (--mk-text-color) */
.lx-panel { padding: clamp(1.25rem, 3vw, 2.25rem); color: var(--ink); --mk-text-color: var(--ink); }
.lx-in svg { width: 100% !important; height: auto !important; }
.lx-cap { min-height: 3em; }

/* crystals and the XYZ import: light pictures from the app (they stay on white in dark mode) */
.crystal-panel { background: var(--surface); display: grid; place-items: center; }
.crystal-panel img { width: 100%; max-width: 30rem; height: auto; }
.mk-dark .crystal-panel { border-color: transparent; }
.xyz-grid { display: grid; grid-template-columns: max-content auto minmax(0, 1fr); gap: 1rem; align-items: center; }
.xyz-grid .code { margin: 0; padding: 0.8rem 0.9rem; font-size: 0.64rem; line-height: 1.55; white-space: pre; overflow-x: hidden; overflow-y: auto; max-height: 22rem; }
.xyz-arrow { font: 700 1.6rem/1 var(--head); color: var(--accent-text); }
.xyz-fig { background: var(--surface); border-radius: 10px; padding: 0.75rem; min-height: 12rem; display: grid; place-items: center; }
@media (max-width: 640px) { .xyz-grid { grid-template-columns: minmax(0, 1fr); justify-items: stretch; } .xyz-grid .code { max-height: 11rem; } .xyz-arrow { justify-self: center; transform: rotate(90deg); } }

/* ESP */
.esp-pick { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.esp-host { height: 44rem; }   /* 40rem clipped the footer at 768 to 1024 px, where the legend and its note wrap (dev 2026-11-29) */
.orb-host { height: 36rem; }
.calc .calc-ir { background: transparent; border: 0; padding: 0; max-width: 780px; margin: 0 auto; }
.mk-dark .calc .calc-ir { background: transparent; }
.mk-dark .calc .calc-ir figcaption { color: var(--muted); }
.ir-host { height: auto; min-height: 34rem; overflow: visible; }   /* taller than the other viewers: the map, its scale and the range buttons (dev 2026-11-27) */
.esp-pick .btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* practice: the chosen problem's prompt, large above the frame (dev 2026-11-27: the student must read it) */
/* "Figures that know their chemistry": the live figure and the rule under it */
.chem-fig .chem-svg { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; display: grid; place-items: center; min-height: 12rem; }
.chem-fig .chem-code { margin-top: 0.9rem; font-size: 0.78rem; min-height: 3.2em; }
.chem-fig .c-muted { color: var(--muted); }
/* the page's switches drive this Viewer: its own title bar and credit line would repeat them (dev 2026-11-27); the
   legend stays, it says what the chosen overlay shows */
#chem-demo .mkw-bar, #chem-demo .mkw-credit, #chem-demo .mkw-foot-res, #chem-demo .mkw-3dtoggle, #chem-demo .mkw-zoomctl { display: none !important; }   /* + the 3D and zoom buttons (dev) */
.chem-fig .chem-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; }
.chem-fig .chem-pick-k { font: 600 0.78rem var(--body); color: var(--muted); min-width: 4.4rem; }
.chem-fig .chem-pick .btn { padding-left: 0.6rem; padding-right: 0.6rem; font-size: 0.82rem; }   /* five labels on one line (dev 2026-11-27) */
.chem-fig .chem-pick .btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chem-fig .chem-svg { margin-top: 0.4rem; }
.practice-pick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.9rem; }
.practice-pick .btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.practice-prompt { margin: 0 0 0.8rem; max-width: none; font: 700 1.3rem/1.3 var(--head); color: var(--ink); }

/* practice */
.practice-host { min-height: 26rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
/* the loader gives its frame a 1px #ddd border and white ground: inside our framed box that showed as thin white
   lines in dark mode (dev 2026-11-29); our box draws the frame (inline style, so !important) */
.practice-host iframe { border: 0 !important; border-radius: 0 !important; background: transparent !important; }
.mk-dark .practice-host iframe { filter: brightness(0.9); }

/* ---- journal styles: six figures at printed size, named only */
.journals { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 1rem; max-width: 62rem; margin: 2.75rem auto 0; padding: 0; }
.journals figure { display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; gap: 0.9rem; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 1.75rem 1rem 1.1rem; min-height: 12rem; }
.journals .jfig { display: grid; place-items: center; }
.journals figcaption { margin: 0; font: 700 1.05rem/1.2 var(--head); color: var(--ink); justify-content: center; }

/* ---- More in Molkit */
.tiles-sec { padding: clamp(4rem, 8vw, 7rem) 0 0; }
.tiles-sec h2 { text-align: center; margin-bottom: 2.5rem; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem 2rem; }
.tiles li { display: grid; align-content: start; gap: 0.35rem; }
.ti { width: 40px; height: 40px; margin-bottom: 0.6rem; }
.tiles h3 { font: 700 1.15rem/1.25 var(--head); }
.tiles h3 a { color: var(--ink); text-decoration: none; }
.tiles h3 a::after { content: " \2192"; color: var(--accent); }
.tiles h3 a:hover { color: var(--accent-text); }
.tiles p { margin: 0; font-size: 0.95rem; line-height: 1.55; color: var(--muted); }

/* ---- presets */
.presets { padding: clamp(4rem, 8vw, 7rem) 0; background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.presets .narrow p { color: var(--muted); font-size: 1.08rem; }
.preset-panel { max-width: 62rem; margin: 2.75rem auto 0; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; }
.pp-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.pp-head label { font: 600 1rem/1 var(--head); }
.pp-head select { font: 600 1rem var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--muted); border-radius: 6px; padding: 0.5rem 2rem 0.5rem 0.75rem; min-height: 42px; }
.pp-head .by { margin-left: auto; font-size: 0.9rem; color: var(--muted); }
.pp-head .by code { background: var(--code-bg); padding: 0.1rem 0.35rem; border-radius: 3px; color: var(--ink); }
.pp-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: 2.5rem; align-items: center; padding: clamp(1.5rem, 4vw, 3rem); min-height: 21rem; }
.ts { display: grid; justify-items: center; min-width: 0; }
/* never shrunk: a figure wider than the panel (3x, Textbook on a phone) scrolls sideways */
.ts-fig { max-width: 100%; overflow-x: auto; display: flex; justify-content: safe center; align-items: center; min-height: 9.5rem; }
.ts .ruler { display: block; margin-top: 1rem; color: var(--muted); max-width: 100%; }
.ts figcaption { justify-content: center; text-align: center; max-width: 26rem; }
.specs dl { margin: 0; display: grid; }
.specs dl div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.specs dl div:first-child { border-top: 1px solid var(--line); }
.specs dt { font: 600 0.78rem/1.9 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.specs dd { margin: 0; font-size: 0.98rem; }
.specs p { margin: 0; color: var(--muted); }
.presets .more { margin-top: 2rem; }
[data-preset-scope] .cap-canvas { display: none; }
[data-preset-scope][data-canvas-size] .cap-canvas { display: inline; }
[data-preset-scope][data-canvas-size] .ts figcaption,
[data-preset-scope][data-canvas-size] .cap-print,
[data-preset-scope][data-canvas-size] svg[data-ruler],
[data-preset-scope][data-canvas-size] .zoom { display: none; }
[data-preset-scope] .cap-zoom { display: none; }
[data-preset-scope][data-zoomed]:not([data-canvas-size]) .cap-zoom { display: inline; }
[data-preset-scope][data-zoomed]:not([data-canvas-size]) .cap-print,
[data-preset-scope][data-zoomed] svg[data-ruler] { display: none; }
.zoom { display: flex; gap: 0.5rem; margin-top: 1.25rem; }
.zoom .btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---- documentation */
.docs { padding: clamp(4rem, 8vw, 7rem) 0 clamp(4rem, 8vw, 6.5rem); }
.docs-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.docs h2 { font-size: clamp(1.9rem, 2.9vw, 2.4rem); font-weight: 700; }
.docs h2 a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 6px; }
.docs h2 a:hover { color: var(--accent-text); }
.docs-grid > div p { color: var(--muted); margin-top: 1.2rem; }
.links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.links li { display: grid; gap: 0.15rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.links a { font: 600 1.15rem/1.35 var(--head); color: var(--ink); text-decoration: none; justify-self: start; }
.links a::after { content: " \2192"; color: var(--accent); }
.links a:hover { color: var(--accent-text); }
.links span { color: var(--muted); font-size: 0.95rem; }

footer { border-top: 1px solid var(--line); padding: 1.5rem 0 2.25rem; color: var(--muted); font-size: 0.92rem; }
footer a { color: var(--muted); display: inline-block; padding: 0.2rem 0; min-height: 24px; }

/* ---- narrower */
@media (max-width: 960px) {
  .row-grid, .row.flip .row-grid, .row.even .row-grid, [data-practice-scope] .row-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .row.flip .txt { order: 0; }
  .txt { max-width: 40rem; }
  .pp-body { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .specs { max-width: 26rem; width: 100%; justify-self: center; }
  .docs-grid { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .std { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .wrap { padding: 0 18px; }
  header.top .bar { padding-top: 1rem; padding-bottom: 1rem; }
  header nav { gap: 1rem; font-size: 0.95rem; }
  header nav .hide-s { display: none; }
  .brand { font-size: 1.3rem; } .brand svg { width: 24px; height: 24px; }
  .hero h1 { font-size: clamp(1.9rem, 8.4vw, 2.4rem); }
  .hero .sub { font-size: 1rem; }
  .act { margin-top: 1.4rem; }
  .wide { padding: 0 10px; }
  .player { border-radius: 14px; }
  .slot:not(.has-video) { aspect-ratio: 3 / 2; }
  .slot-fallback { padding: 0.75rem 0.4rem 0.75rem; }
  .soon { padding: 0 0.45rem; font-size: 0.82rem; }
  .row .panel { padding: 0.6rem; }
  .compare-panel { padding: 1rem 0.75rem 0.85rem !important; }
  /* the E2 keeps labels >= 10 px: it scrolls sideways inside its panel */
  .e2-panel { overflow-x: auto; }
  .e2-in { min-width: 440px; }
  .bar-ctl { gap: 0.6rem 0.75rem; padding: 0.75rem 0.8rem; }
  .cap { font-size: 0.86rem; }
  .host { height: 26rem; }
  .esp-host { height: 36rem; }   /* its legend wraps to several lines on a phone (dev 2026-11-29) */
  .pp-head .by { margin-left: 0; flex-basis: 100%; }
  .pp-body { padding: 1.25rem 1rem 1.5rem; min-height: 0; }
  .code { font-size: 0.78rem; padding: 0.85rem 0.8rem; }
  .tiles { gap: 2rem 1.25rem; }
  .journals { gap: 0.6rem; grid-template-columns: minmax(0, 1fr); }
  .std { grid-template-columns: minmax(0, 1fr); }
  .journals figure { padding: 1.1rem 0.4rem 0.9rem; min-height: 9rem; }
  .journals .jfig { max-width: 100%; overflow-x: auto; }
  .ic { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
/* the three SN2 structures under the reaction path chart (dev 2026-11-27) */
.calc-structs { margin-top: 0.8rem; display: block; width: 100%; }   /* full width: the kit sizes the inlined svg to its host (width 100%, max-height data-max-h) */

/* the crystals row picks (dev 2026-11-27) */
.cr-pick { margin-bottom: 0.7rem; }
.cr-live { min-height: 26rem; }
/* block, not a centering grid: the grid shrank the inlined figure to 300 px in a 611 px panel (Fable 20); the kit's
   .w svg { width: 100% } fills it, capped so the cell is not taller than the Count atoms picture */
.crystal-panel.cr-svg { display: block; min-height: 22rem; background: var(--surface); max-width: 34rem; margin-inline: auto; }

/* phone: the reaction path chart, equation and structures keep a readable size and the figure scrolls sideways (Fable 20:
   at 390 px the chart text was about 3 px and the structure labels 4 to 6 px) */
@media (max-width: 640px) {
  [data-calc-fig="path"] { overflow-x: auto; }
  [data-calc-fig="path"] > .calc-eq, [data-calc-fig="path"] > img, [data-calc-fig="path"] > .calc-structs { min-width: 600px; }
}

/* the customization block (dev 2026-11-28): the journal grid with four looks; two columns on a phone */
.custom-looks { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 72rem; }
.custom-looks figcaption { font-size: 0.95rem; text-align: center; }
@media (max-width: 760px) { .custom-looks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* the anatomy figure (dev 2026-11-29, option A): numbered markers over the drawing (an overlay in the figure's own
   viewBox, so they stay on their parts at every width), the numbered list beside it; stacked on a phone */
.anatomy { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; max-width: 68rem; margin: 2.5rem auto 0; }
.anatomy-fig { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; }
.anatomy-fig > [data-svg] { position: relative; }
.anatomy-marks { position: absolute; inset: 1.5rem; width: calc(100% - 3rem); height: calc(100% - 3rem); overflow: visible; pointer-events: none; }
.anatomy-more { max-width: 40rem; margin: 1.75rem auto 0; color: var(--muted, var(--ink)); }
.custom-row-lead { margin: 3rem auto 0; color: var(--muted, var(--ink)); }
.custom-looks figure.on-dark { background: #1b1d20; border-color: #1b1d20; }
.custom-looks figure.on-dark figcaption { color: #f2f2f2; }
/* dev 2026-11-29: filled blocks were "too jarring": plain accent numerals and hairline leaders, as a textbook callout */
.anatomy-marks line { stroke: var(--accent-text); stroke-width: 0.45; stroke-linecap: round; opacity: 0.7; }
.anatomy-marks text { fill: var(--accent-text); font: 600 7px/1 var(--head); text-anchor: middle; dominant-baseline: central; }
.anatomy-list { margin: 0; padding: 0; list-style: none; counter-reset: an; display: grid; gap: 0.55rem; }
.anatomy-list li { counter-increment: an; display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.5rem; align-items: baseline; color: var(--ink); line-height: 1.35; }
.anatomy-list li::before { content: counter(an); color: var(--accent-text); font: 600 1rem/1 var(--head); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .anatomy-marks text { font-size: 10px; } .anatomy-marks line { stroke-width: 0.7; } .anatomy { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } .anatomy-fig { padding: 0.75rem; } .anatomy-marks { inset: 0.75rem; width: calc(100% - 1.5rem); height: calc(100% - 1.5rem); } }
