:root {
  --ground: #f2f4f7; --surface: #fff; --sunken: #f2f4f7; --hairline: #e4e8ed; --text: #272b30; --muted: #5a5f66;
  --accent: #007bff; --accent-ink: #0069dc; --highlight: #fff1c2;
  --jade: #00614e; --jade-tint: #d8fcef; --rasp: #cd285d; --rasp-tint: #ffeef0; --peri: #4f3fa0; --peri-tint: #f1f1ff;
  --fig: #ebf3ff; --fig-ink: #0d4fa3; --try: #f1f1ff; --try-ink: #4f3fa0; --play: #ffefe7; --play-ink: #803d14;
  --example: #e9f9de; --example-ink: #3b5e1c; --check: #fff8dc; --check-ink: #6b4e00;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ground); font-family: 'Hanken Grotesk', system-ui, sans-serif; color: var(--text); overflow: hidden; }
button { font: inherit; color: inherit; }

/* ---------- the shell ---------- */
.shell { position: fixed; inset: 0; display: flex; }
.rail { width: 96px; flex: none; background: var(--surface); border-right: 1px solid var(--hairline); }
.space { flex: 1; display: flex; flex-direction: column; padding: 12px 24px 24px; gap: 12px; min-width: 0; }
.bar { height: 52px; flex: none; display: flex; align-items: center; gap: 16px; }
.bar .where { font: 700 13px 'Hanken Grotesk'; color: var(--muted); }
.modes { display: flex; background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px; padding: 3px; margin-left: auto; }
.modes button { border: 0; background: none; font: 700 13px 'Hanken Grotesk'; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.modes button.on { background: var(--accent-ink); color: #fff; }
.modes button:disabled { opacity: .4; cursor: default; }
.guide-controls { display: none; align-items: center; gap: 8px; }
body[data-mode="learn"] .guide-controls { display: flex; }
.guide-controls button { font: 600 13px 'Hanken Grotesk'; padding: 8px 14px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--surface); cursor: pointer; }
.status-line { font: 600 13px 'Hanken Grotesk'; color: var(--muted); max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panes { flex: 1; display: flex; gap: 24px; min-height: 0; }
/* The top bar's menu: the player's settings. */
.menu { position: relative; }
.menu-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); cursor: pointer; color: var(--muted); }
.menu-btn svg { fill: currentColor; }
.menu-btn[aria-expanded="true"] { color: var(--accent-ink); border-color: var(--accent-ink); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 240px; background: var(--surface); border-radius: 16px; padding: 8px; box-shadow: 0 10px 28px rgba(11, 29, 82, .18); }
.menu-pop[hidden] { display: none; }
.back-btn, .phone-only { display: none; }
.back-btn { width: 44px; height: 44px; place-items: center; border: 0; border-radius: 999px; background: none; color: var(--text); cursor: pointer; }
.menu-item { display: block; padding: 10px 12px; border-radius: 10px; font: 600 14px 'Hanken Grotesk'; color: var(--text); text-decoration: none; }
.menu-item:hover, .menu-contents button:hover { background: var(--sunken); }
.menu-item[hidden] { display: none !important; }
.menu-contents { border-block: 1px solid var(--hairline); margin: 4px 0; padding: 4px 0; }
.menu-head { margin: 0; padding: 8px 12px 4px; font: 700 11px 'Hanken Grotesk'; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.menu-contents ol { list-style: none; margin: 0; padding: 0; }
.menu-contents button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 10px; font: 600 14px/1.35 'Hanken Grotesk'; cursor: pointer; }
.menu-contents button[aria-current="true"] { color: var(--accent-ink); }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font: 600 14px 'Hanken Grotesk'; cursor: pointer; }
.switch-row:hover { background: var(--sunken); }
.switch-row > span:first-child { flex: 1; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 40px; height: 24px; flex: none; border-radius: 999px; background: #c3c9d1; position: relative; transition: background .2s; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch-row input:checked + .switch { background: var(--accent-ink); }
.switch-row input:checked + .switch::after { transform: translateX(16px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row input:disabled + .switch { opacity: .5; }

/* The host app draws the controls (?embed=1), at every width. */
body.embed .space > .bar, body.embed .rail { display: none; }
.phone-only.switch-row { display: none; }
@media (max-width: 900px) { .phone-only.switch-row { display: flex; } .phone-only.switch-row[hidden] { display: none; } }

/* ---------- the text ---------- */
.text { flex: 1; min-width: 0; background: var(--surface); border-radius: 32px; padding: 40px 56px 50vh; overflow-y: auto; scroll-behavior: auto; }
.lesson { max-width: 680px; }
.lesson h1 { font: 600 36px/1.15 'Fredoka', sans-serif; margin: 0 0 8px; }
.lesson h2 { font: 600 28px/1.2 'Fredoka', sans-serif; margin: 0 0 16px; }
.sec { padding-top: 28px; }
.sec + .sec { margin-top: 20px; border-top: 1px solid var(--hairline); }
.lesson p, .lesson li { font-size: 18px; line-height: 1.6; }
.lesson p { margin: 0 0 14px; }
.lesson ul { margin: 0 0 14px; padding-left: 24px; }
.lesson li { margin-bottom: 6px; }
.lesson code { background: var(--sunken); padding: 1px 6px; border-radius: 6px; font-size: 15px; }
.table-wrap { overflow-x: auto; margin: 6px 0 18px; }
.lesson table { border-collapse: collapse; width: 100%; font-size: 15px; }
.lesson th, .lesson td { border-bottom: 1px solid var(--hairline); padding: 8px 10px; text-align: left; vertical-align: top; }
.lesson th { color: var(--muted); font-weight: 700; }
::highlight(ayo) { background-color: var(--highlight); color: inherit; }
.lit { background: var(--highlight); border-radius: 6px; }

.tag { font: 700 12px/1 'Hanken Grotesk'; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }

/* Markers: where a stage item belongs in the text. */
.marker { display: grid; grid-template-columns: auto 1fr auto; column-gap: 12px; row-gap: 2px; align-items: baseline; width: 100%; text-align: left;
  border: 0; border-radius: 16px; padding: 12px 16px; margin: 18px 0; cursor: pointer; background: var(--bg); color: var(--ink); transition: box-shadow .2s; }
.marker.figure { --bg: var(--fig); --ink: var(--fig-ink); }
.marker.interactive { --bg: var(--try); --ink: var(--try-ink); }
.marker.game { --bg: var(--play); --ink: var(--play-ink); }
.marker .m-tag { font: 700 12px 'Hanken Grotesk'; letter-spacing: .04em; text-transform: uppercase; }
.marker .m-text { font: 600 16px/1.35 'Hanken Grotesk'; color: var(--text); }
.marker .m-sub { grid-column: 2; font-size: 14px; line-height: 1.45; color: var(--muted); }
.marker .m-where { grid-row: 1; grid-column: 3; font: 700 12px 'Hanken Grotesk'; white-space: nowrap; }
.marker.active { box-shadow: inset 0 0 0 2px var(--ink); }

.example, .check, .callout { border-radius: 16px; padding: 16px 18px 8px; margin: 18px 0; }
.example { background: var(--example); } .example .tag { color: var(--example-ink); }
.check { background: var(--check); } .check .tag { color: var(--check-ink); }
.callout { background: var(--play); } .callout .tag { color: var(--play-ink); }
.callout.going-further { background: var(--fig); } .callout.going-further .tag { color: var(--fig-ink); }
.example p, .check p, .callout p { font-size: 16px; margin: 0 0 10px; }
.example .step b { color: var(--example-ink); }
.example .chip.go { margin-bottom: 10px; }

.options { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.option { display: flex; gap: 10px; align-items: baseline; text-align: left; font-size: 16px; line-height: 1.45; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--hairline); background: var(--surface); cursor: pointer; }
.option b { flex: none; width: 22px; color: var(--muted); }
.option:hover { border-color: #c3c9d1; }
.option.right { background: var(--jade-tint); border-color: var(--jade); }
.option.wrong { background: var(--rasp-tint); border-color: var(--rasp); }
.options.done .option:not(.right) { opacity: .5; cursor: default; }
.feedback { min-height: 0; }
.feedback.right { color: var(--jade); font-weight: 600; }
.feedback.wrong { color: #9b1c42; font-weight: 600; }
.num-in { width: 110px; font: 600 16px 'Hanken Grotesk'; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--hairline); background: #fff; }
.num-in.right { border-color: var(--jade); background: var(--jade-tint); }
.num-in.wrong { border-color: var(--rasp); background: var(--rasp-tint); }
.part-q { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 8px 0; font-size: 16px; }
.unit { font-weight: 700; color: var(--muted); }
.check .row { margin-bottom: 10px; }

/* ---------- the stage ---------- */
.stage { width: 432px; flex: none; align-self: stretch; border-radius: 32px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.stage > header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px 20px; flex: none; }
:is(.stage, .inline-card) .kind { font: 700 11px 'Hanken Grotesk'; letter-spacing: .05em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; background: var(--fig); color: var(--fig-ink); }
:is(.stage, .inline-card) .kind.try { background: var(--try); color: var(--try-ink); }
:is(.stage, .inline-card) .kind.play { background: var(--play); color: var(--play-ink); }
:is(.stage, .inline-card) .title { font: 600 16px/1.2 'Fredoka', sans-serif; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(.stage, .inline-card) .dots { display: flex; gap: 4px; }
:is(.stage, .inline-card) .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--hairline); }
:is(.stage, .inline-card) .dots i.past { background: var(--jade); }
:is(.stage, .inline-card) .dots i.now { background: var(--accent); }
:is(.stage, .inline-card) .reset { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--surface); cursor: pointer; font-size: 17px; line-height: 1; color: var(--muted); }
:is(.stage, .inline-card) .reset:hover { color: var(--text); }
.stage .body { padding: 0 16px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.stage > footer { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; padding: 0 8px 6px 20px; min-height: 150px; flex: none; }
.stage .caption { flex: 1; font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0; padding: 10px 0 8px; }
.stage .corner { width: 170px; height: 150px; flex: none; }

/* An item in the reading (phones): the stage's card, in place of its marker. */
.inline-card { margin: 20px -8px; border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--hairline); overflow: hidden; }
.inline-card > header { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 14px; }
.inline-card .body { padding: 0 12px; }
.inline-card .item > svg { display: block; max-width: 100%; height: auto; }
.inline-card figcaption .caption { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0; padding: 8px 14px 14px; }
.inline-card figcaption .caption[hidden] { display: none; }

/* ---------- stage items ---------- */
.item { display: flex; flex-direction: column; gap: 10px; }
.board { display: block; width: 100%; height: auto; border-radius: 12px; touch-action: none; user-select: none; -webkit-user-select: none; }
.controls { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: space-between; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.label { font: 700 11px 'Hanken Grotesk'; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.label.w { width: 76px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 600 13px 'Hanken Grotesk'; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); cursor: pointer; }
.chip:hover { border-color: #c3c9d1; }
.chip.on { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.chip.tried:not(.on)::after { content: ' ✓'; color: var(--jade); }
.chip.warn { background: var(--rasp-tint); color: var(--rasp); border-color: #f3c2cd; }
.chip.go { background: var(--accent-ink); color: #fff; border-color: var(--accent-ink); }
.chips.seg .chip { border-radius: 10px; padding: 8px 14px; }
.tray { display: flex; gap: 8px; flex-wrap: wrap; background: var(--sunken); border-radius: 14px; padding: 8px; }
.obj, .meter-tile, .gtile { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; background: var(--surface); border-radius: 12px; padding: 6px 8px;
  font: 600 11px/1.2 'Hanken Grotesk'; text-align: center; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; min-width: 60px; position: relative; }
.obj { width: calc((100% - 32px) / 5); min-width: 0; }
.obj.yes { box-shadow: inset 0 0 0 2px var(--jade); }
.obj.no { box-shadow: inset 0 0 0 2px var(--rasp); }
.meter-tile.used { opacity: .35; }
.legend { font: 600 12px 'Hanken Grotesk'; color: var(--muted); }
.drag-ghost { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 50; filter: drop-shadow(0 8px 14px rgba(11, 29, 82, .22)); }
.ghost-obj { background: var(--surface); border-radius: 12px; padding: 6px; }
.zone.hot rect { fill: rgba(0, 123, 255, .16); }
.part.tap, .tapme, .probe { cursor: pointer; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.bulb-tray { flex-direction: column; align-items: center; cursor: grab; touch-action: none; }
.count { font: 700 12px 'Hanken Grotesk'; color: var(--muted); }
.predict-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.guess { font: 600 13px 'Hanken Grotesk'; color: var(--muted); }
.record { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 56px 1fr; gap: 8px; align-items: center; font: 600 12px 'Hanken Grotesk'; }
.track { height: 10px; background: var(--hairline); border-radius: 5px; overflow: hidden; }
.track .bar { height: 100%; background: #ffc83d; border-radius: 5px; transition: width .3s; }
.track .bar.jade { background: var(--jade); }
.sum { font: 700 13px 'Hanken Grotesk'; margin-top: 2px; }
.battery-left { display: flex; align-items: center; gap: 8px; }
.battery-left .track { flex: 1; }
.readings { display: flex; flex-direction: column; background: var(--sunken); border-radius: 12px; padding: 4px; }
.readings .tr { display: grid; grid-template-columns: 1fr 1fr 1.3fr; padding: 5px 8px; font: 600 13px 'Hanken Grotesk'; }
.readings .tr.th { font: 700 11px 'Hanken Grotesk'; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.readings .tr.now { background: var(--highlight); border-radius: 8px; }
.gauge { background: var(--sunken); border-radius: 14px; padding: 10px 12px; }
.gauge-head { display: flex; justify-content: space-between; align-items: center; }
.gauge-head .row { display: flex; gap: 10px; align-items: center; }
.gauge-head .chip.warn { padding: 4px 12px; font-size: 13px; }
.gauge-reading { font: 700 18px 'Hanken Grotesk'; }
.gauge-reading.over { color: var(--rasp); }
.gauge-reading.safe { color: var(--jade); }
.gauge-track { position: relative; height: 12px; background: var(--hairline); border-radius: 6px; margin: 8px 0 4px; overflow: hidden; }
.gauge-safe { position: absolute; left: 0; top: 0; bottom: 0; width: 25%; background: var(--jade-tint); }
.gauge-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--jade); border-radius: 6px; transition: width .15s; }
.gauge-fill.over { background: var(--rasp); }
.gauge-limit { position: absolute; left: 25%; top: 0; bottom: 0; width: 2px; background: var(--text); }
.gauge-ticks { position: relative; display: flex; justify-content: space-between; font: 600 11px 'Hanken Grotesk'; color: var(--muted); }
.gauge-ticks .lim { position: absolute; left: 25%; transform: translateX(-50%); }
.timer { display: flex; flex-direction: column; background: var(--sunken); border-radius: 12px; padding: 6px 12px; margin-left: auto; }
.timer b { font: 700 18px 'Hanken Grotesk'; }
.ways { display: flex; gap: 8px; }
.way { flex: 1; padding: 8px 10px; border-radius: 12px; border: 1.5px dashed #c3c9d1; font: 600 13px 'Hanken Grotesk'; color: var(--muted); }
.way.ok { border-style: solid; border-color: var(--jade); color: var(--jade); background: var(--jade-tint); }
.status-list { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.status { font: 600 12px 'Hanken Grotesk'; padding: 6px 10px; border-radius: 10px; background: var(--sunken); color: var(--muted); }
.status.ok { background: var(--jade-tint); color: var(--jade); }
.status.warn { background: var(--rasp-tint); color: var(--rasp); }

/* ---------- the game ---------- */
.game .eyebrow { font: 700 11px 'Hanken Grotesk'; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.game .goal { font: 600 15px/1.4 'Hanken Grotesk'; margin-top: -6px; }
.board-wrap { position: relative; }
.short-tag { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: var(--rasp); color: #fff; font: 700 12px 'Hanken Grotesk'; padding: 4px 10px; border-radius: 999px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.short-tag.on { opacity: 1; }
.game-checks { display: flex; flex-direction: column; gap: 4px; }
.gcheck { display: flex; gap: 8px; align-items: center; font: 600 13px 'Hanken Grotesk'; color: var(--muted); }
.gcheck i { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid #c3c9d1; display: grid; place-items: center; font-style: normal; font-size: 11px; }
.gcheck.ok { color: var(--jade); }
.gcheck.ok i { background: var(--jade); border-color: var(--jade); color: #fff; }
.game-tray { gap: 6px; }
.gtile { min-width: 0; flex: 1 1 0; padding: 6px 4px; }
.gtile b { position: absolute; top: 4px; right: 6px; font: 700 11px 'Hanken Grotesk'; color: var(--accent-ink); }
.gtile.empty { opacity: .3; cursor: default; }
.gtile svg { max-width: 100%; height: auto; }
.peg { cursor: crosshair; }
.gpart { cursor: grab; }
.gwire-hit { cursor: pointer; }
.answer label { font: 600 14px 'Hanken Grotesk'; }
.answer input { width: 80px; font: 600 15px 'Hanken Grotesk'; padding: 6px 8px; border-radius: 10px; border: 1.5px solid var(--hairline); margin: 0 4px; }
.stars { font: 600 13px 'Hanken Grotesk'; color: var(--muted); }
.star-row { color: #f2b705; font-size: 18px; letter-spacing: 2px; margin-right: 4px; }
.star-row .dim { color: #d3d9e0; }
.continue { font: 700 14px 'Hanken Grotesk'; padding: 10px 18px; border-radius: 999px; border: 0; background: #c3c9d1; color: #fff; }
.continue.ready { background: var(--accent-ink); cursor: pointer; }

/* ---------- Ayo ---------- */
#ayo-layer { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
/* Her flat glyph in the stage corner (ayo-flat.js). The plate keeps the light item hues in either
   theme, so her white face always reads on it. */
.ayo-flat { display: block; width: 116px; height: 116px; margin: auto; overflow: visible; pointer-events: none;
  --item-blue: #0063d3; --item-periwinkle: #9283ff; --item-grape: #9a259c; --item-raspberry: #cd285d; --item-orange: #FF7400;
  --item-olive: #417300; --item-jade: #00c09c; --item-cyan: #0093c0; --n-500: #9399a1; --n-700: #5a5f66; }
.corner:has(.ayo-flat) { display: grid; place-items: center; }
.ayo-flat-zs { fill: var(--n-700); font-family: 'Fredoka', sans-serif; font-weight: 600; }
/* What Ayo points at: a ring round it (spots.js), or a glow along a wire. */
#spots { position: fixed; inset: 0; pointer-events: none; z-index: 9; }
.spot { position: fixed; border: 3px solid var(--accent); border-radius: 14px; background: rgba(0, 123, 255, .05); box-sizing: border-box; }
.spot-glow { filter: drop-shadow(0 0 2px rgba(0, 123, 255, .95)) drop-shadow(0 0 6px rgba(0, 123, 255, .6)); }
.spot-glow path { stroke: #7fb6ff; }
.ayo-bubble { position: fixed; left: 0; top: 0; z-index: 30; max-width: 300px; background: var(--surface); color: var(--text); font: 600 16px/1.45 'Hanken Grotesk';
  padding: 12px 16px; border-radius: 20px; box-shadow: 0 10px 28px rgba(11, 29, 82, .18); opacity: 0; transition: opacity .2s; pointer-events: none; }
.ayo-bubble.on { opacity: 1; }
.ayo-bubble.ask { box-shadow: 0 10px 28px rgba(11, 29, 82, .18), inset 0 0 0 2px var(--accent); }

/* What she says, as a caption under the reading, when there is no voice. */
.ayo-caption { position: fixed; z-index: 30; margin: 0; transform: translateY(-100%); background: var(--surface); color: var(--text); font: 600 17px/1.5 'Hanken Grotesk';
  padding: 14px 18px; border-radius: 20px; box-shadow: 0 10px 28px rgba(11, 29, 82, .18), inset 0 0 0 2px var(--accent); pointer-events: none; max-height: 40vh; overflow: hidden; }
.ayo-caption[hidden] { display: none; }

/* Ayo's dock on phones: her glyph, the part of her line she is saying on one line, Pause and
   Skip. Pinned above the host's bottom nav (--inset-bottom) for the whole of Learn with Ayo.
   Tapping the line opens it upward to three lines, over the reading. */
.ayo-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--inset-bottom, 0px) + env(safe-area-inset-bottom)); z-index: 30; min-height: 56px;
  display: flex; align-items: flex-end; gap: 2px; padding: 6px 4px 6px 12px; background: var(--surface); box-shadow: 0 -1px 0 var(--hairline), 0 -6px 16px rgba(11, 29, 82, .08); }
.ayo-bar[hidden] { display: none; }
.ayo-bar .corner { width: 40px; height: 44px; flex: none; }
.ayo-bar .ayo-flat { width: 40px; height: 40px; }
.bar-line { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; border: 0; background: none; padding: 0 6px; text-align: left; cursor: pointer;
  font: 600 15px/1.4 'Hanken Grotesk'; color: var(--text); }
.bar-line span { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ayo-bar.open .bar-line { padding-block: 4px; }
.ayo-bar.open .bar-line span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; }
.dock-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 999px; background: none; color: var(--text); cursor: pointer; }
.dock-btn:hover { background: var(--sunken); }
.dock-btn svg { fill: currentColor; }
.dock-btn .i-play, .dock-btn.paused .i-pause { display: none; }
.dock-btn.paused .i-play { display: block; }
:is(.dock-btn, .bar-line, .back-btn):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* An activity from the package runs in its own shadow root. */
.activity { display: block; }

/* ---------- narrow windows: one column, the items in the reading ---------- */
body.inline .stage { display: none; }
body.inline .marker { display: none; }
/* In read mode Ayo is not on the page; the 3D form flies over the column only while she teaches. */
body.inline[data-mode="read"] #ayo-layer { display: none; }
@media (max-width: 900px) {
  .rail { display: none; }
  .space { padding: 0; gap: 0; }
  /* One control row: back, the two modes, and the menu. */
  .space > .bar { height: 48px; display: grid; grid-template-columns: 48px 1fr 48px; gap: 0; padding: 0 2px; }
  .space > .bar .where, .space > .bar .guide-controls { display: none; }
  .back-btn { display: grid; }
  .modes { margin: 0; justify-self: center; grid-column: 2; }
  .modes button { padding: 7px 14px; }
  .menu { grid-column: 3; justify-self: center; }
  .menu-btn { width: 44px; height: 44px; border: 0; background: none; }
  .menu-pop { max-height: min(70vh, 560px); overflow-y: auto; width: min(300px, calc(100vw - 16px)); right: 2px; top: calc(100% + 2px); }
  .phone-only { display: block; }
  /* The reading flows on the page ground, like an article. */
  .text { background: none; border-radius: 0; padding: 8px 16px 0; }
  .text > .lesson::after { content: ''; display: block; height: calc(40vh + var(--inset-bottom, 0px)); }
  .lesson h1 { font-size: 30px; }
  .lesson h2 { font-size: 24px; }
  .inline-card { margin: 20px 0; }
}
