/* =====================================================================
   QQuill · mini, the print studio (js/print.js) and the pages it sets.

   Two worlds in one file:
   · the STUDIO (.qq-ps …): the bar, the panel, the desk. It wears the app's
     scheme, like every other screen.
   · the PAPER (.pr-* under [data-pr-look]): the sheets on the desk and the
     measuring room beside it. A look re-issues the tokens the editor draws
     with, so a row on paper is the editor's row in the paper's inks: night
     (the apps' dark, its text greys set by APCA: body about Lc 85, secondary
     about Lc 65), paper (the mini's warm light scheme), ink saver (white,
     lines only). The measuring room and the desk carry the same look and the
     same geometry, so what is measured is what is printed.

   The geometry is written by print.js as --pr-* (px, from mm at 96 px/in):
   the sheet (W, H), its margins (top, side, bottom), the body inside them,
   the flow's width, a card's padding, the gap between cards, --pr-type (the
   Type size) and --pr-k (A5 sets everything a step tighter).
   ===================================================================== */

/* ---------- the looks: the editor's tokens, re-issued for paper ---------- */
[data-pr-look='night'] {
  color-scheme: dark;
  --bg: #12151A; --bg-list: #12151A; --card: #1F252B; --card-border: #2B333B; --group-card: #1A1F24; --water-border: #41505E;
  --surface: #1f252b; --surface-2: #252c34;
  /* Blvck Reader's night greys: body Lc ≈ 85, secondary ≈ 65 on the card */
  --fg: #DADEE6; --fg-between: #B8BECB; --fg-light: #9EA5B3;
  --text-primary: #DADEE6; --text-secondary: #B8BECB; --text-hint: #9EA5B3; --primary: #E5E9EF;
  --el-akasha: #5A15CC; --el-air: #FCBD3F; --el-fire: #FA1928; --el-water: #006FBE; --el-earth: #0FB500;
  --air: #fcbd3f; --fire: #fa1928; --water: #006fbe; --earth: #0fb500; --akasha: #5a15cc;
  --hover: rgba(255, 255, 255, 0.04); --hover-2: rgba(255, 255, 255, 0.05); --tint: rgba(255, 255, 255, 0.03);
  --code-bg: rgba(255, 255, 255, 0.07); --thumb: rgba(255, 255, 255, 0.08);
  --pr-page: #12151A; --pr-card: #1F252B; --pr-card-shadow: none; --pr-glow: 16%;
}
[data-pr-look='paper'], [data-pr-look='ink'] {
  color-scheme: light;
  --bg: #F5F2EC; --bg-list: #F5F2EC;
  --card: #FCFBF8; --card-border: #E6E1D8; --group-card: #F1EDE6; --water-border: #CFC8BC;
  --surface: #FCFBF8; --surface-2: #F1EDE6;
  --fg: #1F1B16; --fg-between: #5B6470; --fg-light: #7D838B;
  --text-primary: #1F1B16; --text-secondary: #5B6470; --text-hint: #7D838B; --primary: #1F1B16;
  --el-akasha: #5A15CC; --el-air: #B8860B; --el-fire: #D1121F; --el-water: #0A5FA8; --el-earth: #118A0A;
  --air: #b8860b; --fire: #d1121f; --water: #0a5fa8; --earth: #118a0a; --akasha: #5a15cc;
  --hover: rgba(31, 27, 22, 0.04); --hover-2: rgba(31, 27, 22, 0.06); --tint: rgba(31, 27, 22, 0.03);
  --code-bg: rgba(31, 27, 22, 0.06); --thumb: rgba(31, 27, 22, 0.14);
  --pr-page: #F5F2EC; --pr-card: #FCFBF8; --pr-card-shadow: 0 0 0 0.5px #E3DDD2; --pr-glow: 12%;
}
[data-pr-look='ink'] {
  --bg: #FFFFFF; --bg-list: #FFFFFF; --card: #FFFFFF; --group-card: #FFFFFF; --surface: #FFFFFF; --surface-2: #FAFAFA;
  --card-border: #DEDEDE; --code-bg: rgba(0, 0, 0, 0.045); --tint: transparent;
  --pr-page: #FFFFFF; --pr-card: #FFFFFF; --pr-card-shadow: none; --pr-glow: 0%;
}

