/* ==========================================================================
   The Trove — library pages (inside the site chrome) and the reader
   (its own full-screen layout, templates/trove/layouts/reader.html).
   ========================================================================== */

/* Custom elements are inline by default; every Trove component is a block. */
trove-reader, trove-player, trove-gallery, trove-cite, trove-catalog, trove-search { display: block; }

.visually-hidden { position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --------------------------------------------------------------------------
   Library pages
   -------------------------------------------------------------------------- */

.trove {
    --tv-card: 9.5rem;
    max-inline-size: 76rem;
    margin-inline: auto;
    padding: 1rem clamp(1rem, 3vw, 2rem) 4rem;
}
.trove a { color: var(--cyan, #00e5ff); }
.trove a:hover { color: var(--magenta, #ff00ff); }
.trove h1 { font-family: Georgia, serif; font-weight: normal; font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: .02em; margin: .4rem 0 .6rem; color: var(--silver, #c0c0d0); }
.trove h2 { font-family: 'Courier New', monospace; font-size: .95rem; font-weight: normal; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-dim, #8898b8); margin: 2rem 0 .8rem; }
.trove .page-intro { max-inline-size: 46rem; color: var(--text-secondary, #9090a8); }

.trove-trail { font-family: 'Courier New', monospace; font-size: .8rem; color: var(--text-dim, #606078); }
.trove-trail a { color: var(--text-secondary, #9090a8); text-decoration: none; }
.trove-trail a:hover { color: var(--cyan, #00e5ff); }

.trove-hero { padding-block: 1rem 1.5rem; border-block-end: 1px solid var(--bg-tertiary, #1c1c30); }
.trove-searchbox { display: flex; gap: .5rem; margin: 1.2rem 0; max-inline-size: 44rem; }
.trove-searchbox input { flex: 1; min-inline-size: 0; font: inherit; font-size: 1rem; padding: .65rem .9rem; background: var(--bg-secondary, #151525); color: var(--text-primary, #d0d0e0); border: 1px solid var(--bg-tertiary, #1c1c30); border-radius: 4px; }
.trove-searchbox input:focus { outline: 2px solid var(--cyan-dim, #00a0b0); outline-offset: 1px; }
.trove-searchbox button, .trove .button { font-family: 'Courier New', monospace; font-size: .9rem; padding: .6rem 1rem; background: transparent; color: var(--cyan, #00e5ff); border: 1px solid var(--cyan-dim, #00a0b0); border-radius: 4px; cursor: pointer; text-decoration: none; display: inline-block; }
.trove .button.primary { background: var(--cyan-dim, #00a0b0); color: var(--bg-void, #0a0a0f); border-color: var(--cyan-dim, #00a0b0); }
.trove .button:hover, .trove-searchbox button:hover { border-color: var(--magenta, #ff00ff); color: var(--magenta, #ff00ff); }
.trove .button.primary:hover { background: var(--magenta, #ff00ff); color: var(--bg-void); }
.trove-stats { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; list-style: none; padding: 0; margin: 0; font-family: 'Courier New', monospace; font-size: .85rem; }
.trove-stats a { color: var(--text-secondary); text-decoration: none; }
.trove-stats strong { color: var(--silver); font-weight: normal; font-size: 1.1rem; }

/* Shelves and cards */
.trove-shelf { margin-block: 2rem; }
.trove-shelf > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; }
.trove-shelf > header h2 { margin: 0; }
.trove-shelf > header p { margin: 0; flex: 1 1 20rem; font-size: .9rem; color: var(--text-dim); }
.shelf-more { font-family: 'Courier New', monospace; font-size: .8rem; margin-inline-start: auto; }

.trove-cards { list-style: none; margin: .9rem 0 0; padding: 0; }
.trove-row { display: grid; grid-auto-flow: column; grid-auto-columns: var(--tv-card); gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-block-end: .8rem; scrollbar-width: thin; scrollbar-color: var(--bg-tertiary) transparent; }
.trove-row > li { scroll-snap-align: start; }
.trove-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tv-card), 1fr)); gap: 1.4rem 1rem; }
.trove-card a { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: var(--text-primary); }
.trove-card a:hover .cover, .trove-card a:focus-visible .cover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0, 229, 255, .12), 0 0 0 1px var(--cyan-dim); }
.trove-card[hidden] { display: none; }
.cover {
    position: relative; aspect-ratio: 2 / 3; border-radius: 3px; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; padding: .8rem .7rem;
    background:
        linear-gradient(160deg, hsl(var(--h) 45% 26%), hsl(calc(var(--h) + 40) 40% 12%));
    box-shadow: inset 3px 0 0 hsl(var(--h) 40% 40% / .5), 0 2px 8px rgba(0,0,0,.4);
    transition: transform .18s ease, box-shadow .18s ease;
    font-family: Georgia, serif; color: hsl(var(--h) 30% 90%);
}
.cover::after { content: ""; position: absolute; inset: .35rem; border: 1px solid hsl(var(--h) 40% 70% / .25); pointer-events: none; }
.cover-title { font-size: .98rem; line-height: 1.2; overflow-wrap: anywhere; }
.cover-by { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.cover.has-img { padding: 0; background: var(--bg-secondary); }
.cover.has-img::after { display: none; }
.cover.has-img img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.cover-video.has-img, .cover-image.has-img { aspect-ratio: 4 / 3; }
.trove-grid .cover-video, .trove-grid .cover-image { aspect-ratio: 2 / 3; }
.card-title { font-size: .92rem; line-height: 1.25; margin-block-start: .35rem; }
.card-by { font-size: .8rem; color: var(--text-secondary); }
.card-meta { display: flex; flex-wrap: wrap; gap: .25rem .4rem; font-family: 'Courier New', monospace; font-size: .68rem; color: var(--text-dim); }
.badge { display: inline-block; padding: 0 .35rem; border: 1px solid var(--bg-tertiary); border-radius: 2px; font-family: 'Courier New', monospace; font-size: .68rem; color: var(--accent-dim); }
.badge-parallel { color: var(--cyan-dim); border-color: var(--cyan-dim); }
.badge-nt { color: #e0b060; border-color: #806020; }
.badge-video { color: var(--magenta-dim, #b000b0); }
.badge-image { color: var(--violet, #b060ff); }
.badge-audio { color: var(--green, #33ff33); }

/* Filters */
.trove-filters { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; padding: .8rem; margin-block: 1rem; background: var(--bg-primary); border: 1px solid var(--bg-tertiary); border-radius: 4px; font-family: 'Courier New', monospace; font-size: .8rem; }
.trove-filters label { display: flex; flex-direction: column; gap: .2rem; color: var(--text-secondary); }
.trove-filters label.check { flex-direction: row; align-items: center; gap: .35rem; }
.trove-filters input[type=search], .trove-filters select { font: inherit; font-size: .85rem; padding: .35rem .5rem; background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--bg-tertiary); border-radius: 3px; max-inline-size: 14rem; }
.trove-count { margin-inline-start: auto; color: var(--text-dim); }
.trove-empty { color: var(--text-dim); font-style: italic; }

/* Index pages */
.trove-letters { display: flex; flex-wrap: wrap; gap: .2rem .6rem; font-family: 'Courier New', monospace; margin-block: 1rem; position: sticky; top: 0; background: var(--bg-void); padding-block: .4rem; z-index: 2; }
.trove-index { columns: 18rem; column-gap: 2rem; }
.trove-index section { break-inside: avoid-column; }
.trove-index h2 { margin-block: 1rem .3rem; }
.trove-index ul { list-style: none; padding: 0; margin: 0; }
.trove-index li { padding-block: .12rem; font-size: .95rem; }
.trove-index .dates, .trove-index .roles, .dates { color: var(--text-dim); font-size: .8rem; }
.trove-tags { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; padding: 0; margin: 0; }
.trove-tags a { display: inline-block; padding: .2rem .6rem; border: 1px solid var(--bg-tertiary); border-radius: 999px; font-size: .85rem; text-decoration: none; color: var(--accent); }
.trove-tags a:hover { border-color: var(--magenta); }
.trove-tagcloud a { font-size: calc(.85rem * var(--w, 1)); }
.trove-tags a span { color: var(--text-dim); font-size: .75em; }

/* Holding page */
.trove-item-head { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr; gap: 1.6rem; align-items: start; margin-block: 1rem 1.5rem; }
.trove-item-head .cover { max-inline-size: 13rem; }
.trove-item-head .cover-title { font-size: 1.25rem; }
.trove-item-head h1 { margin-block: 0 .3rem; }
.trove-item-head .kind { font-family: 'Courier New', monospace; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-dim); margin: 0; }
.title-original { font-size: 1.3rem; color: var(--accent-dim); margin: 0 0 .3rem; }
.subtitle { color: var(--text-secondary); font-style: italic; margin: 0 0 .4rem; }
.byline { font-size: 1.1rem; margin: .2rem 0; }
.contributors { font-size: .92rem; color: var(--text-secondary); margin: .2rem 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .9rem; font-size: .88rem; margin: 1rem 0; }
.facts dt { font-family: 'Courier New', monospace; color: var(--text-dim); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; padding-block-start: .15rem; }
.facts dd { margin: 0; color: var(--text-secondary); }
.trove-flag { border-inline-start: 3px solid #806020; padding: .5rem .8rem; background: rgba(128, 96, 32, .12); font-size: .9rem; }
.trove-warning { border-inline-start: 3px solid var(--magenta-dim, #b000b0); padding: .6rem .9rem; background: rgba(176, 0, 176, .08); margin-block: 1rem; font-size: .92rem; }
.trove-summary { max-inline-size: 46rem; font-size: 1.05rem; }
.trove-front { margin-block: 1.5rem; max-inline-size: 46rem; }
.trove-front summary { cursor: pointer; font-family: 'Courier New', monospace; color: var(--accent-dim); }
.trove-toc ol { columns: 20rem; column-gap: 2rem; padding-inline-start: 1.6rem; }
.trove-toc li { break-inside: avoid; padding-block: .1rem; }
.trove-toc .count { font-family: 'Courier New', monospace; font-size: .72rem; color: var(--text-dim); }
.trove-toc .orig { color: var(--text-dim); font-size: .85rem; }
.trove-versions { border-collapse: collapse; font-size: .9rem; inline-size: 100%; max-inline-size: 46rem; }
.trove-versions th, .trove-versions td { text-align: start; padding: .45rem .6rem; border-block-end: 1px solid var(--bg-tertiary); vertical-align: top; }
.trove-versions th { font-family: 'Courier New', monospace; font-weight: normal; font-size: .75rem; text-transform: uppercase; color: var(--text-dim); }
.trove-sources { font-size: .9rem; padding-inline-start: 1.2rem; }
.trove-cite { max-inline-size: 46rem; }
.trove-cite-bar { display: flex; flex-wrap: wrap; gap: .4rem; margin-block-end: .6rem; }
.trove-cite-bar .button { padding: .3rem .7rem; font-size: .78rem; }
.trove-cite-bar .button[aria-pressed="true"] { border-color: var(--magenta); color: var(--magenta); }
.trove-cite .cite-out { white-space: pre-wrap; font-family: 'Courier New', monospace; font-size: .85rem; color: var(--text-secondary); background: var(--bg-primary); border: 1px solid var(--bg-tertiary); border-radius: 4px; padding: .8rem; margin: 0; }
.trove-cite .cite-chicago { font-size: .92rem; color: var(--text-secondary); }
.trove-portrait { float: inline-end; margin: 0 0 1rem 1.5rem; max-inline-size: 12rem; }
.trove-portrait img { border-radius: 3px; }
.trove-portrait figcaption { font-size: .72rem; color: var(--text-dim); }

/* Media */
.trove-video { margin: 1.5rem 0; }
.trove-video video { inline-size: 100%; max-block-size: 80vh; background: #000; border-radius: 3px; }
.trove-video figcaption, .trove-gallery figcaption { font-size: .82rem; color: var(--text-secondary); margin-block-start: .4rem; }
.trove-player { margin: 1.5rem 0; padding: 1rem; background: var(--bg-primary); border: 1px solid var(--bg-tertiary); border-radius: 4px; max-inline-size: 46rem; }
.trove-player h2 { margin-block-start: 0; }
.trove-player audio { inline-size: 100%; }
.trove-tracks { max-block-size: 18rem; overflow-y: auto; padding-inline-start: 2rem; font-size: .9rem; }
.trove-tracks a { text-decoration: none; }
.trove-tracks li.is-playing a { color: var(--magenta); }
.trove-tracks .dur { font-family: 'Courier New', monospace; font-size: .75rem; color: var(--text-dim); }
.trove-player .credit { font-size: .78rem; color: var(--text-dim); }
.trove-player .tp-extra { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; font-family: 'Courier New', monospace; font-size: .8rem; margin-block: .5rem; }
.trove-player .tp-extra select, .trove-player .tp-extra button { font: inherit; background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--bg-tertiary); border-radius: 3px; padding: .2rem .4rem; }
.trove-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1.4rem; margin-block: 1.5rem; }
.trove-gallery.single { grid-template-columns: 1fr; max-inline-size: 60rem; }
.trove-gallery figure { margin: 0; }
.trove-gallery img { inline-size: 100%; block-size: auto; border-radius: 3px; background: var(--bg-secondary); cursor: zoom-in; }
.trove-gallery .t { color: var(--text-primary); }
.trove-gallery .c { display: block; color: var(--text-dim); font-size: .75rem; }

/* Lightbox */
.tv-lightbox { position: fixed; inset: 0; z-index: 10000; background: rgba(5, 5, 10, .96); display: grid; grid-template-rows: auto 1fr auto; color: #ddd; touch-action: none; }
.tv-lightbox[hidden] { display: none; }
.tv-lightbox .lb-bar { display: flex; gap: .5rem; padding: .6rem; justify-content: flex-end; font-family: 'Courier New', monospace; font-size: .85rem; align-items: center; }
.tv-lightbox .lb-bar .lb-count { margin-inline-end: auto; color: #999; }
.tv-lightbox button, .tv-lightbox a.lb-btn { font: inherit; background: rgba(255,255,255,.06); color: #ddd; border: 1px solid rgba(255,255,255,.15); border-radius: 3px; padding: .35rem .7rem; cursor: pointer; text-decoration: none; }
.tv-lightbox .lb-stage { position: relative; overflow: hidden; cursor: grab; }
.tv-lightbox .lb-stage.dragging { cursor: grabbing; }
.tv-lightbox .lb-stage img { position: absolute; left: 50%; top: 50%; max-inline-size: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }
.tv-lightbox .lb-caption { padding: .6rem 1rem 1rem; font-size: .85rem; text-align: center; color: #aaa; }
.tv-lightbox .lb-prev, .tv-lightbox .lb-next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 1.6rem; padding: .6rem .9rem; z-index: 2; }
.tv-lightbox .lb-prev { left: .6rem; } .tv-lightbox .lb-next { right: .6rem; }

/* Search page */
.trove-search .ts-layout { display: grid; grid-template-columns: 14rem 1fr; gap: 2rem; align-items: start; }
.trove-search .ts-layout.no-facets { grid-template-columns: 1fr; }
.ts-facets { position: sticky; top: 1rem; font-size: .85rem; max-block-size: calc(100vh - 2rem); overflow-y: auto; }
.ts-facets fieldset { border: 0; padding: 0; margin: 0 0 1.2rem; }
.ts-facets legend { font-family: 'Courier New', monospace; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); margin-block-end: .3rem; }
.ts-facets label { display: flex; gap: .4rem; align-items: baseline; padding-block: .08rem; color: var(--text-secondary); cursor: pointer; }
.ts-facets label span { margin-inline-start: auto; font-family: 'Courier New', monospace; font-size: .7rem; color: var(--text-dim); }
.ts-facets .more { font: inherit; font-size: .75rem; background: none; border: 0; color: var(--cyan-dim); cursor: pointer; padding: 0; }
.ts-summary { font-family: 'Courier New', monospace; font-size: .82rem; color: var(--text-dim); margin-block-end: 1rem; }
.ts-holdings { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .6rem; margin-block-end: 1.5rem; list-style: none; padding: 0; }
.ts-holdings a { display: block; padding: .6rem .8rem; border: 1px solid var(--bg-tertiary); border-radius: 4px; text-decoration: none; }
.ts-holdings .t { color: var(--silver); display: block; }
.ts-holdings .b { color: var(--text-secondary); font-size: .82rem; }
.ts-hits { list-style: none; padding: 0; margin: 0; }
.ts-hit { padding-block: .9rem; border-block-end: 1px solid var(--bg-tertiary); }
.ts-hit a.ts-where { text-decoration: none; font-size: .88rem; }
.ts-hit .ts-where .w { color: var(--silver); }
.ts-hit .ts-where .s { color: var(--text-secondary); }
.ts-hit .ts-v { font-family: 'Courier New', monospace; font-size: .7rem; color: var(--text-dim); margin-inline-start: .4rem; }
.ts-hit p { margin: .3rem 0 0; font-size: .95rem; color: var(--text-primary); }
.ts-hit mark, .tr-search mark { background: rgba(255, 0, 255, .25); color: inherit; border-radius: 2px; padding: 0 .1em; }
.ts-more { margin-block: 1rem; }
.ts-help { font-size: .82rem; color: var(--text-dim); margin-block-start: 2rem; }

@media (max-width: 760px) {
    .trove-item-head { grid-template-columns: 1fr; }
    .trove-item-head .cover { max-inline-size: 9rem; }
    .trove-search .ts-layout { grid-template-columns: 1fr; }
    .ts-facets { position: static; max-block-size: none; }
    .ts-facets:not([hidden]) { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
    .trove { --tv-card: 8rem; }
    .trove-filters label { flex: 1 1 40%; }
    .trove-filters input[type=search], .trove-filters select { max-inline-size: none; }
}

/* --------------------------------------------------------------------------
   Reader
   -------------------------------------------------------------------------- */

html.trove-html { scroll-padding-block-start: 4.5rem; }
body.trove-reading {
    --r-bg: #12131b; --r-bg2: #191a25; --r-fg: #dcd8cc; --r-muted: #8a8a9c; --r-faint: #4d4e60;
    --r-accent: #7fd3e0; --r-accent2: #e08fe0; --r-rule: #282a3a;
    --r-hot: rgba(127, 211, 224, .07); --r-pair: rgba(224, 143, 224, .16); --r-mark: rgba(255, 210, 90, .22);
    margin: 0; background: var(--r-bg); color: var(--r-fg);
    font-family: var(--r-font, 'Literata', Georgia, serif);
    -webkit-text-size-adjust: 100%;
    accent-color: var(--r-accent);
}
:root[data-theme="paper"] body.trove-reading, :root[data-theme="auto"] body.trove-reading.auto-light {
    --r-bg: #fbf9f4; --r-bg2: #f1eee6; --r-fg: #1f1d1a; --r-muted: #6b665d; --r-faint: #b9b3a6;
    --r-accent: #1d6f80; --r-accent2: #8a2c8a; --r-rule: #e3ded2;
    --r-hot: rgba(29, 111, 128, .06); --r-pair: rgba(138, 44, 138, .11); --r-mark: rgba(255, 200, 0, .3);
}
@media (prefers-color-scheme: light) {
    :root[data-theme="auto"] body.trove-reading {
        --r-bg: #fbf9f4; --r-bg2: #f1eee6; --r-fg: #1f1d1a; --r-muted: #6b665d; --r-faint: #b9b3a6;
        --r-accent: #1d6f80; --r-accent2: #8a2c8a; --r-rule: #e3ded2;
        --r-hot: rgba(29, 111, 128, .06); --r-pair: rgba(138, 44, 138, .11); --r-mark: rgba(255, 200, 0, .3);
    }
}
:root[data-theme="sepia"] body.trove-reading {
    --r-bg: #f3e9d4; --r-bg2: #eadcbf; --r-fg: #3a2d1c; --r-muted: #7a6748; --r-faint: #c4b08c;
    --r-accent: #8a4b16; --r-accent2: #7a2f55; --r-rule: #dfcfae;
    --r-hot: rgba(138, 75, 22, .06); --r-pair: rgba(122, 47, 85, .12); --r-mark: rgba(220, 150, 0, .25);
}
:root[data-theme="black"] body.trove-reading {
    --r-bg: #000; --r-bg2: #0e0e0e; --r-fg: #c9c9c9; --r-muted: #7d7d7d; --r-faint: #3a3a3a;
    --r-accent: #8fd8e6; --r-accent2: #e39ae3; --r-rule: #1e1e1e;
    --r-hot: rgba(143, 216, 230, .06); --r-pair: rgba(227, 154, 227, .14);
}
:root[data-theme="night"] body.trove-reading { /* default palette */ }

.tr {
    --r-size: 1.125rem; --r-leading: 1.65; --r-measure: 36rem; --r-label: 3.4rem; --r-gap: clamp(1.25rem, 3vw, 3rem);
    display: block; min-block-size: 100vh;
}
.tr a { color: var(--r-accent); }
.tr :focus-visible { outline: 2px solid var(--r-accent); outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: .5rem; top: .5rem; z-index: 100; background: var(--r-bg); padding: .4rem .7rem; }

/* Top bar */
.tr-bar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: .6rem;
    padding: .45rem max(.8rem, env(safe-area-inset-right)) .45rem max(.8rem, env(safe-area-inset-left));
    background: var(--r-bg);
    border-block-end: 1px solid var(--r-rule);
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .85rem;
    transition: transform .25s ease;
}
.tr.bar-hidden .tr-bar { transform: translateY(-100%); }
.tr-home { font-size: 1.3rem; text-decoration: none; color: var(--r-accent2) !important; line-height: 1; }
.tr-work { display: flex; flex-direction: column; min-inline-size: 0; text-decoration: none; color: var(--r-fg) !important; line-height: 1.2; }
.tr-work-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-inline-size: 22rem; }
.tr-work-by { color: var(--r-muted); font-size: .78rem; }
.tr-where { color: var(--r-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-inline-size: 0; }
.tr-where::before { content: "· "; }
.tr-tools { display: flex; gap: .15rem; margin-inline-start: auto; }
.tr-tools button, .tr-sheet button, .tr-pop button {
    font: inherit; color: var(--r-fg); background: transparent; border: 1px solid transparent; border-radius: 6px;
    padding: .35rem .55rem; cursor: pointer; display: inline-flex; gap: .35rem; align-items: center; line-height: 1.1;
}
.tr-tools button:hover, .tr-tools button[aria-expanded="true"], .tr-tools button[aria-pressed="true"] { background: var(--r-bg2); border-color: var(--r-rule); }
.tr-tools .lbl { display: none; }
.tr-tools svg { inline-size: 1.15rem; block-size: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tr-tools .aa { font-family: Georgia, serif; font-size: 1.05rem; line-height: 1; }
@media (min-width: 1100px) { .tr-tools .lbl { display: inline; } }
.tr-progress { position: absolute; inset-inline: 0; inset-block-end: -1px; block-size: 2px; }
.tr-progress span { display: block; block-size: 100%; inline-size: 0; background: linear-gradient(90deg, var(--r-accent), var(--r-accent2)); }

/* Contents: inline at the end without JS; a drawer with it */
.tr-toc { padding: 1rem 1.5rem; font-family: system-ui, sans-serif; font-size: .9rem; }
.tr-toc h2 { font-size: 1rem; margin: 0 0 .6rem; }
.tr-toc ol { padding-inline-start: 1.5rem; margin: 0; }
.tr-toc li { padding-block: .15rem; }
.tr-toc a { color: var(--r-fg); text-decoration: none; }
.tr-toc a[aria-current] { color: var(--r-accent); font-weight: 600; }
.tr.js .tr-toc {
    position: fixed; z-index: 60; inset-block: 0; inset-inline-start: 0; inline-size: min(22rem, 88vw);
    overflow-y: auto; background: var(--r-bg); border-inline-end: 1px solid var(--r-rule);
    box-shadow: 8px 0 30px rgba(0,0,0,.25);
    padding-block-start: max(1rem, env(safe-area-inset-top));
    display: none;
}
.tr.js .tr-toc.open { display: block; animation: tr-slide-l .2s ease; }
@keyframes tr-slide-l { from { transform: translateX(-100%); } to { transform: none; } }
.tr:not(.js) .tr-toc { order: 2; border-block-start: 1px solid var(--r-rule); }

/* Scrim for drawers/sheets */
.tr-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.35); }
.tr-scrim[hidden] { display: none; }

/* Main column */
.tr-main { padding: 1.5rem max(1rem, env(safe-area-inset-right)) 4rem max(1rem, env(safe-area-inset-left)); }
.tr-head, .tr-text, .tr-notes, .tr-pager, .tr-foot, .tr-main > .trove-warning {
    max-inline-size: calc(var(--r-label) + var(--r-measure) * 2 + var(--r-gap) * 2); margin-inline: auto;
}
.tr[data-layout="left"] :is(.tr-head, .tr-text, .tr-notes, .tr-pager, .tr-foot),
.tr[data-layout="right"] :is(.tr-head, .tr-text, .tr-notes, .tr-pager, .tr-foot),
.tr[data-layout="single"] :is(.tr-head, .tr-text, .tr-notes, .tr-pager, .tr-foot),
.tr[data-layout="stacked"] :is(.tr-head, .tr-text, .tr-notes, .tr-pager, .tr-foot),
.tr[data-layout="flip"] :is(.tr-head, .tr-text, .tr-notes, .tr-pager, .tr-foot) {
    max-inline-size: calc(var(--r-label) + var(--r-measure) + var(--r-gap));
}
.tr-kicker { font-family: system-ui, sans-serif; font-size: .8rem; color: var(--r-muted); margin: 0; padding-inline-start: calc(var(--r-label) + var(--r-gap)); }
.tr-kicker a { color: inherit; text-decoration: none; }
.tr-title { font-weight: 400; font-size: calc(var(--r-size) * 1.9); line-height: 1.2; margin: .3rem 0 1.6rem; padding-inline-start: calc(var(--r-label) + var(--r-gap)); }
.tr-title-orig { display: block; font-size: .55em; color: var(--r-muted); font-style: italic; margin-block-start: .3rem; }
.tr-colheads { display: grid; grid-template-columns: var(--r-label) minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--r-gap); font-family: system-ui, sans-serif; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--r-muted); border-block-end: 1px solid var(--r-rule); padding-block-end: .4rem; margin-block-end: .6rem; position: sticky; top: 3.1rem; z-index: 5; background: var(--r-bg); padding-block-start: .4rem; }
.tr-colheads [data-side="l"] { grid-column: 2; } .tr-colheads [data-side="r"] { grid-column: 3; }
.tr-colheads select { font: inherit; text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--r-fg); background: var(--r-bg2); border: 1px solid var(--r-rule); border-radius: 4px; padding: .15rem .3rem; max-inline-size: 100%; }
.tr.bar-hidden .tr-colheads { top: 0; }
.tr:not([data-layout="parallel"]) .tr-colheads { display: none; }

/* Text */
.tr-text { font-size: var(--r-size); line-height: var(--r-leading); hyphens: var(--r-hyphens, manual); -webkit-hyphens: var(--r-hyphens, manual); text-align: var(--r-align, start); font-variant-numeric: oldstyle-nums; font-kerning: normal; text-rendering: optimizeLegibility; }
.tr-row {
    display: grid; grid-template-columns: var(--r-label) minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--r-gap);
    position: relative; border-radius: 4px;
}
.tr-row:target { animation: tr-flash 2.2s ease-out; }
@keyframes tr-flash { from { background: var(--r-mark); } to { background: transparent; } }
.tr-heading { grid-column: 2 / -1; font-size: 1.05em; font-weight: 600; margin: 1.4em 0 .2em; font-variant: small-caps; letter-spacing: .03em; }
.tr-label {
    grid-column: 1; justify-self: end; align-self: start; margin-block-start: calc(var(--r-leading) * .5em - .5em + 1em);
    font-family: system-ui, sans-serif; font-size: .7rem; line-height: 1; color: var(--r-faint); text-decoration: none;
    font-variant-numeric: tabular-nums; padding: .2rem .25rem; border-radius: 4px; white-space: nowrap; max-inline-size: var(--r-label); overflow: hidden; text-overflow: ellipsis;
}
.tr-label:hover, .tr-row.is-hot .tr-label { color: var(--r-accent); }
.tr-row.marked .tr-label::after { content: " 🔖"; }
.tr-cell { min-inline-size: 0; padding: 0 .55rem; margin-inline: -.55rem; border-radius: 4px; transition: background-color .15s ease; overflow-wrap: break-word; }
.tr-cell[data-side="l"] { grid-column: 2; }
.tr-cell[data-side="r"] { grid-column: 3; }
.tr-cell.empty::before { content: "—"; color: var(--r-faint); display: block; margin-block: 1em; }
.tr-cell > :first-child { margin-block-start: 1em; }
.tr-cell p { margin: 0 0 1em; }
.tr-cell p + p { text-indent: var(--r-indent, 0); }
/* The point of the parallel reader: pointing at one side lights up the other. */
.tr-row.is-hot .tr-cell[data-side]:not(.is-src):not(.empty) { background: var(--r-pair); }
.tr-row.is-hot .tr-cell.is-src { background: var(--r-hot); }
/* Word gloss popover */
.tr-gloss { position: absolute; z-index: 75; max-inline-size: min(22rem, calc(100vw - 1rem)); padding: .55rem .75rem; border-radius: 8px;
    background: var(--r-bg2); color: var(--r-fg); border: 1px solid var(--r-faint); border-top: 3px solid var(--r-accent2);
    font-family: system-ui, sans-serif; font-size: .82rem; line-height: 1.4; pointer-events: none; }
.tr-gloss[hidden] { display: none; }
.tr-gloss p, .tr-gloss ul { margin: 0; padding: 0; list-style: none; }
.tr-gloss .gw { font-family: var(--r-font, 'Literata', serif); font-size: 1.05rem; margin-block-end: .2rem; }
.tr-gloss li + li { margin-block-start: .2rem; }
.tr-gloss b { font-family: var(--r-font, 'Literata', serif); font-weight: 600; }
.tr-gloss i { color: var(--r-muted); }
.tr-gloss .gh { margin-block-start: .35rem; color: var(--r-muted); }
.tr-gloss .gh span { color: var(--r-accent2); font-family: var(--r-font, 'Literata', serif); font-size: 1rem; }
.tr-gloss .gn { color: var(--r-muted); font-style: italic; }
.tr-gloss .gs { margin-block-start: .35rem; font-size: .66rem; color: var(--r-faint); }

/* Clause and word alignment (src/trove/align.ts) */
.tr-row.fine .tr-cell[data-side] { background: transparent !important; color: color-mix(in srgb, var(--r-fg) 45%, var(--r-bg)); transition: color .12s ease; }
.tr-row.fine .tr-cell .w.cs { color: var(--r-fg); }
.tr-cell .w.ws, .tr-cell .w.wsrc { background: var(--r-mark); box-shadow: 0 0 0 2px var(--r-mark); border-radius: 2px; }
.tr-cell .w.ws { outline: 1px solid var(--r-accent2); outline-offset: 1px; }
.tr-cell .l.is-hot { background: var(--r-pair); box-shadow: 0 0 0 2px var(--r-pair); border-radius: 2px; }
.tr-row.speaking .tr-cell[data-side] { background: var(--r-mark); }

/* Verse */
.tr-cell .verse { margin: 1em 0; text-align: start; }
.tr-cell .l { display: block; padding-inline-start: 1.6em; text-indent: -1.6em; position: relative; }
.tr-cell .l.i1 { padding-inline-start: 3.1em; } .tr-cell .l.i2 { padding-inline-start: 4.6em; } .tr-cell .l.i3 { padding-inline-start: 6.1em; }
.tr-cell .l[data-n$="0"]::after, .tr-cell .l[data-n$="5"]::after {
    content: attr(data-n); position: absolute; inset-inline-end: calc(100% + .7rem); inset-block-start: .35em; text-indent: 0;
    font-family: system-ui, sans-serif; font-size: .62rem; color: var(--r-faint); font-variant-numeric: tabular-nums;
}
.tr.no-lines .tr-cell .l::after { display: none; }
.tr-cell blockquote { margin: 1em 1.5em; }
.tr-cell h3, .tr-cell h4, .tr-cell h5 { font-size: 1em; font-weight: 600; margin: 1.4em 0 .5em; }
.tr-cell .center { text-align: center; text-indent: 0; }
.tr-cell .sc { font-variant: small-caps; }
.tr-cell table { border-collapse: collapse; font-size: .9em; }
.tr-cell td, .tr-cell th { border: 1px solid var(--r-rule); padding: .2em .5em; }
.tr-cell img { max-inline-size: 100%; block-size: auto; }
.tr-cell hr { border: 0; text-align: center; margin: 1.5em 0; }
.tr-cell hr::after { content: "⁂"; color: var(--r-muted); }
.tr-cell a.nr { font-family: system-ui, sans-serif; font-size: .62em; vertical-align: super; line-height: 0; text-decoration: none; padding: 0 .12em; }
.tr-cell [lang="grc"], .tr-cell:lang(grc) { font-family: var(--r-font-greek, var(--r-font, 'Literata')), 'Gentium Book Plus', 'GFS Didot', serif; }

/* Layouts */
.tr[data-layout="left"] .tr-row, .tr[data-layout="right"] .tr-row, .tr[data-layout="single"] .tr-row,
.tr[data-layout="stacked"] .tr-row, .tr[data-layout="flip"] .tr-row { grid-template-columns: var(--r-label) minmax(0, 1fr); }
.tr[data-layout="left"] .tr-cell[data-side="r"], .tr[data-layout="single"] .tr-cell[data-side="r"] { display: none; }
.tr[data-layout="right"] .tr-cell[data-side="l"] { display: none; }
.tr[data-layout="right"] .tr-cell[data-side="r"] { grid-column: 2; }
.tr[data-layout="stacked"] .tr-cell[data-side="r"] { grid-column: 2; margin-block-start: -.4em; padding-inline-start: 1rem; border-inline-start: 2px solid var(--r-rule); color: color-mix(in srgb, var(--r-fg) 82%, var(--r-bg)); font-size: .94em; }
.tr[data-layout="stacked"] .tr-row.is-hot .tr-cell[data-side="r"] { border-color: var(--r-accent2); }
.tr[data-layout="flip"] .tr-cell[data-side="r"] { display: none; grid-column: 2; }
.tr[data-layout="flip"] .tr-row.flipped .tr-cell[data-side="l"] { display: none; }
.tr[data-layout="flip"] .tr-row.flipped .tr-cell[data-side="r"] { display: block; }
.tr[data-layout="flip"] .tr-row { cursor: pointer; }
.tr[data-layout="flip"] .tr-row.flipped .tr-label { color: var(--r-accent2); }
.tr[data-layout="flip"] .tr-row.flipped .tr-label::before { content: "⇄ "; }

/* Paged mode (single-column layouts) */
.tr.paged .tr-text {
    block-size: calc(100dvh - 9.5rem); overflow: hidden; columns: var(--r-cols, 1); column-gap: var(--r-gap); column-fill: auto;
}
.tr.paged .tr-row { display: block; }
.tr.paged .tr-label { float: inline-start; margin-inline-end: .4rem; margin-block-start: 1.25em; }
.tr.paged .tr-cell { margin: 0; padding: 0; }
.tr.paged .tr-cell[data-side="r"] { display: none; }
.tr.paged[data-layout="right"] .tr-cell[data-side="l"] { display: none; }
.tr.paged[data-layout="right"] .tr-cell[data-side="r"], .tr.paged[data-layout="stacked"] .tr-cell[data-side="r"] { display: block; }
.tr.paged .tr-title { padding-inline-start: 0; font-size: calc(var(--r-size) * 1.5); margin-block-end: .8rem; }
.tr.paged .tr-kicker { padding-inline-start: 0; }
.tr.paged .tr-pager { display: none; }
.tr-pagebar { display: none; }
.tr.paged .tr-pagebar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: system-ui, sans-serif; font-size: .8rem; color: var(--r-muted); margin: .8rem auto 0; max-inline-size: calc(var(--r-label) + var(--r-measure) + var(--r-gap)); }
.tr-pagebar button { font: inherit; color: var(--r-fg); background: var(--r-bg2); border: 1px solid var(--r-rule); border-radius: 6px; padding: .4rem .9rem; cursor: pointer; }
.tr.paged .tr-tapzone { position: fixed; inset-block: 4rem 3rem; inline-size: 22%; z-index: 4; }
.tr-tapzone { display: none; }
.tr.paged .tr-tapzone { display: block; }
.tr-tapzone.prev { inset-inline-start: 0; } .tr-tapzone.next { inset-inline-end: 0; }

/* Notes, pager, footer */
.tr-notes { font-size: calc(var(--r-size) * .86); line-height: 1.5; border-block-start: 1px solid var(--r-rule); margin-block-start: 3rem; padding-inline-start: calc(var(--r-label) + var(--r-gap)); color: color-mix(in srgb, var(--r-fg) 85%, var(--r-bg)); }
.tr-notes h2 { font-family: system-ui, sans-serif; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--r-muted); }
.tr-notes li:target { background: var(--r-mark); }
.tr-notes ol { list-style: none; padding-inline-start: 0; }
.tr-notes li { display: grid; grid-template-columns: 2.2em 1fr; margin-block: .4em; }
.tr-notes li > div > :first-child { margin-block-start: 0; }
.tr-notes li > div > :last-child { margin-block-end: 0; }
.tr-notes .nm { font-family: system-ui, sans-serif; font-size: .85em; font-variant-numeric: tabular-nums; color: var(--r-muted); text-decoration: none; padding-block-start: .1em; }
.tr-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-block: 3rem 1rem; font-family: system-ui, sans-serif; padding-inline-start: calc(var(--r-label) + var(--r-gap)); }
.tr-pager a { display: flex; flex-direction: column; gap: .15rem; padding: .8rem 1rem; border: 1px solid var(--r-rule); border-radius: 8px; text-decoration: none; color: var(--r-fg); font-size: .95rem; }
.tr-pager a span { font-size: .72rem; color: var(--r-muted); text-transform: uppercase; letter-spacing: .1em; }
.tr-pager a[rel="next"], .tr-pager a:last-child { text-align: end; }
.tr-pager a:hover { border-color: var(--r-accent); }
.tr-foot { font-family: system-ui, sans-serif; font-size: .75rem; color: var(--r-muted); padding-inline-start: calc(var(--r-label) + var(--r-gap)); }
.tr .trove-warning { border-inline-start: 3px solid var(--r-accent2); padding: .6rem .9rem; background: var(--r-pair); margin-block-end: 1.5rem; font-family: system-ui, sans-serif; font-size: .9rem; }

/* Sheets: settings, search, bookmarks */
.tr-sheet {
    position: fixed; z-index: 60; inset-block: 0; inset-inline-end: 0; inline-size: min(24rem, 100vw);
    background: var(--r-bg); border-inline-start: 1px solid var(--r-rule); box-shadow: -8px 0 30px rgba(0,0,0,.25);
    overflow-y: auto; padding: max(1rem, env(safe-area-inset-top)) 1.2rem 2rem; font-family: system-ui, sans-serif; font-size: .9rem;
    display: none;
}
.tr-sheet.open { display: block; animation: tr-slide-r .2s ease; }
@keyframes tr-slide-r { from { transform: translateX(100%); } to { transform: none; } }
@keyframes tr-slide-up { from { transform: translateY(100%); } to { transform: none; } }
.tr-sheet header { display: flex; align-items: center; justify-content: space-between; margin-block-end: .8rem; }
.tr-sheet h2 { font-size: 1rem; margin: 0; }
.tr-sheet fieldset { border: 0; margin: 0 0 1.1rem; padding: 0; }
.tr-sheet legend { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--r-muted); margin-block-end: .4rem; }
.tr-seg { display: flex; flex-wrap: wrap; gap: .3rem; }
.tr-seg button { border: 1px solid var(--r-rule) !important; flex: 1 1 auto; justify-content: center; }
.tr-seg button[aria-pressed="true"] { background: var(--r-accent) !important; color: var(--r-bg) !important; border-color: var(--r-accent) !important; }
.tr-seg button:disabled { opacity: .4; cursor: not-allowed; }
.tr-sheet input[type="range"] { inline-size: 100%; }
.tr-sheet select, .tr-sheet input[type="search"], .tr-sheet textarea { font: inherit; inline-size: 100%; padding: .45rem .6rem; color: var(--r-fg); background: var(--r-bg2); border: 1px solid var(--r-rule); border-radius: 6px; box-sizing: border-box; }
.tr-sheet .row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding-block: .25rem; }
.tr-sheet .hint { color: var(--r-muted); font-size: .78rem; }
.tr-sheet kbd { font-family: ui-monospace, monospace; font-size: .75rem; padding: .05rem .35rem; border: 1px solid var(--r-rule); border-radius: 4px; background: var(--r-bg2); }
.tr-swatches button { inline-size: 2.4rem; block-size: 2.4rem; border-radius: 50% !important; padding: 0 !important; flex: 0 0 auto !important; }
.tr-search .ts-hits { list-style: none; padding: 0; margin: .6rem 0 0; }
.tr-search .ts-hit { padding-block: .6rem; border-block-end: 1px solid var(--r-rule); }
.tr-search .ts-hit a { text-decoration: none; color: var(--r-fg); display: block; }
.tr-search .ts-hit .s { font-size: .75rem; color: var(--r-muted); display: block; }
.tr-search .ts-hit p { margin: .2rem 0 0; font-family: var(--r-font, 'Literata', serif); font-size: .92rem; }
.tr-marks ul { list-style: none; padding: 0; margin: 0; }
.tr-marks li { padding-block: .55rem; border-block-end: 1px solid var(--r-rule); }
.tr-marks li a { color: var(--r-fg); text-decoration: none; display: block; }
.tr-marks .q { font-family: var(--r-font, 'Literata', serif); font-size: .9rem; color: var(--r-muted); display: block; }
.tr-marks .note { font-size: .85rem; font-style: italic; }
.tr-marks .acts { display: flex; gap: .4rem; margin-block-start: .3rem; }
.tr-marks .acts button { font-size: .75rem; padding: .15rem .45rem; border: 1px solid var(--r-rule); }
.tr-speech { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Popovers: passage menu, selection menu, footnotes, citation, toast */
.tr-pop {
    position: absolute; z-index: 70; max-inline-size: min(26rem, calc(100vw - 1.5rem));
    background: var(--r-bg); color: var(--r-fg); border: 1px solid var(--r-rule); border-radius: 8px;
    box-shadow: 0 10px 34px rgba(0,0,0,.3); padding: .4rem; font-family: system-ui, sans-serif; font-size: .85rem;
}
.tr-pop[hidden] { display: none; }
.tr-pop.menu { display: flex; flex-direction: column; min-inline-size: 12rem; }
.tr-pop.menu button { justify-content: flex-start; inline-size: 100%; }
.tr-pop.menu button:hover, .tr-pop.menu button:focus-visible { background: var(--r-bg2); }
.tr-pop.selbar { flex-direction: row; display: flex; gap: .1rem; padding: .25rem; }
.tr-pop.note { padding: .8rem 1rem; font-family: var(--r-font, 'Literata', serif); font-size: .92rem; line-height: 1.5; max-block-size: 50vh; overflow-y: auto; }
.tr-pop.note p { margin: 0 0 .6em; }
.tr-cite-dialog { padding: 1rem 1.1rem; inline-size: min(32rem, calc(100vw - 1.5rem)); }
.tr-cite-dialog h3 { margin: 0 0 .5rem; font-size: .95rem; }
.tr-cite-dialog .fmt { display: flex; gap: .3rem; flex-wrap: wrap; margin-block-end: .6rem; }
.tr-cite-dialog textarea { inline-size: 100%; min-block-size: 6.5rem; font: inherit; font-size: .82rem; color: var(--r-fg); background: var(--r-bg2); border: 1px solid var(--r-rule); border-radius: 6px; padding: .5rem; box-sizing: border-box; resize: vertical; }
.tr-cite-dialog .acts { display: flex; gap: .4rem; justify-content: flex-end; margin-block-start: .5rem; }
.tr-cite-dialog .acts button, .tr-cite-dialog .fmt button { border: 1px solid var(--r-rule); }
.tr-toast { position: fixed; z-index: 80; inset-inline: 0; margin-inline: auto; inset-block-end: max(1.2rem, env(safe-area-inset-bottom)); inline-size: max-content; max-inline-size: calc(100vw - 2rem); background: var(--r-fg); color: var(--r-bg); padding: .55rem 1rem; border-radius: 999px; font-family: system-ui, sans-serif; font-size: .85rem; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.tr-toast button { font: inherit; color: inherit; background: none; border: 0; text-decoration: underline; cursor: pointer; margin-inline-start: .6rem; }
.tr-toast[hidden] { display: none; }

/* Narrow screens: parallel becomes interlinear unless the reader insists */
@media (max-width: 820px) {
    .tr { --r-label: 2.1rem; --r-gap: .8rem; --r-size: 1.06rem; }
    .tr[data-layout="parallel"]:not(.force-parallel) .tr-row { grid-template-columns: var(--r-label) minmax(0, 1fr); }
    .tr[data-layout="parallel"]:not(.force-parallel) .tr-cell[data-side="r"] { grid-column: 2; margin-block-start: -.4em; padding-inline-start: .9rem; border-inline-start: 2px solid var(--r-rule); font-size: .94em; color: color-mix(in srgb, var(--r-fg) 82%, var(--r-bg)); }
    .tr[data-layout="parallel"]:not(.force-parallel) .tr-colheads { display: none; }
    .tr-main { padding-block-start: 1rem; }
    .tr-title { font-size: calc(var(--r-size) * 1.55); }
    .tr-work-title { max-inline-size: 40vw; }
    .tr-where { display: none; }
    .tr-sheet { inset-block-start: auto; inline-size: 100%; max-block-size: 78vh; border-inline-start: 0; border-block-start: 1px solid var(--r-rule); border-radius: 14px 14px 0 0; padding-block-end: max(2rem, env(safe-area-inset-bottom)); }
    .tr-sheet.open { animation-name: tr-slide-up; }
    .tr-pager { grid-template-columns: 1fr; padding-inline-start: 0; }
    .tr-notes, .tr-foot { padding-inline-start: 0; }
    .tr-label { font-size: .62rem; }
}
@media (max-width: 820px) and (orientation: landscape) { .tr.force-parallel { --r-size: .98rem; } }
@media (prefers-reduced-motion: reduce) { .tr *, .tr-sheet, .tr-toc { transition: none !important; animation: none !important; } }

@media print {
    .tr-bar, .tr-toc, .tr-pager, .tr-sheet, .tr-pop, .tr-scrim, .tr-toast, .tr-pagebar, .tr-tapzone { display: none !important; }
    body.trove-reading { background: #fff; color: #000; }
    .tr-cell { background: none !important; }
    .tr-colheads { position: static; }
}
