/* Core styles: the shell, the bottom sheet, toasts, marks, characters, sync. Colors come only from the tokens
   that the text pack's app.css defines (--paper, --paper-2, --ink, --ink-2, --ink-3, --rule, --seal, --seal-ink, --wash, --shadow). */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html:has(.sheet.in), html:has(.sheet.in) body { overscroll-behavior-y: contain; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.125rem/1.6 var(--serif); min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent; overflow-wrap: break-word;
}
[lang|="zh"] { font-family: var(--han); }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; border-radius: 3px; }
#view:focus, #view:focus-visible { outline: none; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.noscript { padding: 2rem; }
.muted { color: var(--ink-3); }
.small { font-size: .9rem; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.scroll-x { overflow-x: auto; overscroll-behavior-x: contain; }

/* Shell */
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .4rem;
  padding: .35rem .75rem; /* body already pads the side insets */
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.bar nav { display: flex; gap: .1rem; flex: 1; justify-content: center; }
.bar nav a { text-decoration: none; padding: 0 .6rem; min-height: var(--tap); display: inline-flex; align-items: center; color: var(--ink-2); border-radius: 999px; font-size: 1rem; }
.bar nav a[aria-current="page"] { color: var(--seal); text-decoration: underline; text-underline-offset: .35em; text-decoration-thickness: 1.5px; }
.brand { text-decoration: none; display: inline-grid; min-width: var(--tap); min-height: var(--tap); place-items: center; }
.seal { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; background: var(--seal); color: var(--seal-ink); font: 600 1.3rem/1 var(--brush); border-radius: 4px; }
.theme-btn { appearance: none; border: 0; background: none; color: var(--ink-2); min-width: var(--tap); min-height: var(--tap); border-radius: 50%; cursor: pointer; }
.search-btn { display: inline-grid; place-items: center; min-width: var(--tap); min-height: var(--tap); color: var(--ink-2); border-radius: 50%; }
.search-btn[aria-current="page"] { color: var(--seal); }
.theme-btn svg, .search-btn svg { display: block; margin: 0 auto; } /* on the bar's center line, side by side */
main { max-width: var(--measure); margin: 0 auto; padding: 1.25rem 1.1rem 3rem; }
.site-foot { text-align: center; font-size: .85rem; color: var(--ink-3); padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom)); }