/* =====================================================================
   the studio
   ===================================================================== */
html.qq-ps-open, html.qq-ps-open body { overflow: hidden; }
.qq-ps {
  position: fixed; inset: 0; z-index: 120;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg);
  font-family: var(--font-text); font-size: 13px;
  animation: qq-ps-in 0.2s var(--ease-soft);
  user-select: none;
  /* a sheet is wider than a phone: without this a phone's text autosizing would set its words larger than measured */
  -webkit-text-size-adjust: none; text-size-adjust: none;
}
.qq-ps[data-closing] { opacity: 0; transition: opacity 0.15s var(--ease-soft); pointer-events: none; }
@keyframes qq-ps-in { from { opacity: 0; } to { opacity: 1; } }

.qq-ps-bar {
  position: relative; flex: none;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  padding: max(10px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--card-border);
}
.qq-ps[data-busy='true'] .qq-ps-bar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--air), transparent) no-repeat;
  background-size: 36% 100%;
  animation: qq-ps-scan 1.1s linear infinite;
}
@keyframes qq-ps-scan { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.qq-ps-brand { display: inline-flex; align-items: center; gap: 9px; flex: none; }
.qq-ps-brand .qq-logo { height: 19px; color: var(--fg); }
.qq-ps-brand-t { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-between); white-space: nowrap; }
.qq-ps-what { min-width: 0; flex: 0 1 auto; font-size: 12.5px; color: var(--fg); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28vw; }
.qq-ps-count { font-family: var(--font-mono); font-size: 11px; color: var(--fg-light); white-space: nowrap; }
.qq-ps-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qq-ps-segs { display: inline-flex; border: 1px solid var(--card-border); border-radius: var(--r-pill); overflow: hidden; flex: none; }
.qq-ps-seg { padding: 5px 11px; border: 0; background: none; color: var(--fg-light); font-family: var(--font-text); font-size: 12px; cursor: pointer; white-space: nowrap; }
.qq-ps-seg + .qq-ps-seg { border-inline-start: 1px solid var(--card-border); }
.qq-ps-seg:hover { color: var(--fg); }
.qq-ps-seg[aria-checked='true'] { background: color-mix(in srgb, var(--air) 16%, transparent); color: var(--fg); }
.qq-ps-seg:focus-visible, .qq-ps-switch:focus-visible, .qq-ps-look:focus-visible { outline: 1px solid var(--fg-light); outline-offset: 1px; }
.qq-ps-zoom { display: inline-flex; align-items: center; gap: 2px; }
.qq-ps-zoom .qq-btn-icon { padding: 6px 7px; }
.qq-ps-zoom-v { min-width: 74px; padding: 5px 6px; border: 0; background: none; font-family: var(--font-mono); font-size: 11px; color: var(--fg-between); cursor: pointer; border-radius: 6px; }
.qq-ps-zoom-v:hover { color: var(--fg); background: var(--hover); }
.qq-ps-print { --el-color: var(--air); --el-on: #1F252B; }
.qq-ps-close { padding: 7px 8px; }

.qq-ps-main { flex: 1; min-height: 0; display: flex; }
.qq-ps-panel {
  flex: 0 0 292px; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 18px max(40px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  border-inline-end: 1px solid var(--card-border);
  background: var(--bg);
}
.qq-ps[data-panel='closed'] .qq-ps-panel { display: none; }
.qq-ps-sec { padding: 6px 0 14px; }
.qq-ps-sec + .qq-ps-sec { border-top: 1px solid var(--card-border); padding-top: 14px; }
.qq-ps-sec[hidden] { display: none; }
.qq-ps-h { margin: 0 0 10px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 400; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-light); }
.qq-ps-k { font-size: 11.5px; color: var(--fg-between); }
.qq-ps-field { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 12px; }
.qq-ps-field .qq-ps-segs { max-width: 100%; }

/* the three looks, each a small page in its own inks */
.qq-ps-looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.qq-ps-look {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 6px 6px 7px; min-width: 0;
  border: 1px solid var(--card-border); border-radius: 10px; background: none; cursor: pointer; text-align: start;
  transition: border-color 140ms var(--ease-soft), background-color 140ms var(--ease-soft);
}
.qq-ps-look:hover { border-color: var(--fg-light); }
.qq-ps-look[aria-checked='true'] { border-color: var(--air); background: color-mix(in srgb, var(--air) 9%, transparent); }
.qq-ps-look-page { display: block; aspect-ratio: 210 / 297; padding: 15% 13%; margin-bottom: 4px; border-radius: 4px; background: var(--pr-page); box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--fg) 14%, transparent); }
.qq-ps-look-card {
  display: flex; flex-direction: column; gap: 11%; height: 100%; padding: 16% 12%;
  background: var(--pr-card); box-shadow: var(--pr-card-shadow);
  border-top: 1.5px solid var(--air); border-left: 1.5px solid var(--air); border-top-left-radius: 9px;
}
.qq-ps-look-card i { display: block; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--fg) 24%, transparent); border-left: 3px solid var(--c); }
.qq-ps-look-card i:nth-child(1) { --c: var(--air); width: 82%; }
.qq-ps-look-card i:nth-child(2) { --c: var(--fire); width: 64%; margin-left: 12%; }
.qq-ps-look-card i:nth-child(3) { --c: var(--water); width: 72%; margin-left: 12%; }
.qq-ps-look-card i:nth-child(4) { --c: var(--earth); width: 56%; }
.qq-ps-look-name { font-size: 12px; font-weight: 600; color: var(--fg); }
.qq-ps-look-hint { font-size: 10px; line-height: 1.3; color: var(--fg-light); }

