/* Colloquia web UI: design tokens, fonts, app shell and shared components (owner: shell).
 * Ported from the decided configurator design (neutral white, accent teal, one sheet, two-line rows, docked inspector,
 * filter sentence, Literata + Figtree, comfortable density; dark = "Midnight + teal"). All colours are tokens below;
 * area stylesheets (library.css, me.css, inbox.css) use the tokens and the cq-* component classes, never hex values.
 * Theme: <html data-theme="light|dark"> when the user picked one, else the system preference decides.
 * Light ramp = "Midnight + teal" (theme-midnight, Jan's pick of the design round: the deep navy top bar #05263c with
 * white tiles, the wash under it, teal for action and identity, navy for structure); dark = the same family (deep navy
 * sheets, mint-teal action, ice-blue structure, the bar navy as frame), in both dark blocks (data-theme and the system
 * preference). The other variations (emerald, the previous default; mist; paper) stay as fallbacks in
 * docs/design/midnight/palettes/*.css (one token file each).
 * Colour rounds 4 and 5 (2026-11-02, docs/decisions.md): emerald for what you press, navy and ice blue for the frame
 * and "you are here", yellow only for My shelf. No line under the top bar (a soft shadow instead); the tab row a
 * neutral grey band, hidden while no paper is open (dark: a neutral #0f1f2d frame under the same navy bar); a navy
 * glow in the hero wash; the dark bar's logo and avatar white as in light; label icons navy; the scope tiles frosted
 * with the glyph in colour (Library emerald, My shelf yellow). My shelf (shelf-tile, 2026-11-04): one tile, the scope
 * menu's (--c-shelf-tile / -tile-line / -tile-ink: light cream #fdf3d6, a soft gold ring #f1d98f, a deep gold glyph
 * #8a6400; dark the menu's 6% tint, the navy ring, the bar's yellow) for the menu, the light left bar's current
 * item (with a yellow #e3b322 edge), the phone's bottom bar, the empty shelf and the shelf's colour; the dark left bar
 * keeps its 15% yellow pill. The Library's current item, the count badges and the PDF links stay emerald.
 * Polish 3, E2 "Tint tiles" (2026-11-11): the shelf's yellow is calmer, a soft gold #ecce83 (OKLCH .86 .10 88, was
 * #fcd34d) for the bar's glyph in both themes and everything yellow in dark (the menu glyph, the left bar's edge and
 * pill, the line under the bar); no solid tile anywhere: the header's tile (open and folded) is a tint with a ring
 * and the glyph in the ink (--c-shelf-head-tile*, projects take their --pc tint, ring and ink), the Inbox count a
 * tinted pill (--c-shelf-count*). Light: the menu's cream tile for both; dark: a 14% (count 18%) tint of the yellow on
 * the surface with a 40% ring. */