/* Buttons */
.btn { appearance: none; border: 1px solid var(--seal); background: transparent; color: var(--seal); min-height: var(--tap); padding: 0 1.3rem; border-radius: 999px; cursor: pointer; font-size: 1.05rem; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.primary { background: var(--seal); color: var(--seal-ink); }
.btn.quiet { border-color: var(--rule); color: var(--ink-2); }
.btn.small { min-height: 36px; font-size: .92rem; padding: 0 .9rem; }
.btn:active { transform: translateY(1px); }
.link-btn { appearance: none; border: 0; background: none; color: var(--ink-3); text-decoration: underline; cursor: pointer; padding: .3rem; min-height: 36px; }
/* Toggle and suggestion buttons. (A text pack may use .chip for its own labels.) */
.pill {
  appearance: none; display: inline-flex; align-items: center; min-height: var(--tap); padding: .45rem .95rem;
  border: 1px solid var(--rule); border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-size: .9rem;
  cursor: pointer; text-decoration: none; transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill:active { background: var(--ink-2); color: var(--paper); border-color: var(--ink-2); }
.filters { display: flex; flex-wrap: wrap; gap: .55rem; margin: .8rem 0 .4rem; }

/* Marks and characters */
.mark {
  appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-align: inherit;
  text-decoration-line: underline; text-decoration-style: dotted; text-decoration-color: var(--seal);
  text-decoration-thickness: 1.5px; text-underline-offset: .22em;
}
.mark:active { background: var(--wash); }
/* A button is one box: a long phrase wraps inside it, never past the screen edge. */
.mark { max-width: 100%; white-space: normal; vertical-align: baseline; }
.glue:has(.mark) { white-space: normal; }
.glue .mark + * { white-space: nowrap; }
.glue { white-space: nowrap; }
.han {
  appearance: none; background: none; border: 0; padding: .06em 0; margin: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 3px; min-width: 1.1em;
  --han-rule: color-mix(in srgb, var(--ink-3) 60%, transparent);
  text-decoration-line: underline; text-decoration-color: var(--han-rule); text-decoration-thickness: 1px; text-underline-offset: .3em; text-decoration-skip-ink: none;
}
span.han { cursor: inherit; }
.han.glossed { color: var(--seal); --han-rule: color-mix(in srgb, var(--seal) 60%, transparent); }
.han:active { background-color: var(--wash); }
.mark .han { text-decoration-style: dotted; text-decoration-color: var(--seal); text-decoration-thickness: 1.5px; }

/* Sheet */
.scrim { position: fixed; inset: 0; background: rgba(10, 14, 20, .4); z-index: 20; opacity: 0; transition: opacity .2s ease; cursor: pointer; touch-action: none; }
.scrim.in { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 82dvh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); border-radius: 14px 14px 0 0; box-shadow: var(--shadow);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  max-width: 40rem; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom);
}
.sheet.in { transform: none; }
.sheet.dragging { transition: none; }
.sheet .grab, .sheet header { touch-action: none; }
.sheet .grab { width: 2.6rem; height: 5px; border-radius: 5px; background: var(--rule); margin: .55rem auto .25rem; cursor: grab; }
.sheet header { display: flex; align-items: center; gap: .5rem; padding: .2rem .9rem .5rem; border-bottom: 1px solid var(--rule); }
.sheet header .ttl { flex: 1; min-width: 0; }
.sheet header h2 { margin: 0; font-size: 1.15rem; font-weight: 500; border-radius: 4px; }
.sheet .kind { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--seal); display: block; margin-bottom: .1rem; }
.sheet .crumbs { display: flex; align-items: center; gap: .1rem; overflow-x: auto; touch-action: pan-x; scrollbar-width: none; padding: 0 .6rem; border-bottom: 1px solid var(--rule); background: var(--wash); white-space: nowrap; flex: none; }
.sheet .crumbs::-webkit-scrollbar { display: none; }
.sheet .crumb { appearance: none; border: 0; background: none; font-size: .88rem; min-height: var(--tap); padding: 0 .45rem; max-width: 11em; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: var(--tap); color: var(--ink-2); cursor: pointer; }
button.crumb { text-decoration: underline dotted var(--ink-3); text-underline-offset: .25em; }
.sheet .crumb.here { color: var(--ink); font-weight: 600; max-width: 13em; }
.sheet .crumbs .sep { color: var(--ink-3); flex: none; }
.icon-btn { appearance: none; border: 0; background: none; min-width: var(--tap); min-height: var(--tap); border-radius: 50%; cursor: pointer; font-size: 1.3rem; color: var(--ink-2); }
.sheet .body { overflow-y: auto; padding: 1rem 1.1rem 1.5rem; font-size: 1.07rem;
  /* Up and down stay in the sheet; sideways goes on, so a trackpad's two-finger swipe still means Back. */
  overscroll-behavior-y: contain; overscroll-behavior-x: auto; }
.sheet .body p { margin: 0 0 .8rem; }
.sheet .big-han { font: 400 4.2rem/1.1 var(--brush); float: right; margin: 0 0 .4rem 1rem; }
.sheet dl { margin: .6rem 0; }
.sheet dt { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-top: .9rem; }
.sheet dd { margin: .15rem 0 0; }
.sheet .zh-quote { font-family: var(--han); font-size: 1.15rem; }
.sheet .links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; clear: both; }
.sheet .links a { font-size: .9rem; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: .35rem .8rem; text-decoration: none; }
.sheet .src { font-size: .85rem; color: var(--ink-3); }
/* The thing tapped is already the open sheet: blink the title and say so. */
.sheet .here-hint { margin: .4rem 1rem 0; font-size: .9rem; color: var(--seal); }
.sheet h2.pulse { animation: here-pulse .9s ease 2; }
@keyframes here-pulse { 50% { color: var(--seal); background: var(--wash); } }