/* switches */
.qq-ps-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 6px 0; border: 0; background: none; cursor: pointer; text-align: start; color: var(--fg);
}
.qq-ps-switch-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 12.5px; }
.qq-ps-switch-t i { font-style: normal; font-size: 10.5px; color: var(--fg-light); }
.qq-ps-track { flex: none; position: relative; width: 30px; height: 17px; border-radius: 999px; background: var(--card-border); transition: background-color 160ms var(--ease-soft); }
.qq-ps-track i { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--fg-light); transition: transform 160ms var(--ease-soft), background-color 160ms var(--ease-soft); }
.qq-ps-switch[aria-checked='true'] .qq-ps-track { background: color-mix(in srgb, var(--air) 70%, var(--card-border)); }
.qq-ps-switch[aria-checked='true'] .qq-ps-track i { transform: translateX(13px); background: var(--bg); }

.qq-ps-range { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.qq-ps-range .qq-ps-k { flex: 1 0 100%; }
.qq-ps-range input { flex: 1; min-width: 0; accent-color: var(--air); }
.qq-ps-range output { font-family: var(--font-mono); font-size: 11px; color: var(--fg-between); min-width: 4ch; text-align: end; }
.qq-ps-text { align-items: stretch; width: 100%; }
.qq-ps-text input, .qq-ps-text textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--card-border); border-radius: 8px; background: var(--card);
  font-family: var(--font-text); font-size: 13px; color: var(--fg); resize: vertical; user-select: text;
}
.qq-ps-text input:focus, .qq-ps-text textarea:focus { border-color: var(--fg-light); }
.qq-ps-tip { margin: 10px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--fg-light); }
.qq-ps-tip strong { color: var(--fg-between); font-weight: 600; }