/* Fonts (SIL OFL 1.1, see fonts/OFL-*.txt): variable woff2, latin + latin-ext, self-hosted. */
@font-face { font-family: "Figtree"; font-style: italic; font-weight: 300 900; font-display: swap;
  src: url("fonts/figtree-italic-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: italic; font-weight: 300 900; font-display: swap;
  src: url("fonts/figtree-italic-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("fonts/figtree-normal-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("fonts/figtree-normal-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("fonts/literata-italic-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("fonts/literata-italic-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("fonts/literata-normal-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("fonts/literata-normal-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* colour: light ramp "Midnight + teal" (theme-midnight, palette designer B; Jan's round-2 pick: the deep navy top bar,
   * white parts on it, the hero wash under it). Two roles: TEAL = action and identity (links, primary buttons,
   * checkboxes, the Library scope's glyph and current item), NAVY = structure (--c-struct: the current underline tab, the open
   * row, the sorted column, the current Settings section; --c-sel the open row's tint; focus, info, tooltips).
   * Navy-tinted cool greys. The other variations: docs/design/midnight/palettes/. */
  --c-page: #f1f4f6;
  --c-bar: #edf0f3;        /* the tab row (and the phone's bottom bar): neutral grey, hidden while no paper is open (band-b) */
  --c-bar-plain: #edf0f3;  /* the tab row without the hero wash: the same since band-b */
  --c-rail: #eef2f5;
  --c-surface: #ffffff;
  --c-surface-2: #f5f7f9;
  --c-hover: #edf1f4;
  --c-raised: #ffffff;
  --c-line: #d9e0e6;
  --c-line-soft: #e9edf1;
  --c-ink: #0e1b25;
  --c-ink-2: #283640;
  --c-ink-3: #4a5863;
  --c-mute: #6a7782;   /* marks only (separators, rules): below AA on the dark surfaces, never for text */
  --c-ph: #66737e;     /* placeholders of form fields: lighter than any value, AA on the field */
  --c-accent: #0b6f67;
  --c-accent-fill: #0b6f67;
  --c-accent-fill-hover: #07574f;
  --c-on-accent: #ffffff;
  --c-accent-soft: #dff1ed;
  --c-accent-line: #5d9f98;
  --c-focus: #2a6aa8;
  --c-ok: #13744f;
  --c-ok-soft: #e2f3ea;
  --c-ok-line: #9dd5b9;
  --c-warn: #a24a0a;
  --c-warn-soft: #fdf3e3;
  --c-warn-line: #f0cf98;
  --c-danger: #b42340;
  --c-danger-soft: #fcecef;
  --c-danger-line: #f1b5c1;
  --c-info: #1d5f9c;
  --c-info-soft: #e8f1fa;
  --c-info-line: #b2cde8;
  --c-amber: #9a5800;
  --c-violet: #6a3fc9;
  --c-sky: #0a6aa0;
  --c-rose: #b42a68;
  --c-indigo: #3f4bbf;
  --c-cyan: #0b7088;
  --c-orange: #b9480f;
  --c-fuchsia: #9a2aa6;
  --c-lime: #4b7414;
  --c-tooltip-bg: #0b2234;
  --c-tooltip-ink: #ffffff;
  --c-scrim: rgba(4, 20, 33, 0.36);
  --shadow-1: 0 1px 2px rgba(5, 30, 50, 0.07);
  --shadow-2: 0 8px 24px rgba(5, 30, 50, 0.10), 0 1px 2px rgba(5, 30, 50, 0.06);
  --shadow-3: 0 24px 64px rgba(5, 30, 50, 0.24);
  /* the Library home's hero band and its search field (light: the navy bar's wash eases into the sheet) */
  --hero-bg: linear-gradient(180deg, #e1e9f0 0%, #e4ebf2 13%, #e9eff4 25%, #f0f4f7 38%, #f6f8fa 50%, #fbfcfd 63%, #fefefe 75%, #ffffff 88%, #ffffff 100%);
  --hero-glow: radial-gradient(70% 100% at 50% 0%, rgba(18, 69, 107, 0.07) 0%, rgba(18, 69, 107, 0) 72%);   /* navy (hero-b) */
  --hero-field-bg: #ffffff;
  --hero-field-line: #778693;
  --hero-field-shadow: 0 6px 22px rgba(5, 30, 50, 0.09), 0 1px 2px rgba(5, 30, 50, 0.05);
  --band-bg: linear-gradient(180deg, #e6edf2 0%, #f3f6f8 100%);   /* the search band above a list (M1) */
  --c-hover-raised: var(--c-hover);
  --c-frame-hover: color-mix(in srgb, #05263c 7%, transparent);   /* hover on the frame (bar, rail, tab row) */
  --c-insp: var(--c-raised);   /* the docked inspector: white beside the paper sheet */
  /* the top bar's own tokens (polish 2): every rule of the bar reads these, never the ramp directly. Light (theme-midnight):
   * the deep navy bar, contrast "inverted": the logo, the scope tile, the Jump field and the avatar are white tiles like
   * the logo, the scope icon in the scope's dark colour. The dark theme sets its own bar (the --tb-* block after the dark
   * ramps); data-tbc="pair" and the fallback bars (data-topbar) are token blocks too. Menus keep the raised tokens. */
  --tb-bg: #05263c;
  --tb-stripe-w: 0px; --tb-stripe: #22b5a2; --tb-stripe-shelf: #f59e0b;   /* no line under the bar (stripe-d): a soft shadow */
  --tb-brand: #ffffff;
  --tb-mark-bg: #ffffff; --tb-mark-ink: #05263c; --tb-mark-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  --tb-slash: #7aa2c4;
  --tb-sel-ink: #ffffff; --tb-chev: #c7ddf0;
  /* the scope tile (colour round 5, scope-c): the logo tile's sibling (same size and radius), a frosted tile (a 9% white
   * tint with a 16% white ring) for both scopes; only the glyph has colour: emerald for the Library (the colour of its
   * current item in the left bar), yellow for My shelf (names.py icons). The logo stays the only solid tile. The scope
   * menu shows the same glyphs on pale tints (light: deep emerald and deep gold; dark: the bar's glyphs on a 6% tint).
   * --tb-scope-shadow is a valid shadow by default (the tile's box-shadow list is "ring, shadow": `none` there made the
   * whole list invalid, so the ring was never drawn). */
  --tb-scope-size: 30px; --tb-scope-radius: 7px; --tb-scope-ic: 18px; --tb-scope-ring-w: 1px;
  --tb-scope-mark: rgba(255, 255, 255, 0.09); --tb-scope-mark-shelf: rgba(255, 255, 255, 0.09);
  --tb-scope-mark-ink: #45cfba; --tb-scope-mark-ink-shelf: #ecce83;
  --tb-scope-ring: rgba(255, 255, 255, 0.16); --tb-scope-ring-shelf: rgba(255, 255, 255, 0.16);
  --tb-scope-shadow: 0 0 0 transparent;
  /* a project's scope tile (Projects v1): its tone (.cq-app.is-proj sets it from .cq-pc-<tone>), a white glyph */
  --tb-proj-mark: #5b6b82; --tb-proj-ink: #ffffff; --tb-proj-ring: rgba(255, 255, 255, 0.18);
  --tb-menu-tile: #e6f4f1; --tb-menu-tile-shelf: var(--c-shelf-tile);
  --tb-menu-tile-line: #bfe3dc; --tb-menu-tile-line-shelf: var(--c-shelf-tile-line);
  --tb-menu-ic: #0b6f67; --tb-menu-ic-shelf: var(--c-shelf-tile-ink);
  --tb-hover: #173c56;
  --tb-focus: #7cc6ef;
  --tb-jump-bg: #ffffff; --tb-jump-line: #ffffff; --tb-jump-ink: #3c4a55; --tb-jump-icon: #3c4a55;
  --tb-jump-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  --tb-jump-hover-bg: #ffffff; --tb-jump-hover-line: #ffffff; --tb-jump-hover-ink: #14222c;
  --tb-jump-hover-shadow: 0 1px 2px rgba(0, 0, 0, 0.22), 0 0 0 3px rgba(255, 255, 255, 0.24);
  --tb-jump-ph-bg: #ffffff; --tb-jump-ph-hover-bg: #e6edf2; --tb-jump-ph-ink: #22313b;
  --tb-kbd-bg: #eef2f5; --tb-kbd-line: #c6d0d8; --tb-kbd-ink: #3a4752;
  --tb-icon: #cfe1f1; --tb-icon-hover: #ffffff;
  --tb-avatar-bg: #ffffff; --tb-avatar-line: #ffffff; --tb-avatar-ink: #05263c;
  --tb-avatar-hover-line: #ffffff; --tb-avatar-ring: rgba(255, 255, 255, 0.24); --tb-avatar-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  /* type: Literata (display: titles, abstracts) + Figtree (UI), self-hosted, system fallbacks */
  --f-display: "Literata", Georgia, Cambria, "Times New Roman", serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  --display-scale: 0.95; --display-weight: 500; --display-tracking: -0.01em;
  --fs-xs: 12px; --fs-sm: 13px; --fs-body: 15px; --fs-md: 16px; --fs-title: 17px; --fs-lg: 21px; --fs-xl: 28px; --lh: 1.55;
  /* density: comfortable */
  --d-topbar-h: 56px; --d-tab-h: 38px; --d-ctrl-h: 38px; --d-row-py: 12px; --d-pad: 20px; --d-gap: 14px;
  /* geometry */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --w-act: 64px; --h-bottombar: 64px;
  /* theme-midnight: form field borders (>= 3:1, WCAG 1.4.11: inputs, the list search, the PDF viewer's find field), link
   * hover, the Library scope colour (activity bar, scope menu, the dark bar's stripe), navy structure + the open row's tint */
  --c-line-strong: #7b8a97;
  --c-accent-hover: #07574f;
  --c-scope: #0b6f67;
  --c-struct: #12456b;
  --c-sel: #e9f0f7;
  /* My shelf (shelf-tile, 2026-11-04, after round 5c): ONE tile, the scope menu's shelf tile, wherever the shelf shows a
   * tile: --c-shelf-tile (cream), --c-shelf-tile-line (a soft gold ring), --c-shelf-tile-ink (the deep gold glyph). The
   * scope menu (--tb-menu-*-shelf), the left bar's current item (pill, ring, icon; the phone's bottom bar the same pill
   * and ring), the empty shelf's tile and the shelf's colour --cq-sc (the open tab's icon, the status underline and
   * icon, the menu check) all read them. The rail's edge: a stronger yellow of the same hue (#e3b322, 45deg; the ring's
   * #f1d98f is too faint on the rail), fully yellow, no brown side. Dark: the dark blocks. --c-amber stays as it is (it
   * also marks the PDF viewer's find highlight). The rules: the app shell section and the empty states. */
  --c-shelf-tile: #fdf3d6; --c-shelf-tile-line: #f1d98f; --c-shelf-tile-ink: #8a6400;
  --c-shelf-ink: var(--c-shelf-tile-ink); --c-shelf-glyph: var(--c-shelf-tile-ink); --c-shelf-pill: var(--c-shelf-tile);
  --c-shelf-pill-ring: inset 0 0 0 1px var(--c-shelf-tile-line); --c-shelf-bar-ring: inset 0 0 0 1px var(--c-shelf-tile-line);
  --c-shelf-edge: #e3b322; --c-shelf-edge-w: 3px; --c-shelf-edge-ring: none;
  --c-shelf-soft: var(--c-shelf-tile); --c-shelf-soft-ring: inset 0 0 0 1px var(--c-shelf-tile-line); --c-shelf-soft-ink: var(--c-shelf-tile-ink);
  /* the header's tile and the Inbox count (E2): light, the menu's cream tile; dark, a tint of the yellow (dark blocks) */
  --c-shelf-head-tile: var(--c-shelf-tile); --c-shelf-head-tile-line: var(--c-shelf-tile-line);
  --c-shelf-count: var(--c-shelf-tile); --c-shelf-count-ink: var(--c-shelf-tile-ink); --c-shelf-count-ring: inset 0 0 0 1px var(--c-shelf-tile-line);
  /* Projects v1: the 8 tones of a project and its groups (colloquia/projects.py COLORS), in ONE recipe since
   * 2026-11-09 (folders and filters; calm2-think ideas.md Q5, option A: the My shelf recipe): per tone an ink and a
   * tint at equal OKLCH lightness (light: L .50 ink, L .955 tint at a quarter of the chroma; dark: L .82 ink, L .33
   * tint at .42 of it; chroma .12, ochre .11, teal .11, slate .04; scratchpad foldcol.py). --c-proj-<tone> and
   * --c-proj-<tone>-ink: the tone's colour (the tile's glyph and ring, the left bar's icon and edge, a folder icon's
   * stroke, dots, the B2 line under the top bar, text); --c-proj-<tone>-tint: the pale fill (the tile, the left bar's
   * pill, a folder icon's fill, chips); --c-proj-<tone>-nav / -nav-tint: the dark pair, for the navy top bar in both
   * themes. Every ink is 4.5:1 or more against its tint and against the page in its theme, the nav pair against
   * each other and the navy (WCAG AA; tests/web/test_fold_base_web.py computes it). .cq-pc-<tone> puts a tone into --pc,
   * --pc-ink, --pc-tint, --pc-ring (30 % of the ink) and --pc-nav / --pc-nav-tint for any component. */
  --c-proj-blue: #2e64a6; --c-proj-blue-ink: #2e64a6; --c-proj-blue-tint: #e7f1fe; --c-proj-blue-nav: #9dc7fe; --c-proj-blue-nav-tint: #23364f;
  --c-proj-rust: #9a4825; --c-proj-rust-ink: #9a4825; --c-proj-rust-tint: #feece5; --c-proj-rust-nav: #ffad8d; --c-proj-rust-nav-tint: #4b2c20;
  --c-proj-violet: #6953a0; --c-proj-violet-ink: #6953a0; --c-proj-violet-tint: #f1eefe; --c-proj-violet-nav: #c8b7ff; --c-proj-violet-nav-tint: #37304d;
  --c-proj-green: #3a732c; --c-proj-green-ink: #3a732c; --c-proj-green-tint: #e6f6e3; --c-proj-green-nav: #9ad78c; --c-proj-green-nav-tint: #273c23;
  --c-proj-rose: #974263; --c-proj-rose-ink: #974263; --c-proj-rose-tint: #ffeaf0; --c-proj-rose-nav: #fea6c4; --c-proj-rose-nav-tint: #4a2a35;
  --c-proj-ochre: #835a01; --c-proj-ochre-ink: #835a01; --c-proj-ochre-tint: #fbeedc; --c-proj-ochre-nav: #ebbb6e; --c-proj-ochre-nav-tint: #423218;
  --c-proj-slate: #52657a; --c-proj-slate-ink: #52657a; --c-proj-slate-tint: #ebf1f7; --c-proj-slate-nav: #b1c7de; --c-proj-slate-nav-tint: #2f363e;
  --c-proj-teal: #046f87; --c-proj-teal-ink: #046f87; --c-proj-teal-tint: #ddf5fd; --c-proj-teal-nav: #67d5f5; --c-proj-teal-nav-tint: #153b46;
}
:root[data-theme="dark"] {
  /* colour: dark ("Midnight + teal", theme-midnight) */
  --c-page: #142331;
  --c-bar: #0f1f2d;
  --c-rail: #0f1f2d;
  --c-surface: #182a39;
  --c-surface-2: #1d3142;
  --c-hover: #213a4c;
  --c-raised: #233a4d;
  --c-line: #2f475b;
  --c-line-soft: #233749;
  --c-ink: #e9eff4;
  --c-ink-2: #cbd6df;
  --c-ink-3: #a3b2bf;
  --c-mute: #7d8d9b;
  --c-ph: #94a3b0;
  --c-accent: #45cfba;
  --c-accent-fill: #34c3ad;
  --c-accent-fill-hover: #5fd9c6;
  --c-on-accent: #03211d;
  --c-accent-soft: #173f45;
  --c-accent-line: #2e8f86;
  --c-focus: #7cc6ef;
  --c-ok: #5ad3a0;
  --c-ok-soft: #173d33;
  --c-ok-line: #2a7a5c;
  --c-warn: #f2b26b;
  --c-warn-soft: #3d3324;
  --c-warn-line: #7d5d2c;
  --c-danger: #f59aaa;
  --c-danger-soft: #3f2731;
  --c-danger-line: #8a4152;
  --c-info: #8ec5f4;
  --c-info-soft: #1d3550;
  --c-info-line: #36628f;
  --c-amber: #f4c35a;
  --c-violet: #c4b5fd;
  --c-sky: #7dd3fc;
  --c-rose: #f9a8d4;
  --c-indigo: #aab8fc;
  --c-cyan: #67e8f9;
  --c-orange: #fdba74;
  --c-fuchsia: #f0abfc;
  --c-lime: #bef264;
  --c-tooltip-bg: #36506a;
  --c-tooltip-ink: #ffffff;
  --c-scrim: rgba(2, 12, 22, 0.6);
  --shadow-1: 0 1px 2px rgba(2, 12, 22, 0.5);
  --shadow-2: 0 8px 24px rgba(2, 12, 22, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-3: 0 24px 64px rgba(2, 12, 22, 0.62), 0 0 0 1px rgba(255, 255, 255, 0.07);
  --c-hover-raised: var(--c-accent-soft);
  --c-frame-hover: color-mix(in srgb, var(--c-ink) 8%, transparent);
  --c-insp: var(--c-surface);
  --hero-bg: linear-gradient(180deg, #0b2d45 0%, #182a39 100%);
  --hero-glow: radial-gradient(60% 90% at 50% 0%, rgba(143, 189, 227, 0.07) 0%, rgba(143, 189, 227, 0) 70%);
  --hero-field-bg: #1d3142;
  --hero-field-line: #738ba0;
  --hero-field-shadow: 0 8px 24px rgba(2, 12, 22, 0.45);
  --band-bg: linear-gradient(180deg, #13304a 0%, #182a39 100%);   /* the search band above a list (M1) */
  color-scheme: dark;
  --c-bar-plain: #0f1f2d;
  --c-line-strong: #738ba0;
  --c-accent-hover: #5fd9c6;
  --c-scope: #45cfba;
  --c-struct: #8fbde3;
  --c-sel: #1d3a52;
  --c-proj-blue: #9dc7fe; --c-proj-blue-ink: #9dc7fe; --c-proj-blue-tint: #23364f;
  --c-proj-rust: #ffad8d; --c-proj-rust-ink: #ffad8d; --c-proj-rust-tint: #4b2c20;
  --c-proj-violet: #c8b7ff; --c-proj-violet-ink: #c8b7ff; --c-proj-violet-tint: #37304d;
  --c-proj-green: #9ad78c; --c-proj-green-ink: #9ad78c; --c-proj-green-tint: #273c23;
  --c-proj-rose: #fea6c4; --c-proj-rose-ink: #fea6c4; --c-proj-rose-tint: #4a2a35;
  --c-proj-ochre: #ebbb6e; --c-proj-ochre-ink: #ebbb6e; --c-proj-ochre-tint: #423218;
  --c-proj-slate: #b1c7de; --c-proj-slate-ink: #b1c7de; --c-proj-slate-tint: #2f363e;
  --c-proj-teal: #67d5f5; --c-proj-teal-ink: #67d5f5; --c-proj-teal-tint: #153b46;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-page: #142331;
    --c-bar: #0f1f2d;
    --c-rail: #0f1f2d;
    --c-surface: #182a39;
    --c-surface-2: #1d3142;
    --c-hover: #213a4c;
    --c-raised: #233a4d;
    --c-line: #2f475b;
    --c-line-soft: #233749;
    --c-ink: #e9eff4;
    --c-ink-2: #cbd6df;
    --c-ink-3: #a3b2bf;
    --c-mute: #7d8d9b;
    --c-ph: #94a3b0;
    --c-accent: #45cfba;
    --c-accent-fill: #34c3ad;
    --c-accent-fill-hover: #5fd9c6;
    --c-on-accent: #03211d;
    --c-accent-soft: #173f45;
    --c-accent-line: #2e8f86;
    --c-focus: #7cc6ef;
    --c-ok: #5ad3a0;
    --c-ok-soft: #173d33;
    --c-ok-line: #2a7a5c;
    --c-warn: #f2b26b;
    --c-warn-soft: #3d3324;
    --c-warn-line: #7d5d2c;
    --c-danger: #f59aaa;
    --c-danger-soft: #3f2731;
    --c-danger-line: #8a4152;
    --c-info: #8ec5f4;
    --c-info-soft: #1d3550;
    --c-info-line: #36628f;
    --c-amber: #f4c35a;
    --c-violet: #c4b5fd;
    --c-sky: #7dd3fc;
    --c-rose: #f9a8d4;
    --c-indigo: #aab8fc;
    --c-cyan: #67e8f9;
    --c-orange: #fdba74;
    --c-fuchsia: #f0abfc;
    --c-lime: #bef264;
    --c-tooltip-bg: #36506a;
    --c-tooltip-ink: #ffffff;
    --c-scrim: rgba(2, 12, 22, 0.6);
    --shadow-1: 0 1px 2px rgba(2, 12, 22, 0.5);
    --shadow-2: 0 8px 24px rgba(2, 12, 22, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-3: 0 24px 64px rgba(2, 12, 22, 0.62), 0 0 0 1px rgba(255, 255, 255, 0.07);
    --c-hover-raised: var(--c-accent-soft);
    --c-frame-hover: color-mix(in srgb, var(--c-ink) 8%, transparent);
    --c-insp: var(--c-surface);
    --hero-bg: linear-gradient(180deg, #0b2d45 0%, #182a39 100%);
    --hero-glow: radial-gradient(60% 90% at 50% 0%, rgba(143, 189, 227, 0.07) 0%, rgba(143, 189, 227, 0) 70%);
    --hero-field-bg: #1d3142;
    --hero-field-line: #738ba0;
    --hero-field-shadow: 0 8px 24px rgba(2, 12, 22, 0.45);
    --band-bg: linear-gradient(180deg, #13304a 0%, #182a39 100%);   /* the search band above a list (M1) */
    color-scheme: dark;
    --c-bar-plain: #0f1f2d;
    --c-line-strong: #738ba0;
    --c-accent-hover: #5fd9c6;
    --c-scope: #45cfba;
    --c-struct: #8fbde3;
    --c-sel: #1d3a52;
    --c-proj-blue: #9dc7fe; --c-proj-blue-ink: #9dc7fe; --c-proj-blue-tint: #23364f;
    --c-proj-rust: #ffad8d; --c-proj-rust-ink: #ffad8d; --c-proj-rust-tint: #4b2c20;
    --c-proj-violet: #c8b7ff; --c-proj-violet-ink: #c8b7ff; --c-proj-violet-tint: #37304d;
    --c-proj-green: #9ad78c; --c-proj-green-ink: #9ad78c; --c-proj-green-tint: #273c23;
    --c-proj-rose: #fea6c4; --c-proj-rose-ink: #fea6c4; --c-proj-rose-tint: #4a2a35;
    --c-proj-ochre: #ebbb6e; --c-proj-ochre-ink: #ebbb6e; --c-proj-ochre-tint: #423218;
    --c-proj-slate: #b1c7de; --c-proj-slate-ink: #b1c7de; --c-proj-slate-tint: #2f363e;
    --c-proj-teal: #67d5f5; --c-proj-teal-ink: #67d5f5; --c-proj-teal-tint: #153b46;
  }
}
/* the dark theme's top bar: the same navy bar as light (#05263c) above the darker neutral frame (--c-bar, --c-rail
 * #0f1f2d: band-b), the white logo and avatar of the light bar (dbar-b), the frosted scope tiles (scope-c). Both dark
 * selectors; the media one also undoes the light-only variants (data-tbc, data-topbar: :not([data-theme="dark"]) never
 * matches the explicit dark choice, but it does match the system's dark theme). */
:root[data-theme="dark"] {
  --tb-bg: #05263c;
  --tb-stripe-w: 0px; --tb-stripe: var(--c-scope); --tb-stripe-shelf: var(--c-amber);
  --tb-brand: var(--c-ink);
  --tb-mark-bg: #ffffff; --tb-mark-ink: #05263c; --tb-mark-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  --tb-slash: var(--c-mute);
  --tb-sel-ink: var(--c-ink); --tb-chev: var(--c-ink-3);
  /* the scope tile: the light theme's frosted tile on the bar (scope-c); the dark menu: the same glyphs on a 6% tint */
  --tb-scope-size: 30px; --tb-scope-radius: 7px; --tb-scope-ic: 18px; --tb-scope-ring-w: 1px;
  --tb-scope-mark: rgba(255, 255, 255, 0.09); --tb-scope-mark-shelf: rgba(255, 255, 255, 0.09);
  --tb-scope-mark-ink: #45cfba; --tb-scope-mark-ink-shelf: #ecce83;
  --tb-scope-ring: rgba(255, 255, 255, 0.16); --tb-scope-ring-shelf: rgba(255, 255, 255, 0.16);
  --tb-scope-shadow: 0 0 0 transparent;
  --tb-menu-tile: rgba(255, 255, 255, 0.06); --tb-menu-tile-shelf: var(--c-shelf-tile);
  --tb-menu-tile-line: #3d5870; --tb-menu-tile-line-shelf: var(--c-shelf-tile-line);
  --tb-menu-ic: #45cfba; --tb-menu-ic-shelf: var(--c-shelf-tile-ink);
  --tb-hover: var(--c-frame-hover);
  --tb-focus: var(--c-focus);
  --tb-jump-bg: var(--c-raised); --tb-jump-line: var(--c-line); --tb-jump-ink: var(--c-ink-3); --tb-jump-icon: var(--c-ink-3);
  --tb-jump-shadow: none;
  --tb-jump-hover-bg: var(--c-raised); --tb-jump-hover-line: var(--c-accent-line); --tb-jump-hover-ink: var(--c-ink-2);
  --tb-jump-hover-shadow: none;
  --tb-jump-ph-bg: transparent; --tb-jump-ph-hover-bg: var(--c-frame-hover); --tb-jump-ph-ink: var(--c-ink-3);
  --tb-kbd-bg: var(--c-surface); --tb-kbd-line: var(--c-line); --tb-kbd-ink: var(--c-ink-3);
  --tb-icon: var(--c-ink-3); --tb-icon-hover: var(--c-ink);
  --tb-avatar-bg: #ffffff; --tb-avatar-line: #ffffff; --tb-avatar-ink: #05263c;
  --tb-avatar-hover-line: #ffffff; --tb-avatar-ring: rgba(255, 255, 255, 0.24); --tb-avatar-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  /* My shelf in dark (shelf-tile): the shared tile is the dark scope menu's (a 6% tint, the navy ring, the bar's
   * yellow glyph), on the menu and the empty shelf; the shelf's colour (--cq-sc) is that yellow. The left bar keeps
   * the rail-0 look (`initial`: a 15% pill of the yellow, the yellow edge, no ring) */
  --c-shelf-tile: rgba(255, 255, 255, 0.06); --c-shelf-tile-line: #3d5870; --c-shelf-tile-ink: #ecce83;
  --c-shelf-ink: var(--c-shelf-tile-ink); --c-shelf-glyph: initial; --c-shelf-pill: initial; --c-shelf-pill-ring: initial;
  --c-shelf-bar-ring: initial; --c-shelf-edge: initial; --c-shelf-edge-w: initial; --c-shelf-edge-ring: initial;
  --c-shelf-soft: var(--c-shelf-tile); --c-shelf-soft-ring: inset 0 0 0 1px var(--c-shelf-tile-line); --c-shelf-soft-ink: var(--c-shelf-tile-ink);
  --c-shelf-head-tile: color-mix(in oklab, var(--c-shelf-tile-ink) 14%, var(--c-surface));
  --c-shelf-head-tile-line: color-mix(in oklab, var(--c-shelf-tile-ink) 40%, transparent);
  --c-shelf-count: color-mix(in oklab, var(--c-shelf-tile-ink) 18%, var(--c-surface)); --c-shelf-count-ink: #f0d592;
  --c-shelf-count-ring: inset 0 0 0 1px color-mix(in oklab, var(--c-shelf-tile-ink) 40%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]), :root[data-topbar]:not([data-theme="light"]), :root[data-tbc]:not([data-theme="light"]) {
    --tb-bg: #05263c;
    --tb-stripe-w: 0px; --tb-stripe: var(--c-scope); --tb-stripe-shelf: var(--c-amber);
    --tb-brand: var(--c-ink);
    --tb-mark-bg: #ffffff; --tb-mark-ink: #05263c; --tb-mark-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    --tb-slash: var(--c-mute);
    --tb-sel-ink: var(--c-ink); --tb-chev: var(--c-ink-3);
    /* the scope tile: the light theme's frosted tile on the bar (scope-c); the dark menu: the same glyphs on a 6% tint */
    --tb-scope-size: 30px; --tb-scope-radius: 7px; --tb-scope-ic: 18px; --tb-scope-ring-w: 1px;
    --tb-scope-mark: rgba(255, 255, 255, 0.09); --tb-scope-mark-shelf: rgba(255, 255, 255, 0.09);
    --tb-scope-mark-ink: #45cfba; --tb-scope-mark-ink-shelf: #ecce83;
    --tb-scope-ring: rgba(255, 255, 255, 0.16); --tb-scope-ring-shelf: rgba(255, 255, 255, 0.16);
    --tb-scope-shadow: 0 0 0 transparent;
    --tb-menu-tile: rgba(255, 255, 255, 0.06); --tb-menu-tile-shelf: var(--c-shelf-tile);
    --tb-menu-tile-line: #3d5870; --tb-menu-tile-line-shelf: var(--c-shelf-tile-line);
    --tb-menu-ic: #45cfba; --tb-menu-ic-shelf: var(--c-shelf-tile-ink);
    --tb-hover: var(--c-frame-hover);
    --tb-focus: var(--c-focus);
    --tb-jump-bg: var(--c-raised); --tb-jump-line: var(--c-line); --tb-jump-ink: var(--c-ink-3); --tb-jump-icon: var(--c-ink-3);
    --tb-jump-shadow: none;
    --tb-jump-hover-bg: var(--c-raised); --tb-jump-hover-line: var(--c-accent-line); --tb-jump-hover-ink: var(--c-ink-2);
    --tb-jump-hover-shadow: none;
    --tb-jump-ph-bg: transparent; --tb-jump-ph-hover-bg: var(--c-frame-hover); --tb-jump-ph-ink: var(--c-ink-3);
    --tb-kbd-bg: var(--c-surface); --tb-kbd-line: var(--c-line); --tb-kbd-ink: var(--c-ink-3);
    --tb-icon: var(--c-ink-3); --tb-icon-hover: var(--c-ink);
    --tb-avatar-bg: #ffffff; --tb-avatar-line: #ffffff; --tb-avatar-ink: #05263c;
    --tb-avatar-hover-line: #ffffff; --tb-avatar-ring: rgba(255, 255, 255, 0.24); --tb-avatar-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    /* My shelf in dark (shelf-tile): the shared tile is the dark scope menu's (a 6% tint, the navy ring, the bar's
     * yellow glyph), on the menu and the empty shelf; the shelf's colour (--cq-sc) is that yellow. The left bar keeps
     * the rail-0 look (`initial`: a 15% pill of the yellow, the yellow edge, no ring) */
    --c-shelf-tile: rgba(255, 255, 255, 0.06); --c-shelf-tile-line: #3d5870; --c-shelf-tile-ink: #ecce83;
    --c-shelf-ink: var(--c-shelf-tile-ink); --c-shelf-glyph: initial; --c-shelf-pill: initial; --c-shelf-pill-ring: initial;
    --c-shelf-bar-ring: initial; --c-shelf-edge: initial; --c-shelf-edge-w: initial; --c-shelf-edge-ring: initial;
    --c-shelf-soft: var(--c-shelf-tile); --c-shelf-soft-ring: inset 0 0 0 1px var(--c-shelf-tile-line); --c-shelf-soft-ink: var(--c-shelf-tile-ink);
    --c-shelf-head-tile: color-mix(in oklab, var(--c-shelf-tile-ink) 14%, var(--c-surface));
    --c-shelf-head-tile-line: color-mix(in oklab, var(--c-shelf-tile-ink) 40%, transparent);
    --c-shelf-count: color-mix(in oklab, var(--c-shelf-tile-ink) 18%, var(--c-surface)); --c-shelf-count-ink: #f0d592;
    --c-shelf-count-ring: inset 0 0 0 1px color-mix(in oklab, var(--c-shelf-tile-ink) 40%, transparent);
  }
}
/* top bar contrast "pair" (the alternative to "inverted"): the scope tile filled with the scope colour (Library mint,
 * My shelf amber) with a dark icon, so the scope reads at a glance; the field and the avatar stay white */
:root[data-tbc="pair"]:not([data-theme="dark"]) {
  --tb-scope-mark: #5eead4; --tb-scope-mark-shelf: #fcd34d;
  --tb-scope-mark-ink: #0f4f4a; --tb-scope-mark-ink-shelf: #78350f;
  --tb-menu-tile: #5eead4; --tb-menu-tile-shelf: #fcd34d;
  --tb-menu-tile-line: #45c9b4; --tb-menu-tile-line-shelf: #dbac3e;
  --tb-menu-ic: #0f4f4a; --tb-menu-ic-shelf: #78350f;
}
/* the hero wash off: the tab row and the hero band plain (the sheet's colours) */
:root:root[data-hero="off"]:not([data-theme="dark"]) {
  --c-bar: var(--c-bar-plain);
  --hero-bg: var(--c-surface);
  --hero-glow: linear-gradient(transparent, transparent);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--c-page); color: var(--c-ink-2);
  font-family: var(--f-body); font-size: var(--fs-body); line-height: var(--lh);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--c-accent); text-underline-offset: 2px; }
a:hover { color: var(--c-accent-hover); }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--c-accent-soft); color: var(--c-ink); }
.cq-i { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.cq-i.is-fill { fill: currentColor; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }

/* type helpers */
.cq-display { font-family: var(--f-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); color: var(--c-ink); }
.cq-meta { font-size: var(--fs-sm); color: var(--c-ink-3); }
.cq-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); }
.cq-mono { font-family: var(--f-mono); font-size: var(--fs-sm); }
.cq-num { font-variant-numeric: tabular-nums; }
.cq-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
.cq-nw { white-space: nowrap; }
.cq-skip { position: absolute; left: 8px; top: -80px; z-index: 200; background: var(--c-surface); color: var(--c-ink); padding: 8px 12px; border-radius: var(--r-md); }
.cq-skip:focus { top: 8px; box-shadow: var(--shadow-2); }

/* ---------------------------------------------------------------- buttons */
.cq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--d-ctrl-h); padding: 0 14px;
  border-radius: var(--r-md); border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-ink-2);
  font-size: var(--fs-body); font-weight: 500; line-height: 1.2; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.cq-btn:hover { background: var(--c-hover); color: var(--c-ink); }
.cq-btn > .cq-i { color: var(--c-ink-3); }
.cq-btn:hover > .cq-i { color: inherit; }
.cq-btn.is-primary { background: var(--c-accent-fill); border-color: var(--c-accent-fill); color: var(--c-on-accent); font-weight: 600; }
.cq-btn.is-primary > .cq-i { color: inherit; }
.cq-btn.is-primary:hover { background: var(--c-accent-fill-hover); border-color: var(--c-accent-fill-hover); color: var(--c-on-accent); }
.cq-btn.is-danger { color: var(--c-danger); border-color: var(--c-danger-line); }
.cq-btn.is-danger > .cq-i { color: inherit; }
.cq-btn.is-danger:hover { background: var(--c-danger-soft); color: var(--c-danger); }
.cq-btn.is-danger.is-solid { background: var(--c-danger); border-color: var(--c-danger); color: var(--c-surface); font-weight: 600; }
.cq-btn.is-ghost { background: transparent; border-color: transparent; }
.cq-btn.is-ghost:hover { background: var(--c-hover); }
.cq-btn.is-sm { min-height: 32px; padding: 0 10px; font-size: var(--fs-sm); gap: 6px; }
.cq-btn.is-lg { min-height: 46px; padding: 0 18px; font-size: var(--fs-md); }
.cq-btn.is-icon { padding: 0; width: var(--d-ctrl-h); }
.cq-btn.is-icon.is-sm { width: 32px; }
.cq-btn.is-block { display: flex; width: 100%; }
.cq-btn[disabled], .cq-btn[aria-disabled="true"] { opacity: .62; cursor: not-allowed; }
.cq-btn[disabled]:hover, .cq-btn[aria-disabled="true"]:hover { background: var(--c-surface); color: var(--c-ink-2); }
.cq-btn.is-busy { cursor: progress; }
.cq-btn.is-busy > .cq-i { animation: cq-spin 1s linear infinite; }
.cq-link { background: none; border: 0; padding: 2px 0; font-size: inherit; font-weight: 600; color: var(--c-accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cq-link:hover { color: var(--c-accent-hover); }

/* ---------------------------------------------------------------- inputs and forms */
.cq-input, .cq-select, .cq-textarea {
  min-height: var(--d-ctrl-h); width: 100%; border: 1px solid var(--c-line-strong); background: var(--c-surface); color: var(--c-ink);
  border-radius: var(--r-md); padding: 0 12px; font-size: var(--fs-body);
}
.cq-select { width: auto; padding-right: 8px; cursor: pointer; }
.cq-textarea { padding: 10px 12px; min-height: 96px; line-height: 1.5; resize: vertical; }
.cq-input::placeholder, .cq-textarea::placeholder { color: var(--c-ph); opacity: 1; }   /* example values: muted, never like a value */
.cq-input:focus, .cq-select:focus, .cq-textarea:focus { outline: 2px solid var(--c-focus); outline-offset: 0; border-color: var(--c-focus); }
.cq-input[aria-invalid="true"] { border-color: var(--c-danger); }
.cq-check { width: 18px; height: 18px; accent-color: var(--c-accent-fill); margin: 0; flex-shrink: 0; cursor: pointer; vertical-align: middle; }
.cq-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cq-field + .cq-field { margin-top: 16px; }
.cq-field-l { font-size: var(--fs-body); font-weight: 600; color: var(--c-ink); }
.cq-field-h { font-size: var(--fs-sm); color: var(--c-ink-3); }
.cq-field-e { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--c-danger); font-weight: 500; }
.cq-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.cq-choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: var(--r-md); cursor: pointer; background: var(--c-surface); }
.cq-choice + .cq-choice { margin-top: 8px; }
.cq-choice:hover { background: var(--c-hover); }
.cq-choice:has(input:checked) { background: var(--c-accent-soft); border-color: var(--c-accent-line); }
.cq-choice input { margin-top: 3px; accent-color: var(--c-accent-fill); width: 18px; height: 18px; flex-shrink: 0; }
.cq-choice-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cq-choice-l { font-weight: 600; color: var(--c-ink); }
.cq-choice-d { font-size: var(--fs-sm); color: var(--c-ink-2); }
.cq-choice:has(input:checked) .cq-choice-l { color: var(--c-accent); }
/* underline tabs: the ONE tab / segment component (paper views, review tab, Inbox Uploads | Reports, Browse, Shelf
 * statuses, Settings sections, My uploads filters): flat 40px, no border / background / shadow; the current one is ink
 * 600 with a 2px accent underline. Put the row at the bottom of a head whose bottom hairline it sits on (the underline
 * stays inside the row's box, so the row can scroll sideways on a phone), or give the row its own hairline with
 * .is-bar (an inset 1px line the underline covers). Counts: plain muted numbers. (ui.utabs; ui.seg is its old name.) */
.cq-utabs { --utab-drop: 0px; display: flex; align-items: stretch; gap: 0 22px; min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.cq-utabs::-webkit-scrollbar { display: none; }
/* a row that scrolls sideways fades on the side where more tabs are (app.js CQ.utabs: .is-fl / .is-fr) */
.cq-utabs.is-fl, .cq-utabs.is-fr {
  --fl: 0px; --fr: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, black var(--fl), black calc(100% - var(--fr)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, black var(--fl), black calc(100% - var(--fr)), transparent 100%);
}
.cq-utabs.is-fl { --fl: 32px; }
.cq-utabs.is-fr { --fr: 32px; }
.cq-utabs.is-bar { box-shadow: inset 0 -1px 0 var(--c-line); }
.cq-utabs.is-tight { gap: 0 16px; }
.cq-utab{
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 1px; margin: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--c-ink-2); font: 500 14px/1 var(--f-body); white-space: nowrap; text-decoration: none; cursor: pointer; flex-shrink: 0;
}
.cq-utab:hover { color: var(--c-ink); }
.cq-utab > .cq-i { color: var(--c-ink-3); }
.cq-utab::after { content: ""; position: absolute; left: 0; right: 0; bottom: var(--utab-drop); height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.cq-utab:hover::after { background: var(--c-line); }
.cq-utab[aria-current="page"], .cq-utab[aria-current="true"], .cq-utab[aria-pressed="true"], .cq-utab[aria-selected="true"], .cq-utab.is-on { color: var(--c-ink); font-weight: 600; }
.cq-utab[aria-current="page"]::after, .cq-utab[aria-current="true"]::after, .cq-utab[aria-pressed="true"]::after, .cq-utab[aria-selected="true"]::after, .cq-utab.is-on::after { background: var(--c-struct); }
.cq-utab[aria-current="page"] > .cq-i, .cq-utab.is-on > .cq-i, .cq-utab[aria-pressed="true"] > .cq-i, .cq-utab[aria-selected="true"] > .cq-i { color: var(--c-struct); }
.cq-utab:focus-visible { outline-offset: -2px; }
.cq-utab-n { font-size: var(--fs-sm); font-weight: 500; color: var(--c-ink-3); font-variant-numeric: tabular-nums; }

/* ghost text menu ("Sort: Newest ▾", like the filter sentence's menus): details.cq-dd.cq-gm > summary.cq-gm-s */
/* 34 px tall in every area, as the "?" beside it (L2 audit A16: 32 px in the Library, 34 px elsewhere) */
.cq-gm-s { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 8px; border-radius: var(--r-md); color: var(--c-ink-2); font-size: var(--fs-body); white-space: nowrap; }
.cq-gm-s:hover, .cq-gm[open] > .cq-gm-s { background: var(--c-hover); color: var(--c-ink); }
.cq-gm-p { color: var(--c-ink-3); }
.cq-gm-v { font-weight: 600; color: var(--c-ink); }
.cq-gm-s > .cq-i { color: var(--c-ink-3); transition: transform .15s ease; }
.cq-gm[open] > .cq-gm-s > .cq-i { transform: rotate(180deg); }

/* notices (inline messages) */
.cq-note { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--c-info-line); background: var(--c-info-soft); color: var(--c-ink); font-size: var(--fs-body); line-height: 1.45; }
.cq-note > .cq-i { color: var(--c-info); margin-top: 1px; }
.cq-note.is-ok { border-color: var(--c-ok-line); background: var(--c-ok-soft); }
.cq-note.is-ok > .cq-i { color: var(--c-ok); }
.cq-note.is-warn { border-color: var(--c-warn-line); background: var(--c-warn-soft); }
.cq-note.is-warn > .cq-i { color: var(--c-warn); }
.cq-note.is-error { border-color: var(--c-danger-line); background: var(--c-danger-soft); }
.cq-note.is-error > .cq-i { color: var(--c-danger); }

/* keys */
.cq-kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px;
  font-family: var(--f-body); font-size: var(--fs-xs); font-weight: 600; color: var(--c-ink-3); background: var(--c-surface);
  border: 1px solid var(--c-line); border-bottom-width: 2px; border-radius: 5px; line-height: 1; vertical-align: middle;
}
.cq-kbd + .cq-kbd { margin-left: 3px; }

/* chips and badges */
.cq-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--c-line);
  background: var(--c-surface); color: var(--c-ink-2); font-size: var(--fs-sm); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.cq-chip:hover { background: var(--c-hover); color: var(--c-ink); }
.cq-chip[aria-pressed="true"], .cq-chip.is-on { background: var(--c-accent-soft); border-color: var(--c-accent-line); color: var(--c-accent); font-weight: 600; }
.cq-chip .cq-count { font-size: var(--fs-xs); color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.cq-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
  white-space: nowrap; border: 1px solid var(--c-line); color: var(--c-ink-2); background: var(--c-surface-2); line-height: 1;
}
.cq-badge.is-ok { color: var(--c-ok); background: var(--c-ok-soft); border-color: var(--c-ok-line); }
.cq-badge.is-warn { color: var(--c-warn); background: var(--c-warn-soft); border-color: var(--c-warn-line); }
.cq-badge.is-danger { color: var(--c-danger); background: var(--c-danger-soft); border-color: var(--c-danger-line); }
.cq-badge.is-info { color: var(--c-info); background: var(--c-info-soft); border-color: var(--c-info-line); }
.cq-badge.is-accent { color: var(--c-accent); background: var(--c-accent-soft); border-color: var(--c-accent-line); }
.cq-badge.is-dash { border-style: dashed; background: transparent; }
.cq-badge.is-count { min-width: 22px; justify-content: center; padding: 0 6px; }

/* tooltip: any element with data-tip shows it on hover and keyboard focus */
[data-tip] { position: relative; }
@media (hover: hover) {
  [data-tip]:hover::after, [data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); z-index: 90; pointer-events: none;
    background: var(--c-tooltip-bg); color: var(--c-tooltip-ink); font: 500 var(--fs-sm)/1.3 var(--f-body); letter-spacing: 0; text-transform: none;
    padding: 6px 10px; border-radius: var(--r-sm); white-space: nowrap; box-shadow: var(--shadow-2);
  }
  [data-tip][data-tip-pos="right"]:hover::after, [data-tip][data-tip-pos="right"]:focus-visible::after { left: calc(100% + 10px); top: 50%; transform: translateY(-50%); }
  [data-tip][data-tip-pos="left"]:hover::after, [data-tip][data-tip-pos="left"]:focus-visible::after { left: auto; right: 0; transform: none; }
  /* a menu's button says nothing while its menu is open: the tip would cover the menu (runA4 V4) */
  details[open] > summary[data-tip]::after { content: none !important; }
}

