/* cell.css: the plant cell page (/plant-cell/), on top of site.css.
   Part 1 colours Fig. 2, the inline drawing: every shape takes its colour
   from a class here, so dark mode works and the SVG carries no style.
   Part 2 is the states the engine (cell.js) sets on the drawing. Part 3 lays
   out the page. Every colour is a token from site.css, except the four
   organelle washes below, which only fill shapes (no text sits on them). */

/* ---------- 1. the drawing ---------- */

.cell-figure {
  display: block;
  width: 100%;
  height: auto;
  /* four organelle washes of the drawing's own */
  --c-mito: #d4703a;   /* mitochondria: warm orange */
  --c-nuc: #9478c8;    /* nucleus: violet */
  --c-er: #6386d0;     /* endoplasmic reticulum: periwinkle */
  --c-golgi: #3a978a;  /* Golgi apparatus: teal */
}

@media screen and (prefers-color-scheme: dark) {
  .cell-figure {
    --c-mito: #b8673a;
    --c-nuc: #7259a6;
    --c-er: #5577bf;
    --c-golgi: #2f8174;
  }
}

/* outlines */
.ol {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ol-wall {
  stroke-width: 3;
}
.ol-vac {
  stroke-width: 2.8;
}
/* rough ER outline: flat ends, so it runs straight on into the smooth ER tube */
.ol-butt {
  stroke-linecap: butt;
}
.ol-accent {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ol-crista {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linejoin: round;
}
.ol-thin {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ol-env {
  stroke: var(--ink);
  stroke-width: 1.9;
  stroke-linejoin: round;
}
.ol-coin {
  stroke: var(--ink);
  stroke-width: 1;
}
.mem {
  fill: none;
  stroke: var(--pond);
  stroke-width: 3.4;
  stroke-linejoin: round;
}

/* washes */
.f-wall {
  fill: var(--tape);
  fill-rule: evenodd;
}
.f-cyto {
  fill: var(--paper);
}
.f-vac {
  fill: var(--water);
}
.f-nuc {
  fill: var(--c-nuc);
}
.f-lumen {
  fill: var(--card);
  fill-opacity: 0.55;
}
.f-nucleolus {
  fill: var(--c-nuc);
}
.xhatch {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.3;
  stroke-linecap: round;
}
.f-chl {
  fill: var(--leaf);
}
.f-grana {
  fill: var(--pond);
}
.f-mito {
  fill: var(--c-mito);
}
.f-matrix {
  fill: var(--card);
  fill-opacity: 0.35;
}
.f-er {
  fill: var(--c-er);
}
.f-golgi {
  fill: var(--c-golgi);
}
.f-ribo {
  fill: var(--ink);
}

/* pencil work */
.hatch {
  fill: none;
  stroke: var(--pencil);
  stroke-width: 1.4;
  stroke-linecap: round;
}
.fibre {
  fill: none;
  stroke: var(--pencil);
  stroke-width: 1.1;
  stroke-linecap: round;
}
.chromatin {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-opacity: 0.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lam {
  fill: none;
  stroke: var(--pond);
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* smooth ER tubes: an ink stroke with a narrower colour stroke on top */
.tube-ink {
  fill: none;
  stroke: var(--ink);
  stroke-width: 15;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tube-fill {
  fill: none;
  stroke: var(--c-er);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* where the tube meets the rough ER ribbon: a flat end, so the two join */
.tube-butt {
  stroke-linecap: butt;
}

/* invisible, generous hit shapes: a click anywhere inside one finds its part.
   The cell membrane has a second one (.hit-wide) that widens its band
   inward wherever the cytoplasm there is free of other parts, so that a 24
   by 24 pixel square fits on it at 1024 wide and up (WCAG 2.5.8: in the
   quiz the drawing is the only way to answer). It takes nothing from any
   other part but the cytoplasm, and it is not a ring: the membrane's focus
   ring stays the outline of its first band. */
.hit {
  fill: none;
  stroke: none;
  pointer-events: all;
}
.hit-ring {
  fill-rule: evenodd;
}

/* highlighter halo: hidden at rest */
.halo {
  fill: none;
  stroke: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* focus ring: hidden at rest. A ring is a hit shape's outline, or a path of
   its own a little outside the halo, so it shows beside a selected part's
   highlighter instead of under it. */
.ring {
  fill: none;
  stroke: none;
}
.ring:not(.hit) {
  pointer-events: none;
}

/* phones: the drawing is drawn at about 0.35 scale there, so the pen gets
   heavier to keep every outline as bold as it is on a laptop */
@media (max-width: 560px) {
  .cell-figure .ol {
    stroke-width: 3.6;
  }
  .cell-figure .ol-wall {
    stroke-width: 3.8;
  }
  .cell-figure .ol-thin,
  .cell-figure .ol-crista {
    stroke-width: 2;
  }
  .cell-figure .ol-env {
    stroke-width: 2.4;
  }
  .cell-figure .mem {
    stroke-width: 4.4;
  }
  .cell-figure .tube-ink {
    stroke-width: 16.5;
  }
}

/* ---------- 2. states (set by cell.js) ----------
   .is-live on the drawing: the engine is running and each part is a button.
   .is-selected on a part: the one being shown (aria-pressed="true").
   .is-quiet on the drawing: something is selected, so the rest steps back.
   .is-wrong on a part: a wrong answer in the quiz, flashed briefly. */

.cell-figure.is-live .part {
  cursor: pointer;
  /* no grey box of the browser's own over the part's bounds on a tap */
  -webkit-tap-highlight-color: transparent;
}

/* under the pointer: a light highlighter touch. Not on a part selected or
   marked wrong: right after a click the pointer still rests there, and
   their stronger look must show. Nor on the rough ER while Ribosomes is
   selected: its dots are then part of the answer (below), the rest of it
   is not. */
.cell-figure.is-live .part:not(.is-selected):not(.is-wrong):not([data-part="rough-er"]):hover .halo,
.cell-figure.is-live:not([data-selected="ribosome"]) .part[data-part="rough-er"]:not(.is-selected):not(.is-wrong):hover .halo {
  stroke: var(--highlight);
  stroke-opacity: 0.7;
  stroke-width: 9;
}
/* .halo.halo-tube: as specific as the rule above, which it follows, so the
   smooth ER's halo clears its 15-wide inked tube */
.cell-figure.is-live .part:not(.is-selected):not(.is-wrong):hover .halo.halo-tube {
  stroke-width: 22;
}
.cell-figure.is-live .part:not(.is-selected):not(.is-wrong):not([data-part="rough-er"]):hover .halo-dot,
.cell-figure.is-live:not([data-selected="ribosome"]) .part[data-part="rough-er"]:not(.is-selected):not(.is-wrong):hover .halo-dot {
  stroke-width: 8;
}
.cell-figure.is-live .part:not(.is-selected):not(.is-wrong):hover .f-cyto {
  fill: var(--highlight);
  fill-opacity: 0.25;
}

/* selected, or a wrong answer: a thick highlighter halo and a heavier pen */
.cell-figure .part.is-selected .halo,
.cell-figure .part.is-wrong .halo {
  stroke: var(--highlight);
  stroke-opacity: 1;
  stroke-width: 16;
}
.cell-figure .part.is-selected .halo-tube,
.cell-figure .part.is-wrong .halo-tube {
  stroke-width: 30;
}
.cell-figure .part.is-selected .halo-dot,
.cell-figure .part.is-wrong .halo-dot {
  stroke-width: 11;
}
.cell-figure .part.is-selected .halo-mem,
.cell-figure .part.is-wrong .halo-mem {
  stroke-width: 16;
}
.cell-figure .part.is-selected .ol,
.cell-figure .part.is-wrong .ol {
  stroke-width: 4.2;
}
.cell-figure .part.is-selected .ol-wall,
.cell-figure .part.is-wrong .ol-wall {
  stroke-width: 4.6;
}
.cell-figure .part.is-selected .ol-env,
.cell-figure .part.is-wrong .ol-env {
  stroke-width: 2.8;
}
.cell-figure .part.is-selected .mem,
.cell-figure .part.is-wrong .mem {
  stroke-width: 5.5;
}
.cell-figure .part.is-selected .tube-ink,
.cell-figure .part.is-wrong .tube-ink {
  stroke-width: 17.5;
}
.cell-figure .part.is-selected .f-cyto,
.cell-figure .part.is-wrong .f-cyto {
  fill: var(--highlight);
  fill-opacity: 0.5;
}
/* The selected cytoplasm has no outline of its own to draw heavier, and in
   light mode its highlighter wash is barely darker than the paper. So it is
   also hatched in pencil, a mark that is not colour (WCAG 1.4.1): diagonal
   lines across the whole cytoplasm, cut at its edge, the parts above them
   hiding them where they sit. */
.cyto-hatch {
  fill: none;
  stroke: none;
  pointer-events: none;
}
.cell-figure .part.is-selected .cyto-hatch {
  stroke: var(--pencil);
  stroke-opacity: 0.6;
  stroke-width: 1.3;
  stroke-linecap: round;
}
@media (max-width: 560px) {
  .cell-figure .part.is-selected .ol,
  .cell-figure .part.is-wrong .ol {
    stroke-width: 5.4;
  }
  .cell-figure .part.is-selected .mem,
  .cell-figure .part.is-wrong .mem {
    stroke-width: 6.5;
  }
  .cell-figure .part.is-selected .tube-ink,
  .cell-figure .part.is-wrong .tube-ink {
    stroke-width: 19;
  }
}

/* quiet: everything but the selected part steps back, except the part with
   keyboard focus, whose ring must stay clear. What steps back is each
   part's washes, hatching and chromatin, faded to --fade. Its ink
   outlines, the membrane's line and the ribosomes' dots stay at full ink:
   every part is still a button to find and press (WCAG 1.4.11 asks 3 to 1
   for them, and full ink gives far more). */
.cell-figure .part {
  --fade: 1;
}
.cell-figure.is-quiet .part:not(.is-selected) {
  --fade: 0.45;
}
.cell-figure.is-quiet .part:not(.is-selected):focus-visible {
  --fade: 1;
}

/* What the selected part includes does not step back (cell.js names the
   selected part in data-selected). Nucleus: the nucleolus inside it stays
   bright. Cytoplasm: it fills the space around the other parts, so no part
   steps back, and its wash shows between them, not through them.
   Ribosomes: the dots on the rough ER are ribosomes too; they stay at full
   ink, as every dot does, and take the highlighter (below), while the rough
   ER's wash steps back. */
.cell-figure.is-quiet[data-selected="nucleus"] .part[data-part="nucleolus"],
.cell-figure.is-quiet[data-selected="cytoplasm"] .part:not(.is-selected) {
  --fade: 1;
}

.cell-figure :is(.f-wall, .f-cyto, .f-vac, .f-nuc, .f-nucleolus, .f-er, .f-golgi, .f-mito, .f-matrix, .f-chl, .hatch, .fibre, .chromatin, .lam, .xhatch) {
  opacity: var(--fade);
}
/* a wash and an ink edge on one shape (the nucleus's pores, the
   chloroplasts' stacks): only the wash fades */
.cell-figure .f-lumen {
  fill-opacity: calc(0.55 * var(--fade));
}
.cell-figure .f-grana {
  fill-opacity: var(--fade);
}
/* The smooth ER's colour runs along the middle of its own inked tube, so
   made see-through it would show the ink below it. Faded, it is the colour
   it would look through the faded cytoplasm instead: mixed with the paper
   at 45% over the card. Without color-mix() it stays as it is. */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .cell-figure .tube-fill {
    stroke: color-mix(in srgb, var(--c-er) calc(var(--fade) * 100%), color-mix(in srgb, var(--paper) 45%, var(--card)));
  }
}
.cell-figure[data-selected="ribosome"] .part[data-part="rough-er"] .halo-dot {
  stroke: var(--highlight);
  stroke-opacity: 1;
  stroke-width: 11;
}

/* A wrong answer's highlighter fades out. The engine takes .is-wrong off
   after the fade; with reduced motion there is no fade, and the mark stays
   until the next click. */
@media (prefers-reduced-motion: no-preference) {
  .cell-figure .part.is-wrong .halo {
    animation: cell-flash 0.9s ease-in forwards;
  }
  .cell-figure .part.is-wrong .f-cyto {
    animation: cell-flash-fill 0.9s ease-in forwards;
  }
}
@keyframes cell-flash {
  0%, 40% { stroke-opacity: 1; }
  100% { stroke-opacity: 0; }
}
@keyframes cell-flash-fill {
  0%, 40% { fill: var(--highlight); fill-opacity: 0.5; }
  100% { fill: var(--paper); fill-opacity: 1; }
}

/* Keyboard focus on a part: a dashed ring around each of its pieces, in
   the focus colour. The browser's own outline would be a box around the
   whole group, which for the chloroplasts or the cell wall is most of the
   drawing. The ring keeps the same width on a phone as on a laptop. */
.cell-figure .part:focus {
  outline: none;
}
.cell-figure .part:focus-visible .ring {
  stroke: var(--focus);
  stroke-width: 3;
  stroke-dasharray: 9 5;
  vector-effect: non-scaling-stroke;
}
/* The nucleolus's ring lies on the nucleus's violet wash, where the focus
   colour is too faint: there it is drawn in ink, and a fifth wider, so it
   clears a selected nucleolus's highlighter instead of running on it. */
.cell-figure .part[data-part="nucleolus"] .ring {
  transform: scale(1.2);
  transform-box: fill-box;
  transform-origin: center;
}
.cell-figure .part[data-part="nucleolus"]:focus-visible .ring {
  stroke: var(--ink);
}
/* The cytoplasm's ring lies wholly on the cytoplasm. While it is selected
   that is the highlighter wash, where the focus colour is too faint at
   night: then the ring is drawn in ink. */
.cell-figure[data-selected="cytoplasm"] .part[data-part="cytoplasm"]:focus-visible .ring {
  stroke: var(--ink);
}
/* The rough ER's ring is the outline of its hit shape, which runs through
   the middle of a selected rough ER's highlighter halo. While it is
   selected, its ring is the halo's own line instead, drawn beneath the
   halo and wider than it, so it shows as a dashed edge round the outside
   of the highlighter, on the cytoplasm. In ink: the focus colour is too
   close to the highlighter beside it. In the drawing's own units, like
   the halo (16 wide): 3.5 each side on a laptop, more on a phone, where
   the drawing is smaller. The halo's line is a ring too (.ring), so the
   rule that hides it while the rough ER is not selected names both
   classes: it must outrank the ring rule in the forced-colours block. */
.cell-figure .part:focus-visible .ring.ring-halo {
  stroke: none;
}
.cell-figure .part[data-part="rough-er"].is-selected:focus-visible .hit.ring {
  stroke: none;
}
.cell-figure .part[data-part="rough-er"].is-selected:focus-visible .ring-halo {
  stroke: var(--ink);
  stroke-width: 23;
  stroke-dasharray: 9 5;
  vector-effect: none;
}
@media (max-width: 560px) {
  .cell-figure .part[data-part="rough-er"].is-selected:focus-visible .ring-halo {
    stroke-width: 30;
    stroke-dasharray: 18 10;
  }
}

/* ---------- 3. the page ---------- */

/* the engine shows these when it starts; until then (or without
   JavaScript) they stay hidden, whatever display a rule below gives them */
.cell-page [hidden] {
  display: none !important;
}

/* Wide screens: the heading, the mode buttons and the panel on the left,
   the drawing on the right, beside all three. The drawing is sized from the
   screen's height so that on a school laptop (1366 by 768, about 620 pixels
   of page showing) the heading, both mode buttons, the whole drawing and
   the panel fit on one screen. 10rem is everything above and below the
   drawing: the sheet's top edge, the page header, the card's padding and
   caption, and a little air; 1.4286 is the drawing's width over its height
   (800 by 560). */
.cell-page {
  --fig-w: min(48rem, max(24rem, calc((100vh - 10rem) * 1.4286 + 2rem)));
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(0, var(--fig-w));
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas:
    "head figure"
    "panel figure"
    "finder finder"
    "list list";
  column-gap: 3rem;
  align-items: start;
}

.sheet > main.cell-page {
  padding-top: 1.5rem;
}

.cell-head {
  grid-area: head;
}

/* The drawing's column, as tall as the heading and the panel together. The
   card inside it is held in view only this far, so it stops at the foot of
   the panel and never slides over the name buttons or the list below. */
.cell-figure-slot {
  grid-area: figure;
  align-self: stretch;
}

.cell-card {
  padding: 0.75rem 0.875rem 0.625rem;
  transform: rotate(-0.5deg);
  /* room for the strip of tape when cell.js scrolls the card into view */
  scroll-margin-top: 1.25rem;
}

/* Beside a panel taller than the screen (a short or zoomed screen, a
   long answer), the drawing stays in view as the page scrolls down to Next
   or Show me, so the part being shown never leaves the screen. The
   drawing is sized from the screen's height, so it fits on any screen
   22rem tall or more. Not in one column (below). Held inside its column
   (above): a grid item held in view by itself would be held through the
   whole grid. */
@media (min-height: 22rem) {
  .cell-card {
    position: sticky;
    top: 1.25rem;
  }
}

.panel {
  grid-area: panel;
  max-width: 32rem;
}

.finder {
  grid-area: finder;
  margin-top: 1.75rem;
}

.parts-fold {
  grid-area: list;
  margin-top: 1.75rem;
}

/* the mode buttons */
.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.cell-head .note {
  margin-top: 0.5rem;
}

/* The line about the keyboard is no use on a phone or tablet worked by
   touch alone, where in one column it would push the drawing, and the
   question in the quiz, down the screen. A laptop, a touch screen with a
   mouse or trackpad, and a zoomed-in browser keep it. */
@media (hover: none) and (pointer: coarse) {
  .cell-keys {
    display: none;
  }
}

/* cell.js removes this line when it starts. With JavaScript off the
   <noscript> line says it all, so this one stays out of the way where the
   browser can tell. */
@media (scripting: none) {
  .cell-loading {
    display: none;
  }
}

/* ---- the panel ---- */

.panel-text p {
  margin: 0 0 0.75rem;
}

.panel .panel-name {
  margin: 0 0 0.625rem;
  font-size: 1.75rem;
}

/* the part's name, swiped with the highlighter */
.swipe {
  padding: 0 0.2em;
  color: var(--highlight-ink);
  background: var(--highlight);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.panel-text .quiz-meta {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.5rem;
  margin-bottom: 0.375rem;
  font: 600 1.0625rem/1.4 var(--hand);
  color: var(--pencil);
}

.panel-text .quiz-prompt {
  margin-bottom: 1rem;
  font: 700 1.375rem/1.35 var(--hand);
}

/* the answer to a click: a pencilled note, ruled green when it is right */
.panel-text .quiz-feedback {
  padding-left: 0.875rem;
  border-left: 3px solid var(--rule-strong);
}

.panel-text .quiz-feedback.is-right {
  border-left-color: var(--pond);
}

.panel-text .quiz-feedback:empty {
  display: none;
}

/* The result sits above the live region (cell.js says why). */
.panel .quiz-result {
  margin: 0 0 0.75rem;
  font: 700 1.5rem/1.3 var(--hand);
}

/* The engine moves focus here when a round ends, so a screen reader starts
   from the result; it is not a control, so it draws no focus ring. */
.panel .quiz-result:focus {
  outline: none;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.25rem;
}

.panel-actions:empty {
  display: none;
}

/* room for the focus ring when cell.js scrolls Next or Show me into view */
.panel-actions button {
  scroll-margin: 0.75rem 0;
}

.panel-actions .missed-label {
  flex-basis: 100%;
  margin: 0.5rem 0 0;
}

.missed {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.625rem;
  flex-basis: 100%;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

/* ---- find a part by name ---- */

.finder h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3125rem;
}

.finder-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.625rem;
}

/* ---- the list of parts ---- */

.parts-fold > summary {
  min-height: 2.75rem;
  padding: 0.375rem 0;
  font: 700 1.3125rem/1.4 var(--hand);
  cursor: pointer;
  /* on a phone it wraps: no word left alone on the second line */
  text-wrap: balance;
}

.parts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3rem;
}

.parts > h2 {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

.part-entry h3 {
  margin-top: 1.25rem;
}

.part-entry p {
  margin-bottom: 0.625rem;
}

/* ---- narrow screens: one column, in reading order ----
   Only below 50rem (800 pixels), so a laptop mirrored to a 1024 by 768
   projector, or a 1366 screen at 150%, keeps the drawing and the panel side
   by side. cell.js uses the same width. In one column the heading and the
   mode buttons sit above the drawing, so its height budget is the screen
   less 18rem, but never so small that the parts are hard to hit. */

@media (max-width: 50rem) {
  .cell-page {
    display: block;
  }

  .cell-card {
    position: relative;
    max-width: min(var(--fig-w), max(20rem, calc((100vh - 18rem) * 1.4286 + 2rem)));
    margin-top: 1.75rem;
  }

  .panel {
    margin-top: 1.5rem;
  }

  .parts {
    display: block;
  }
}

@media (max-width: 30rem) {
  .cell-card {
    padding: 0.5rem 0.5rem 0.375rem;
  }
}

/* ---------- other settings ---------- */

/* Windows High Contrast and other forced colours: the drawing keeps its
   own colours on its own card, as a picture would (as Fig. 1 does on the
   home page), and the states are drawn in system colours: a thick
   Highlight halo for the selected part, a dashed ring in the text colour for
   keyboard focus. */
@media (forced-colors: active) {
  .cell-figure {
    forced-color-adjust: none;
    background: var(--card);
  }

  .cell-figure.is-live .part:not(.is-selected):not(.is-wrong):not([data-part="rough-er"]):hover .halo,
  .cell-figure.is-live:not([data-selected="ribosome"]) .part[data-part="rough-er"]:not(.is-selected):not(.is-wrong):hover .halo {
    stroke: Highlight;
    stroke-opacity: 1;
    stroke-width: 6;
  }

  .cell-figure .part.is-selected .halo,
  .cell-figure .part.is-wrong .halo {
    stroke: Highlight;
    stroke-width: 18;
  }

  .cell-figure .part.is-selected .halo-tube,
  .cell-figure .part.is-wrong .halo-tube {
    stroke-width: 32;
  }

  .cell-figure .part.is-selected .halo-dot,
  .cell-figure .part.is-wrong .halo-dot {
    stroke-width: 12;
  }

  .cell-figure .part.is-selected .f-cyto,
  .cell-figure .part.is-wrong .f-cyto {
    fill: Highlight;
    fill-opacity: 0.35;
  }

  .cell-figure .part.is-selected .cyto-hatch {
    stroke: CanvasText;
  }

  .cell-figure[data-selected="ribosome"] .part[data-part="rough-er"] .halo-dot {
    stroke: Highlight;
    stroke-width: 12;
  }

  .cell-figure .part:focus-visible .ring,
  .cell-figure .part[data-part="nucleolus"]:focus-visible .ring,
  .cell-figure[data-selected="cytoplasm"] .part[data-part="cytoplasm"]:focus-visible .ring {
    stroke: CanvasText;
  }

  /* the rough ER's ring round its halo, which is 18 wide here */
  .cell-figure .part[data-part="rough-er"].is-selected:focus-visible .ring-halo {
    stroke: CanvasText;
    stroke-width: 26;
  }
  /* on a phone, where the drawing is smaller: the rule just above has the
     same weight as the phone rule's 30 and comes later, so without this
     the ring would show only about 1.5px each side */
  @media (max-width: 560px) {
    .cell-figure .part[data-part="rough-er"].is-selected:focus-visible .ring-halo {
      stroke-width: 32;
    }
  }

  .swipe {
    forced-color-adjust: none;
    color: HighlightText;
    background: Highlight;
  }

  .panel-text .quiz-feedback,
  .panel-text .quiz-feedback.is-right {
    border-left-color: CanvasText;
  }
}

/* On paper: the drawing and, outside a round, the list (cell.js opens it
   before printing), without the buttons or the line about the keyboard. */
@media print {
  .cell-page {
    display: block;
  }

  .cell-card {
    position: relative;
    max-width: 40rem;
  }

  .modes,
  .cell-keys,
  .finder,
  .panel-actions {
    display: none;
  }
}
