/* Layout and components for the reader.  Colours come from themes.css. */

* { box-sizing: border-box; }
html { font-size: var(--size); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-latin);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
button, select, input {
  font: inherit;
  color: inherit;
}
.coptic, [lang="cop"] { font-family: var(--font-coptic); }
.greek, [lang="grc"] { font-family: var(--font-latin); }
.arabic, [lang="ar"] { font-family: var(--font-arabic); direction: rtl; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- header */
.site-header {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.7rem 1.25rem 0.55rem;
  background: var(--ground-2);
  border-bottom: 1px solid var(--gold-soft);
}
.site-header .cross { width: 30px; height: 30px; color: var(--red); flex: none; }
.site-header h1 {
  margin: 0; font-weight: 400; font-size: 1.35rem; letter-spacing: 0.02em;
  font-family: var(--font-latin);
}
.site-header h1 .coptic { color: var(--red); margin-left: 0.5rem; font-size: 1.15rem; }

/* --------------------------------------------------------------- toolbar */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.3rem 0.4rem;
  padding: 0.3rem 1rem 0.4rem;
  background: color-mix(in srgb, var(--ground-2) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--gold-soft);
  font-family: var(--font-ui); font-size: 0.8rem;
}
.tgroup {
  position: relative; display: flex; align-items: center; gap: 0.25rem; flex-wrap: nowrap;
  padding: 0.95rem 0.45rem 0; border-left: 1px solid var(--gold-soft);
}
.tgroup:first-child { border-left: 0; padding-left: 0; }
.tgroup > :not(.tlabel) { flex: none; }
.tlabel {
  position: absolute; top: 0.05rem; left: 0.45rem;
  font-variant: small-caps; letter-spacing: 0.12em; font-size: 0.68rem; color: var(--gold); line-height: 1.2;
}
.tgroup:first-child .tlabel { left: 0; }
.tgroup.view { margin-left: auto; }
.tgroup.view .menu { left: auto; right: 0; }
.tgroup.view { margin-left: auto; }
.toolbar select, .toolbar button, .toolbar .chip {
  background: var(--ground); border: 1px solid var(--gold-soft); border-radius: 4px;
  padding: 0.2rem 0.4rem; cursor: pointer; color: var(--ink);
}
.toolbar select { padding: 0.2rem 0.15rem; }
#book { max-width: 8.5rem; }
#chapter { max-width: 6.5rem; }
.toolbar button:hover, .toolbar .chip:hover { background: var(--ground-3); }
.toolbar .chip { display: inline-flex; align-items: center; gap: 0.3rem; user-select: none; }
.toolbar .chip.on { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.toolbar .chip .k {
  display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem;
  border-radius: 50%; background: var(--ground-3); font-size: 0.7rem; font-weight: 600;
}
.toolbar .chip.on .k { background: var(--red); color: var(--ground); }
.toolbar .seg { display: inline-flex; border: 1px solid var(--gold-soft); border-radius: 4px; overflow: hidden; }
.toolbar .seg button { border: 0; border-radius: 0; border-right: 1px solid var(--gold-soft); }
.toolbar .seg button:last-child { border-right: 0; }
.toolbar .seg button.on { background: var(--blue-soft); color: var(--blue); }
.menu-host { position: relative; display: inline-block; }
#textsBtn { display: inline-flex; align-items: center; gap: 0.35rem; }
#textsBadges { display: inline-flex; gap: 0.2rem; }
#textsBadges .k, .texts-menu .k {
  display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: 0.7rem;
  background: var(--ground-3); color: var(--ink-3); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.02em;
}
#textsBadges .k.on { background: var(--red); color: var(--ground); }
.texts-menu { min-width: 19rem; }
.texts-menu .row { cursor: pointer; }
.texts-menu .row:hover { color: var(--red); }
.texts-menu .mname { min-width: 7rem; }
.texts-menu small { color: var(--ink-3); font-size: 0.72rem; }
.texts-menu input:checked ~ .k { background: var(--red); color: var(--ground); }