/* ---------------------------------------------------------------- popovers and menus (details.cq-dd > summary + .cq-pop) */
.cq-dd { position: relative; display: inline-flex; }
.cq-pop {
  position: absolute; z-index: 70; top: calc(100% + 6px); left: 0; min-width: 220px; max-width: min(380px, calc(100vw - 24px));
  background: var(--c-raised); color: var(--c-ink-2); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  padding: 6px; text-align: left; font-size: var(--fs-body); font-weight: 400; letter-spacing: 0; text-transform: none; white-space: normal;
}
.cq-pop.is-right { left: auto; right: 0; }
.cq-pop.is-up { top: auto; bottom: calc(100% + 6px); }
/* beside its button in a panel that scrolls (app.js placeSide): fixed, so the panel never clips it; shown once placed */
.cq-js .cq-pop.is-side { position: fixed; top: 0; left: 0; visibility: hidden; }
.cq-js .cq-pop.is-side.is-placed { visibility: visible; }
.cq-pop-h { padding: 8px 10px 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); }
.cq-pop-sep { height: 1px; margin: 6px 4px; background: var(--c-line-soft); border: 0; }
.cq-pop-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 6px 8px 8px; }
.cq-pop-form .cq-field { flex: 1 1 90px; }
.cq-pop-form .cq-field + .cq-field { margin-top: 0; }
.cq-menu { display: flex; flex-direction: column; gap: 2px; }
.cq-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--c-ink-2); font-size: var(--fs-body); text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.cq-menu-item:hover, .cq-menu-item:focus-visible { background: var(--c-hover-raised); color: var(--c-ink); }
.cq-menu-item:focus-visible { outline-offset: -2px; }
.cq-menu-item > .cq-i { color: var(--c-ink-3); }
.cq-menu-item[aria-current="true"], .cq-menu-item[aria-checked="true"], .cq-menu-item.is-on { color: var(--c-ink); font-weight: 600; }
.cq-menu-item[aria-current="true"] > .cq-i:last-child, .cq-menu-item[aria-checked="true"] > .cq-i:last-child, .cq-menu-item.is-on > .cq-i:last-child { color: var(--c-accent); }
.cq-menu-item.is-danger { color: var(--c-danger); }
.cq-menu-item.is-danger > .cq-i { color: inherit; }
.cq-menu-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* filter options (long venue names): wrap instead of cutting them to the same start (m16) */
.cq-fs .cq-menu-item { white-space: normal; }
.cq-fs .cq-menu-item > .cq-menu-l { overflow: visible; overflow-wrap: anywhere; padding: 6px 0; line-height: 1.3; }
.cq-menu-n { font-size: var(--fs-sm); color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.cq-menu-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st, var(--c-ink-3)); flex-shrink: 0; }

/* ---------------------------------------------------------------- app shell */
.cq-app { --cq-sc: var(--c-scope); height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; overflow: clip; background: var(--c-page); }
/* clip, not hidden: the shell never scrolls, not even programmatically (a #hash or scrollIntoView inside the
 * inspector or the list moved the whole app up under the top bar; polish fix F3) */
.cq-app[data-scope="shelf"] { --cq-sc: var(--c-shelf-ink, var(--c-amber)); }
/* inside a project: its tone (shell.html), the one recipe (tokens above): the top bar's mark is the dark pair's
 * tint with the ink glyph and ring on the navy bar in both themes */
.cq-app.is-proj { --cq-sc: var(--pc-ink); --tb-proj-mark: var(--pc-nav-tint); --tb-proj-ink: var(--pc-nav);
  --tb-proj-ring: color-mix(in srgb, var(--pc-nav) 32%, transparent); }

/* top bar: brand, ONE scope selector, jump, theme, avatar; the scope stripe. Colours: the --tb-* tokens only (a dark
 * top bar is a token block); its menus (.cq-pop) keep the raised-surface tokens. */