/* the desk: a drafting table the sheets lie on */
.qq-ps-desk {
  position: relative; flex: 1; min-width: 0; overflow: auto; overscroll-behavior: contain;
  padding: 30px 30px max(60px, env(safe-area-inset-bottom));
  background-color: color-mix(in srgb, var(--bg) 82%, #000);
  background-image: radial-gradient(color-mix(in srgb, var(--fg) 7%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
html[data-scheme='light'] .qq-ps-desk { background-color: #E7E2D8; }
.qq-ps-pages {
  --zoom: 0.5;
  display: grid; justify-content: center; align-content: start;
  grid-template-columns: calc(var(--pr-W, 794px) * var(--zoom));
  gap: 34px 0;
  transition: opacity 0.2s var(--ease-soft);
}
.qq-ps-pages[data-spread='true'] { grid-template-columns: repeat(2, calc(var(--pr-W, 794px) * var(--zoom))); column-gap: 2px; }
.qq-ps-pages[data-spread='true'] > .qq-ps-slot:first-child { grid-column: 2; }
.qq-ps[data-busy='true'] .qq-ps-pages { opacity: 0.55; }
.qq-ps-slot {
  position: relative;
  width: calc(var(--pr-W) * var(--zoom)); height: calc(var(--pr-H) * var(--zoom));
  background: var(--pr-page);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 14px 34px rgba(0, 0, 0, 0.3);
}
html[data-scheme='light'] .qq-ps-slot { box-shadow: 0 1px 2px rgba(40, 32, 18, 0.16), 0 12px 30px rgba(40, 32, 18, 0.14); }
.qq-ps-slot::after {
  content: attr(data-n); position: absolute; left: 0; right: 0; bottom: -21px; text-align: center;
  font-family: var(--font-mono); font-size: 10px; color: var(--fg-light);
}
.qq-ps-pages[data-spread='true'] > .qq-ps-slot::after { display: none; }
.qq-ps-slot > .pr-sheet { transform: scale(var(--zoom)); transform-origin: 0 0; }
.qq-ps-desk-note { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; font-size: 13px; color: var(--fg-between); text-align: center; }
.qq-ps-desk-note[hidden] { display: none; }
/* the measuring room: laid out like the desk, never seen */
.qq-ps-measure { position: absolute; left: -100000px; top: 0; visibility: hidden; pointer-events: none; }

@media (max-width: 760px) {
  .qq-ps-bar { gap: 8px 10px; padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  .qq-ps-what, .qq-ps-viewseg, .qq-ps-zoom, .qq-ps-brand-t { display: none; }
  .qq-ps-main { flex-direction: column; }
  .qq-ps-panel { flex: 0 1 auto; max-height: 48%; border-inline-end: 0; border-bottom: 1px solid var(--card-border); padding: 12px 16px 18px; }
  .qq-ps-desk { padding: 18px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .qq-ps, .qq-ps[data-busy='true'] .qq-ps-bar::after { animation: none; }
}

/* =====================================================================
   the paper
   ===================================================================== */
.pr-sheet {
  position: relative; box-sizing: border-box; overflow: hidden;
  width: var(--pr-W); height: calc(var(--pr-H) - 1px);
  background: var(--pr-page); color: var(--fg);
  font-family: var(--font-text); font-size: 13px; line-height: 1.45;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  user-select: text;
}
.pr-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pr-sheet-head {
  position: absolute; left: var(--pr-side); right: var(--pr-side); top: calc(var(--pr-top) * 0.4);
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  font-family: var(--font-mono); font-size: calc(8px * var(--pr-k)); letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-light);
}
.pr-head-l, .pr-head-r { min-width: 0; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.pr-head-l { flex: 0 1 auto; text-overflow: ellipsis; }
.pr-head-r { flex: 0 1 auto; justify-content: flex-end; font-family: var(--font-text); font-size: calc(9.5px * var(--pr-k)); letter-spacing: 0.01em; text-transform: none; color: var(--fg-between); }
.pr-head-r > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.pr-sheet-body { position: absolute; left: var(--pr-side); top: var(--pr-top); width: var(--pr-bodyW); height: var(--pr-bodyH); display: flex; flex-direction: column; gap: var(--pr-gap); }
.pr-sheet-foot {
  position: absolute; left: var(--pr-side); right: var(--pr-side); bottom: calc(var(--pr-bottom) * 0.34);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--font-mono); font-size: calc(9px * var(--pr-k)); color: var(--fg-light);
}
.pr-sheet[data-side='verso'] .pr-sheet-foot { flex-direction: row-reverse; } /* the folio on the outer edge */
.pr-foot-mark { display: inline-flex; align-items: center; gap: 4px; opacity: 0.75; font-family: var(--font-text); letter-spacing: 0.02em; }
.pr-foot-mark .qq-logo { height: calc(10px * var(--pr-k)); color: var(--fg-between); }
.pr-folio { font-variant-numeric: tabular-nums; letter-spacing: 0.06em; color: var(--fg-between); }
.pr-folio i { font-style: normal; color: var(--fg-light); opacity: 0.75; }
.pr-sheet-full { position: absolute; inset: 0; }

/* ---------- the card: the thing's own spine, round every slice of it ---------- */
.pr-card {
  --ink: var(--el-color);
  --spine-ink: var(--el-color);
  flex: none; box-sizing: border-box;
  padding: var(--pr-pad-t) var(--pr-pad-x) var(--pr-pad-b);
  background: var(--pr-card); box-shadow: var(--pr-card-shadow);
  border-radius:
    calc(var(--k-boxRadius) * var(--c-tl)) calc(var(--k-boxRadius) * var(--c-tr))
    calc(var(--k-boxRadius) * var(--c-br)) calc(var(--k-boxRadius) * var(--c-bl));
}
.pr-card[data-cont='true'] { flex: 1 1 auto; } /* a thing that goes on overleaf fills its page */
.pr-window { position: relative; overflow: hidden; width: var(--pr-flowW); }
.pr-window > .pr-flow { position: absolute; left: 0; top: 0; }

/* ---------- a thing's flow: the editor's rows at paper's sizes ---------- */
.pr-flow {
  display: flow-root; box-sizing: border-box; width: var(--pr-flowW);
  color: var(--fg); text-align: start;
  --scale: 1; --fade: 1;
  --k-rowFont: calc(12.5px * var(--pr-type)); --k-metaFont: calc(8.8px * var(--pr-type)); --k-glyphSize: calc(14px * var(--pr-type));
  --k-bodyFont: calc(13.5px * var(--pr-type)); --k-qnFont: calc(11px * var(--pr-type));
  --k-rowPadX: 7px; --k-rowPadY: 5px; --k-rowGap: 5px; --k-railIndent: 10px; --k-headGap: 5px; --k-toolSize: 0px;
}
.pr-flow.qq-detail { position: relative; inset: auto; z-index: auto; display: flow-root; flex-direction: initial; background: none; animation: none; transition: none; }
/* Adam's reading type for the words (headings and code keep their own spacing) */
.pr-flow :is(.outline-content, .pr-md, .qq-qcell-text, .pr-arrow-note) { letter-spacing: 0.032em; word-spacing: 0.13em; line-height: 1.55; }
.pr-flow :is(.outline-content, .pr-md) :is(h1, h2, h3, h4, h5, h6, code, pre, .katex) { letter-spacing: normal; word-spacing: normal; }
[data-pr-look='night'] .pr-flow :is(.outline-content, .pr-md, .pr-title) { -webkit-font-smoothing: auto; -webkit-text-stroke: 0.05px currentColor; }

.pr-thing-head { display: grid; grid-template-columns: calc(92px * var(--pr-type)) minmax(0, 1fr); gap: calc(18px * var(--pr-type)); align-items: start; margin: 0 0 4px; }
.pr-sigil { width: 100%; aspect-ratio: 1; }
.pr-sigil .qq-charged-sigil > svg { width: 100%; height: 100%; opacity: 1; }
.pr-thing-titles { min-width: 0; padding-top: 4px; }
.pr-kicker { display: flex; align-items: center; gap: 5px; margin: 0 0 5px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-light); }
.pr-kicker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-title { margin: 0 0 8px; font-family: var(--font-title); font-weight: 600; font-size: calc(26px * var(--pr-type)); line-height: 1.16; letter-spacing: -0.01em; color: var(--fg); text-wrap: balance; overflow-wrap: anywhere; }
.pr-title.is-empty { color: var(--fg-light); font-style: italic; font-weight: 500; }
.pr-qn { margin: 0 0 8px; }
.pr-qn .qq-ava { --ava: 15px; }
.pr-stats { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em; color: var(--fg-light); }
.pr-stats .qq-coll-bar { flex: 0 0 96px; max-width: 96px; height: 4px; }
.pr-charge { display: inline-flex; align-items: center; gap: 3px; color: var(--el-color); }

.pr-md { margin: 14px 0 16px; cursor: auto; border-radius: 0; font-size: var(--k-bodyFont); }
.pr-md:hover { background: none; }
.pr-label { margin: 0 0 6px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 400; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-light); }

.pr-voices { margin: 4px 0 14px; padding: 9px 12px 4px; border: 0.5px solid var(--water-border); border-radius: 12px; }
.pr-voices .qq-persp-row { grid-template-columns: 22px 1fr auto 0; padding: 5px 0; }

.pr-outline { position: relative; margin: 6px 0 4px; }
.pr-outline.pr-has-arrows { padding-inline-start: 16px; }
.pr-arrows { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 1; }
.pr-flow .rail-head { cursor: auto; scale: none; }
.pr-flow .rail-head:hover { background: none; }
.pr-flow .node-symbol { cursor: auto; }
.pr-flow .node-symbol:hover { filter: none; }
.pr-flow .outline-content { cursor: auto; }
.pr-flow .node-shells, .pr-flow .qq-src-chip, .pr-flow .node-fig, .pr-flow .qq-replyto, .pr-flow .qq-td-corresp-row { cursor: auto; }
.pr-flow :is(.qq-qcell-empty, .qq-qcell-back, .qq-fold, .node-tools, .qq-layer-add) { display: none !important; }
.pr-flow .node-persp { display: inline-flex; align-items: center; }
.pr-flow .node-persp .qq-ava { --ava: 12px; }
.pr-flow .qq-md-embed { margin: 0; }
.pr-arrow-note { display: flex; align-items: baseline; gap: 5px; margin-top: 3px; font-size: 0.86em; font-style: italic; color: var(--fg-between); }
.pr-arrow-note svg { flex: none; transform: scaleX(-1); color: var(--rail); }
/* no meta line: the glyph sits beside the words, as on a page of notes */
.pr-compact .rail-head { flex-wrap: nowrap; align-items: flex-start; }
.pr-compact .rail-head > .node-symbol { order: 1; min-height: 0; padding-top: 0.14em; }
.pr-compact .rail-head > .node-main { order: 2; flex: 1 1 auto; }
.pr-compact .rail[data-side='right'] > .rail-head > .node-symbol { order: 3; }
.pr-layer-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 4px; font-family: var(--font-title); font-weight: 600; font-size: calc(12.5px * var(--pr-type)); color: var(--fg-between); }
/* a debate on paper: the voices stand still, and the ink saver prints none of their colour clouds */
.pr-flow[data-view='debate'] .rail > .rail-head::after { animation: none; opacity: 0.5; }
[data-pr-look='ink'] .pr-flow[data-view='debate'] .rail > .rail-head::after { display: none; }
[data-pr-look='ink'] .pr-flow[data-view='debate'] .rail > .rail-head { box-shadow: inset 0 0 0 0.5px var(--card-border); }

/* the plate: the sky, the shape, the correspondences */
.pr-plate { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 20px; margin: 24px 0 2px; padding: 16px 0 0; border-top: 0.5px solid var(--water-border); }
.pr-plate-cell { min-width: 0; }
.pr-wheel { display: flex; justify-content: center; margin: 0 0 6px; }
.pr-wheel svg { width: 150px; height: auto; }
.pr-tree { display: flex; justify-content: center; }
.pr-tree svg { max-width: 100%; height: auto; max-height: 230px; }
.pr-plate .qq-td-corresp-browse { display: none; }
.pr-plate .qq-td-corresp-row { width: 100%; text-align: start; font-size: 11px; }
.pr-plate .qq-td-corresp-meaning, .pr-plate .qq-td-corresp-attr { font-size: 11px; line-height: 1.5; }

/* a video on paper */
.pr-video { display: flex; align-items: center; gap: 10px; margin: 3px 0; padding: 6px; border: 0.5px solid var(--water-border); border-radius: 10px; }
.pr-video-thumb { flex: none; width: 92px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--code-bg); }
.pr-video-none { display: grid; place-items: center; color: var(--fg-light); }
.pr-video-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.35; }
.pr-video-provider { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-light); }
.pr-video-text strong { font-size: 0.95em; font-weight: 600; color: var(--fg); }
.pr-video-author { font-size: 0.85em; color: var(--fg-between); }
.pr-video-url { font-family: var(--font-mono); font-size: 8.5px; line-height: 1.4; color: var(--el-water); overflow-wrap: anywhere; }