/* the View menu */
.menu {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; min-width: 17rem;
  background: var(--paper); border: 1px solid var(--gold); border-radius: 6px;
  box-shadow: var(--shadow); padding: 0.6rem 0.8rem; display: grid; gap: 0.55rem;
}
.menu .row { display: flex; align-items: center; gap: 0.4rem; }
.menu .mlabel { color: var(--ink-3); width: 6rem; flex: none; }
#fontPct { min-width: 3rem; text-align: center; color: var(--ink-2); }

/* ---------------------------------------------------------------- reader */
main.reader { padding: 1.25rem 1.25rem 4rem; max-width: 1800px; margin: 0 auto; transition: opacity 0.15s ease; }
main.reader.busy { opacity: 0.6; }
.chapter-title {
  text-align: center; margin: 0.5rem 0 1.25rem; font-weight: 400; font-size: 1.6rem;
  letter-spacing: 0.04em; color: var(--ink);
}
.chapter-title::after {
  content: ""; display: block; width: 6rem; height: 1px; margin: 0.6rem auto 0;
  background: var(--gold);
}
.chapter-title .coptic { color: var(--red); font-size: 1.2rem; margin-left: 0.75rem; }

/* columns layout: a CSS grid, one row per verse, one column per pane */
.columns .pane-head, .columns .vrow {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  gap: 0 1.6rem;
}
.columns .pane-head {
  position: sticky; top: var(--toolbar-h, 3.4rem); z-index: 10;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  border-bottom: 1px solid var(--gold);
  margin-bottom: 0.6rem;
}
.pane-head .ph { padding: 0.6rem 0 0.4rem; display: flex; flex-direction: column; gap: 0.1rem; }
.pane-head .ptitle { font-size: 1.05rem; color: var(--red); line-height: 1.3; }
.pane-head .ptitle[lang="cop"] { font-family: var(--font-coptic); }
.pane-head .ptitle[lang="ar"] { font-family: var(--font-arabic); font-size: 1.15rem; }
.pane-head .ph small {
  font-family: var(--font-ui); font-variant: small-caps; letter-spacing: 0.1em;
  color: var(--gold); font-size: 0.7rem;
}
.pane-head .ph[dir="rtl"] small { direction: ltr; text-align: right; }
.pane-head .ph small a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--gold-soft); }
.pane-head .ph small a:hover { color: var(--red); border-bottom-color: var(--red); }
.titles { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; justify-content: center; margin: -0.6rem 0 1rem; color: var(--red); }
.titles [lang="cop"] { font-family: var(--font-coptic); }
.titles [lang="ar"] { font-family: var(--font-arabic); font-size: 1.1em; }
.pane-head .ph[dir="rtl"] { text-align: right; }
.vgrid { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 0 1.6rem; }
.vgrid > .cell { padding: 0.45rem 0; border-bottom: 1px dashed var(--gold-soft); }
.vgrid > .cell.span-chapter { border-bottom: 0; border-left: 1px solid var(--gold-soft); padding-left: 0.9rem; margin-left: -0.8rem; }
.cell.unattested .note { color: var(--ink-3); font-style: italic; font-family: var(--font-ui); font-size: 0.8rem; }
.vgrid > .cell.none { color: var(--ink-3); font-style: italic; font-family: var(--font-ui); font-size: 0.8rem; border-bottom: 0; }
.vgrid > .heading { grid-column: 1 / -1; }
.absent { text-align: center; color: var(--ink-3); font-family: var(--font-ui); font-size: 0.8rem; margin: -0.5rem 0 0.8rem; }
.vnote { display: block; font-family: var(--font-ui); font-size: 0.7rem; color: var(--gold); letter-spacing: 0.04em; margin-bottom: 0.15rem; }
.heading.inline { margin: 0 0 0.3rem; }
ruby.tk.sup { color: var(--ink-2); }
ruby.tk.sup::before { content: "["; color: var(--ink-3); }
ruby.tk.sup::after { content: "]"; color: var(--ink-3); }
ruby.tk.gap { color: var(--ink-3); }
.pb { font-family: var(--font-ui); font-size: 0.6rem; color: var(--gold); vertical-align: super; margin-right: 0.3em; user-select: none; }
.cell { min-width: 0; overflow-wrap: anywhere; position: relative; }
.copy {
  float: right; margin: 0 0 0.2rem 0.4rem; border: 0; background: none; cursor: pointer;
  color: var(--ink-3); font-size: 0.85rem; line-height: 1; padding: 0.1rem 0.25rem; border-radius: 3px;
  opacity: 0; user-select: none; transition: opacity 0.12s;
}
.cell[dir="rtl"] .copy { float: left; margin: 0 0.4rem 0.2rem 0; }
.cell:hover .copy, .copy:focus, .copy.done { opacity: 1; }
@media (hover: none) { .copy { opacity: 0.5; } }   /* touch screens cannot hover */
.copy:hover { background: var(--ground-3); color: var(--red); }
.copy.done { color: var(--teal); opacity: 1; }
.sep, rt, .vn, .pb, .vnote { user-select: none; -webkit-user-select: none; }
.cell[dir="rtl"] { text-align: right; }
.vn {
  color: var(--red); font-family: var(--font-ui); font-size: 0.7rem; font-weight: 600;
  vertical-align: 0.5em; margin-right: 0.35em; user-select: none;
}
.cell[data-text="sah"] .vn, .cell[data-text="boh"] .vn { font-family: var(--font-coptic); font-weight: 400; font-size: 0.75em; vertical-align: 0.35em; }
.cell[dir="rtl"] .vn { font-family: var(--font-arabic); font-weight: 400; font-size: 0.8em; vertical-align: 0.3em; }
.cell[dir="rtl"] .vn { margin-right: 0; margin-left: 0.35em; }
.heading {
  font-family: var(--font-ui); font-variant: small-caps; letter-spacing: 0.1em;
  color: var(--blue); font-size: 0.85rem; margin: 1rem 0 0.2rem; text-align: center;
}
.heading.inline { text-align: start; }   /* a heading inside one cell (Thomas sayings) stays with its text */
.web-trans { color: var(--ink-3); font-style: italic; font-size: 0.9em; display: block; margin-top: 0.15rem; }