.cq-top {
  position: relative; z-index: 60; height: var(--d-topbar-h); flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 16px;
  background: var(--tb-bg); border-bottom: var(--tb-stripe-w) solid var(--tb-stripe); min-width: 0;
  box-shadow: 0 1px 0 rgba(5, 30, 50, .20), 0 2px 8px rgba(5, 30, 50, .10);   /* no line under the bar: a soft shadow (stripe-d) */
}
:root[data-theme="dark"] .cq-top { box-shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .25); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cq-top { box-shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .25); }
}
.cq-app[data-scope="shelf"] .cq-top { border-bottom-color: var(--tb-stripe-shelf); }
.cq-top-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tb-brand); flex-shrink: 0; border-radius: var(--r-md); }
.cq-top-brand:hover { color: var(--tb-brand); }
.cq-top-brand:focus-visible, .cq-top .cq-jump:focus-visible, .cq-top .cq-top-icon:focus-visible, .cq-top summary.cq-avatar:focus-visible { outline-color: var(--tb-focus); }
.cq-top-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--tb-mark-bg); color: var(--tb-mark-ink); box-shadow: var(--tb-mark-shadow); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cq-top-mark .cq-i { stroke-width: 1.9; }
.cq-top-word { font-family: var(--f-display); font-size: calc(22px * var(--display-scale) / 1.12 + 1px); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1; color: var(--tb-brand); }
/* the bar's three parts (shell.html): the brand and the scope selector | the Jump field | the tools. Wider than a phone
 * they are a grid whose outer columns share the room equally, so the field sits at the bar's centre, at the same x in
 * the Library, My shelf and every project (L2 audit T17: it was centred in the room after the scope name and moved by
 * up to 50 px); the scope name gives way first (ends with …) and never reaches the field. The field is 340 px wide,
 * 300 px from 900 to 1099 px, 220 px under 900 px; the brand's word goes under 1000 px; under 900 px Feedback is its
 * icon and the key hint only "K" (the T17 drawing at 768). The phone keeps its flex row (a search icon). */
.cq-top-start { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cq-top-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; }
.cq-top-left > .cq-dd { min-width: 0; }
.cq-top-center { flex: 1 1 0%; min-width: 0; display: flex; align-items: center; justify-content: center; }
.cq-top-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }
@media (min-width: 761px) {
  .cq-top { --tb-jump-w: 340px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--tb-jump-w)) minmax(0, 1fr); padding: 0 16px; }
  .cq-top-right { justify-self: end; min-width: 0; margin-left: 0; }
}
@media (min-width: 761px) and (max-width: 1099px) { .cq-top { --tb-jump-w: 300px; } }
@media (min-width: 761px) and (max-width: 999px) {
  .cq-top .cq-top-word, .cq-top .cq-sc-slash { display: none; }
}
@media (min-width: 761px) and (max-width: 899px) {
  .cq-top { --tb-jump-w: 220px; }
  .cq-top .cq-jump-keys > [data-mod] { display: none; }
  /* Feedback: its icon; the word stays its name for screen readers */
  .cq-top .cq-top-right .cq-fb-top { position: relative; width: 34px; padding: 0; justify-content: center; box-shadow: none; }
  .cq-top .cq-top-right .cq-fb-top > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.cq-top .cq-top-icon { color: var(--tb-icon); }
.cq-top .cq-top-icon:hover { color: var(--tb-icon-hover); background: var(--tb-hover); }
.cq-top-icon > .cq-i { color: inherit; }
.cq-top .cq-sc-slash { color: var(--tb-slash); font-size: 22px; font-weight: 300; margin: 0 -2px 0 -6px; }
/* scope selector: mark + name + chevron, no box at rest, on hover or open (a tint behind the name only) */
/* the scope tile: the logo tile's sibling (same size and radius), the scope's icon in its colour */
.cq-top .cq-sc-mark { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1;
  width: var(--tb-scope-size); height: var(--tb-scope-size); border-radius: var(--tb-scope-radius);
  background: var(--tb-scope-mark); color: var(--tb-scope-mark-ink); box-shadow: inset 0 0 0 var(--tb-scope-ring-w) var(--tb-scope-ring), var(--tb-scope-shadow); }
.cq-top .cq-sc-mark.is-shelf { background: var(--tb-scope-mark-shelf); color: var(--tb-scope-mark-ink-shelf); box-shadow: inset 0 0 0 var(--tb-scope-ring-w) var(--tb-scope-ring-shelf), var(--tb-scope-shadow); }
.cq-top .cq-sc-mark .cq-i { width: var(--tb-scope-ic); height: var(--tb-scope-ic); stroke-width: 1.9; }
.cq-top .cq-sc-sel { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: min(340px, 100%); height: 38px; padding: 0 0 0 2px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--tb-sel-ink); font-size: var(--fs-md); font-weight: 600; white-space: nowrap; }
.cq-sc-sel-l { display: inline-flex; align-items: center; gap: 4px; min-width: 0; height: 32px; padding: 0 6px 0 8px; border-radius: var(--r-md); }
.cq-top .cq-sc-sel:hover .cq-sc-sel-l, .cq-top .cq-dd[open] > .cq-sc-sel .cq-sc-sel-l { background: var(--tb-hover); }
.cq-sc-sel:focus-visible { outline: none; }
.cq-top .cq-sc-sel:focus-visible .cq-sc-sel-l { outline: 2px solid var(--tb-focus); outline-offset: 0; }
.cq-sc-sel-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cq-top .cq-sc-chev { color: var(--tb-chev); transition: transform .15s ease; }
.cq-dd[open] > .cq-sc-sel .cq-sc-chev { transform: rotate(180deg); }
.cq-sc-menu { width: 300px; padding: 6px; }
.cq-sc-row { --cq-mc: var(--c-scope); display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 10px; border-radius: var(--r-md); color: var(--c-ink-2); text-decoration: none; }
.cq-sc-row.is-shelf { --cq-mc: var(--c-shelf-ink, var(--c-amber)); }
.cq-sc-row:hover, .cq-sc-row:focus-visible { background: var(--c-hover-raised); color: var(--c-ink-2); }
.cq-sc-row:focus-visible { outline-offset: -2px; }
.cq-sc-ic { display: inline-flex; flex-shrink: 0; color: var(--cq-mc); }
/* the scope menu shows the tiles of the bar, so each row says which tile it puts there */
.cq-top .cq-sc-menu .cq-sc-ic { width: 30px; height: 30px; border-radius: 7px; align-items: center; justify-content: center;
  background: var(--tb-menu-tile); color: var(--tb-menu-ic); box-shadow: inset 0 0 0 var(--tb-scope-ring-w) var(--tb-menu-tile-line); }
.cq-top .cq-sc-menu .cq-sc-row.is-shelf .cq-sc-ic { background: var(--tb-menu-tile-shelf); color: var(--tb-menu-ic-shelf); box-shadow: inset 0 0 0 var(--tb-scope-ring-w) var(--tb-menu-tile-line-shelf); }
.cq-top .cq-sc-menu .cq-sc-ic .cq-i { stroke-width: 1.9; }
.cq-sc-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cq-sc-row-nm { color: var(--c-ink); font-weight: 500; }
.cq-sc-row[aria-current="page"] .cq-sc-row-nm { font-weight: 600; }
.cq-sc-row-sub { font-size: var(--fs-sm); color: var(--c-ink-3); }
.cq-sc-row-ok { display: inline-flex; width: 16px; flex-shrink: 0; color: var(--cq-mc); }
.cq-sc-keep { margin: 6px -6px -6px; padding: 9px 16px; border-top: 1px solid var(--c-line-soft); font-size: var(--fs-xs); color: var(--c-ink-3); }
/* Projects in the scope menu (Projects v1): the heading "PROJECTS · N active", a filter above 6 (projects.js), each
 * project's tile, a "Shared" badge, the "new" dot until opened; "+ New project" and "All projects…". The rows scroll
 * when there are many. */
.cq-pc-blue { --pc: var(--c-proj-blue); --pc-ink: var(--c-proj-blue-ink); --pc-tint: var(--c-proj-blue-tint); --pc-nav: var(--c-proj-blue-nav); --pc-nav-tint: var(--c-proj-blue-nav-tint); }
.cq-pc-rust { --pc: var(--c-proj-rust); --pc-ink: var(--c-proj-rust-ink); --pc-tint: var(--c-proj-rust-tint); --pc-nav: var(--c-proj-rust-nav); --pc-nav-tint: var(--c-proj-rust-nav-tint); }
.cq-pc-violet { --pc: var(--c-proj-violet); --pc-ink: var(--c-proj-violet-ink); --pc-tint: var(--c-proj-violet-tint); --pc-nav: var(--c-proj-violet-nav); --pc-nav-tint: var(--c-proj-violet-nav-tint); }
.cq-pc-green { --pc: var(--c-proj-green); --pc-ink: var(--c-proj-green-ink); --pc-tint: var(--c-proj-green-tint); --pc-nav: var(--c-proj-green-nav); --pc-nav-tint: var(--c-proj-green-nav-tint); }
.cq-pc-rose { --pc: var(--c-proj-rose); --pc-ink: var(--c-proj-rose-ink); --pc-tint: var(--c-proj-rose-tint); --pc-nav: var(--c-proj-rose-nav); --pc-nav-tint: var(--c-proj-rose-nav-tint); }
.cq-pc-ochre { --pc: var(--c-proj-ochre); --pc-ink: var(--c-proj-ochre-ink); --pc-tint: var(--c-proj-ochre-tint); --pc-nav: var(--c-proj-ochre-nav); --pc-nav-tint: var(--c-proj-ochre-nav-tint); }
.cq-pc-slate { --pc: var(--c-proj-slate); --pc-ink: var(--c-proj-slate-ink); --pc-tint: var(--c-proj-slate-tint); --pc-nav: var(--c-proj-slate-nav); --pc-nav-tint: var(--c-proj-slate-nav-tint); }
.cq-pc-teal { --pc: var(--c-proj-teal); --pc-ink: var(--c-proj-teal-ink); --pc-tint: var(--c-proj-teal-tint); --pc-nav: var(--c-proj-teal-nav); --pc-nav-tint: var(--c-proj-teal-nav-tint); }
.cq-pc-blue, .cq-pc-rust, .cq-pc-violet, .cq-pc-green, .cq-pc-rose, .cq-pc-ochre, .cq-pc-slate, .cq-pc-teal {
  --pc-ring: color-mix(in srgb, var(--pc-ink) 30%, transparent); }