/* ---------- the cover, and a collection's title page ---------- */
.pr-cover {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: calc(var(--pr-top) * 1.75) calc(var(--pr-side) * 1.75) calc(var(--pr-bottom) * 1.45);
  color: var(--fg);
}
.pr-cover-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pr-cover-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 10, 14, 0.62) 0%, rgba(8, 10, 14, 0.4) 40%, rgba(8, 10, 14, 0.86) 100%); }
.pr-cover[data-has-pic='true'] { --fg: #FFF3E3; --fg-between: rgba(255, 243, 227, 0.84); --fg-light: rgba(255, 243, 227, 0.68); }
.pr-cover-corners { position: absolute; inset: calc(var(--pr-side) * 0.85); pointer-events: none; }
.pr-cover .pr-corner {
  position: absolute; width: 27%; height: 19%;
  --off: calc(var(--k, 0) * 10px);
  --spine-w: 1.6px; --spine-w-h: 1.6px;
  border-radius: calc(34px * var(--j-tl)) calc(34px * var(--j-tr)) calc(34px * var(--j-br)) calc(34px * var(--j-bl));
}
.pr-cover .pr-corner[data-corner='tl'] { top: var(--off); left: var(--off); }
.pr-cover .pr-corner[data-corner='tr'] { top: var(--off); right: var(--off); }
.pr-cover .pr-corner[data-corner='bl'] { bottom: var(--off); left: var(--off); }
.pr-cover .pr-corner[data-corner='br'] { bottom: var(--off); right: var(--off); }
.pr-cover-top { position: relative; display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: calc(9px * var(--pr-k)); letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-light); }
.pr-cover-top .qq-logo { height: calc(18px * var(--pr-k)); color: var(--fg); }
.pr-cover-mini { font-family: var(--font-text); font-size: 1.15em; letter-spacing: 0.02em; text-transform: none; color: var(--fg-between); }
.pr-cover-kind::before { content: '·'; margin-inline-end: 9px; }
.pr-cover-mid { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(12px * var(--pr-k)); }
.pr-cover-mid::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: min(86%, calc(var(--pr-H) * 0.5)); aspect-ratio: 1; translate: -50% -58%;
  border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--el-color) var(--pr-glow), transparent), transparent);
  pointer-events: none;
}
.pr-cover-sigil { position: relative; width: min(54%, calc(var(--pr-H) * 0.29)); aspect-ratio: 1; }
.pr-cover[data-part='true'] .pr-cover-sigil { width: min(44%, calc(var(--pr-H) * 0.24)); }
.pr-cover-sigil svg { width: 100%; height: 100%; }
.pr-cover-title { position: relative; max-width: 88%; margin: calc(8px * var(--pr-k)) 0 0; font-family: var(--font-title); font-weight: 600; font-size: calc(36px * var(--pr-k)); line-height: 1.1; letter-spacing: -0.015em; color: var(--fg); text-wrap: balance; overflow-wrap: anywhere; }
.pr-cover-sub { position: relative; max-width: 72%; margin: 0; font-size: calc(13px * var(--pr-k)); line-height: 1.55; letter-spacing: 0.032em; word-spacing: 0.13em; color: var(--fg-between); text-wrap: pretty; white-space: pre-line; }
.pr-cover-figure { position: relative; display: flex; justify-content: center; width: min(62%, 420px); margin: 0 0 calc(20px * var(--pr-k)); }
.pr-cover-figure .qq-lens-els { width: 100%; }
.pr-cover-figure :is(.qq-lens-tree, .qq-lens-gk) { height: calc(var(--pr-H) * 0.17); }
.pr-cover-foot {
  position: relative; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 12px; border-top: 0.5px solid color-mix(in srgb, var(--fg) 16%, transparent);
  font-family: var(--font-mono); font-size: calc(8.5px * var(--pr-k)); letter-spacing: 0.08em; color: var(--fg-light);
}
.pr-cover[data-part='true'] .pr-cover-foot { justify-content: center; }
.pr-cover-date, .pr-cover-me { display: inline-flex; align-items: center; gap: 6px; }
.pr-cover-me .qq-ava { --ava: 15px; }

