[hidden] { display: none !important; }
/* Where is the text? demo. Uses the site's tokens when present, with fallbacks for the standalone page. */
#demo {
  --wb-ink: var(--text, #1c1c1c);
  --wb-muted: var(--muted, #6b6b6b);
  --wb-line: var(--rule, #d6d6d4);
  --wb-bg: var(--bg, #ffffff);
  --wb-accent: #1e50a2;
  --wb-annot: #b35c00;
  --wb-bad: #b3261e;
}
@media (prefers-color-scheme: dark) {
  #demo { --wb-ink: var(--text, #ececec); --wb-muted: var(--muted, #a3a3a3); --wb-line: var(--rule, #3a3a3a); --wb-bg: var(--bg, #1f1f1f); --wb-accent: #7aa0e8; --wb-annot: #f0a04b; --wb-bad: #f2837b; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wb-drop { border: 1.5px dashed var(--wb-line); border-radius: 12px; padding: 1.25rem; text-align: center; }
.wb-drop.over { border-color: var(--wb-accent); }
.wb-drop p { margin: 0 0 0.75rem; color: var(--wb-muted); }
.wb-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.wb-btn { display: inline-flex; align-items: center; min-height: 44px; font: inherit; font-size: 0.9rem; padding: 0.45rem 0.95rem; border-radius: 999px; border: 1px solid var(--wb-ink); background: var(--wb-ink); color: var(--wb-bg); cursor: pointer; }
.wb-btn.ghost { background: transparent; color: var(--wb-ink); border-color: var(--wb-line); }
.wb-btn:disabled { opacity: 0.4; cursor: default; }
.wb-btn:focus-visible, .wb-toggle input:focus-visible { outline: 2px solid var(--wb-accent); outline-offset: 2px; }
.wb-status { min-height: 1.4em; color: var(--wb-muted); font-size: 0.9rem; }
.wb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0.5rem 0; font-size: 0.9rem; }
.wb-page { font-variant-numeric: tabular-nums; }
.wb-verdict { padding: 0.15rem 0.6rem; border-radius: 999px; border: 1px solid var(--wb-line); }
.wb-verdict.v-garbled { color: var(--wb-bad); border-color: currentColor; }
.wb-verdict.v-invisible { color: var(--wb-annot); border-color: currentColor; }
.wb-counts { color: var(--wb-muted); }
.wb-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; }
.wb-toggle input { width: 1.1rem; height: 1.1rem; }
.wb-view { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
@media (max-width: 760px) { .wb-view { grid-template-columns: 1fr; } }
.wb-stage { position: relative; background: #fff; border: 1px solid var(--wb-line); border-radius: 4px; overflow: hidden; }
.wb-stage canvas { display: block; }
.wb-overlay { position: absolute; inset: 0; }
.wb-box { position: absolute; border: 1px solid rgba(30, 80, 162, 0.55); background: rgba(30, 80, 162, 0.07); }
.wb-box.annot { border-color: rgba(179, 92, 0, 0.8); border-style: dashed; }
.wb-box.invisible { border-style: dotted; }
.wb-box.unmapped { border-color: rgba(179, 38, 30, 0.85); }
.wb-box.hot { background: rgba(30, 80, 162, 0.28); border-color: #1e50a2; }
.no-boxes .wb-box { border-color: transparent; background: transparent; }
.no-boxes .wb-box.hot { background: rgba(30, 80, 162, 0.28); }
.wb-words { max-height: 70vh; overflow: auto; border: 1px solid var(--wb-line); border-radius: 4px; padding: 0.5rem 0.75rem; font-size: 0.9rem; line-height: 1.5; }
.wb-line { margin: 0 0 0.3rem; }
.wb-w { border-radius: 3px; }
.wb-w.hot { background: rgba(30, 80, 162, 0.22); outline: 1px solid var(--wb-accent); }
.wb-w.annot { color: var(--wb-annot); }
.wb-w.invisible { font-style: italic; }
.wb-w.offpage { color: var(--wb-muted); text-decoration: line-through; }
.wb-w.unmapped { color: var(--wb-bad); }
.wb-empty, .wb-note { color: var(--wb-muted); font-size: 0.9rem; }

/* The demo page's own layout (site only): wider than the reading column, so the page and its word
   list sit side by side. The write-up page doesn't load any of this. */
main.demo-page {
  width: min(72rem, 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-top: clamp(3rem, 2rem + 6vh, 6rem);
  padding-bottom: 4rem;
}
main.demo-page .page-head { max-width: var(--measure); }
main.demo-page #demo { margin-top: 1.5rem; }
.demo-key { max-width: var(--measure); margin-top: 1.5rem; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
/* the site header and footer line up with the wider demo, on this page only */
body:has(main.demo-page) > .site-header,
body:has(main.demo-page) > .site-footer { width: min(72rem, 100% - 2 * var(--gutter)); }