.cq-top .cq-sc-mark.is-proj { background: var(--tb-proj-mark); color: var(--tb-proj-ink); box-shadow: inset 0 0 0 1px var(--tb-proj-ring), var(--tb-scope-shadow); }
.cq-top .cq-sc-mark.is-ini { font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.cq-top .cq-sc-shared { color: var(--tb-chev); flex-shrink: 0; }
.cq-sc-menu { width: 340px; max-width: calc(100vw - 24px); }
.cq-sc-ph { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 10px 4px; }
.cq-sc-ph-n { font-size: var(--fs-xs); color: var(--c-ink-3); }
.cq-sc-find { display: flex; align-items: center; gap: 6px; margin: 2px 4px 4px; padding: 0 8px; border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); color: var(--c-ink-3); }
.cq-sc-find[hidden] { display: none; }
.cq-sc-find:focus-within { border-color: var(--c-focus); box-shadow: 0 0 0 1px var(--c-focus); }
.cq-sc-find .cq-input { border: 0; box-shadow: none; background: transparent; height: 34px; padding: 0; min-width: 0; flex: 1; }
.cq-sc-find .cq-input:focus { outline: none; }
.cq-sc-projects { max-height: min(46vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.cq-sc-row.is-proj { min-height: 48px; }
.cq-top .cq-sc-menu .cq-sc-ic.is-proj { background: none; box-shadow: none; width: auto; height: auto; }
.cq-sc-row-nm { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cq-sc-row-nmt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cq-sc-row.is-proj .cq-sc-row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cq-sc-badge { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; padding: 0 6px; border-radius: 999px; background: var(--c-info-soft); color: var(--c-info); font-size: 11px; font-weight: 600; line-height: 18px; }
.cq-sc-new { width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); flex-shrink: 0; box-shadow: 0 0 0 2px var(--c-raised); }
.cq-sc-none { padding: 8px 12px; font-size: var(--fs-sm); color: var(--c-ink-3); }
.cq-sc-act { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 4px 12px; border-radius: var(--r-md); color: var(--c-ink-2); text-decoration: none; font-weight: 500; }
.cq-sc-act:hover, .cq-sc-act:focus-visible { background: var(--c-hover-raised); color: var(--c-ink); }
.cq-sc-act:focus-visible { outline-offset: -2px; }
.cq-sc-act.is-new { color: var(--c-accent); }
.cq-sc-act .cq-i { flex-shrink: 0; }
.cq-sc-act-n { margin-left: auto; font-size: var(--fs-xs); font-weight: 400; color: var(--c-ink-3); }
/* a long project name on a phone: it gives way (ends with …) so the jump button keeps its place */
@media (max-width: 760px) {
  .cq-top-left { flex-shrink: 1; min-width: 0; }
  .cq-top .cq-sc-sel-nm { max-width: calc(100vw - 210px); }
  /* the scope menu on a phone: it fills the screen down to the bottom bar, its project list takes the room that is
     left and scrolls (its last row cut, with a line under it), so "+ New project" and "All projects…" stay in view */
  .cq-top .cq-pop.cq-sc-menu { display: flex; flex-direction: column; overflow: hidden;
    max-height: calc(100dvh - var(--d-topbar-h) - var(--h-bottombar) - 12px); }
  .cq-sc-menu > * { flex-shrink: 0; }
  .cq-sc-menu > .cq-sc-projects { flex: 0 1 auto; min-height: 0; max-height: none; border-bottom: 1px solid var(--c-line-soft); margin-bottom: 4px; }
  .cq-sc-menu.has-inv { overflow-y: auto; }
  .cq-sc-menu.has-inv > .cq-sc-projects { flex: none; max-height: 40vh; }
}
.cq-top .cq-jump {
  display: inline-flex; align-items: center; gap: 8px; width: 100%; max-width: 340px; min-width: 0; height: var(--d-ctrl-h); padding: 0 6px 0 12px;
  border: 1px solid var(--tb-jump-line); border-radius: var(--r-md); background: var(--tb-jump-bg); color: var(--tb-jump-ink); font-size: var(--fs-body); cursor: pointer; text-align: left;
}
.cq-top .cq-jump { box-shadow: var(--tb-jump-shadow); transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease; }
.cq-top .cq-jump > .cq-i { color: var(--tb-jump-icon); }
.cq-top .cq-jump:hover { background: var(--tb-jump-hover-bg); border-color: var(--tb-jump-hover-line); color: var(--tb-jump-hover-ink); box-shadow: var(--tb-jump-hover-shadow); }
.cq-top .cq-jump .cq-kbd { background: var(--tb-kbd-bg); border-color: var(--tb-kbd-line); color: var(--tb-kbd-ink); }
.cq-jump > .cq-i { flex-shrink: 0; }
.cq-jump-t { flex: 1 1 0%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cq-jump-keys { display: inline-flex; flex-shrink: 0; }
.cq-avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--c-accent-line); background: var(--c-accent-soft); color: var(--c-accent);
  font-size: var(--fs-sm); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; letter-spacing: .02em;
}
.cq-top summary.cq-avatar { background: var(--tb-avatar-bg); border-color: var(--tb-avatar-line); color: var(--tb-avatar-ink); box-shadow: var(--tb-avatar-shadow); }
.cq-top summary.cq-avatar:hover, .cq-top .cq-dd[open] > summary.cq-avatar { border-color: var(--tb-avatar-hover-line); box-shadow: 0 0 0 3px var(--tb-avatar-ring); }
.cq-user-menu { width: 270px; }
.cq-user-head .cq-avatar { background: var(--c-sel); border-color: var(--c-line); color: var(--c-struct); }
.cq-user-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--c-line-soft); margin-bottom: 6px; }
.cq-user-who { display: flex; flex-direction: column; min-width: 0; }
.cq-user-name { font-size: var(--fs-md); font-weight: 600; color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cq-user-sub { font-size: var(--fs-sm); color: var(--c-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cq-user-menu form { margin: 0; }
.cq-user-menu .cq-menu-item > .cq-kbd { margin-left: auto; }
/* theme toggle shows the icon of the theme you switch TO */
.cq-theme-btn .cq-ic-sun { display: none; }
:root[data-theme="dark"] .cq-theme-btn .cq-ic-sun { display: inline-block; }
:root[data-theme="dark"] .cq-theme-btn .cq-ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cq-theme-btn .cq-ic-sun { display: inline-block; }
  :root:not([data-theme="light"]) .cq-theme-btn .cq-ic-moon { display: none; }
}

/* body: activity bar (full height) | work area (tab row, then main | inspector) */
/* a time-limited account's last 14 days: one line under the top bar (shell.html access_ends) */
.cq-access-end { flex: none; display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 16px; border-bottom: 1px solid var(--c-warn-line); background: var(--c-warn-soft); color: var(--c-ink); font-size: var(--fs-sm); line-height: 1.4; }
.cq-access-end > .cq-i { flex: none; color: var(--c-warn); }
.cq-body { flex: 1; display: flex; min-height: 0; position: relative; }
.cq-work { flex: 1 1 0%; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.cq-work-in { flex: 1 1 0%; display: flex; min-height: 0; position: relative; }
.cq-main { flex: 1; min-width: 0; overflow: auto; display: flex; flex-direction: column; outline: none; position: relative; background: var(--c-surface); }
.cq-main:focus-visible { outline: none; }

/* tab row: the open papers of this scope, from the work area's left edge. A tab is its short label in the user's style
 * (Settings › Tab labels: the author and year .cq-tab-l, never cut, and/or the short title .cq-tab-t, which ends with
 * an ellipsis at 170px beside the author and year, 190px alone, so the row's natural width stays sane), the
 * close button in its own slot; the active tab joins the sheet below (sheet background, no bottom line). Too many: the
 * strip scrolls sideways with fading edges and "N more" (app.js).
 * Polish 3 B4 "Outlined tabs" (Jan's pick 2026-11-11): every tab has the same 1 px top-rounded outline, 4 px apart; an
 * inactive one is see-through with the stronger ring (--tab-ring) and fills on hover, the open one is the sheet's
 * white (dark: the sheet's) with the --c-line ring. The ring colours are local to the tab row (the mockup's --divider).
 * The open tab joins the page like a sheet (polish 3 fix 1, Jan 2026-11-11 "still has a bottom line"): the row's line
 * is the row's inset shadow and the tab only paints over it, so at a fractional device scale (a zoomed or scaled
 * display, e.g. 1.25, 1.75) a device-pixel sliver of it showed under the open tab. The strip now reaches 1 px into the
 * page (margin-bottom: -1px), an inactive tab still ends on the row's line (margin-bottom: 1px), and the open one runs
 * that 1 px further down in the sheet's colour (its content box as tall as the others: the label stays put), its foot
 * painted over its side rings (no spur below the line), so the line is cut under it at every scale. */
.cq-tabs { --tab-ring: #c3cdd5; }
:root[data-theme="dark"] .cq-tabs { --tab-ring: #3e5870; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cq-tabs { --tab-ring: #3e5870; } }
.cq-tabs {
  flex-shrink: 0; display: flex; align-items: stretch; min-width: 0; height: calc(var(--d-tab-h) + 4px); padding: 0 4px 0 6px;
  background: var(--c-bar); box-shadow: inset 0 -1px 0 var(--c-line); position: relative; z-index: 20;
}
.cq-tabs:not(:has(.cq-tab)) { display: none; }   /* no paper open: no empty band, the page starts under the bar (band-b) */
.cq-tabs-strip {
  --fl: 0px; --fr: 0px; flex: 1 1 0%; min-width: 0; margin-bottom: -1px; display: flex; align-items: flex-end; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(to right, transparent 0, black var(--fl), black calc(100% - var(--fr)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, black var(--fl), black calc(100% - var(--fr)), transparent 100%);
}
.cq-tabs-strip::-webkit-scrollbar { display: none; }
.cq-tabs-strip.is-fl { --fl: 28px; }
.cq-tabs-strip.is-fr { --fr: 28px; }
.cq-tab.is-out { visibility: hidden; }        /* in "N more": not a clipped half beside it (app.js fitTabs) */
.cq-tab {
  position: relative; flex: 0 0 auto; max-width: 240px; height: calc(100% - 7px); margin-bottom: 1px; display: inline-flex; align-items: center;
  border-radius: var(--r-md) var(--r-md) 0 0; color: var(--c-ink-2); background: transparent;
  box-shadow: inset 1px 0 0 var(--tab-ring), inset -1px 0 0 var(--tab-ring), inset 0 1px 0 var(--tab-ring);
}
.cq-tab + .cq-tab { margin-left: 4px; }
.cq-tab:hover { background: var(--c-frame-hover); color: var(--c-ink); }
.cq-tab.is-active { height: calc(100% - 6px); margin-bottom: 0; padding-bottom: 1px; background: var(--c-surface); color: var(--c-ink); box-shadow: inset 0 -1px 0 var(--c-surface), inset 1px 0 0 var(--c-line), inset -1px 0 0 var(--c-line), inset 0 1px 0 var(--c-line); z-index: 1; }
.cq-tab-a { flex: 0 0 auto; height: 100%; display: inline-flex; align-items: center; gap: 7px; padding: 0 2px 0 12px; color: inherit; text-decoration: none; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; border-radius: var(--r-md) var(--r-md) 0 0; }
.cq-tab-a:hover { color: inherit; }
.cq-tab.is-active .cq-tab-a { font-weight: 600; }
.cq-tab-a > .cq-i { color: var(--c-ink-3); }
.cq-tab.is-active .cq-tab-a > .cq-i { color: var(--cq-sc); }
.cq-tab-l { flex: 0 0 auto; white-space: nowrap; }
.cq-tab.is-titled { max-width: 340px; }
.cq-tab.is-titled .cq-tab-a { flex: 0 1 auto; min-width: 0; }
.cq-tab-sep { flex: 0 0 auto; margin: 0 -3px; color: var(--c-ink-3); font-weight: 500; }
.cq-tab-t { flex: 0 1 auto; min-width: 0; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cq-tab-sep + .cq-tab-t { max-width: 170px; color: var(--c-ink-3); font-weight: 500; }
.cq-tab.is-active .cq-tab-sep + .cq-tab-t { color: var(--c-ink-2); }
.cq-tab.is-visiting .cq-tab-l, .cq-tab.is-visiting .cq-tab-t { font-style: italic; }
.cq-tab-keep, .cq-tab-x {
  flex-shrink: 0; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0;
  border-radius: 5px; background: transparent; color: var(--c-ink-3); cursor: pointer;
}
.cq-tab-x { margin: 0 6px 0 2px; opacity: 0; }
.cq-tab.is-active .cq-tab-x, .cq-tab:hover .cq-tab-x, .cq-tab:focus-within .cq-tab-x { opacity: 1; }
.cq-tab-keep:hover, .cq-tab-x:hover { background: var(--c-frame-hover); color: var(--c-ink); }
.cq-tabs :focus-visible { outline-offset: -2px; }
.cq-tabs-more { flex-shrink: 0; align-self: center; margin-left: 4px; }
.cq-tabs-more-s { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px 0 8px; border-radius: var(--r-md); color: var(--c-ink-3); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.cq-tabs-more-s:hover, .cq-tabs-more[open] > .cq-tabs-more-s { background: var(--c-frame-hover); color: var(--c-ink); }
.cq-tabs-more-pop { width: 320px; }
.cq-tabs-more-pop .cq-menu-item { gap: 10px; }
.cq-tabs-more-pop .cq-menu-l { flex: 0 0 auto; overflow: visible; }
.cq-tabs-more-pop .cq-menu-n { flex: 1 1 0%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
/* a tooltip that floats above everything (app.js: [data-tipf], used where a CSS tooltip would be clipped) */
.cq-ftip {
  position: fixed; z-index: 96; max-width: 340px; padding: 7px 10px; border-radius: var(--r-sm); pointer-events: none; white-space: pre-line;
  background: var(--c-tooltip-bg); color: var(--c-tooltip-ink); font: 500 var(--fs-sm)/1.35 var(--f-body); box-shadow: var(--shadow-2);
}
.cq-ftip::first-line { font-weight: 600; }

/* activity bar (DEFAULT, 64px): icon in a pill with a one-line label under it; the current tool = a 3px bar in the
 * scope colour at the edge + a tinted pill; badges on the icon. No hover expansion. */
.cq-act { position: relative; z-index: 30; flex: 0 0 var(--w-act); width: var(--w-act); background: var(--c-rail); border-right: 1px solid var(--c-line); }
.cq-act-in { height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 10px 0 8px; overflow: hidden auto; scrollbar-width: none; }
.cq-act-grp { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 0 4px; }
.cq-act-div { height: 1px; border: 0; margin: 0 0 8px; background: var(--c-line); flex-shrink: 0; }
.cq-act-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; padding: 2px 0 4px;
  border: 0; background: transparent; cursor: pointer; color: var(--c-ink-3); border-radius: var(--r-md); text-decoration: none;
}
.cq-act-ic { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 30px; border-radius: 999px; transition: background-color .12s; }
.cq-act-btn:hover { color: var(--c-ink); }
.cq-act-btn:hover .cq-act-ic { background: var(--c-frame-hover); }
.cq-act-btn:focus-visible { outline-offset: -2px; }
.cq-act-btn[aria-current="page"] { color: var(--cq-sc); }
.cq-act-btn[aria-current="page"] .cq-act-ic { background: color-mix(in srgb, var(--cq-sc) 15%, var(--c-rail)); }
.cq-act-btn[aria-current="page"]::before { content: ""; position: absolute; left: -4px; top: 2px; height: 30px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cq-sc); }
/* a project's current item: the tile's recipe (tint, ink glyph, a ring of the ink), the edge in the ink */
.cq-app.is-proj .cq-act-btn[aria-current="page"] .cq-act-ic { background: var(--pc-tint); box-shadow: inset 0 0 0 1px var(--pc-ring); color: var(--pc-ink); }
/* My shelf's current item: the --c-shelf-* tokens (light: the shelf tile, shelf-tile), else (dark: `initial`) the
 * Library's recipe in --cq-sc (the bar's yellow).
 * Specificity 0,4,0: the pill holds on hover too. */
.cq-app[data-scope="shelf"] .cq-act-btn[aria-current="page"] .cq-act-ic {
  background: var(--c-shelf-pill, color-mix(in srgb, var(--cq-sc) 15%, var(--c-rail)));
  box-shadow: var(--c-shelf-pill-ring, none);
  color: var(--c-shelf-glyph, var(--cq-sc));
}
.cq-app[data-scope="shelf"] .cq-act-btn[aria-current="page"]::before {
  width: var(--c-shelf-edge-w, 3px);
  background: var(--c-shelf-edge, var(--cq-sc));
  box-shadow: var(--c-shelf-edge-ring, none);
}
.cq-act-lb { max-width: 100%; font-size: 11px; font-weight: 500; line-height: 14px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c-ink-2); }
.cq-act-btn:hover .cq-act-lb { color: var(--c-ink); }
.cq-act-btn[aria-current="page"] .cq-act-lb { font-weight: 600; color: var(--c-ink); }
/* the badge's right edge 27px right of the icon's centre (5px outside the 44px pill), so "42" and "99+" grow to the
 * left and stay inside the 64px bar (its overflow clips) */
.cq-act-badge {
  position: absolute; top: -5px; right: calc(50% - 27px); min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--c-accent-fill);
  color: var(--c-on-accent); font: 700 11px/18px var(--f-body); text-align: center; box-shadow: 0 0 0 2px var(--c-rail); font-variant-numeric: tabular-nums;
}

/* inspector container (L2 audit T4): docked beside the list from 900 px up (pushes it: 380 px, 340 px under 1100 px,
 * where the list shows the title and the year only); from 761 to 899 px it takes the whole work column under the tab
 * row (a sheet: "‹ Back to list", "3 of 58", ↑ ↓; the list stays laid out under it, so Back finds the row and the
 * scroll as they were); full screen on the phone. Header (48px): "Inspector", ghost previous / next (the row stepping
 * of app.js), always a ×; hints live in "?". */
.cq-insp {
  position: relative; flex-shrink: 0; width: 380px; min-width: 320px; max-width: 560px; display: flex; flex-direction: column; min-height: 0;
  background: var(--c-insp); border-left: 1px solid var(--c-line);
}
.cq-insp-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 48px; padding: 0 8px 0 20px; border-bottom: 1px solid var(--c-line-soft); background: inherit; }
.cq-insp-ctl { display: flex; align-items: center; gap: 2px; }
.cq-insp-ctl .cq-btn { color: var(--c-ink-3); }
.cq-insp-ctl .cq-btn > .cq-i { color: inherit; }
.cq-insp-ctl .cq-btn:hover { color: var(--c-ink); }
.cq-insp-ctl .cq-btn:disabled { opacity: .4; }
.cq-insp-x { margin-left: 4px; }
.cq-insp-back { display: none; }
.cq-insp-back > .cq-i { flex-shrink: 0; }
.cq-insp-back-s, .cq-insp-back-to { display: none; }
.cq-insp-ttl { display: none; }
.cq-insp-pos { display: none; }
.cq-insp-body { flex: 1 1 0%; overflow: auto; overscroll-behavior: contain; padding: 18px 20px 32px; }
.cq-insp-body:focus { outline: none; }
.cq-insp.is-loading .cq-insp-body { opacity: .55; transition: opacity .2s .15s; }
@media (min-width: 900px) and (max-width: 1099px) {
  .cq-insp { width: 340px; min-width: 0; }
  .cq-insp-body { padding-inline: 16px; }
  .cq-insp .cq-ins-tool { padding-inline: 0; font-size: 11px; }   /* six labels in 308 px: "Download" whole */
  /* the list makes room: the title and the year only, in every area (the Library, a project, My shelf); its Read and
     shelf cell, its projects and the date it was added go while the inspector is open (they come back with Esc) */
  body.cq-insp-open .cq-sheet col:is(.cq-c-cols, .cq-c-proj, .cq-c-added) { width: 0; }
  body.cq-insp-open .cq-sheet :is(th, td):is(.cq-c-cols, .cq-c-proj, .cq-c-added, .pj-c-added) { padding: 0; overflow: hidden; visibility: hidden; }
  body.cq-insp-open .cq-sheet tr > .is-num { padding-right: var(--d-pad); }
}
@media (min-width: 761px) and (max-width: 899px) {
  .cq-insp { position: absolute; inset: 0; z-index: 40; width: auto; min-width: 0; max-width: none; border-left: 0; background: var(--c-surface); }
  .cq-insp-head { height: 46px; padding: 0 8px 0 6px; gap: 4px; justify-content: flex-start; background: var(--c-surface); border-bottom: 1px solid var(--c-line); }
  .cq-insp-back { display: inline-flex; gap: 4px; padding: 0 10px 0 8px; color: var(--c-accent); font-weight: 600; }
  .cq-insp-back:hover { color: var(--c-accent); }
  .cq-insp-back > .cq-ic-arrow-left, .cq-insp-lbl, .cq-insp-x { display: none; }
  .cq-insp-back-s { display: inline-flex; margin-right: -2px; }
  .cq-insp-back-to { display: inline; }
  .cq-insp-pos { display: inline; margin-left: auto; padding: 0 6px; font-size: var(--fs-sm); color: var(--c-ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .cq-insp-pos:empty { display: none; }
  .cq-insp-pos:empty + .cq-insp-ctl { margin-left: auto; }
  .cq-insp-body { padding: 22px 24px 40px; }
  /* the details as in the 768 drawing: a wider title, Read PDF and Details side by side at their own width, the tool
     row under them */
  .cq-insp .cq-ins { max-width: 720px; }
  .cq-insp .cq-ins-title { font-size: calc(var(--fs-xl) * var(--display-scale)); line-height: 1.18; }
  .cq-insp .cq-ins-bar { max-width: 560px; gap: 12px; }
  .cq-insp .cq-ins-read { max-width: 368px; }
  .cq-insp .cq-ins-tools { border-top: 0; border-bottom: 0; padding: 0; }
}

/* phone: the activity bar is the bottom bar (same icons and labels); no tab row; full-screen inspector */
@media (max-width: 760px) {
  .cq-top { gap: 8px; padding: 0 10px; }
  .cq-top .cq-top-word, .cq-sc-slash { display: none; }
  .cq-top-center { justify-content: flex-end; flex: 1 0 auto; }   /* the search icon never shrinks: the scope name gives way */
  .cq-top-start { gap: 8px; }
  .cq-top .cq-jump { width: 34px; height: 34px; padding: 0; justify-content: center; border-color: var(--tb-jump-ph-bg); background: var(--tb-jump-ph-bg); color: var(--tb-jump-ph-ink); }
  .cq-top .cq-jump > .cq-i { color: inherit; }
  .cq-top .cq-jump:hover { background: var(--tb-jump-ph-hover-bg); border-color: var(--tb-jump-ph-hover-bg); color: var(--tb-jump-ph-ink); box-shadow: var(--tb-jump-shadow); }
  .cq-jump-t, .cq-jump-keys { display: none; }
  .cq-tabs { display: none; }
  .cq-body { flex-direction: column; }
  .cq-work { order: 1; }
  .cq-act { order: 2; flex: 0 0 auto; width: auto; height: calc(var(--h-bottombar) + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--c-line); background: var(--c-bar); }
  .cq-act-in { flex-direction: row; justify-content: space-around; gap: 2px; height: var(--h-bottombar); padding: 6px 4px; overflow: visible; }
  .cq-act-top, .cq-act-sys { display: contents; }
  .cq-act-grp { display: contents; }
  .cq-act-div { display: none; }
  .cq-act-btn { flex: 1 1 0; min-width: 44px; min-height: 48px; justify-content: center; padding: 2px; }
  .cq-act-btn[aria-current="page"]::before { display: none; }
  .cq-act-ic { width: 52px; height: 28px; }
  .cq-act-btn[aria-current="page"] .cq-act-ic { background: color-mix(in srgb, var(--cq-sc) 15%, var(--c-bar)); }
  .cq-app[data-scope="shelf"] .cq-act-btn[aria-current="page"] .cq-act-ic {
    background: var(--c-shelf-pill, color-mix(in srgb, var(--cq-sc) 15%, var(--c-bar)));
    box-shadow: var(--c-shelf-bar-ring, none);
  }
  .cq-act-badge { box-shadow: 0 0 0 2px var(--c-bar); }
  .cq-insp { position: fixed; inset: 0; z-index: 80; width: auto; min-width: 0; max-width: none; border: 0; background: var(--c-surface); box-shadow: none; }
  .cq-insp-head { height: 52px; padding: 0 6px; gap: 4px; justify-content: flex-start; background: var(--c-bar); border-bottom: 1px solid var(--c-line); }
  .cq-insp-back { display: inline-flex; padding: 0 10px 0 6px; gap: 6px; }
  .cq-insp-ttl { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--c-ink-2); }
  .cq-insp-lbl, .cq-insp-x { display: none; }
  .cq-insp-ctl .cq-btn.is-icon.is-sm { width: 40px; min-height: 40px; }
  .cq-insp-body { padding: 16px 16px 0; }
  .cq-insp-body > :last-child { padding-bottom: 24px; }
  /* the Read PDF / Details pair becomes the sticky foot of the full-screen inspector */
  .cq-insp .cq-ins-bar { display: contents; }
  .cq-insp .cq-ins-read { order: 99; position: sticky; bottom: 0; z-index: 2; margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--c-surface); border-top: 1px solid var(--c-line); flex-wrap: nowrap; }
  .cq-insp .cq-ins-read .cq-btn { min-height: 44px; }
  .cq-insp .cq-ins:has(.cq-ins-read) { padding-bottom: 0; }
  .cq-top .cq-theme-btn { display: none; }
}
/* narrow phones: the scope mark is the brand there (both are the teal mark) */
@media (max-width: 599px) {
  .cq-top .cq-top-brand { display: none; }
  .cq-top { padding-left: 12px; }
}

/* ---------------------------------------------------------------- the one sheet: search, filter sentence, table */
.cq-page { flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; background: var(--c-surface); }
.cq-page-head { padding: 22px var(--d-pad) 6px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; }
.cq-page-title { font-family: var(--f-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); color: var(--c-ink); font-size: calc(var(--fs-xl) * var(--display-scale)); line-height: 1.15; }
.cq-page-sub { font-size: var(--fs-body); color: var(--c-ink-3); margin-top: 4px; }
.cq-page-eyebrow { margin-bottom: 6px; }

.cq-search { flex-shrink: 0; padding: 14px var(--d-pad) 12px; border-bottom: 1px solid var(--c-line-soft); background: var(--c-surface); }
.cq-search-f {
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 720px; height: 44px; padding: 0 6px 0 14px; margin: 0;
  border: 1px solid var(--c-line-strong); border-radius: var(--r-lg); background: var(--c-surface-2);
}
.cq-search-f:focus-within { outline: 2px solid var(--c-focus); outline-offset: 0; border-color: var(--c-focus); background: var(--c-surface); }
.cq-search-f > .cq-i { color: var(--c-ink-3); }
.cq-search-f:focus-within > .cq-i { color: var(--c-accent); }
.cq-search-in { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--c-ink); font-size: max(16px, var(--fs-md)); padding: 0; outline: none; }
.cq-search-in:focus-visible { outline: none; }
.cq-search-in::placeholder { color: var(--c-ink-3); opacity: 1; }
.cq-search-in::-webkit-search-cancel-button, .cq-search-in::-webkit-search-decoration { appearance: none; }
.cq-search-x { color: var(--c-ink-3); }
.cq-search-f.is-compact { height: 36px; max-width: 360px; border-radius: var(--r-md); background: var(--c-surface); }
.cq-search-f.is-compact .cq-search-in { font-size: var(--fs-body); }
/* the Library field's (library.css .cq-fld) thin accent progress line while the list loads (.cq-fld-f.is-loading) and
 * the suggestions listbox under it (the L2 search header's .cq-hero, -row, -box, -bar, -f … went with M1) */
.cq-hero-prog { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.cq-hero-prog::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 34%; border-radius: 2px; background: var(--c-accent); animation: cq-prog 1s ease-in-out infinite; }
@keyframes cq-prog { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .cq-hero-prog::before { width: 100%; opacity: .5; } }
/* the suggestions under the field: papers (title in Literata, the match bold; authors · year), then authors and venues
 * with counts, then "Show all N results"; built from /api/jump with text nodes only (library.js) */
.cq-hero-sugg { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); max-height: min(70vh, 540px); overflow: auto; padding: 6px; text-align: left; background: var(--c-raised); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.cq-hero-sg { display: flex; justify-content: space-between; padding: 10px 10px 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); }
.cq-hero-opt { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border-radius: var(--r-md); color: var(--c-ink-2); text-decoration: none; cursor: pointer; }
.cq-hero-opt:hover { color: var(--c-ink); }
.cq-hero-opt.is-active { background: var(--c-hover-raised); color: var(--c-ink); }
.cq-hero-opt > .cq-i { flex-shrink: 0; color: var(--c-ink-3); }
.cq-hero-opt.is-active > .cq-i { color: var(--c-accent); }
.cq-hero-ot { flex: 1 1 14em; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cq-hero-ott { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--f-display); font-weight: 400; letter-spacing: var(--display-tracking); font-size: calc(var(--fs-md) * var(--display-scale) + 1px); line-height: 1.3; color: var(--c-ink); }
.cq-hero-ott b { font-weight: 700; }
.cq-hero-ott.is-name { font-family: var(--f-body); font-size: var(--fs-body); font-weight: 600; letter-spacing: 0; }
.cq-hero-om { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--c-ink-3); }
.cq-hero-on { flex-shrink: 0; font-size: var(--fs-sm); color: var(--c-ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* a name with its counts ("12 papers · 2 theses · 1 report"): when both do not fit on one line (a phone), the counts go
   under the name, right-aligned, instead of cutting the name short */
.cq-hero-opt.has-n { flex-wrap: wrap; row-gap: 0; }
.cq-hero-opt.has-n > .cq-hero-on { margin-left: auto; }
/* the name's basis (14em, not its full length) keeps a long venue or title on the icon's line, cut with an ellipsis;
   only counts that do not fit beside 14em of name wrap under it (2026-11-06: a long NDSS proceedings name put the icon
   on a line of its own). Hovered or armed, a cut name runs to its end and back (library.js measure) */
.cq-hero-run { white-space: nowrap; }
.cq-hero-opt:is(:hover, .is-active) .cq-hero-ott.is-long { text-overflow: clip; }
.cq-hero-opt:is(:hover, .is-active) .cq-hero-ott.is-long > .cq-hero-run { display: inline-block; animation: cq-hero-run var(--run-dur, 6s) ease-in-out 500ms infinite alternate; }
@keyframes cq-hero-run { 0%, 12% { transform: translateX(0); } 88%, 100% { transform: translateX(calc(-1 * var(--run, 0px))); } }
@media (prefers-reduced-motion: reduce) { .cq-hero-opt:is(:hover, .is-active) .cq-hero-ott.is-long > .cq-hero-run { animation: none; display: inline; } .cq-hero-opt:is(:hover, .is-active) .cq-hero-ott.is-long { text-overflow: ellipsis; } }
/* "Show all N results" stays at the foot of the box while the suggestions scroll (a phone shows it without scrolling) */
.cq-hero-sep { display: none; }
.cq-hero-opt.is-all { position: sticky; bottom: -6px; z-index: 1; min-height: 44px; margin: 6px -6px -6px; padding: 6px 16px; border-top: 1px solid var(--c-line-soft); border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--c-raised); color: var(--c-accent); font-weight: 600; }
.cq-hero-opt.is-all.is-active { background: var(--c-hover-raised); }
.cq-hero-opt.is-all .cq-kbd { margin-left: auto; }
.cq-hero-none { padding: 12px 10px 10px; font-size: var(--fs-body); color: var(--c-ink-2); line-height: 1.45; }
.cq-hero-none .cq-meta { display: block; margin-top: 2px; }
/* the list below while the live search fetches it, and its count when the new one arrives */
.cq-lib-live[aria-busy="true"] .cq-sheet-wrap { opacity: .55; transition: opacity .15s ease .1s; }
.cq-lib-live.is-fresh:not([aria-busy="true"]) .cq-sheet-wrap { animation: cq-list-in .22s ease-out both; }
@keyframes cq-list-in { from { opacity: .55; } }
.cq-fs-n.is-fresh { animation: cq-fresh .35s ease; }
@keyframes cq-fresh { from { opacity: .2; } }

/* filter sentence = the count line; Columns, Sort and "?" at its right end. One line (round 6b: sentence-c's tokens
 * on sentence-b's line): the count in bold first, then each phrase with its lead ("from", "in", "by") as one group
 * (.cq-fs-ph, never broken inside: a lead never ends a line alone, a "·" ends its phrase's group so no line starts
 * with it). A default phrase is dotted; a set one is an emerald token (.cq-fs-tok.is-set: soft tint, a fine edge,
 * semibold, its × inside). Default and set are both 30px high, so setting one never moves the lines. */
.cq-fs { flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 14px; padding: 8px var(--d-pad); background: var(--c-surface); border-bottom: 1px solid var(--c-line-soft); min-width: 0; container: cqfs / inline-size; }
.cq-fs-sent { flex: 1 1 420px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: var(--fs-md); color: var(--c-ink-2); }
.cq-fs-n { font-size: var(--fs-md); font-weight: 700; color: var(--c-ink); line-height: 1.4; margin: 0 2px 0 0; font-variant-numeric: tabular-nums; }
.cq-fs-suf { font-weight: 400; color: var(--c-ink-2); }
.cq-fs-lead, .cq-fs-sep { color: var(--c-ink-3); }
.cq-fs-ph { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; white-space: nowrap; }
.cq-fs-tok { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; height: 30px; border-radius: var(--r-sm); }
.cq-fs-tok > .cq-dd { min-width: 0; max-width: 100%; }
.cq-fs-b {
  display: inline-block; height: 30px; max-width: 26em; padding: 0 4px; overflow: hidden; color: var(--c-ink-2); font-size: var(--fs-md); line-height: 30px;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; border-radius: var(--r-sm);
  text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-color: var(--c-ink-3);
}
.cq-fs-b:hover, .cq-dd[open] > .cq-fs-b { background: var(--c-hover); color: var(--c-ink); text-decoration-style: solid; }
.cq-fs-tok.is-set { padding-right: 4px; background: var(--c-accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-accent-line) 60%, transparent); color: var(--c-accent); transition: background-color .12s ease; }
.cq-fs-tok.is-set .cq-fs-b, .cq-fs-tok.is-set .cq-dd[open] > .cq-fs-b { padding: 0 3px 0 9px; background: transparent; color: inherit; font-weight: 600; text-decoration: none; }
.cq-fs-tok.is-set:hover, .cq-fs-tok.is-set:has(.cq-dd[open]) { background: color-mix(in srgb, var(--c-accent) 20%, var(--c-surface)); }
.cq-fs-tok.is-set .cq-fs-b:focus-visible { outline-offset: 0; }
.cq-fs-x { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px; background: transparent; color: inherit; text-decoration: none; }
.cq-fs-x:hover { background: color-mix(in srgb, var(--c-accent) 22%, transparent); color: var(--c-ink); }
.cq-fs-x:focus-visible { outline-offset: 0; }
/* the tools stay on the sentence's first line (Columns, the "Sort: Newest ▾" ghost menu, "?"); a narrow sheet (the
 * inspector open at 1280) keeps them as icons and the sort's value only */
.cq-fs-tools { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 2px; min-height: 34px; margin-left: auto; min-width: 0; }
.cq-fs-tools > .cq-meta { margin-right: 8px; }
.cq-fs-tools:empty { display: none; }
.cq-fs-tools .cq-gm-s { font-size: var(--fs-body); }
.cq-gm-vs { display: none; }       /* a ghost menu's short value (ui.ghost_menu short=): shown by the page's CSS */
@container cqfs (max-width: 860px) {
  .cq-fs-tools .cq-gm-p, .cq-fs-tools .cq-fs-tl { display: none; }
}
.cq-fs-coln { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--c-surface-2); color: var(--c-ink-2); font-size: var(--fs-xs); font-weight: 700; }
.cq-btn.is-icon.cq-fs-help { width: 34px; height: 34px; min-height: 34px; }   /* beats .cq-btn.is-icon.is-sm (A16) */
.cq-fs-colw > .cq-btn.is-icon, .cq-fs-help { color: var(--c-ink-3); }
.cq-js .cq-js-hide { display: none; }