/* Trail (core/trail.js): the thing tapped blinks, and blinks again when the reader comes back to it.
   A drawer level that opens slides in from the right; Back slides the earlier level in from the left. */
.trail-blink { animation: trail-blink 1.05s ease 1; }
@keyframes trail-blink { /* three pulses, a ring only: the element keeps its own fill and corners */
  0%, 33%, 66%, 100% { box-shadow: 0 0 0 3px transparent; }
  16%, 50%, 83% { box-shadow: 0 0 0 3px var(--seal); }
}
.trail-tap { animation: trail-tap .36s ease 1; } /* the thing tapped: two quick pulses before what it opens shows */
@keyframes trail-tap {
  0%, 50%, 100% { box-shadow: 0 0 0 3px transparent; }
  25%, 75% { box-shadow: 0 0 0 3px var(--seal); }
}
/* A scrim that is not shown yet (the sheet waits for its tap's blink) or is going away lets taps through. */
.scrim:not(.in) { pointer-events: none; }
.trail-mark { box-shadow: 0 0 0 3px var(--seal); }
/* A crumb sits in a bar that clips outside it: its ring is drawn inside. */
.sheet .crumb.trail-blink { animation-name: trail-blink-in; }
@keyframes trail-blink-in { 16%, 50%, 83% { box-shadow: inset 0 0 0 2px var(--seal); color: var(--seal); } }
.sheet .crumb.trail-mark { box-shadow: inset 0 0 0 2px var(--seal); }
@media (forced-colors: active) { .sheet .crumb.trail-blink { animation: none; } .sheet .crumb.trail-blink, .sheet .crumb.trail-mark { outline-offset: -2px; } }
.sheet { overflow-x: clip; } /* the slide stays inside the sheet on wide screens */
.sheet .slide-from-right { animation: slide-from-right .22s ease-out; }
.sheet .slide-from-left { animation: slide-from-left .22s ease-out; }
@keyframes slide-from-right { from { transform: translateX(40%); opacity: 0; } }
@keyframes slide-from-left { from { transform: translateX(-40%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet .slide-from-right, .sheet .slide-from-left { animation: none; } }
@media (forced-colors: active) { .trail-blink, .trail-tap { animation: none; } .trail-blink, .trail-tap, .trail-mark { outline: 2px solid Highlight; } }

/* Toast and update banner */
/* left + right + auto margins: a long message wraps at the full width and stays centred; a small radius keeps a tall box a box. */
#toast { position: fixed; left: 1rem; right: 1rem; margin: 0 auto; width: fit-content; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 30; background: var(--ink); color: var(--paper); padding: .7rem 1.1rem; border-radius: 1.2rem; font-size: .95rem; line-height: 1.4; box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: 34rem; }
#toast button { background: none; border: 0; color: var(--seal); font-weight: 600; margin-left: .6rem; min-height: 36px; cursor: pointer; }
#toast.warn { background: var(--seal); color: var(--seal-ink); }
#update { position: fixed; top: calc(.6rem + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 31; background: var(--ink); color: var(--paper); padding: .5rem .6rem .5rem 1rem; border-radius: 999px; font-size: .95rem; }
#update button { background: var(--seal); color: var(--seal-ink); border: 0; border-radius: 999px; padding: .3rem .8rem; margin-left: .4rem; cursor: pointer; }
.pending { padding: 1rem; background: var(--paper-2); border-radius: 6px; color: var(--ink-2); font-size: 1rem; }

/* Sync: the card after a draw, the Sync section, in-page confirm boxes, warnings */
.btn.danger { background: var(--seal); border-color: var(--seal); color: var(--seal-ink); }
.sync-warn { font-size: .95rem; padding: .8rem 1rem; border-left: 3px solid var(--seal); background: var(--paper-2); color: var(--ink); margin: 1rem 0; }
.confirm { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem; background: var(--paper-2); border-radius: 6px; margin-top: .5rem; }
.sync-card { margin: 1.5rem 0; padding: 1rem; border: 1px solid var(--rule); border-left: 3px solid var(--seal); border-radius: 6px; background: var(--wash); }
.sync-card .sync-lead { margin: 0 0 .25rem; font-weight: 600; }
.sync-card .row, .sync-box .row { margin-top: .6rem; }
.sync-box { margin: 1rem 0 1.5rem; }
.sync-box h2 { margin-bottom: .3rem; }
.sync-box details.more { margin-top: .9rem; }
.sync-box details.more > summary { cursor: pointer; color: var(--ink-2); min-height: var(--tap); display: flex; align-items: center; gap: .4rem; list-style: none; }
.sync-box details.more > summary::-webkit-details-marker { display: none; }
.sync-box details.more > summary::before { content: '▸'; display: inline-block; transition: transform .15s; }
.sync-box details.more[open] > summary::before { transform: rotate(90deg); }
.sync-box details.more .row { margin-top: .3rem; }

/* Search: the box, the suggestions, the results */
.search-box input { width: 100%; box-sizing: border-box; font: inherit; font-size: 1.1rem; padding: .7rem 2.9rem .7rem .9rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); color: var(--ink); }
.search-box input:focus { outline: 2px solid var(--seal); outline-offset: 1px; }
.search-box { position: relative; }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; } /* our own × below */
.search-clear { appearance: none; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; padding: 0; border-radius: 50%; background: none; color: var(--ink-3); display: inline-grid; place-items: center; cursor: pointer; }
.search-clear:hover, .search-clear:focus-visible { color: var(--ink); background: var(--paper-2); }
.search-clear[hidden] { display: none; }
.results-label { margin: 0 0 .3rem; font: inherit; font-size: .9rem; font-weight: 400; color: var(--ink-3); letter-spacing: .04em; }
.results-label[hidden], .results[hidden] { display: none; }
/* The offer of chapter search (search-view.js): under a query it can answer, until the reader taps Download. */
.deep-card { margin: .2rem 0 .8rem; padding: .6rem .75rem; border: 1px solid var(--rule); border-radius: 8px; }
.deep-card[hidden] { display: none; }
.deep-card p { margin: 0 0 .45rem; }
.deep-card p:last-child { margin-bottom: 0; }
.deep-card .deep-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .5rem; }
.deep-card .deep-actions[hidden], .deep-card span[hidden] { display: none; }
.search-status { min-height: 1.2em; }
.suggest .pill { margin: .3rem .3rem 0 0; }
.results { list-style: none; padding: 0; margin: .5rem 0 2rem; }
.result { border-bottom: 1px solid var(--rule); padding: .55rem 0; }
.r-main { display: block; width: 100%; appearance: none; border: 0; background: none; padding: .2rem 0; text-align: left; font: inherit; color: inherit; cursor: pointer; text-decoration: none; min-height: var(--tap); }
.r-main .kind { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--seal); }
.r-title { display: block; font-size: 1.05rem; color: var(--ink); }
.r-snip { display: block; font-size: .92rem; color: var(--ink-2); margin-top: .15rem; }
.r-links { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .5rem; }
.r-links a { display: inline-flex; align-items: center; min-height: var(--tap); padding: .25rem .85rem; font-size: .82rem; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; }