/* stacked layout */
.stacked .vblock { padding: 0.6rem 0; border-bottom: 1px dashed var(--gold-soft); }
.stacked .vblock .line { display: grid; grid-template-columns: 2.2rem 1fr; gap: 0.5rem; padding: 0.15rem 0; }
.stacked .vblock .line .lab {
  font-family: var(--font-ui); font-size: 0.7rem; color: var(--gold); font-variant: small-caps;
  letter-spacing: 0.1em; padding-top: 0.35rem;
}
.stacked .vn-block { color: var(--red); font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600; margin-bottom: 0.2rem; }

/* ---------------------------------------------------------- Coptic text */
.cop-text { font-family: var(--font-coptic); font-size: 1.05em; line-height: 1.9; }
.bg { display: inline-block; margin-right: 0.45em; white-space: nowrap; }
.bg.punct { margin-right: 0.45em; margin-left: -0.3em; color: var(--ink-3); }
ruby.tk { ruby-position: over; ruby-align: center; cursor: pointer; border-radius: 3px; padding: 0; }
ruby.tk rt {
  font-family: var(--font-ui); font-size: 0.46em; letter-spacing: 0;
  color: var(--ink-3); text-transform: lowercase; line-height: 1; user-select: none;
}
.mode-plain ruby.tk rt { display: none; }
.mode-morph .bg, .mode-gloss .bg { margin-right: 0.7em; }
.sep { display: none; color: var(--gold); font-weight: 700; margin: 0 0.12em; user-select: none; }
.mode-morph .sep, .mode-gloss .sep { display: inline; }
.mode-gloss ruby.tk rt { text-transform: none; color: var(--blue); font-style: italic; font-size: 0.55em; }
ruby.tk:hover, ruby.tk:focus, ruby.tk.active { background: var(--red-soft); outline: none; }
ruby.tk:hover rt, ruby.tk.active rt { color: var(--red); }
ruby.tk.grk-loan { text-decoration: underline dotted var(--teal); text-underline-offset: 0.2em; }
ruby.tk.nprop { text-decoration: underline solid var(--gold-soft); text-underline-offset: 0.2em; }
.mode-plain ruby.tk.grk-loan, .mode-plain ruby.tk.nprop { text-decoration: none; }

