/* learnmingo.com - the live demos of the home page and /download/ (demos.js builds them into every [data-demo]; README "The
   demos"). No screenshots: each demo is the feature itself in small, drawn in HTML and SVG from Mingo's own data
   (demos-data.js). ONE FRAME for every page of the app (.mw: Mingo's window - the warm ground, the rail with the page that
   shows marked, the round x); the two things that are not a page keep their own shape: the small card (dark, on the edge of
   a screen) and the practice sheet (paper). The colors are the app's light palette: red New, yellow Learning, green Known;
   the order map's five on the card and the sheet. No inline styles: classes, and custom properties set by script.
   EVERY DEMO FITS ITS OWN WIDTH, whatever the window (the owner, 2026-11-11: "cut off when I use a thinner screen"): a .dm
   is a size container, its parts follow ITS width (@container), never the window's; a tile puts its copy above the demo by
   itself when the two do not fit side by side (flex-wrap); nothing in a demo has a fixed width that can be cut - rows and
   squares shrink, long text ends in an ellipsis. hero-headless.mjs measures it at eleven window widths. */

.dm {
  --mg-ground: #FBFAF7; --mg-panel: #FFFFFF; --mg-rule: rgba(0, 0, 0, .09); --mg-in: #F1EFEB;
  --mg-ink: #1D1D1F; --mg-ink-2: #5F5F64; --mg-cur: #2C5AA0;
  --mg-n: #E53935; --mg-l: #E0A300; --mg-k: #2F9E5B;
  --dm-h: 252px;
  position: relative; min-width: 0; height: var(--dm-h); margin: 0; container-type: inline-size;
  font: 12px/1.35 var(--w-font); color: var(--mg-ink); text-align: left;
}
.dm:empty { display: none; }
.dm p { margin: 0; font: inherit; color: inherit; }   /* a tile's own line is .ft p */   /* without the script a tile is its headline and its line */
.dm button { font: inherit; color: inherit; margin: 0; padding: 0; border: 0; background: none; cursor: inherit; }
/* a demo is a picture that plays: nothing in it takes the visitor's pointer (demos.js also marks its content inert) */
.dm > :not(.cur) { pointer-events: none; -webkit-user-select: none; user-select: none; }
/* the drawn cursor: on the page only while its demo's round plays; its place is --cx / --cy, and demos.js animates each move
   between two places (a bowed path, eased); between moves it stands still. Its tip is the arrow's point; a press is a ring
   from the tip */
.cur { position: absolute; left: 0; top: 0; z-index: 5; width: 26px; height: 26px; pointer-events: none; opacity: 0;
  transform: translate(calc(var(--cx, 0px) - 5px), calc(var(--cy, 0px) - 3px)); transition: opacity .2s; }