/* Pronunciation: one play button per Mandarin reading, under the big character on its sheet */
.say-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: .3rem 0 .4rem; }
.say-btn { appearance: none; display: inline-flex; align-items: center; gap: .1rem; min-height: var(--tap); padding: .3rem .95rem; border: 1px solid var(--seal); border-radius: 999px; background: none; color: var(--seal); font: inherit; font-size: .95rem; cursor: pointer; }
.say-btn .say-icon { font-size: .75em; }
.say-btn.playing { background: var(--wash); }

/* Listen: the play row and the lit cell. While a row plays or is paused, it sticks to the screen bottom,
   so Pause stays in reach. A read cell dims by colour, not opacity (opacity would dim the focus ring too):
   67 % ink on paper is 5.2:1 (light) and 7.2:1 (dark). A read glossed character keeps the seal colour. */
.listen-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin: .75rem 0 0; }
.listen-row .filters { margin: 0; align-items: center; }
.listen-row .listen-btn { min-width: 11.5em; } /* fits "Listen in Chinese", so Pause and Resume do not move the speed buttons */
/* Sticky at the very bottom, its padding over the home indicator, so no page text shows under it on an iPhone.
   One line at 390 px: while active the button reads only Pause or Resume, so it needs less width. */
.listen-row.active {
  position: sticky; bottom: 0; background: var(--paper); z-index: 4; border-top: 1px solid var(--rule);
  padding-top: .4rem; padding-bottom: calc(.4rem + env(safe-area-inset-bottom, 0px));
}
.listen-row.active .listen-btn { min-width: 7em; }
.listen-row .listen-speed { color: var(--ink-2); margin-inline-end: .15rem; }
.listen-row .listen-error { flex-basis: 100%; margin: 0; color: var(--ink-2); }
/* Empty: out of the flow but still in the accessibility tree, so the status change is announced. */
.listen-row .listen-error:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.han.now, .lc.now, .w.now { background: var(--seal); color: var(--seal-ink); border-radius: 3px; }
.han.done, .lc.done, .w.done { color: color-mix(in srgb, var(--ink) 67%, var(--paper)); }
.han.glossed.done { color: var(--seal); }