/* gestures table (the "?" popover and Settings) */

/* the sheet table. It takes its rows' height, never the column's: the pager comes right after the last row of a short
 * list, not at the foot of a tall filter panel or window (L2 audit A7); the page under it keeps the sheet's colour */
.cq-sheet-wrap { flex: 0 0 auto; display: flex; flex-direction: column; min-width: 0; background: var(--c-surface); container: cqsheet / inline-size; }
.cq-sheet { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: var(--fs-body); }
.cq-sheet col.cq-c-check { width: 46px; }
.cq-sheet col.cq-c-year, .cq-sheet col.cq-c-num { width: 76px; }
.cq-sheet col.cq-c-cols { width: 236px; }
.cq-sheet col.cq-c-cols.is-slim { width: 184px; }      /* no row of the page on the shelf: the bookmark only */
/* a wide sheet caps the title column (~760px) so Year sits close to it; the Read / shelf column takes the rest */
@container cqsheet (min-width: 1180px) {
  .cq-sheet:has(col.cq-c-cols) col.cq-c-main { width: 760px; }
  .cq-sheet:has(col.cq-c-cols) col.cq-c-cols { width: auto; }
}
.cq-sheet col.cq-c-state { width: 220px; }
.cq-sheet col.cq-c-when { width: 130px; }
.cq-sheet th {
  position: sticky; top: 0; z-index: 4; height: 38px; padding: 0 8px; text-align: left; background: var(--c-surface-2); border-bottom: 1px solid var(--c-line);
  color: var(--c-ink-3); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.cq-sheet th.cq-c-check, .cq-sheet td.cq-c-check { padding-left: var(--d-pad); padding-right: 4px; }
.cq-sheet tr > :last-child { padding-right: var(--d-pad); }
.cq-sheet th.is-num, .cq-sheet td.is-num { text-align: right; }
.cq-sth { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 30px; padding: 0 6px; margin-left: -6px; border-radius: var(--r-sm); color: inherit; text-decoration: none; }
.cq-sth:hover { background: var(--c-hover); color: var(--c-ink); }
.cq-sth.is-on { color: var(--c-struct); }
.cq-sth .cq-sth-i { opacity: .5; }
.cq-sth:hover .cq-sth-i { opacity: 1; }
th.is-num .cq-sth { margin: 0 -6px 0 0; }
.cq-sheet-alll { display: none; }
.cq-sheet td { padding: 9px 8px; border-bottom: 1px solid var(--c-line-soft); vertical-align: top; color: var(--c-ink-2); background: var(--c-surface); }
.cq-sheet td.cq-c-check { padding-top: 12px; }
/* check boxes: always there, light until the row is hovered, focused, open or checked (DEFAULT) */
.cq-sheet .cq-check:not(:checked):not(:indeterminate) { opacity: .5; transition: opacity .12s ease; }
.cq-sheet .cq-row:hover .cq-check, .cq-sheet .cq-row.is-open .cq-check, .cq-sheet .cq-row:focus-visible .cq-check, .cq-sheet .cq-check:hover, .cq-sheet .cq-check:focus-visible { opacity: 1; }
.cq-sheet td.is-num { padding-top: 11px; font-weight: 600; color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.cq-sheet td.cq-c-cols, .cq-sheet td.cq-c-right { padding-top: 7px; }
.cq-row { cursor: default; scroll-margin-top: 48px; scroll-margin-bottom: 24px; }
.cq-row:hover > td { background: var(--c-hover); }
.cq-row.is-sel > td { background: color-mix(in srgb, var(--c-accent-soft) 40%, var(--c-surface)); }
.cq-row.is-open > td { background: var(--c-sel); }
.cq-row.is-open > td:first-child { box-shadow: inset 3px 0 0 var(--c-struct); }
.cq-row:focus { outline: none; }
.cq-row:focus-visible > td { border-bottom-color: var(--c-accent-line); }
.cq-row:focus-visible > td:first-child { box-shadow: inset 3px 0 0 var(--c-focus); }
.cq-l1 { display: flex; align-items: baseline; min-width: 0; font-family: var(--f-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-size: calc(var(--fs-md) * var(--display-scale)); line-height: 1.32; }
.cq-title { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-ink); text-decoration: none; }
.cq-title:hover { color: var(--c-ink); text-decoration: underline 1px; }
.cq-title.is-mono { font-family: var(--f-mono); font-size: var(--fs-body); letter-spacing: 0; }
.cq-row.is-open .cq-title { color: var(--c-struct); }
.cq-l2 { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 3px; }
.cq-l2t { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--c-ink-3); }
.cq-l2-lead { color: var(--c-ink-2); }
.cq-l2b { flex: 0 0 auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.cq-l2b .cq-badge { height: 20px; padding: 0 7px; }
/* without the Read and shelf columns: a quiet PDF mark (m17) */
.cq-pdfmark { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border: 1px solid var(--c-accent-line); border-radius: var(--r-sm); color: var(--c-accent); font-size: var(--fs-xs); font-weight: 600; }
.cq-l3 { margin-top: 4px; font-size: var(--fs-sm); color: var(--c-ink-2); }

.cq-l1-ic { display: inline-flex; align-self: center; margin-right: 8px; color: var(--c-ink-3); }
.cq-l1-ic.is-ok { color: var(--c-ok); } .cq-l1-ic.is-warn { color: var(--c-warn); } .cq-l1-ic.is-danger { color: var(--c-danger); } .cq-l1-ic.is-accent { color: var(--c-accent); }
/* group header rows inside a sheet */
.cq-grp > td { padding: 10px 8px 10px var(--d-pad) !important; background: var(--c-surface-2) !important; border-bottom: 1px solid var(--c-line); }
.cq-grp-in { display: flex; align-items: center; gap: 12px; }
.cq-grp-t { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.cq-grp-h { font-size: var(--fs-sm); font-weight: 600; color: var(--c-ink); }
.cq-grp-n { font-size: var(--fs-sm); color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.cq-grp-sub { flex-basis: 100%; font-size: var(--fs-sm); color: var(--c-ink-3); }
.cq-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cq-page-ht { min-width: 0; }
.cq-page-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cq-page-acts:empty { display: none; }

/* paper_cols: Read button (PDF available) or "Title only" + bookmark that becomes a shelf status pill */
.cq-pc { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 32px; }
.cq-pc-head { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; }
/* the quiet ghost "PDF" in the accent (no page count: polish 2, item 3): its border shows on row hover, focus or
 * selection */
.cq-pc-read {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px 0 7px; margin-left: -8px; justify-self: start;
  border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--c-accent); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.cq-pc-read > .cq-i { color: var(--c-accent); }
.cq-row:hover .cq-pc-read, .cq-row.is-open .cq-pc-read, .cq-row.is-sel .cq-pc-read, .cq-row:focus-visible .cq-pc-read, .cq-pc-read:focus-visible { border-color: var(--c-accent-line); }
.cq-pc-read:hover { border-color: var(--c-accent-line); background: var(--c-accent-soft); color: var(--c-accent); }
.cq-pc-none { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--c-ink-3); white-space: nowrap; }
.cq-pc-shelf { justify-self: start; }
/* the shelf pill says its short word (names.SHELF_SHORT) where the shelf cell is narrow (the docked inspector at 1440,
 * a slim column): below 136px for the pill, as before the PDF cell lost its page count */
.cq-pc { container: cqpc / inline-size; }
.cq-pill-short { display: none; }
@container cqpc (max-width: 216px) {
  .cq-pill-long { display: none; }
  .cq-pill-short { display: inline; }
}
.cq-shelf-add {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 30px; padding: 0; margin-left: -6px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--c-ink-3); cursor: pointer;
}
.cq-shelf-add:hover, .cq-shelf-add:focus-visible { color: var(--c-warn); background: var(--c-hover); }
.cq-pill {
  --st: var(--c-ink-3);
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 8px; border: 1px solid transparent; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; background: var(--c-surface-2); color: var(--c-ink-2);
}
summary.cq-pill, button.cq-pill { cursor: pointer; }
.cq-pill.is-inbox { --st: var(--c-ink-3); }
/* the shelf pill: tinted, no heavy border (a soft one on hover / open) */
.cq-pill.is-want { --st: var(--c-warn); background: var(--c-warn-soft); color: var(--c-warn); }
.cq-pill.is-reading { --st: var(--c-accent); background: var(--c-accent-soft); color: var(--c-accent); }
.cq-pill.is-read { --st: var(--c-ok); background: var(--c-ok-soft); color: var(--c-ok); }
summary.cq-pill:hover, button.cq-pill:hover, .cq-dd[open] > .cq-pill { border-color: color-mix(in srgb, currentColor 40%, transparent); }
.cq-pill > .cq-i { fill: none; }    /* the status's outline icon (names.SHELF_STATUS_ICON), never a filled mark */
.cq-menu-item.is-inbox { --st: var(--c-ink-3); }
.cq-menu-item.is-want { --st: var(--c-warn); }
.cq-menu-item.is-reading { --st: var(--c-accent); }
.cq-menu-item.is-read { --st: var(--c-ok); }

/* sheet foot, pager, loading */
.cq-sheet-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px var(--d-pad) 28px; color: var(--c-ink-3); font-size: var(--fs-sm); }
.cq-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cq-pager-b { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--r-md); color: var(--c-ink-2); text-decoration: none; font-variant-numeric: tabular-nums; }
.cq-pager-b:hover { background: var(--c-hover); color: var(--c-ink); }
.cq-pager-b[aria-current="page"] { border-color: var(--c-accent-line); background: var(--c-accent-soft); color: var(--c-accent); font-weight: 700; }
.cq-pager-b.is-off { color: var(--c-ink-3); opacity: .7; pointer-events: none; }
.cq-pager-gap { padding: 0 4px; color: var(--c-ink-3); }
.cq-pager-info { font-size: var(--fs-sm); color: var(--c-ink-3); }
.cq-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 20px; color: var(--c-ink-3); font-size: var(--fs-body); }
.cq-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--c-line); border-top-color: var(--c-accent); animation: cq-spin .8s linear infinite; flex-shrink: 0; }
.cq-skel { display: block; height: 12px; border-radius: 6px; background: var(--c-line-soft); animation: cq-pulse 1.4s ease-in-out infinite; }
.cq-skel + .cq-skel { margin-top: 10px; }
@keyframes cq-spin { to { transform: rotate(360deg); } }
@keyframes cq-pulse { 50% { opacity: .5; } }