/* ----------------------------------------------------------- Greek text */
.grc-text { font-size: 1.05em; }
.gw { cursor: pointer; border-radius: 3px; padding: 0 1px; }
.gw:hover, .gw:focus, .gw.active { background: var(--blue-soft); outline: none; }
.gw.kvar { display: none; color: var(--ink-3); }
.show-variants .gw.kvar { display: inline; }
.gw.has-var { border-bottom: 1px dotted var(--teal); }

/* ------------------------------------------------ aligned English/Arabic */
.aw { border-radius: 3px; padding: 0 1px; cursor: default; }
.aw[data-s] { cursor: pointer; }
.aw[data-s]:hover { background: var(--blue-soft); }
.hl { background: var(--hl) !important; box-shadow: 0 0 0 2px var(--hl); }
.hl.src { background: var(--hl-strong) !important; }
.ara-text { font-size: 1.15em; line-height: 2; }

/* --------------------------------------------------------------- popover */
.popover {
  position: absolute; z-index: 50; width: min(30rem, calc(100vw - 2rem));
  max-height: 70vh; overflow: auto;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--gold); border-radius: 6px;
  box-shadow: var(--shadow); padding: 0.75rem 0.9rem 0.6rem;
  font-family: var(--font-latin); font-size: 0.92rem; line-height: 1.5;
}
.popover[hidden] { display: none; }
.popover .pin-bar { display: flex; gap: 0.5rem; align-items: baseline; margin-bottom: 0.3rem; }
.popover .pin-bar .form { font-family: var(--font-coptic); font-size: 1.35rem; color: var(--red); }
.popover .pin-bar .form.greek { font-family: var(--font-latin); }
.popover .pin-bar .lemma { color: var(--ink-2); font-family: var(--font-coptic); }
.popover .pin-bar .lemma::before { content: "← "; color: var(--ink-3); font-family: var(--font-ui); }
.popover .pin-bar .close { margin-left: auto; border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 1.1rem; }
.popover .pin-bar .close:hover { color: var(--red); }
.popover .posline { font-family: var(--font-ui); font-size: 0.78rem; color: var(--ink-2); margin-bottom: 0.4rem; }
.popover .posline .pos { color: var(--blue); font-weight: 600; letter-spacing: 0.04em; }
.popover .posline .dl { color: var(--gold); margin-left: 0.4rem; }
.popover .grammar { background: var(--blue-soft); border-left: 3px solid var(--blue); padding: 0.35rem 0.6rem; margin: 0.35rem 0; border-radius: 0 4px 4px 0; }
.popover .grammar .note { display: block; color: var(--ink-2); font-size: 0.85em; }
.popover .src {
  margin: 0.5rem 0 0; padding-top: 0.4rem; border-top: 1px solid var(--gold-soft);
}
.popover .src .badge {
  display: inline-block; font-family: var(--font-ui); font-size: 0.65rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ground); background: var(--ink-3); border-radius: 3px;
  padding: 0.05rem 0.4rem; margin-right: 0.4rem; vertical-align: 0.15em;
}
.popover .src.kellia .badge { background: var(--blue); }
.popover .src.crum .badge { background: var(--red); }
.popover .src.andreas .badge { background: var(--teal); }
.popover .src.dawoud .badge { background: var(--gold); }
.popover .src.greek .badge { background: #5b4a8a; }
.popover .src .hw { font-family: var(--font-coptic); color: var(--ink); font-weight: 600; }
.popover .src .forms { color: var(--ink-3); font-size: 0.85em; font-family: var(--font-coptic); }
.popover .src .forms .dl { font-family: var(--font-ui); color: var(--gold); font-size: 0.75em; vertical-align: super; }
.popover .src .via { color: var(--ink-3); font-size: 0.78em; font-family: var(--font-ui); }
.popover .sense { margin: 0.15rem 0 0.15rem 0.6rem; }
.popover .sense .n { color: var(--gold); font-family: var(--font-ui); font-size: 0.75em; margin-right: 0.3rem; }
.popover .sense .alt { color: var(--ink-3); font-size: 0.85em; }
.popover .sense .ref { color: var(--ink-3); font-size: 0.75em; font-family: var(--font-ui); margin-left: 0.4rem; }
.popover .crum-html { font-size: 0.9em; max-height: 9rem; overflow: auto; padding-right: 0.3rem; }
.popover .crum-html .cop { font-family: var(--font-coptic); }
.popover .crum-html .dl { color: var(--gold); font-family: var(--font-ui); font-size: 0.75em; vertical-align: super; }
.popover .crum-html .gl { color: var(--red); }
.popover .crum-html b.hw { color: var(--ink); font-family: var(--font-coptic); }
.popover .arabic-def { direction: rtl; text-align: right; font-family: var(--font-arabic); font-size: 1.1em; line-height: 1.8; }
.popover .arabic-def .B { font-family: var(--font-coptic); direction: ltr; unicode-bidi: embed; }
.popover .greek-line { font-family: var(--font-latin); }
.popover .greek-line .lm { font-size: 1.15em; color: var(--blue); }
.popover .greek-line .strong { font-family: var(--font-ui); font-size: 0.75em; color: var(--ink-3); margin-left: 0.4rem; }
.popover .morph { font-family: var(--font-ui); font-size: 0.8rem; color: var(--ink-2); }
.popover .greek-html { font-size: 0.85em; max-height: 8rem; overflow: auto; color: var(--ink-2); margin-top: 0.25rem; }
.popover .actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; padding-top: 0.5rem; border-top: 1px solid var(--gold-soft); font-family: var(--font-ui); font-size: 0.78rem; }
.popover .actions button, .popover .actions a {
  border: 1px solid var(--gold-soft); background: var(--ground); color: var(--ink); border-radius: 4px;
  padding: 0.2rem 0.55rem; cursor: pointer; text-decoration: none;
}
.popover .actions button:hover, .popover .actions a:hover { background: var(--ground-3); }
.popover .actions .scan { border-color: var(--gold); color: var(--red); }
.popover .miss { color: var(--ink-3); font-style: italic; }
.popover .more { margin-top: 0.4rem; border: 1px solid var(--gold-soft); background: var(--ground); border-radius: 4px; padding: 0.15rem 0.5rem; cursor: pointer; font-family: var(--font-ui); font-size: 0.78rem; }
.popover .steps { font-family: var(--font-ui); font-size: 0.68rem; color: var(--ink-3); margin-top: 0.4rem; }
.popover .loading { color: var(--ink-3); font-family: var(--font-ui); font-size: 0.8rem; }
.popover details summary { cursor: pointer; color: var(--ink-3); font-family: var(--font-ui); font-size: 0.78rem; }