/* Narrow phones: keep the top bar (brand, four links, search, theme, share) inside the screen. */
@media (max-width: 30rem) {
  .bar { gap: .15rem; padding-left: .6rem; padding-right: .4rem; }
  .bar nav { gap: 0; }
  .bar nav a { padding-left: .26rem; padding-right: .26rem; font-size: .92rem; letter-spacing: .02em; }
  .search-btn, .theme-btn { min-width: 36px; }
  .share-toggle { width: 36px; }
}
/* 320–368 px phones: the bar shrinks once more. */
@media (max-width: 23rem) {
  .bar { gap: .1rem; padding-left: .45rem; padding-right: .3rem; }
  .bar nav a { padding-left: .14rem; padding-right: .14rem; font-size: .85rem; letter-spacing: 0; }
  .search-btn, .theme-btn { min-width: 32px; }
  .share-toggle { width: 32px; }
  .bar .seal { width: 1.8rem; height: 1.8rem; font-size: 1.05rem; }
}

/* The Share button at the top right (share-menu.js). Same rules in each site; uses its --paper, --ink, --seal. */
.share-menu { position: relative; }
.share-toggle { appearance: none; border: 0; background: none; color: var(--ink-3); width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.share-toggle:hover, .share-toggle[aria-expanded="true"] { color: var(--seal); background: var(--paper-2); }
.share-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: min(19rem, calc(100vw - 2rem)); background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); padding: .35rem; display: grid; gap: .1rem; text-align: left; font-size: 1rem; line-height: 1.45; }
.share-item { appearance: none; border: 0; background: none; text-align: left; font: inherit; color: var(--ink); padding: .55rem .75rem; border-radius: 8px; min-height: 44px; cursor: pointer; }
.share-item:hover, .share-item:focus-visible { background: var(--paper-2); }
.share-help { padding: .2rem .75rem .6rem; color: var(--ink-2); font-size: .95rem; display: grid; gap: .5rem; }
.share-help p, .share-help ol { margin: 0; }
.share-help ol { padding-left: 1.2rem; display: grid; gap: .35rem; }
.share-help b { color: var(--ink); font-weight: 600; }
.share-glyph { display: block; }
.share-help .share-glyph { display: inline; vertical-align: -3px; }
.share-status { padding: 0 .75rem .4rem; font-size: .9rem; color: var(--ink-2); }
.share-status:empty { display: none; }
.share-pop[hidden], .share-item[hidden], .share-help[hidden] { display: none; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Calligraphy (core/brush.js): a character written on a practice grid (米字格) of faint seal-red lines. */
.brush { display: block; position: relative; width: min(64vw, 240px); aspect-ratio: 1; margin: 0 auto;
  background:
    linear-gradient(color-mix(in srgb, var(--seal) 30%, transparent), color-mix(in srgb, var(--seal) 30%, transparent)) center / 1px 100% no-repeat,
    linear-gradient(color-mix(in srgb, var(--seal) 30%, transparent), color-mix(in srgb, var(--seal) 30%, transparent)) center / 100% 1px no-repeat;
  border: 1.5px solid color-mix(in srgb, var(--seal) 55%, transparent); }
.brush::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(45deg, transparent calc(50% - .5px), color-mix(in srgb, var(--seal) 18%, transparent) 50%, transparent calc(50% + .5px)),
    linear-gradient(-45deg, transparent calc(50% - .5px), color-mix(in srgb, var(--seal) 18%, transparent) 50%, transparent calc(50% + .5px)); }