/* empty states */
.cq-empty { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 56px 24px 64px; max-width: 520px; margin: 0 auto; }
.cq-empty-ic { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; background: var(--c-accent-soft); color: var(--c-accent); margin-bottom: 4px; }
.cq-empty-t { font-family: var(--f-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); color: var(--c-ink); font-size: calc(var(--fs-lg) * var(--display-scale)); line-height: 1.25; }
.cq-empty-x { font-size: var(--fs-body); color: var(--c-ink-3); line-height: 1.55; text-wrap: pretty; }
.cq-empty .cq-btn { margin-top: 8px; }
.cq-empty.is-error .cq-empty-ic { background: var(--c-danger-soft); color: var(--c-danger); }
.cq-empty.is-shelf .cq-empty-ic {
  background: var(--c-shelf-soft, color-mix(in srgb, var(--c-amber) 14%, var(--c-surface)));
  box-shadow: var(--c-shelf-soft-ring, none);
  color: var(--c-shelf-soft-ink, var(--c-shelf-ink, var(--c-amber)));
}

/* floating bulk bar: one line, its content's width (left: 50% alone leaves it half the window: My shelf's wrapped onto
   three lines at 1440, E2E runA11 D8); it wraps only where the window is narrower than its content */
.cq-bulk {
  position: fixed; z-index: 45; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; width: max-content; max-width: calc(100vw - 32px);
  flex-wrap: wrap; justify-content: center; padding: 6px 6px 6px 16px; border-radius: var(--r-xl); background: var(--c-raised); border: 1px solid var(--c-line); box-shadow: var(--shadow-3);
}
.cq-bulk-count { font-size: var(--fs-body); color: var(--c-ink); white-space: nowrap; margin-right: 6px; }
.cq-bulk-count b { font-weight: 700; }
.cq-bulk-acts { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.cq-bulk .cq-btn { border-color: transparent; background: transparent; }
.cq-bulk .cq-btn:hover { background: var(--c-hover-raised); }
.cq-bulk .cq-btn.is-primary { background: var(--c-accent-fill); color: var(--c-on-accent); }
.cq-bulk .cq-btn.is-primary:hover { background: var(--c-accent-fill-hover); }
.cq-bulk-sep { width: 1px; align-self: stretch; margin: 6px; background: var(--c-line); }
.cq-has-bulk .cq-main { padding-bottom: calc(var(--d-ctrl-h) + 48px); }
/* a bar with fold actions (My shelf, ui.bulk_bar): one line down to the phone; under 900 px the fold actions are in
   "⋯" (.is-fold-phone, the Library's: only on the phone, below), on the phone the compact ones show their icon only */
.cq-bmore { display: none; }
.cq-bmore > summary { list-style: none; white-space: nowrap; }
.cq-bmore > summary::-webkit-details-marker { display: none; }
.cq-bmore-pop { bottom: calc(100% + 8px); top: auto; min-width: 240px; }
@media (max-width: 899px) {
  .cq-bulk.has-fold:not(.is-fold-phone), .cq-bulk.has-fold:not(.is-fold-phone) .cq-bulk-acts { flex-wrap: nowrap; }
  .cq-bulk.has-fold:not(.is-fold-phone) .cq-bx { display: none; }
  .cq-bulk.has-fold:not(.is-fold-phone) .cq-bmore { display: flex; }
}

/* ---------------------------------------------------------------- inspector content (shared by Library, Shelf, Inbox, Uploads) */
.cq-ins { display: flex; flex-direction: column; gap: 20px; min-width: 0; color: var(--c-ink-2); }
.cq-ins-head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cq-ins-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 22px; }
.cq-ins-type { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); }
.cq-ins-title { margin: 2px 0 0; font-family: var(--f-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); color: var(--c-ink); font-size: calc(var(--fs-lg) * var(--display-scale)); line-height: 1.22; text-wrap: balance; overflow-wrap: anywhere; }
.cq-ins-title:focus { outline: none; }
.cq-ins-by { font-size: var(--fs-body); font-weight: 500; color: var(--c-ink-2); line-height: 1.45; }
.cq-ins-src { font-size: var(--fs-sm); color: var(--c-ink-3); line-height: 1.45; }
.cq-ins-src b { color: var(--c-ink-2); font-weight: 600; }
.cq-ins-bar { display: flex; flex-direction: column; gap: 10px; }
.cq-ins-read { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.cq-ins-read .cq-btn { flex: 1 1 auto; min-width: min-content; min-height: calc(var(--d-ctrl-h) + 4px); }
.cq-ins-read .cq-btn.is-primary { flex-grow: 1.5; }
/* the tool row (DEFAULT): no box; equal columns between two hairlines, an 18px accent icon over a one-line label */
.cq-ins-tools { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 4px 0; border-top: 1px solid var(--c-line-soft); border-bottom: 1px solid var(--c-line-soft); }
.cq-ins-tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 56px; padding: 6px 2px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--c-ink-2); font-size: var(--fs-xs); font-weight: 500; line-height: 1.2; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.cq-ins-tool > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cq-ins-tool > .cq-i { color: var(--c-accent); }
.cq-ins-tool:hover { background: var(--c-hover-raised); color: var(--c-ink); }
.cq-ins-tool:focus-visible { outline-offset: -2px; position: relative; z-index: 1; }
.cq-ins-sec { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding-top: 18px; border-top: 1px solid var(--c-line-soft); }
.cq-ins-h { margin: 0; font-family: var(--f-body); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); }
.cq-ins-abs { font-family: var(--f-display); font-size: var(--fs-md); line-height: 1.65; color: var(--c-ink-2); overflow-wrap: break-word; }
.cq-ins-dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; align-items: baseline; }
.cq-ins-dl dt { font-size: var(--fs-sm); font-weight: 500; color: var(--c-ink-3); white-space: nowrap; }
.cq-ins-dl dd { margin: 0; min-width: 0; font-size: var(--fs-sm); color: var(--c-ink-2); overflow-wrap: anywhere; line-height: 1.45; }
.cq-ins-kws { display: flex; flex-wrap: wrap; gap: 6px; }
.cq-ins-files { display: flex; flex-direction: column; }
.cq-ins-file { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; }
.cq-ins-file + .cq-ins-file { border-top: 1px solid var(--c-line-soft); }
.cq-ins-file > .cq-i { color: var(--c-ink-3); }
.cq-ins-fn { font-size: var(--fs-body); font-weight: 500; color: var(--c-ink); }
.cq-ins-fd { font-size: var(--fs-sm); color: var(--c-ink-3); }
.cq-ins-key { font-family: var(--f-mono); font-size: var(--fs-sm); color: var(--c-ink); background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-sm); padding: 2px 7px; overflow-wrap: anywhere; }
.cq-ins-bib { margin: 0; max-height: 168px; overflow: auto; padding: 10px 12px; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-md); font-family: var(--f-mono); font-size: var(--fs-sm); line-height: 1.5; color: var(--c-ink); white-space: pre; }
.cq-ins-rel { display: flex; flex-direction: column; }
.cq-ins-rel li + li { border-top: 1px solid var(--c-line-soft); }
.cq-ins-rel a { display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; margin: 0 -6px; border-radius: var(--r-md); text-decoration: none; }
.cq-ins-rel a:hover { background: var(--c-hover); }
.cq-ins-relt { font-family: var(--f-display); font-size: var(--fs-body); line-height: 1.35; color: var(--c-ink); }
.cq-ins-relm { font-size: var(--fs-sm); color: var(--c-ink-3); }

/* ---------------------------------------------------------------- paper tab: header with Details | PDF, PDF iframe */
/* ONE row: the views as underline tabs on the header's bottom hairline, the compact title (not on Details), icon
 * buttons, ⋯, ×. The ← (data-list-link) shows on the phone only. */
.cq-paper { flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; min-height: 100%; background: var(--c-surface); }
.cq-ph { position: sticky; top: 0; z-index: 5; display: flex; align-items: stretch; gap: 16px; min-height: 48px; padding: 0 8px 0 var(--d-pad); background: var(--c-surface); border-bottom: 1px solid var(--c-line); }
.cq-ph-back { display: none; align-self: center; flex-shrink: 0; }
.cq-ph-views { flex-shrink: 0; align-self: stretch; }
.cq-ph-views .cq-utab { height: 100%; min-height: 47px; }
.cq-ph-t { flex: 1 1 0%; min-width: 0; align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-ink-3); font-size: var(--fs-sm); }
.cq-ph-key { font-weight: 600; color: var(--c-ink-2); margin-right: 8px; }
.cq-ph-acts { display: flex; align-items: center; gap: 2px; flex-shrink: 0; align-self: center; }
.cq-ph-acts > .cq-btn.is-icon, .cq-ph-more > .cq-btn.is-icon { width: 36px; min-height: 36px; color: var(--c-ink-3); }
.cq-ph-acts > .cq-btn.is-icon:hover, .cq-ph-more > .cq-btn.is-icon:hover { color: var(--c-ink); }
.cq-ph-more .cq-pop { min-width: 240px; }
.cq-ph .cq-dd[open] > summary::after, .cq-fs .cq-dd[open] > summary::after, .cq-lib-dacts .cq-dd[open] > summary::after { display: none; }
.cq-paper-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.cq-paper-det { width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px var(--d-pad) 48px; }
/* the PDF view (ui.pdf_frame, owner: PDF viewer): our PDF.js viewer (its own toolbar) fills the body */
.cq-pdf { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; background: var(--c-surface-2); }
.cq-pdf-frame { flex: 1 1 auto; width: 100%; min-height: 320px; border: 0; display: block; background: var(--c-surface-2); }

/* ---------------------------------------------------------------- panels (the Settings layout itself: settings.css) */
.cq-panel { border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-surface); padding: 18px 20px 20px; display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 14px 24px; }
.cq-panel.is-stack { grid-template-columns: minmax(0, 1fr); }
.cq-panel-h { font-size: var(--fs-md); font-weight: 600; color: var(--c-ink); }
.cq-panel-sub { margin-top: 4px; font-size: var(--fs-sm); color: var(--c-ink-3); line-height: 1.5; }
.cq-panel-body { min-width: 0; }
.cq-table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.cq-table th { text-align: left; padding: 8px 10px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-3); border-bottom: 1px solid var(--c-line); background: var(--c-surface-2); }
.cq-table td { padding: 10px; border-bottom: 1px solid var(--c-line-soft); vertical-align: top; color: var(--c-ink-2); }
.cq-table td.is-num, .cq-table th.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.cq-table-wrap { overflow-x: auto; }

/* ---------------------------------------------------------------- sign in, set password, error pages (no shell) */
.cq-auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--c-page); }
.cq-auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--d-topbar-h); padding: 0 16px; background: var(--tb-bg); border-bottom: var(--tb-stripe-w) solid var(--tb-stripe); }
.cq-auth-top .cq-top-icon { color: var(--tb-icon); }
.cq-auth-top .cq-top-icon:hover { color: var(--tb-icon-hover); background: var(--tb-hover); }
.cq-auth-top :is(.cq-top-brand, .cq-top-icon):focus-visible { outline-color: var(--tb-focus); }
.cq-auth-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px 64px; }
.cq-auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.cq-auth-h { font-family: var(--f-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); color: var(--c-ink); font-size: calc(var(--fs-xl) * var(--display-scale)); line-height: 1.15; }
.cq-auth-sub { color: var(--c-ink-2); margin-top: 6px; }
.cq-auth-box { border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-raised); padding: 24px 24px 24px; box-shadow: var(--shadow-2); }
.cq-auth-box .cq-form-actions { margin-top: 24px; }
.cq-auth-or { display: flex; align-items: center; gap: 12px; color: var(--c-ink-3); font-size: var(--fs-sm); }
.cq-auth-or::before, .cq-auth-or::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }
/* BeeCloak before it is configured: a quiet ghost button with "coming soon" inline, not an empty field */
.cq-auth-sso[disabled], .cq-auth-sso[disabled]:hover { opacity: 1; background: transparent; border-color: transparent; color: var(--c-ink-3); }
.cq-auth-sso[disabled] > .cq-i { color: var(--c-ink-3); }
.cq-auth-soon { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border: 1px solid var(--c-line); border-radius: 999px; color: var(--c-ink-3); font-size: var(--fs-xs); font-weight: 600; }
.cq-auth-more { border-top: 1px solid var(--c-line-soft); padding-top: 14px; }
.cq-auth-more > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-weight: 600; color: var(--c-accent); }
.cq-auth-more > summary .cq-i:last-child { transition: transform .15s; }
.cq-auth-more[open] > summary .cq-i:last-child { transform: rotate(180deg); }
.cq-auth-more > form { margin-top: 12px; }
.cq-auth-foot { font-size: var(--fs-sm); color: var(--c-ink-3); text-align: center; line-height: 1.5; }
.cq-err { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 16px 64px; }
.cq-err-in { max-width: 520px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cq-err-code { font-family: var(--f-display); font-weight: 500; font-size: 64px; line-height: 1; color: var(--c-accent); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cq-err-t { font-family: var(--f-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); color: var(--c-ink); font-size: calc(var(--fs-xl) * var(--display-scale)); line-height: 1.2; }
.cq-err-x { color: var(--c-ink-2); line-height: 1.55; }
.cq-err-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }

/* ---------------------------------------------------------------- dialog (the "?" overlay) */
.cq-dlg { position: fixed; inset: 0; z-index: 92; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: var(--c-scrim); }
.cq-dlg-box { width: min(680px, 100%); max-height: 80vh; overflow: auto; background: var(--c-raised); color: var(--c-ink-2); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 16px 20px 20px; }
.cq-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cq-dlg-h { font-family: var(--f-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); color: var(--c-ink); font-size: calc(var(--fs-lg) * var(--display-scale)); line-height: 1.25; }
.cq-dlg-sub { margin: 4px 0 12px; font-size: var(--fs-sm); color: var(--c-ink-3); }
/* the shortcuts grouped by task (ui/help.html, Jan's pick help-b of 2026-11-02): the "?" overlay on every page and
 * Settings › Help & shortcuts. A phone shows the touch gestures instead (the overlay opens from a list's "?"). */
.cq-hp-kg { columns: 2; column-gap: 32px; }
.cq-hp-g { min-width: 0; break-inside: avoid; margin-bottom: 18px; }
.cq-hp-g:last-child { margin-bottom: 0; }
.cq-hp-h { display: flex; align-items: center; gap: 7px; margin: 0 0 6px; font-size: var(--fs-xs); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); }
.cq-hp-h > .cq-i { color: var(--c-struct); }
.cq-hp-l { display: flex; flex-direction: column; margin: 0; }
.cq-hp-l > div { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--c-line-soft); }
.cq-hp-l > div:first-child { border-top: 0; }
.cq-hp-l dt { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; white-space: nowrap; font-weight: 600; color: var(--c-ink); font-size: var(--fs-sm); }
.cq-hp-l dd { margin: 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--c-ink-2); }
.cq-hp-or { padding: 0 3px; font-size: var(--fs-xs); font-weight: 500; color: var(--c-ink-3); }
.cq-hp-touch { display: none; }
.cq-hp-phone { display: none; }
.cq-hp-steps { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.cq-hp-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.cq-hp-n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c-sel); color: var(--c-struct); font-weight: 700; font-size: var(--fs-sm); }
.cq-hp-st { font-weight: 600; color: var(--c-ink); }
.cq-hp-sx { margin-top: 2px; font-size: var(--fs-sm); line-height: 1.5; color: var(--c-ink-2); }
.cq-hp-sx code, .cq-sx-row-d code { font-family: var(--f-mono); font-size: .92em; }
.cq-hp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--c-line-soft); font-size: var(--fs-sm); color: var(--c-ink-3); }
.cq-hp-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