/* ------------------------------------------------------------ scan panel */
.scan-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(46rem, 100vw); background: var(--ground-2);
  border-left: 1px solid var(--gold); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.25s ease;
}
.scan-panel.open { transform: none; }
.scan-panel .bar {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--gold-soft); font-family: var(--font-ui); font-size: 0.85rem;
}
.scan-panel .bar .title { font-variant: small-caps; letter-spacing: 0.1em; color: var(--gold); }
.scan-panel .bar .page { color: var(--ink-2); }
.scan-panel .bar button { background: var(--ground); border: 1px solid var(--gold-soft); border-radius: 4px; padding: 0.2rem 0.5rem; cursor: pointer; }
.scan-panel .bar .close { margin-left: auto; }
.scan-panel .view { flex: 1; overflow: auto; background: #fff; cursor: grab; }
.scan-panel .view img { display: block; width: var(--zoom, 100%); max-width: none; }
.scan-panel .status { padding: 0.3rem 0.8rem; font-family: var(--font-ui); font-size: 0.75rem; color: var(--ink-3); border-top: 1px solid var(--gold-soft); }
.scan-panel input[type="range"] { width: 8rem; }

/* ---------------------------------------------------------------- footer */
.frieze { margin-top: 2.5rem; line-height: 0; }
.frieze svg { display: block; }
.frieze-bottom { margin-top: 0; }
.site-footer {
  padding: 1.5rem 1.25rem 2.5rem; font-family: var(--font-latin); font-size: 0.85rem; color: var(--ink-2);
  max-width: 62rem; margin: 0 auto; line-height: 1.55;
}
.site-footer h2 { font-weight: 400; font-size: 1.15rem; letter-spacing: 0.04em; margin: 0 0 0.8rem; color: var(--ink); }
.site-footer h3 { font-family: var(--font-ui); font-variant: small-caps; letter-spacing: 0.12em; font-weight: 400; font-size: 0.8rem; color: var(--gold); margin: 1.2rem 0 0.4rem; }
.site-footer a { color: var(--blue); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer ol.bib, .site-footer ul.bib { padding-left: 1.6rem; margin: 0; }
.site-footer .bib li { margin: 0 0 0.45rem; }
.site-footer code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85em; color: var(--ink-3); }
.site-footer .small { font-family: var(--font-ui); font-size: 0.75rem; color: var(--ink-3); }
.site-footer .about { text-align: center; font-style: italic; color: var(--ink); margin: 0 0 0.6rem; }
.site-footer .coverage { text-align: center; font-family: var(--font-ui); font-size: 0.78rem; color: var(--ink-2); margin: 0 0 0.6rem; }
.site-footer .keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1.4rem; font-family: var(--font-ui); font-size: 0.75rem; color: var(--ink-3); margin: 0 0 0.8rem; }
.site-footer kbd { font-family: var(--font-ui); font-size: 0.7rem; border: 1px solid var(--gold-soft); border-bottom-width: 2px; border-radius: 3px; padding: 0 0.3rem; background: var(--ground-2); color: var(--ink-2); }
.site-footer .small { text-align: center; }
.site-footer .short { margin: 0; text-align: center; color: var(--ink-3); font-size: 0.8rem; }
.site-footer .short a { white-space: nowrap; }
.sources-page { padding-bottom: 0; }
.sources-page .back { font-family: var(--font-ui); font-size: 0.85rem; margin: 0.5rem 0 0; }
.frieze-sources { margin-top: 1rem; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .columns .pane-head, .vgrid { grid-template-columns: repeat(min(var(--cols, 5), 3), minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .columns .pane-head { display: none; }
  .vgrid { display: block; }
  .vgrid > .cell.span-chapter { border-left: 0; margin-left: 0; padding-left: 0; }
  .columns .cell::before {
    content: attr(data-label); display: block; font-family: var(--font-ui); font-variant: small-caps;
    letter-spacing: 0.1em; font-size: 0.7rem; color: var(--gold);
  }
  .toolbar { gap: 0.35rem 0.5rem; padding: 0.4rem 0.6rem; }
  .tlabel { display: none; }
  .tgroup.view .menu { left: 0; right: auto; }
  .tgroup { padding: 0.1rem 0.4rem; border-left: 0; }
  .tgroup.view { margin-left: 0; }
  .menu { right: auto; left: 0; }
  .toolbar .chip { padding: 0.2rem 0.3rem; }
  .popover { width: calc(100vw - 1rem); }
  main.reader { padding: 0.75rem 0.6rem 3rem; }
}