.brush.small { width: 5.25rem; margin: 0; }
.brush-svg { width: 100%; height: 100%; display: block; position: relative; z-index: 1; }
.brush-guide path { fill: color-mix(in srgb, var(--ink) 7%, transparent); }
.brush-stroke { fill: none; stroke: var(--ink); stroke-width: 138; stroke-linecap: round; stroke-linejoin: round; }
.brush-order { display: none; }
.show-order .brush-order { display: inline; }
.brush-order circle { fill: var(--seal); opacity: .9; }
.brush-order text { fill: var(--seal-ink); font: 600 40px var(--serif); }
.brush-fallback { display: grid; place-items: center; height: 100%; font: 400 min(44vw, 10rem)/1 var(--brush); position: relative; z-index: 1; }
.brush.small .brush-fallback { font-size: 3.6rem; }

/* A page's characters: small grids beside their readings. */
.brush-mark { display: flex; align-items: center; gap: .9rem; margin: .8rem 0 1.2rem; }
.brush-mark-art { flex: none; display: flex; gap: .4rem; min-width: 5.25rem; min-height: 5.25rem; }
.brush-mark-btn { display: flex; gap: .4rem; padding: 0; border: 0; background: var(--paper); cursor: pointer; border-radius: 2px; }
.brush-mark figcaption { display: grid; gap: .3rem; font-size: .95rem; line-height: 1.35; color: var(--ink-2); }
.bm-item { appearance: none; display: block; text-align: left; font: inherit; color: inherit; background: none; border: 0; margin: 0 -.5rem; padding: .35rem .5rem; min-height: var(--tap); border-radius: 10px; cursor: pointer; transition: background-color .15s; }
.bm-item:hover, .bm-item:active { background: var(--wash); }
.bm-item .bm-zh { text-decoration: underline dotted var(--seal); text-underline-offset: .25em; text-decoration-thickness: 1.5px; }
.bm-more { color: var(--seal); margin-left: .3rem; }
.bm-zh { font-family: var(--brush); font-size: 1.25rem; color: var(--ink); }
.bm-py { color: var(--seal); letter-spacing: .04em; }

/* core/swipe.js: a box that steps on a sideways swipe; vertical moves still scroll the page. */
.swipe { touch-action: pan-y; }