.cq-help-ov .cq-dlg-box { width: min(760px, 100%); }
@media (max-width: 760px) {
  .cq-hp-kg:not(.is-shown) { display: none; }
  .cq-hp-kg.is-shown { columns: 1; }
  .cq-hp-touch { display: flex; }
  .cq-hp-desk { display: none; }
  .cq-hp-phone { display: inline; }
  .cq-hp-l > div { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
  /* the overlay is a bottom sheet on a phone */
  .cq-dlg.cq-help-ov { align-items: flex-end; }
  .cq-help-ov .cq-dlg-box { max-height: 85vh; border-radius: var(--r-xl) var(--r-xl) 0 0; border-top: 1px solid var(--c-line); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------------- Ctrl/Cmd K command bar
 * A dimmed page behind; a borderless 48px field with a hairline under it; rows = icon, title, and a right column
 * (authors · year, >= 140px); the section headers say what the rows are (no type tags). */
.cq-pal-scrim { position: fixed; inset: 0; z-index: 89; background: var(--c-scrim); animation: cq-fade-in .12s ease-out; }
.cq-pal {
  position: fixed; z-index: 90; left: 50%; top: 12vh; transform: translateX(-50%); width: min(660px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 14vh - 24px));
  display: flex; flex-direction: column; background: var(--c-raised); color: var(--c-ink-2); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); overflow: hidden;
}
.cq-pal-head { flex-shrink: 0; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--c-line-soft); }
.cq-pal-head > .cq-i { color: var(--c-ink-3); }
.cq-pal-in { flex: 1 1 0%; min-width: 0; height: 48px; padding: 0; border: 0; background: transparent; color: var(--c-ink); font-size: var(--fs-md); outline: none; }
.cq-pal-in::placeholder { color: var(--c-ink-3); opacity: 1; }
.cq-pal-head .cq-btn { color: var(--c-ink-3); }
.cq-pal-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 4px 6px 8px; }
.cq-pal-g { display: flex; justify-content: space-between; gap: 8px; padding: 10px 10px 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); }
.cq-pal-g-n { letter-spacing: 0; text-transform: none; font-weight: 500; font-variant-numeric: tabular-nums; }
.cq-pal-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 4px 10px; border-radius: var(--r-md); color: var(--c-ink-2); cursor: pointer; text-decoration: none; }
.cq-pal-opt.is-active { background: var(--c-accent-soft); color: var(--c-ink); }
.cq-pal-opt > .cq-i { color: var(--c-ink-3); }
.cq-pal-opt.is-active > .cq-i { color: var(--c-accent); }
.cq-pal-main { flex: 1 1 0%; min-width: 0; display: flex; align-items: baseline; gap: 16px; }
.cq-pal-t { flex: 1 1 0%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-ink); font-weight: 500; }
.cq-pal-s { flex: 0 1 auto; min-width: 140px; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--c-ink-3); text-align: right; }
.cq-pal-empty { padding: 14px 10px; color: var(--c-ink-3); font-size: var(--fs-sm); }
.cq-pal-foot { flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 16px; border-top: 1px solid var(--c-line-soft); font-size: var(--fs-xs); color: var(--c-ink-3); }
.cq-pal-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.cq-pal-foot .cq-kbd + .cq-kbd { margin-left: 0; }
@keyframes cq-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- toasts (corner)
 * Every kind the same: the raised surface, a hairline, a 3px left edge and the icon in the kind's colour (ok teal,
 * info blue, error red), ink text; actions are accent text buttons. Light and dark from the tokens. */
.cq-toasts { position: fixed; z-index: 95; right: 16px; bottom: 20px; left: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.cq-has-bulk .cq-toasts { bottom: 84px; }
/* inside a dialog that fills the screen (CQ.toast): one line of the dialog's own flow, under its header */
.cq-toasts.is-inline { position: static; z-index: auto; flex: none; align-items: stretch; gap: 8px; pointer-events: auto; }
.cq-toasts.is-inline > .cq-toast { width: auto; min-width: 0; max-width: none; box-shadow: none; }
/* a report in the inspector (beside the list, from 900px up): the toasts sit left of it, never over its reply box or
 * status form (the inspector is 380px wide there, 340px under 1100px); under 900px it takes the work column, on a
 * phone the screen, and a report toast replaces the last one instead (CQ.toast group) */
@media (min-width: 1100px) {
  .cq-insp-open:has(.cq-insp-body [data-report-thread]) .cq-toasts { right: calc(380px + 16px); }
}
@media (min-width: 900px) and (max-width: 1099px) {
  .cq-insp-open:has(.cq-insp-body [data-report-thread]) .cq-toasts { right: calc(340px + 16px); }
}
.cq-toast {
  --k: var(--c-info);
  pointer-events: auto; display: flex; align-items: center; gap: 10px; width: max-content; min-width: min(300px, 100%); max-width: 460px; padding: 10px 10px 10px 14px;
  border-radius: var(--r-md); box-shadow: var(--shadow-2); font-size: var(--fs-body); font-weight: 500; line-height: 1.4;
  background: var(--c-raised); color: var(--c-ink); border: 1px solid var(--c-line); border-left: 3px solid var(--k);
  animation: cq-toast-in .22s ease-out;
}
.cq-toast.is-ok { --k: var(--c-ok); }
.cq-toast.is-error { --k: var(--c-danger); }
.cq-toast-ic { display: inline-flex; flex-shrink: 0; color: var(--k); }
.cq-toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cq-toast-act {
  flex-shrink: 0; display: inline-flex; align-items: center; min-height: 30px; padding: 0 8px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--c-accent);
  font-size: var(--fs-sm); font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.cq-toast-x { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: -4px 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--c-ink-3); cursor: pointer; }
.cq-toast-act:hover { background: var(--c-accent-soft); color: var(--c-accent); }
.cq-toast-x:hover { background: var(--c-hover-raised); color: var(--c-ink); }
@keyframes cq-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- phone (390) */
@media (max-width: 760px) {
  :root { --d-pad: 16px; }
  .cq-hero-sugg { max-height: 60vh; }
  .cq-search { padding: 12px 16px 10px; }
  .cq-search-in { font-size: 16px; }
  .cq-fs { gap: 6px 10px; padding: 8px 12px; }
  .cq-fs-sent { flex: 1 1 100%; }
  .cq-fs-tools { flex: 1 1 100%; justify-content: flex-start; }
  .cq-fs-colw { display: none; }
  /* rows become cards */
  .cq-sheet, .cq-sheet tbody, .cq-sheet thead { display: block; }
  .cq-sheet colgroup { display: none; }
  .cq-sheet thead tr { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--c-line); background: var(--c-surface-2); }
  .cq-sheet thead th { position: static; display: none; height: 40px; background: transparent; border: 0; padding: 0; }
  .cq-sheet thead th.cq-c-check { display: flex; align-items: center; }
  .cq-sheet-alll { display: inline; margin-left: 10px; font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--c-ink-2); }
  .cq-sheet-all { display: inline-flex; align-items: center; cursor: pointer; }
  .cq-grp { display: block; }
  .cq-grp > td { display: block; padding: 10px 16px !important; }
  .cq-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "check main num" ". right right"; column-gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--c-line-soft); }
  .cq-row > td { display: block; padding: 0 !important; border: 0; background: transparent !important; height: auto; }
  .cq-row:hover, .cq-row.is-sel { background: var(--c-hover); }
  .cq-row.is-open { box-shadow: inset 3px 0 0 var(--c-struct); }
  .cq-row.is-open > td:first-child { box-shadow: none; }
  .cq-row > .cq-c-check { grid-area: check; padding-top: 2px !important; }
  .cq-row > .cq-c-main { grid-area: main; }
  .cq-row > .is-num { grid-area: num; font-size: var(--fs-sm); padding-top: 2px !important; }
  .cq-row > .cq-c-cols, .cq-row > .cq-c-right { grid-area: right; margin-top: 8px; }
  .cq-row .cq-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
  .cq-row .cq-l2 { flex-wrap: wrap; }
  .cq-pc { display: flex; flex-wrap: wrap; gap: 8px; }
  .cq-pc-read, .cq-pill { height: 40px; }
  .cq-pc-read { margin-left: 0; border-color: var(--c-accent-line); }
  .cq-shelf-add { width: 40px; height: 40px; margin-left: 0; }
  /* a paper's row (the Library, My shelf, a project: [data-paper]; L2 audit A28): about 105 px instead of 156 px. Line
     1 is the title (the full width beside the year), line 2 the meta line with PDF and the shelf status as small
     buttons at its end (the Library's projects after them), then whatever else the row says. The row is a wrapping
     flex line whose items are the cells and, through display: contents, the title cell's lines (the ::before breaks
     the line after the year). Each button is 28 px to see and 44 px tall to touch (::after); the words stay their
     names for screen readers (aria-label); the shelf menu opens as before. A project's "Added" goes into the meta
     line (its cell stays for screen readers). */
  .cq-sheet .cq-row[data-paper] { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 0; }
  .cq-sheet .cq-row[data-paper]::before { content: ""; order: 4; flex: 0 0 100%; height: 0; }
  .cq-sheet .cq-row[data-paper] > .cq-c-check { order: 1; flex: 0 0 22px; }
  .cq-sheet .cq-row[data-paper] > td.cq-c-main { display: contents; }
  .cq-sheet .cq-row[data-paper] > .cq-c-main > .cq-l1 { order: 2; flex: 1 1 0%; min-width: 0; margin-left: 10px; }
  .cq-sheet .cq-row[data-paper] > .is-num { order: 3; flex: none; margin-left: 10px; }
  .cq-sheet .cq-row[data-paper] > .cq-c-main > .cq-l2 { order: 5; flex: 1 1 0%; min-width: 0; align-self: center; margin: 3px 0 0 32px; }
  .cq-sheet .cq-row[data-paper] > .cq-c-cols { order: 6; flex: none; align-self: center; margin: 3px 0 0 8px; }
  .cq-sheet .cq-row[data-paper] > .cq-c-proj { order: 7; flex: none; align-self: center; margin: 3px 0 0 4px; }
  .cq-sheet .cq-row[data-paper] > .cq-c-main > :not(.cq-l1, .cq-l2) { order: 8; flex: 0 0 calc(100% - 32px); min-width: 0; margin-left: 32px; }
  .cq-sheet .cq-row[data-paper] > td.pj-c-added { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cq-sheet .cq-row[data-paper] .pj-l2-added { display: inline; }
  .cq-row[data-paper] .cq-pc { flex-wrap: nowrap; align-items: center; gap: 4px; min-height: 0; container-type: normal; }   /* sized by its buttons */
  .cq-row[data-paper] .cq-pc :is(.cq-pc-read, .cq-pill, .cq-shelf-add) { position: relative; height: 28px; min-height: 0; margin: 0; }
  /* the touch area; it also wins over the hover tooltip's ::after ([data-tip]: no tooltips on a phone's row) */
  .cq-row[data-paper] .cq-pc :is(.cq-pc-read, .cq-pill, .cq-shelf-add)::after { content: ""; position: absolute; inset: -8px -2px; z-index: auto;
    transform: none; padding: 0; background: none; box-shadow: none; pointer-events: auto; }
  .cq-row[data-paper] .cq-pc .cq-pc-read { gap: 0; padding: 0 7px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; }
  .cq-row[data-paper] .cq-pc .cq-pc-read > .cq-i { display: none; }
  .cq-row[data-paper] .cq-pc .cq-pc-none { display: none; }
  .cq-row[data-paper] .cq-pc .cq-pill { width: 28px; padding: 0; justify-content: center; gap: 0; }
  .cq-row[data-paper] .cq-pc .cq-pill > span { display: none; }
  .cq-row[data-paper] .cq-pc .cq-shelf-add { width: 28px; }
  .cq-row[data-paper] .cq-ptiles { position: relative; height: 28px; margin: 0; }
  .cq-row[data-paper] .cq-ptiles::after { content: ""; position: absolute; inset: -8px -2px; }
  .cq-row[data-paper] .cq-ptiles.is-none { width: 28px; }
  .cq-bulk { left: 10px; right: 10px; width: auto; transform: none; bottom: calc(var(--h-bottombar) + 10px); justify-content: space-between; padding-left: 14px; gap: 2px; }
  .cq-bulk-sep { display: none; }
  .cq-bulk.has-fold, .cq-bulk.has-fold .cq-bulk-acts { flex-wrap: nowrap; }
  .cq-bulk.has-fold .cq-bx { display: none; }
  .cq-bulk.has-fold .cq-bmore { display: flex; }
  .cq-bulk.has-fold .cq-bulk-acts { min-width: 0; gap: 2px; }
  .cq-bulk.has-fold .cq-btn.is-compact { padding-inline: 10px; }
  .cq-bulk.has-fold .cq-btn.is-compact > span, .cq-bmore > summary > span, .cq-bmore > summary > .cq-i:last-child { display: none; }
  .cq-bmore > summary { padding-inline: 10px; }
  .cq-bmore-pop { bottom: calc(var(--h-bottombar) + 74px); }
  .cq-toasts { left: 10px; right: 10px; bottom: calc(var(--h-bottombar) + 10px); align-items: stretch; }
  .cq-toast { width: auto; min-width: 0; max-width: none; }
  .cq-has-bulk .cq-toasts { bottom: calc(var(--h-bottombar) + 74px); }
  .cq-dlg { padding: 0; align-items: stretch; }
  .cq-dlg-box { max-height: none; border-radius: 0; border: 0; }
  .cq-pal { top: 0; left: 0; transform: none; width: 100%; max-height: 100%; height: 100%; border-radius: 0; border: 0; }
  .cq-pal-in { font-size: 16px; }
  .cq-pal-opt { min-height: 44px; }
  .cq-pal-main { flex-direction: column; align-items: stretch; gap: 0; }
  .cq-pal-s { min-width: 0; max-width: none; text-align: left; }
  .cq-pal-foot { display: none; }
  .cq-ph { gap: 8px; padding: 0 4px 0 6px; }
  .cq-ph-back { display: inline-flex; }
  .cq-ph-t, .cq-ph-acts > a.cq-btn { display: none; }
  .cq-ph-views { flex: 1 1 auto; min-width: 0; gap: 0 16px; }
  .cq-ph-views .cq-utab > .cq-i { display: none; }   /* words only: every view fits beside ← ⋯ × */
  .cq-panel { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .cq-auth-main { padding: 28px 16px 40px; }
  .cq-btn { min-height: 40px; }
  .cq-pop { position: fixed; left: 10px !important; right: 10px !important; top: auto !important; bottom: calc(var(--h-bottombar) + 10px); max-width: none; max-height: 70vh; overflow: auto; }
  .cq-auth .cq-pop, .cq-top .cq-pop { top: calc(var(--d-topbar-h) + 4px) !important; bottom: auto; }
  .cq-js .cq-pop.is-side { visibility: visible; }      /* a sheet like every popover on a phone */
}

/* Settings › Preferences (2026-11-02): text size and row density, from the user's preferences (shell.html sets <html
 * data-text="small|large"> and data-density="compact"). The type scale moves as a whole; the PDF keeps its own zoom. */
:root[data-text="small"] { --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-body: 14px; --fs-md: 15px; --fs-title: 16px; --fs-lg: 20px; }
:root[data-text="large"] { --fs-xs: 13px; --fs-sm: 14px; --fs-body: 16.5px; --fs-md: 17.5px; --fs-title: 18.5px; --fs-lg: 22.5px; }
:root[data-density="compact"] .cq-sheet td { padding-top: 5px; padding-bottom: 5px; }
:root[data-density="compact"] .cq-sheet td.cq-c-check { padding-top: 8px; }
:root[data-density="compact"] .cq-sheet td.is-num { padding-top: 7px; }
:root[data-density="compact"] .cq-sheet td.cq-c-cols, :root[data-density="compact"] .cq-sheet td.cq-c-right { padding-top: 3px; }
@media (max-width: 760px) {
  :root[data-density="compact"] .cq-row { padding-top: 8px; padding-bottom: 8px; }
}

/* touch-only devices: no keyboard hints such as "Press Ctrl K" (m15) */
@media (any-hover: none) and (any-pointer: coarse) {
  .cq-kbd-hint { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cq-tabs-strip { scroll-behavior: auto; }
}
@media print {
  .cq-top, .cq-tabs, .cq-act, .cq-insp, .cq-bulk, .cq-toasts { display: none !important; }
  .cq-app { height: auto; overflow: visible; }
  .cq-main { overflow: visible; }
}
/* Ctrl K: a project's row leads with its tile (ui.ptile, cloned from the scope menu) */
.cq-pal-opt > .cq-pal-tile { flex-shrink: 0; }