.cur.on { opacity: 1; }
.cur svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.cur path { fill: #111; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
.cur::after { content: ""; position: absolute; left: 5px; top: 3px; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 2px solid var(--mg-cur); opacity: 0; }
.cur.tap::after { animation: dm-tap .38s ease-out; }
@keyframes dm-tap { from { opacity: .9; transform: scale(.25); } to { opacity: 0; transform: scale(1); } }

/* ---------- the stage: the three leading features in one window. Their headlines in a list (the shown one on a fill), the
   demo of the shown one beside it; under 900px the list over the window ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 9fr); gap: 10px; align-items: center; width: 100%; padding: 14px; background: #fff; border-radius: 22px; text-align: left; }
.stage-list { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stage-item { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 16px; cursor: pointer; }
.stage-item.on { background: var(--w-band); cursor: default; }
@media (hover: hover) { .stage-item:not(.on):hover { background: #FAFAFB; } }
.stage-item h3 { margin: 0; font-size: clamp(20px, 15px + .5vw, 23px); line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.stage-item h3 button { margin: 0; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; color: inherit; text-align: left; cursor: inherit; -webkit-tap-highlight-color: transparent; }
.stage-item h3 button:focus-visible { outline: none; box-shadow: var(--w-ring); border-radius: 6px; }
.stage-item p { margin: 0; font-size: 15px; line-height: 1.4; color: var(--w-ink); text-wrap: pretty; }
.stage-view { min-width: 0; }
.stage-view .dm { --dm-h: 430px; }
@media (max-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .stage-item { padding: 12px 14px; }
  .stage-view .dm { --dm-h: 400px; }
}

/* ---------- the four smaller tiles, two by two: the copy beside its demo while both fit, else the copy over it ---------- */
.grid { gap: clamp(20px, 2.8vw, 36px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.ft-row { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 14px; }
.ft-row .ft-copy { flex: 1 1 180px; padding: 8px 8px 14px; }
.ft-row .dm { flex: 1.7 1 290px; max-width: 520px; margin: 0 auto; }

/* ---------- the frame: Mingo's window ---------- */
.mw {
  position: relative; height: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding: 8px;
  background: linear-gradient(180deg, #FDFCFA, #F7F5F0); border: 1px solid var(--mg-rule); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 14px 30px -14px rgba(0, 0, 0, .25);
}
.mw-rail { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0; background: var(--mg-panel); border: 1px solid var(--mg-rule); border-radius: 10px; }
.mw-rail span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; border: 1px solid transparent; color: var(--mg-ink-2); }
.mw-rail span.on { color: var(--mg-cur); border-color: var(--mg-rule); background: #F6F8FC; }
.mw-rail svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.mw-rail b { display: none; font-weight: 400; font-size: 12px; white-space: nowrap; }
.mw-x { position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--mg-panel); border: 1px solid var(--mg-rule); color: var(--mg-ink-2); pointer-events: none; }
.mw-x svg { width: 8px; height: 8px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.mw-page { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 7px; }
.dm .bar { display: flex; align-items: center; gap: 8px; min-height: 24px; padding-right: 24px; }   /* the x keeps its corner */
.bar-t { font-weight: 600; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dm .bar .seg, .dm .bar .btn { flex: none; }
.dm .bar .seg, .dm .bar .btn { margin-left: auto; }
.pn { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--mg-panel); border: 1px solid var(--mg-rule); border-radius: 10px; padding: 10px 12px; }
.pn-fade::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: linear-gradient(rgba(255, 255, 255, 0), var(--mg-panel)); pointer-events: none; }

/* a segment track, a quiet button, the filled one */
.seg { display: inline-flex; padding: 2px; border-radius: 980px; background: var(--mg-panel); border: 1px solid var(--mg-rule); }
.seg button { height: 20px; padding: 0 9px; border-radius: 980px; font-size: 11px; white-space: nowrap; }
.seg button[aria-pressed="true"] { color: var(--mg-cur); background: #F6F8FC; box-shadow: inset 0 0 0 1px var(--mg-rule); }
.dm .btn { height: 24px; padding: 0 11px; border-radius: calc(var(--w-radius-btn-sm) * .75); border: 1px solid var(--mg-rule); background: var(--mg-panel); font-size: 11px; white-space: nowrap; }   /* the app's 32px action button in small: a rounded rectangle (site.css's token) */
.dm .btn-go { border-color: transparent; background: var(--mg-cur); color: #fff; }

/* ---------- a sentence: every word a stack, its pinyin centered on its characters, a line under it ---------- */
.sn { display: flex; flex-wrap: wrap; align-items: flex-end; row-gap: 5px; }
.tk { display: inline-flex; flex-direction: column; align-items: center; margin-right: 3px; }
.tk .py { font-size: 9.5px; line-height: 1.2; color: var(--mg-ink-2); white-space: nowrap; }
.tk .hz, .sn .pu { font-family: var(--w-zh); font-size: 17px; line-height: 1.22; border-bottom: 2px solid transparent; white-space: nowrap; }
.tw { display: inline-flex; align-items: flex-end; }
.tw .tk { margin-right: 0; }
.sn .pu { margin-right: 3px; }
.tk[data-st="n"] .hz { border-color: var(--mg-n); }
.tk[data-st="l"] .hz { border-color: var(--mg-l); }
.tk[data-st="k"] .hz { border-color: var(--mg-k); }
.tk.at .hz { background: #EEF2FA; border-radius: 3px 3px 0 0; }
.sn-big .hz, .sn-big .pu { font-size: 21px; }
.sn-big .py { font-size: 10.5px; }
.dm .en { margin: 3px 0 11px; font-size: 11.5px; color: var(--mg-ink-2); }
/* the order map: a phrase's words share one line, its English the same */
.ph { display: inline-flex; align-items: flex-end; border-bottom: 2px solid var(--oc, transparent); margin-right: 5px; padding-bottom: 1px; }
.ph > .tk:last-child { margin-right: 0; }
.ph .hz, .ph .pu { border-bottom: 0; }
.ph .pu { margin: 0; }
.tw > .ph { margin-right: 0; }
.tw > .ph + .pu { margin-right: 5px; }
.dk .tw > .ph + .pu { margin-right: 2cqw; }
/* --oc is set by demos.js orderSentence(): the app's own order-map color of the phrase (none = no line) */
.eo { border-bottom: 2px solid var(--oc, transparent); padding-bottom: 1px; }

/* the hover word card: the word, its reading and meaning, and the status it takes */
.tip { position: absolute; z-index: 3; left: var(--x, 0); top: var(--y, 0); width: min(236px, calc(100% - 8px)); padding: 11px 13px 12px; background: #fff; border: 1px solid rgba(0, 0, 0, .12); border-radius: 12px; box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 14px 28px -10px rgba(0, 0, 0, .28); }
.tip-h { display: flex; align-items: baseline; gap: 8px; }
.tip-w { font-family: var(--w-zh); font-size: 21px; line-height: 1.1; }
.tip-py { font-size: 12.5px; }
.tip-en { margin: 3px 0 8px; font-size: 11px; color: var(--mg-ink-2); }
/* each status a pill as wide as its own word plus room on both sides (the app's capsule), never three equal thirds: `Learning` is the longest */
.tip-seg { display: flex; width: fit-content; max-width: 100%; padding: 3px; border-radius: 980px; background: #ECEAE5; }   /* the track hugs its three pills: rounded and closed at both ends, well inside the card */
.tip-seg button { flex: none; height: 22px; padding: 0 10px; display: flex; align-items: center; justify-content: center; gap: 5px; border-radius: 980px; font-size: 10.5px; white-space: nowrap; }
.tip-seg button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .16); }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #999); }
.dot-n { --c: var(--mg-n); } .dot-l { --c: var(--mg-l); } .dot-k { --c: var(--mg-k); }
.dot-e { --c: var(--mg-k); } .dot-a { --c: var(--mg-l); } .dot-d { --c: var(--mg-n); }

/* ---------- the Reader: the pasted text, Read, then the parallel text ---------- */
.dm .name { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; height: 24px; padding: 0 10px; border-radius: 980px; border: 1px solid var(--mg-rule); background: var(--mg-panel); line-height: 22px; white-space: nowrap; overflow: hidden; }
.dm .name b { font: 600 12px var(--w-zh); }
.dm .name span { color: var(--mg-ink-2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.paste { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.paste-box { flex: 1; min-height: 0; padding: 9px 11px; border-radius: 9px; border: 1px solid rgba(0, 0, 0, .14); background: #fff; font: 15px/1.7 var(--w-zh); overflow: hidden; }
.paste-row { display: flex; justify-content: flex-end; }
/* scoped to a demo: site.js puts a class of the same name on the status section, and an unscoped rule here once wiped that
   section's grey ground until it was half in view */
.dm .wait { background: linear-gradient(90deg, var(--mg-ink-2) 30%, #C9C9CE 50%, var(--mg-ink-2) 70%) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: dm-shimmer 1.3s linear infinite; }
.dm .btn-go .wait { background-image: linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, .45) 50%, #fff 70%); }
@keyframes dm-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- Ask Mingo: the question, the answer as it is written, its examples whole ---------- */
.chat { display: flex; flex-direction: column; gap: 7px; padding: 9px; }
/* a chat's log: it fills from the top; once it is full it stays at its END and what came before goes up out of its top
   (justify-content: flex-end; the ::after spacer takes the free room while there is some, so a short log starts at the top) */
.log { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; overflow: hidden; }
.log::after { content: ''; flex: 1 0 0; margin-top: -7px; }
.dm .me { align-self: flex-end; max-width: 92%; padding: 5px 10px; border-radius: 12px; background: #E6ECF7; font-size: 12px; }
.dm .ans { font-size: 11.5px; line-height: 1.45; min-height: 1.45em; }
.exb { padding: 6px 8px 5px; border: 1px solid var(--mg-rule); border-radius: 10px; }
.dm .exb .en { margin: 4px 0 0; }
.log > * { flex: none; }
.exb .tk .hz, .exb .pu { font-size: 14.5px; }
.exb .tk, .exb .sn .pu { margin-right: 2px; }
.exb .tw .tk { margin-right: 0; }
.exb .tk .py { font-size: 9px; }
/* the follow-up questions suggested under an answer: quiet rows, each led by a small turn-down arrow, a hairline between */
.sug { display: flex; flex-direction: column; }
.dm .fq { display: flex; align-items: center; gap: 7px; min-height: 26px; padding: 3px 4px; border-top: 1px solid var(--mg-rule); font-size: 11.5px; text-align: left; }
.dm .fq:first-child { border-top: 0; }
.fq svg { flex: none; width: 12px; height: 12px; fill: none; stroke: var(--mg-cur); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.fq span { min-width: 0; color: var(--mg-cur); }
.dm .exb .os-en { margin-top: 4px; font-size: 11.5px; color: var(--mg-ink-2); }
/* Ask's box: the first question of a round is typed here and sent */
.askbox { display: flex; align-items: flex-end; gap: 6px; }
/* it grows with what is typed, as a chat's box does: a long question wraps onto the next line, never an ellipsis */
.askbox-in { flex: 1; min-width: 0; min-height: 28px; padding: 5px 12px; border: 1px solid rgba(0, 0, 0, .14); border-radius: 14px; background: #fff; font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; }
.askbox-empty { color: var(--mg-ink-2); }
.askbox-go { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--mg-cur); }
.askbox-go svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- the small card on the screen edge. The box is a SCREEN: a wallpaper, someone's work in a window, the taskbar;
   the card is the small dark thing on its right edge, over the work (larger than life - at its true fifth of the screen's
   width nothing on it could be read). Its text is sized by the card's own width (cqw) ---------- */
.desk { position: relative; height: 100%; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, #C9D6FF 0%, #E4DCFB 48%, #FFDCD2 100%); }
.desk-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; display: flex; align-items: center; justify-content: center; gap: 6px; background: rgba(255, 255, 255, .62); }
.desk-bar i { width: 10px; height: 10px; border-radius: 3px; background: rgba(40, 50, 90, .28); }
.desk-bar i:first-child { background: var(--mg-cur); }
.desk-win { position: absolute; left: 6%; top: 17%; width: 62%; bottom: 36px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 24px -12px rgba(30, 30, 70, .4); }
.desk-tb { height: 15px; display: flex; align-items: center; gap: 4px; padding: 0 7px; background: #EEF0F5; }
.desk-tb i { width: 5px; height: 5px; border-radius: 50%; background: #C9CCD6; }
.desk-doc { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.desk-doc i { display: block; height: 5px; border-radius: 3px; background: #E3E5EC; }
.w52 { width: 52%; } .w60 { width: 60%; } .w64 { width: 64%; } .w70 { width: 70%; } .w78 { width: 78%; } .w84 { width: 84%; } .w88 { width: 88%; } .w92 { width: 92%; } .w94 { width: 94%; }
.dk-box { position: absolute; top: 8%; right: 0; width: min(56%, 250px); container-type: inline-size; }
.dk { color: #F2F2F3; border-radius: 10px 0 0 10px; overflow: hidden; background: #2A2C30; box-shadow: 0 10px 26px -8px rgba(20, 20, 50, .55); font-size: 5.6cqw; line-height: 1.3; }
.dk-top { padding: 6cqw 6cqw 5cqw 7cqw; background: #34363B; }
.dk-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4cqw; }
.dk-w { font: 600 15cqw/1.1 var(--w-zh); white-space: nowrap; }
.dk-py { font-size: 6.5cqw; }
.dk-en { margin-top: 2cqw; color: #B9BBC0; font-size: 5.4cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-mid { padding: 4.5cqw 6cqw 6cqw 7cqw; border-top: 1px solid rgba(255, 255, 255, .08); min-height: 37cqw; }   /* one size whatever the word (demos.js picks sentences of one line) */
.dk-top > *, .dk-mid > * { transition: opacity .3s ease; }
.dk.swap .dk-top > *, .dk.swap .dk-mid > * { opacity: 0; }
.dk .tk .py { font-size: 4.4cqw; color: #B9BBC0; }
.dk .tk .hz, .dk .pu { font-size: 8cqw; }
.dk .tk.hw .hz, .dk .tk.hw .py { color: #8FB8F5; }
.dk .ph { border-bottom-width: .9cqw; margin-right: 2cqw; }
.dk .tk { margin-right: 1cqw; }
.dk .os-en { margin-top: 3cqw; color: #D5D6DA; font-size: 5.4cqw; }
.dk .eo { border-bottom-width: .9cqw; }

/* ---------- the new tab (the home page's tile): a sketched Chrome window - its tabs, the + that opens one - and Mingo's
   card as the page, light, in the middle. The card is the screen card's own markup (.dk) in the light palette ---------- */
.nt { position: relative; height: 100%; display: flex; flex-direction: column; border: 1px solid var(--mg-rule); border-radius: 14px; overflow: hidden; background: var(--mg-ground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 14px 30px -14px rgba(0, 0, 0, .25); }
.nt-bar { flex: none; height: 26px; display: flex; align-items: flex-end; gap: 3px; padding: 0 8px; background: #E9E7E2; }
.nt-tab { flex: 0 1 78px; min-width: 0; height: 20px; padding: 0 9px; border-radius: 7px 7px 0 0; font-size: 10.5px; line-height: 20px; color: var(--mg-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-tab.on { background: var(--mg-ground); color: var(--mg-ink); }
.nt-plus { flex: none; width: 18px; height: 18px; margin: 0 0 2px 2px; display: grid; place-items: center; border-radius: 50%; font-size: 14px; line-height: 1; color: var(--mg-ink-2); }
.nt-page { flex: 1; min-height: 0; display: grid; place-items: center; padding: 10px; }
.nt-box { width: min(72%, 250px); container-type: inline-size; }
.dk-lt { color: var(--mg-ink); background: var(--mg-panel); border: 1px solid var(--mg-rule); border-radius: 12px; box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .3); }
.dk-lt .dk-top { background: none; }
.dk-lt .dk-mid { border-top-color: var(--mg-rule); }
.dk-lt .dk-en, .dk-lt .tk .py { color: var(--mg-ink-2); }
.dk-lt .tk.hw .hz, .dk-lt .tk.hw .py { color: var(--mg-cur); }
.dk-lt .os-en { color: var(--mg-ink); }

/* ---------- the Glossary: search, the languages, the rows ---------- */
.gs { width: 100%; height: 26px; padding: 0 11px; margin: 0; border: 1px solid var(--mg-rule); border-radius: 980px; background: var(--mg-panel); font: 12px var(--w-font); color: var(--mg-ink); -webkit-appearance: none; appearance: none; }
.gs::placeholder { color: var(--mg-ink-2); }
.gs-row { padding-right: 24px; }
.gs { min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips button { height: 20px; padding: 0 7px; border-radius: 980px; border: 1px solid var(--mg-rule); font-size: 10.5px; color: var(--mg-ink-2); }
.chips button[aria-pressed="true"] { background: var(--mg-panel); color: var(--mg-ink); box-shadow: inset 0 0 0 1px var(--mg-cur); border-color: transparent; }
.gl { padding: 0 10px; }
.gr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--mg-rule); }
.gr-w { font: 19px/1.1 var(--w-zh); white-space: nowrap; }
.gr-m { min-width: 0; }
.gr-m b { display: block; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-m span { display: block; font-size: 10.5px; color: var(--mg-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-c { display: grid; gap: 1px; font-size: 11px; }
.gr-c span { display: grid; grid-template-columns: 7px 54px auto; gap: 5px; align-items: center; white-space: nowrap; }
.gr-c i { font-style: normal; font-size: 10px; color: var(--mg-ink-2); }
.gl-none { margin: 10px 0; font-size: 11.5px; }

/* ---------- Progress: the graph draws itself, and answers the pointer ---------- */
.pg { display: flex; flex-direction: column; gap: 6px; padding: 9px 10px 6px; }
.pg-top { display: flex; min-width: 0; padding-right: 16px; }
.pg-top .seg { min-width: 0; }
.pg-top .seg button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pg-val { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 11.5px; font-variant-numeric: tabular-nums; min-height: 16px; }
.pg-val span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pg-val b { font-weight: 600; }
.pg-plot { position: relative; flex: 1; min-height: 0; touch-action: pan-y; }
.pg-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pg-plot text { font: 9px var(--w-font); fill: var(--mg-ink-2); font-variant-numeric: tabular-nums; }
.pg-grid { stroke: rgba(0, 0, 0, .07); stroke-width: 1; }
.pg-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pg-cross { stroke: rgba(0, 0, 0, .28); stroke-width: 1; }
.pg-pt { stroke: #fff; stroke-width: 2; }
.dm .c-k { stroke: var(--mg-k); } .dm .c-l { stroke: var(--mg-l); } .dm .c-c { stroke: var(--mg-cur); }
.f-k { fill: var(--mg-k); } .f-l { fill: var(--mg-l); } .f-c { fill: var(--mg-cur); }
.pg-area { stroke: none; fill-opacity: .5; }
.pg-area.f-c { fill-opacity: .16; }
.dot-c { --c: var(--mg-cur); }
.tt { position: absolute; z-index: 2; left: var(--x, 0); top: 0; padding: 5px 8px; background: #fff; border: 1px solid rgba(0, 0, 0, .12); border-radius: 8px; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .3); font-size: 10.5px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.tt b { display: block; font-weight: 600; }
.tt span { display: flex; align-items: center; gap: 5px; }

/* ---------- the practice sheet: paper; a square writes its character when clicked ---------- */
.paper { height: 100%; padding: 11px 14px; background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 14px 30px -14px rgba(0, 0, 0, .3); display: flex; flex-direction: column; gap: 8px; }
.paper > * { flex: none; }
.pp-head { display: flex; align-items: baseline; gap: 6px; padding-bottom: 5px; border-bottom: 1.5px solid #3A3A3D; white-space: nowrap; font-size: 9.5px; color: var(--mg-ink-2); overflow: hidden; }
.pp-head b { font: 600 12px var(--w-zh); color: var(--mg-ink); }
.pp-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pp-head b, .pp-head i { flex: none; }
.pp-head i { font-style: normal; margin-left: auto; }
.sband { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
.sband-m { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 10.5px; color: var(--mg-ink-2); max-width: 78px; min-width: 0; }
.sband-m b { font: 400 22px/1.15 "KaiTi", "STKaiti", "Kaiti SC", var(--w-zh); color: var(--mg-ink); }
.pill-l { margin-top: 3px; padding: 0 7px; border-radius: 980px; border: 1px solid var(--mg-l); color: #8A6400; font-size: 9.5px; line-height: 15px; }
.sband-r { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lad { display: grid; grid-template-columns: repeat(8, minmax(0, 18px)); }
.prow { display: grid; grid-template-columns: repeat(5, minmax(0, 36px)); }
.prow { margin-bottom: 3px; }
.dm .sq { display: block; min-width: 0; aspect-ratio: 1; border: 1px solid #C4C4CA; margin-right: -1px; background: #fff; }
.sq svg { display: block; width: 100%; height: 100%; }
.pp-sn { padding-top: 7px; border-top: 1px solid #E4E4E8; }
.pp-sn .tk .hz, .pp-sn .pu { font: 17px/1.2 "KaiTi", "STKaiti", "Kaiti SC", var(--w-zh); }
.pp-sn .tk.hw .hz, .pp-sn .tk.hw .py { color: var(--mg-cur); }
.pp-sn .os-en { margin-top: 3px; font-size: 11px; }
.sq-guide { stroke: #DCDCE0; stroke-width: 8; stroke-dasharray: 28 28; fill: none; }
.ink-1 { fill: #222; } .ink-2 { fill: #9C9CA2; } .ink-3 { fill: #D2D2D7; }
.pen { fill: none; stroke: #222; stroke-width: 200; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- by the demo's own width ---------- */
.ask-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.ask-wrap .chat { flex: 1; min-width: 0; }
.ask-bg { display: none; }
/* narrow: the window without its rail; the Glossary's readings under the word */
@container (max-width: 300px) {
  .mw { grid-template-columns: minmax(0, 1fr); }
  .mw-rail { display: none; }
  .seg button { padding: 0 7px; }
  .gr { grid-template-columns: auto minmax(0, 1fr); }
  .gr-c { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 8px; }
  .gr-c span { grid-template-columns: 7px auto minmax(0, 1fr); overflow: hidden; }
  .sband { gap: 8px; }
}
/* wide (the stage on a desktop): the rail with its names, larger text, Ask's pane over the Story page as in the app */
@container (min-width: 520px) {
  .mw { grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .mw-rail { align-items: stretch; gap: 3px; padding: 7px; }
  .mw-rail span { width: auto; height: 30px; display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 0 8px; }
  .mw-rail b { display: inline; }
  .mw-x { top: 9px; right: 9px; width: 22px; height: 22px; }
  .dm .bar { min-height: 28px; padding-right: 30px; }
  .bar-t { font-size: 13px; }
  .seg button { height: 24px; padding: 0 12px; font-size: 12px; }
  .dm .btn { height: 28px; padding: 0 14px; font-size: 12px; }
  .pn { padding: 14px 18px; }
  .tk .py { font-size: 10.5px; }
  .tk .hz, .sn .pu { font-size: 20px; }
  .sn-big .hz, .sn-big .pu { font-size: 25px; }
  .sn-big .py { font-size: 11.5px; }
  .dm .en { font-size: 12.5px; margin-bottom: 13px; }
  .paste-box { font-size: 17px; padding: 12px 14px; }
  .dm .name { height: 28px; line-height: 26px; }
  .ask-bg { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; min-height: 0; pointer-events: none; }   /* the Story page as the Stories demo has it: its bar, its panel */
  .ask-bg > .pn { flex: 1; min-height: 0; }
  .ask-wrap .chat { position: absolute; right: 12px; top: 44px; bottom: 0; width: 330px; flex: none; padding: 12px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: 0 2px 6px rgba(0, 0, 0, .06), 0 18px 40px -12px rgba(0, 0, 0, .3); }
  .ask-wrap .chat .tk .py { font-size: 9px; }
  .ask-wrap .chat .tk .hz, .ask-wrap .chat .pu { font-size: 15px; }
  .ask-wrap .chat .en { font-size: 11.5px; margin-bottom: 0; }
  .dm .ans, .dm .me { font-size: 12px; }
}

@media (pointer: coarse) { .gs { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .dm .wait { animation: none; } .cur { display: none; } }