/* ---------- the contents ---------- */
.pr-toc { width: 100%; }
.pr-toc-title { margin: 4px 0 22px; font-family: var(--font-title); font-weight: 600; font-size: calc(26px * var(--pr-k)); letter-spacing: -0.01em; color: var(--fg); }
.pr-toc-rows { display: flex; flex-direction: column; }
.pr-toc-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.pr-toc-sigil { flex: none; width: 28px; height: 28px; }
.pr-toc-sigil svg { width: 100%; height: 100%; }
.pr-toc-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 0 1 auto; max-width: 74%; }
.pr-toc-t { display: flex; align-items: center; gap: 6px; min-width: 0; font-family: var(--font-title); font-weight: 600; font-size: calc(13px * var(--pr-type)); color: var(--fg); }
.pr-toc-t > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-toc-sub { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.04em; color: var(--fg-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-toc-dots { flex: 1; min-width: 18px; align-self: center; height: 1px; margin-top: 8px; background-image: radial-gradient(circle, color-mix(in srgb, var(--fg) 34%, transparent) 0.7px, transparent 0.9px); background-size: 5px 1.6px; background-repeat: repeat-x; background-position: 0 50%; }
.pr-toc-n { flex: none; min-width: 2ch; text-align: end; font-family: var(--font-mono); font-size: 11px; color: var(--fg-between); font-variant-numeric: tabular-nums; }
.pr-toc-group { display: flex; align-items: center; gap: 10px; margin: 18px 0 4px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-between); }
.pr-toc-rows > .pr-toc-group:first-child { margin-top: 0; }
.pr-toc-gbar { flex: none; width: 18px; height: 3px; border-radius: 2px; }
.pr-toc-gt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-toc-gn { margin-inline-start: auto; letter-spacing: 0.04em; text-transform: none; color: var(--fg-light); }

/* =====================================================================
   the print: the sheets alone, at their size, one to a page
   ===================================================================== */
@media print {
  html.qq-ps-open, html.qq-ps-open body { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  html.qq-ps-open { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html.qq-ps-open[data-ps-look='night'], html.qq-ps-open[data-ps-look='night'] body { background: #12151A !important; }
  html.qq-ps-open[data-ps-look='paper'], html.qq-ps-open[data-ps-look='paper'] body { background: #F5F2EC !important; }
  html.qq-ps-open[data-ps-look='ink'], html.qq-ps-open[data-ps-look='ink'] body { background: #FFFFFF !important; }
  html.qq-ps-open body > :not(.qq-ps) { display: none !important; }
  html.qq-ps-open .qq-ps { position: static !important; inset: auto !important; display: block !important; background: none !important; animation: none !important; }
  html.qq-ps-open :is(.qq-ps-bar, .qq-ps-panel, .qq-ps-measure, .qq-ps-desk-note) { display: none !important; }
  html.qq-ps-open :is(.qq-ps-main, .qq-ps-desk, .qq-ps-pages) { display: block !important; overflow: visible !important; padding: 0 !important; margin: 0 !important; height: auto !important; background: none !important; opacity: 1 !important; }
  html.qq-ps-open .qq-ps-slot { width: auto !important; height: auto !important; margin: 0 !important; box-shadow: none !important; break-after: page; break-inside: avoid; }
  html.qq-ps-open .qq-ps-slot:last-child { break-after: auto; }
  html.qq-ps-open .qq-ps-slot::after { display: none !important; }
  html.qq-ps-open .qq-ps-slot > .pr-sheet { transform: none !important; }
}
/* no title known for a video yet: its address is what it is called */
.pr-video-text > .pr-video-url:nth-child(2) { font-size: 10px; color: var(--fg); }

/* ---------- the way in, from the Export popover ---------- */
.qq-export-print { align-items: center; }
.qq-export-print > .qq-icon { color: var(--el-color); flex: none; }
.qq-export-print .qq-export-name { flex: 1; }
.qq-export-print kbd { flex: none; margin-inline-start: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-light); border: 0.5px solid var(--card-border); border-radius: 4px; padding: 0 5px; }
