/* Book-only styles (3D scene, pages). Tokens & shared components: base.css; header/footer: site.css */

html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg); color: var(--ui-ink); font-family: var(--f-sans);
  -webkit-tap-highlight-color: transparent; transition: background .5s;
}


/* ============ toolbar & pager ============ */
.toolbar { position: fixed; z-index: 10; top: 0; left: 0; right: 0; height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(16px, env(safe-area-inset-left)); gap: 12px; }
#soundBtn { width: 36px; padding: 0; justify-content: center; }
#soundBtn .x { display: none; }
#soundBtn.off .w { display: none; }
#soundBtn.off .x { display: inline; }
.pager { position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; height: 62px; display: flex; align-items: center; justify-content: center; gap: 16px; padding-bottom: env(safe-area-inset-bottom); }
.pager > button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--ui-br); background: var(--ui-bg); font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pager > button:disabled { opacity: .3; cursor: default; }
.pager > button:not(:disabled):hover { border-color: var(--acc); }
.pg-mid { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 150px; }
.pg-label { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; }
.pg-progress { width: 140px; height: 2px; background: var(--ui-br); border-radius: 2px; overflow: hidden; }
.pg-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--green)); transition: width .4s; }
.hint { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; opacity: .5; }
/* timeline slider (app/timeline.js) */
.pg-track { position: relative; width: 220px; height: 22px; margin: -3px 0; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; -webkit-user-select: none; user-select: none; }
.pg-track .pg-progress { width: 100%; height: 3px; }
.pg-thumb { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--paper); border: 2px solid var(--green); box-shadow: 0 1px 4px var(--thumb-sh); transition: left .35s, transform .15s; pointer-events: none; }
.pg-track:hover .pg-thumb, .pg-track.previewing .pg-thumb, .pg-track:focus-visible .pg-thumb { transform: scale(1.3); border-color: var(--acc); }
.pg-track.previewing .pg-thumb, .pg-track.previewing .pg-progress i { transition: none; }
.pg-track:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; border-radius: 6px; }
.pg-tip { position: absolute; bottom: calc(100% + 12px); left: 0; transform: translateX(-50%); white-space: nowrap; padding: 7px 11px 6px; border-radius: 8px; background: var(--fill); color: var(--fill-ink); font-family: var(--f-label); font-size: 11px; font-weight: 600; letter-spacing: .08em; line-height: 1.2; pointer-events: none; box-shadow: 0 6px 18px rgba(22, 36, 26, .22); z-index: 2; }
.pg-tip::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--fill); }
.pg-tip[hidden] { display: none; }
.pg-mid:has(.pg-tip:not([hidden])) .pg-label { opacity: 0; }
/* quick jumps: cover / contents */
.pager > .pg-jump { width: auto; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--ui-br); background: var(--ui-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-label); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ui-ink); cursor: pointer; white-space: nowrap; }
.pager > .pg-jump svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pager > .pg-jump:disabled { opacity: .35; cursor: default; }
.pager > .pg-jump:not(:disabled):hover { border-color: var(--acc); color: var(--acc); }
@media (max-width: 600px) {
  .pager { gap: 8px; }
  .pager > .pg-jump { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .pager > .pg-jump span { display: none; }
  .pg-mid { min-width: 0; }
  .pg-track { width: 150px; height: 30px; margin: -7px 0; }
  .pg-thumb { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
}

/* plain "printed" page carried by the fast cascade (too quick to read; keeps the DOM light) */
.p-faux { padding: 9% 9% 0; }
.p-faux i { display: block; height: 1.1%; margin: 0 0 3.2%; border-radius: 2px; background: var(--faux1); }
.p-faux i.h { height: 3.4%; width: 55%; margin-bottom: 5%; background: var(--faux2); }
.p-faux i.k { height: .9%; width: 30%; background: rgba(199, 120, 42, .45); }
.p-faux i.s { width: 70%; }
.p-faux b { display: block; width: 46%; height: 26%; margin: 2% auto 6%; border-radius: 50%; background: radial-gradient(closest-side, var(--faux-bud), rgba(var(--glow-rgb), .12) 70%, transparent); }

/* ============ 3D stage ============ */
/* deeper perspective + origin near the book centre: a lifted cover / page rises much less towards the menu;
   the scene box is also clipped at the header line as a final guard */
.scene { position: fixed; left: 0; right: 0; top: 58px; bottom: 62px; display: grid; place-items: center; perspective: 4200px; perspective-origin: 50% 48%; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; opacity: 0; transition: opacity .6s; }
.ready .scene { opacity: 1; }
[data-mode="single"] .scene { perspective: 1800px; }
.tilt { transform-style: preserve-3d; transform: rotateX(var(--tilt)); }
.float { transform-style: preserve-3d; animation: float 8s ease-in-out infinite; }
.no-float .float { animation: none; }
@media (prefers-reduced-motion: reduce) { .float { animation: none; } }
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) rotateZ(-.2deg) rotateX(0deg); }
  50% { transform: translate3d(0, -7px, 10px) rotateZ(.25deg) rotateX(1.2deg); }
}
.book { position: relative; width: calc(var(--W) * 2); height: var(--H); transform-style: preserve-3d; transform: translateX(var(--shift)); }
[data-mode="single"] .book { width: var(--W); }
.bshadow { position: absolute; left: -12%; right: -12%; transition: left .7s, right .7s; top: 4%; bottom: -14%; transform: translateZ(-3px); pointer-events: none;
  background: radial-gradient(50% 50% at 50% 55%, rgba(var(--sh), .34), transparent 72%); }
.slot { position: absolute; top: 0; width: var(--W); height: var(--H); }
.slot.left { left: 0; border-radius: 3px 0 0 3px; }
.slot.right { left: var(--W); border-radius: 0 3px 3px 0; }
[data-mode="single"] .slot.left { display: none; }
[data-mode="single"] .slot.right { left: 0; }
.slot.empty { visibility: hidden; box-shadow: none !important; }
.cast { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.leaf { position: absolute; top: 0; left: var(--W); width: var(--W); height: var(--H); transform-style: preserve-3d; transform: translateZ(1.5px); pointer-events: none; }
[data-mode="single"] .leaf { left: 0; }
.strip { position: absolute; top: 0; height: 100%; transform-style: preserve-3d; transform-origin: 0 50%; }
.face { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--paper); }
/* hard boards: one solid, fully opaque sheet */
.leaf.hard .face { background: var(--board, #1f3d24); }
.leaf.hard .page { opacity: 1; }
/* board fore-edge: 3px solid cloth strip standing between the two faces (no see-through / ripple at ~90°) */
.board-edge { position: absolute; top: 0; right: -1.5px; width: 3px; height: 100%; background: var(--board, #1f3d24); transform: rotateY(90deg); transform-origin: 50% 50%; backface-visibility: visible; }
.leaf.hard .shade { inset: 0 !important; }
.leaf.edge-on .face { visibility: hidden; }
.face.back { transform: rotateY(180deg); }
.shade { position: absolute; inset: 0; pointer-events: none; }
.dragging, .dragging * { cursor: grabbing !important; }
.boot-msg { position: absolute; max-width: 420px; padding: 20px; text-align: center; line-height: 1.5; }
.boot-error .scene { opacity: 1; }

/* ============ page base ============ */
.page {
  position: absolute; top: 0; left: 0; width: var(--W); height: var(--H); overflow: hidden;
  display: flex; flex-direction: column;
  padding: calc(var(--u) * 8) calc(var(--u) * 8) calc(var(--u) * 9);
  font-size: calc(var(--u) * var(--fs)); line-height: 1.45; color: var(--ink);
  background: var(--noise), linear-gradient(160deg, var(--paper) 0%, var(--paper2) 100%);
  background-blend-mode: soft-light, normal;
}
.side-r { padding-left: calc(var(--u) * 10); }
.side-l { padding-right: calc(var(--u) * 10); }
.gutter { position: absolute; top: 0; bottom: 0; width: 16%; pointer-events: none; z-index: 6; }
.side-r .gutter { left: 0; background: linear-gradient(90deg, rgba(50, 45, 25, .12), rgba(50, 45, 25, .03) 25%, transparent); }
.side-l .gutter { right: 0; background: linear-gradient(270deg, rgba(50, 45, 25, .12), rgba(50, 45, 25, .03) 25%, transparent); }
[data-mode="single"] .side-r .gutter { width: 8%; opacity: .6; }
.hard .gutter { display: none; }
.folio { position: absolute; bottom: calc(var(--u) * 4.2); font-size: .72em; letter-spacing: .25em; color: var(--muted); font-weight: 600; }
.side-r .folio { right: calc(var(--u) * 8); }
.side-l .folio { left: calc(var(--u) * 8); }

.eyebrow { font-size: .72em; letter-spacing: .3em; text-transform: uppercase; color: var(--acc); font-weight: 600; }
.h-serif { font-family: var(--f-serif); font-weight: 400; font-size: 2.5em; line-height: 1.05; margin: .25em 0 .5em; letter-spacing: -.01em; }
.h-serif.big { font-size: 3.6em; margin-bottom: .3em; }
.label { font-size: .7em; letter-spacing: .24em; text-transform: uppercase; color: var(--acc); font-weight: 700; margin: 0 0 .55em; }
.label em { font-style: normal; color: var(--ink); }
.lead { font-family: var(--f-serif); font-size: 1.24em; line-height: 1.32; margin: 0; color: var(--ink); }
p { margin: 0; color: var(--ink2); }


/* botanical ornament: fine rule with a leaf in the middle */
.orn { position: absolute; display: flex; align-items: center; gap: .7em; pointer-events: none; color: var(--gold); }
.orn::before, .orn::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, currentColor); opacity: .7; }
.orn::after { background: linear-gradient(270deg, transparent, currentColor); }
.orn .leaf-mark { width: 1.5em; height: 1.5em; flex: none; }


/* ============ cover / back: green cloth hardcover, gold foil ============ */
.p-cover, .p-back { padding: 0; color: var(--gold-l);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 3px),
    radial-gradient(120% 85% at 50% 32%, var(--cover-a) 0%, var(--cover-b) 55%, var(--cover-c) 100%); }
.cover-tex { position: absolute; inset: 0; background: var(--noise); opacity: .45; mix-blend-mode: overlay; }
.cover-frame { position: absolute; inset: calc(var(--u) * 4); border: 1px solid rgba(217, 178, 106, .62); outline: 1px solid rgba(217, 178, 106, .3); outline-offset: calc(var(--u) * -1.1); }
.spine-crease { position: absolute; top: 0; bottom: 0; left: calc(var(--u) * 2.6); width: calc(var(--u) * 1.4); background: linear-gradient(90deg, rgba(0, 0, 0, .45), rgba(255, 255, 255, .08) 45%, rgba(0, 0, 0, .22)); }
.spine-crease.r { left: auto; right: calc(var(--u) * 2.6); transform: scaleX(-1); }
.p-cover::after, .p-back::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, rgba(255, 255, 255, .08) 0%, transparent 38%, transparent 70%, rgba(255, 255, 255, .035) 100%); }
.cover-kicker { position: absolute; top: calc(var(--u) * 10); left: 0; right: 0; text-align: center; font-size: .68em; letter-spacing: .42em; text-transform: uppercase; color: rgba(243, 223, 168, .82); font-weight: 600; }
/* gold foil serif lettering */
.foil { display: block; font-family: var(--f-serif); font-weight: 400; line-height: 1.12; color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(180deg, #fbefc6 0%, #e9c983 38%, #b88a3e 56%, #e8c886 78%, #f8e9bd 100%);
  filter: drop-shadow(0 .03em .02em rgba(0, 0, 0, .45)); white-space: nowrap; }
.cover-title { position: absolute; top: 15.5%; left: 0; right: 0; margin: 0; font-weight: 400; text-align: center; z-index: 3; }
.cover-title .t1 { font-size: calc(var(--u) * 10.4); letter-spacing: .01em; }
.cover-title .t2 { font-size: calc(var(--u) * 11.5); font-style: italic; margin-top: -.12em; }
.cover-orn { left: 24%; right: 24%; top: 41%; font-size: calc(var(--u) * 2.6); }
.cover-buds { position: absolute; left: 0; right: 0; bottom: 17%; height: 40%; }
.cover-buds .cb { position: absolute; bottom: 0; }
.cover-buds .cb1 { left: 50%; height: 100%; transform: translateX(-50%); z-index: 2; }
.cover-buds .cb0 { left: 6%; height: 66%; bottom: 2%; z-index: 1; }
.cover-buds .cb2 { right: 6%; height: 68%; bottom: 2%; z-index: 1; }
.cover-glow { position: absolute; left: 12%; right: 12%; top: 44%; height: 42%; border-radius: 50%; background: radial-gradient(closest-side, rgba(170, 205, 140, .22), transparent); }
.cover-floor { position: absolute; left: 16%; right: 16%; bottom: 14%; height: 7%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .4), transparent); }
.cover-foot, .back-foot { position: absolute; left: calc(var(--u) * 9); right: calc(var(--u) * 9); bottom: calc(var(--u) * 8); display: flex; align-items: center; justify-content: space-between; font-size: .68em; letter-spacing: .3em; text-transform: uppercase; color: rgba(243, 223, 168, .78); font-weight: 600; }
.age { display: grid; place-items: center; width: 3em; height: 3em; border-radius: 50%; border: 1px solid currentColor; letter-spacing: 0; font-size: 1.05em; color: var(--gold); }
.back-orn { left: 30%; right: 30%; top: 24%; font-size: calc(var(--u) * 3); }
.back-title { position: absolute; top: 36%; left: 0; right: 0; text-align: center; }
.back-title .foil { font-size: calc(var(--u) * 7.2); font-style: italic; }
.back-blurb { position: absolute; top: 51%; left: 16%; right: 16%; text-align: center; font-family: var(--f-serif); font-style: italic; font-size: 1.2em; line-height: 1.45; color: rgba(243, 233, 205, .86); }
.back-names { position: absolute; top: 70%; left: 8%; right: 8%; text-align: center; font-size: .66em; line-height: 1.8; letter-spacing: .3em; text-transform: uppercase; color: rgba(243, 223, 168, .62); }
.back-names em { font-style: normal; color: var(--gold); }
.barcode { display: flex; gap: calc(var(--u) * .45); height: 3.6em; padding: .5em .6em; background: #f6f1e2; border-radius: 2px; }
.barcode i { display: block; background: #16241a; }

/* ============ intro ============ */
.p-intro .lead { margin-bottom: 1.6em; }
.p-intro .legend { margin-bottom: auto; }
.legend { list-style: none; margin: 0; padding: 0; }
.legend li { display: grid; grid-template-columns: 9em 1fr; gap: 1.1em; align-items: center; padding: .7em 0; border-bottom: 1px solid var(--line2); font-size: .92em; color: var(--ink2); }
.lg-ico { display: flex; align-items: center; }
.thc-mini { font-size: 1.9em; font-weight: 300; color: var(--green); letter-spacing: -.02em; }
.thc-mini small { font-size: .55em; color: var(--amber); }
.howto { margin-top: 1em; font-size: .88em; font-family: var(--f-serif); font-style: italic; }
/* page 01: compact "what is cannabis" reference box + where donations go */
.p-intro .lead { margin-bottom: 1em; }
.p-intro .legend li { padding: .45em 0; }
.cannabis-box { margin-top: 1em; padding: .7em .9em .75em; border-left: 2px solid var(--green); background: var(--tag-bg); border-radius: 0 .5em .5em 0; }
.cannabis-box .label { margin: 0 0 .3em; }
.cannabis-box p { font-size: .78em; line-height: 1.45; color: var(--ink2); }
.support-note { margin-top: .7em; font-size: .76em; line-height: 1.4; color: var(--ink2); }
.support-note::before { content: "♥ "; color: var(--amber); }
.disclaimer { margin-top: auto; padding-top: .9em; border-top: 1px solid var(--line2); font-size: .72em; line-height: 1.5; color: var(--muted); }


/* ============ hero page (poster-style: pale name behind the bud, sage glow) ============ */
.p-hero { padding-top: calc(var(--u) * 7); }
.meta-row { position: relative; z-index: 4; display: flex; justify-content: space-between; font-size: .68em; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.meta-row b { color: var(--ink); }
.meta-row .no { color: var(--acc); font-weight: 700; }
.hero-name { position: absolute; left: 2%; right: 2%; top: 16%; overflow: hidden; text-align: center; z-index: 1; line-height: .9; font-family: var(--f-serif); font-weight: 700; letter-spacing: -.02em;
  color: transparent; text-shadow: 0 0 .045em var(--bgname); white-space: nowrap; }
.hero-glow { position: absolute; left: 4%; right: 4%; top: 14%; height: 62%; border-radius: 50%; background: radial-gradient(closest-side, var(--glow-hi2), var(--glow-lo2) 55%, transparent); }
.hero-img { position: absolute; z-index: 2; left: 50%; bottom: 27%; height: 62%; max-width: 110%; transform: translateX(-50%); pointer-events: none; -webkit-user-drag: none; }
.hero-img.raw { height: 56%; bottom: 29%; }
.hero-floor { position: absolute; z-index: 1; left: 22%; right: 22%; bottom: 26%; height: 5%; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--sh), .26), transparent); }
.hero-bottom { position: relative; z-index: 3; margin-top: auto; display: flex; flex-direction: column; gap: 1em; }
.hero-cap { text-align: center; font-size: 1.02em; color: var(--ink2); margin: 0; line-height: 1.35; }
.hero-cap .sname { font-size: 1.35em; margin-right: .15em; }
.hero-gen { text-align: center; font-size: .66em; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); margin-top: -.35em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-gen em { font-style: normal; color: var(--amber); margin: 0 .5em; }
.hero-rule { height: 1px; background: linear-gradient(90deg, transparent, var(--amber) 20%, var(--green) 80%, transparent); opacity: .55; }
.tod-row { display: flex; align-items: center; gap: 1em; flex-wrap: wrap; font-size: .95em; }
.tod-lbl { font-size: .7em; letter-spacing: .24em; text-transform: uppercase; color: var(--acc); font-weight: 700; }
.tod-txt { margin-left: auto; font-family: var(--f-serif); font-style: italic; color: var(--ink2); font-size: .95em; }

/* ============ info page ============ */
.info-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .8em; margin-bottom: .4em; }
[data-closed="front"] .bshadow { left: 44%; }
[data-closed="back"] .bshadow { right: 44%; }
.info-head .no { white-space: nowrap; font-size: .72em; letter-spacing: .2em; color: var(--acc); font-weight: 700; }
.info-head .sname { font-size: 2.3em; min-width: 0; }
.pill { margin-left: auto; font-size: .62em; letter-spacing: .18em; text-transform: uppercase; padding: .45em 1em; border-radius: 99px; border: 1px solid var(--line); color: var(--ink2); white-space: nowrap; }
.sec { position: relative; padding-left: 1.15em; margin-top: 1.1em; }
.p-info > .sec, .p-info > .sec-row { margin-top: auto; padding-top: 1.1em; }
.p-info > .sec::before { top: 1.25em; }
.p-info { padding-bottom: calc(var(--u) * 11); }
.sec::before { content: ""; position: absolute; left: 0; top: .15em; bottom: .1em; width: 1px; background: linear-gradient(180deg, var(--amber) 0 1.6em, var(--green) 1.6em); opacity: .85; }
.sec p { line-height: 1.5; }
.sec-row { display: grid; grid-template-columns: 1fr auto; gap: 1.2em; align-items: end; }
.tags { display: flex; flex-wrap: wrap; gap: .45em; }
.thc-box { text-align: right; padding-left: 0; }
.thc-box::before { display: none; }
.thc { display: flex; align-items: flex-start; justify-content: flex-end; line-height: .9; }
.thc-n { font-size: 3.9em; font-weight: 300; letter-spacing: -.03em; color: var(--green); }
.thc-u { display: flex; flex-direction: column; font-size: 1.5em; color: var(--amber); margin-left: .1em; line-height: 1; font-weight: 600; }
.thc-u b { font-size: .62em; letter-spacing: .12em; color: var(--ink); margin-top: .2em; }
.cbd { margin-top: .5em; font-size: .72em; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.cbd b { color: var(--ink); letter-spacing: .05em; font-size: 1.15em; margin-left: .3em; }
.lineage { display: flex; flex-direction: column; align-items: center; padding-top: .2em; }
.parents { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35em .4em; }
.gp { font-size: .7em; letter-spacing: .16em; text-transform: uppercase; padding: .45em .8em; border: 1px solid var(--line); border-radius: .4em; color: var(--ink); background: var(--tag-bg); white-space: nowrap; }
.gx { color: var(--acc); font-size: .9em; }
.branch { position: relative; width: 62%; height: .9em; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 .6em .6em; }
.branch::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: .7em; background: var(--line); }
.child { margin-top: .7em; }
.child span { display: inline-block; font-family: var(--f-serif); font-style: italic; font-size: 1.05em; padding: .25em 1.1em; border-radius: 99px; background: var(--fill); color: var(--fill-ink); }
.quote .q { position: absolute; right: 0; top: -.2em; width: 2.6em; fill: var(--acc); opacity: .35; }
.quote blockquote { margin: 0; font-family: var(--f-serif); font-style: italic; font-size: 1.12em; line-height: 1.4; color: var(--ink); padding-right: 2.4em; }

/* ============ contents ============ */
.chips { display: flex; flex-wrap: wrap; gap: .45em; margin: .2em 0 1.2em; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: .5em 1.05em; font-size: .74em; letter-spacing: .16em; text-transform: uppercase; color: var(--ink2); cursor: pointer; font-weight: 600; }
.chip:hover { border-color: var(--acc); color: var(--ink); }
.chip.on { background: var(--fill); border-color: var(--fill); color: var(--fill-ink); }
.toc { list-style: none; margin: 0; padding: 0; }
.toc-row { display: grid; grid-template-columns: 1.8em 4.6em auto 1fr auto; align-items: center; gap: .8em; padding: .55em .4em; border-bottom: 1px solid var(--line2); color: inherit; text-decoration: none; border-radius: .4em; transition: background .2s; }
.toc-row:hover { background: var(--tag-bg); }
.toc-no { font-size: .75em; letter-spacing: .12em; color: var(--acc); font-weight: 700; }
.toc-img { width: 4.6em; height: 4.6em; object-fit: contain; }
.toc-main { display: flex; flex-direction: column; gap: .2em; min-width: 0; }
.toc-name { font-family: var(--f-serif); font-size: 1.5em; line-height: 1.1; }
.toc-sub { font-size: .72em; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toc-bar { width: 7em; height: 3px; border-radius: 3px; background: var(--amber); opacity: .9; overflow: hidden; margin-top: .3em; }
.toc-bar i { display: block; height: 100%; background: var(--green); }
.toc-dots { align-self: end; margin-bottom: 1.6em; border-bottom: 1px dotted var(--muted); opacity: .6; min-width: 1em; }
.toc-pg { font-family: var(--f-serif); font-style: italic; font-size: 1.3em; color: var(--acc); }
.toc-empty { padding: 2em 0; color: var(--muted); font-style: italic; font-family: var(--f-serif); }
.toc-foot { margin-top: auto; font-size: .72em; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* ============ glossary & notes ============ */
.gl-mark { position: absolute; right: 9%; top: 7.5%; width: 9%; height: auto; color: var(--green); opacity: .55; }
.gloss { list-style: none; margin: 0; padding: 0; }
.gloss li { padding: .85em 0; border-bottom: 1px solid var(--line2); }
.gl-name { font-family: var(--f-serif); font-size: 1.45em; color: var(--green-t); margin-bottom: .2em; }
.gloss p { font-size: .95em; }
.gl-in { margin-top: .4em; font-size: .66em; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.lines i { display: block; height: 2.35em; border-bottom: 1px solid var(--line2); }
.addbox { margin-top: 1.6em; padding: 1em 1.1em; border: 1px dashed var(--line); border-radius: .6em; }
.addbox p { font-size: .92em; }
.addbox code { display: block; margin-top: .7em; font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: .72em; color: var(--acc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.colophon { margin-top: auto; font-size: .66em; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.p-blank { background: var(--noise), linear-gradient(160deg, var(--paper2), var(--paper)); }
.sec-row > .sec { margin-top: 0; }
.toc-sub { white-space: normal; line-height: 1.3; }
[data-mode="single"] .toc-row { grid-template-columns: 1.6em 4.2em 1fr auto; }
[data-mode="single"] .toc-dots { display: none; }
[data-mode="single"] .toc-row { padding: .9em .3em; }

/* ============ placeholder art for strains without a photo ============ */
.hero-ph { position: absolute; z-index: 2; left: 20%; right: 20%; top: 16%; bottom: 30%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1em; }
.hero-ph .ph-svg { width: 100%; height: auto; max-height: 82%; aspect-ratio: 1; }
.hero-ph .ph-cap b { font-size: .62em; padding: .45em 1em; }
.hero-ph .ph-cap span { font-size: .6em; }
.in-hero .ph-ring { display: none; }
.ph-thumb { display: block; }
.ph-thumb .ph-svg { width: 100%; height: 100%; }

/* ============ dense contents / glossary (many strains) ============ */
.toc.dense { columns: 2; column-gap: 1.4em; }
.toc.dense li { break-inside: avoid; }
.toc.dense .toc-row { grid-template-columns: 1.3em 2.4em 1fr auto; gap: .45em; padding: .38em .15em; }
.toc.dense .toc-img { width: 2.4em; height: 2.4em; }
/* full names and sub-lines: wrap instead of "…" (the page has room for two-line rows) */
.toc.dense .toc-name { font-size: 1.04em; line-height: 1.08; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.toc.dense .toc-main { overflow: visible; }
.toc.dense .toc-sub { font-size: .58em; letter-spacing: .04em; line-height: 1.3; white-space: normal; overflow: visible; text-overflow: clip; }
.toc.dense .toc-bar { width: 5em; height: 2px; margin-top: .15em; }
.toc.dense .toc-dots { display: none; }
.toc.dense .toc-pg { font-size: 1em; }
.toc.dense .toc-no { font-size: .66em; }
[data-mode="single"] .toc.dense .toc-row { grid-template-columns: 1.5em 2.7em 1fr auto; padding: .42em .2em; }
.gloss.dense { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.3em; }
.gloss.dense li { padding: .55em 0; }
.gloss.dense .gl-name { font-size: 1.2em; margin-bottom: .1em; }
.gloss.dense p { font-size: .8em; line-height: 1.35; }
.gloss.dense .gl-in { font-size: .56em; letter-spacing: .1em; line-height: 1.5; }

/* ============ zoom buttons + loupe toggle (app/zoomui.js, app/loupe.js) ============ */
.zoomctl { display: flex; align-items: center; gap: 8px; }
.zoomctl[hidden] { display: none; }
html:not(.ready) .zoomctl { visibility: hidden; }
.zgroup { display: inline-flex; align-items: center; height: 34px; border-radius: 99px; border: 1px solid var(--ui-br); background: var(--ui-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); overflow: hidden; }
.zgroup button { border: 0; background: none; color: var(--ui-ink); cursor: pointer; height: 100%; padding: 0; font-family: var(--f-label); font-weight: 600; line-height: 1; }
.zgroup .zb { width: 32px; font-size: 19px; }
.zgroup .zl { min-width: 54px; padding: 0 4px; font-size: 11.5px; letter-spacing: .06em; border-left: 1px solid var(--ui-br); border-right: 1px solid var(--ui-br); }
.zgroup .zl.on { color: var(--acc); }
.zgroup button:not(:disabled):hover { background: rgba(var(--sh), .07); color: var(--acc); }
.zgroup button:disabled { opacity: .32; cursor: default; }
.zgroup button:focus-visible, .zloupe:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.zloupe { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid var(--ui-br); background: var(--ui-bg); color: var(--ui-ink); cursor: pointer; display: grid; place-items: center; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.zloupe svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.zloupe:hover { border-color: var(--acc); color: var(--acc); }
.zloupe[aria-pressed="true"] { background: var(--fill); color: var(--fill-ink); border-color: var(--fill); }
/* wide screens: on the pager row, at the right end */
.pager > .zoomctl { position: absolute; right: max(16px, env(safe-area-inset-right)); top: 50%; margin-top: -17px; pointer-events: auto; }
.has-book-foot .pager > .zoomctl { margin-top: -17px; }
/* narrower: a slim vertical stack at the right edge, clear of the pager buttons */
@media (max-width: 1180px) {
  .pager > .zoomctl { position: fixed; right: max(8px, env(safe-area-inset-right)); top: 50%; bottom: auto; margin-top: 0; transform: translateY(-50%); flex-direction: column; gap: 8px; }
  .zgroup { flex-direction: column; height: auto; width: 34px; border-radius: 17px; }
  .zgroup button { width: 100%; }
  .zgroup .zb { height: 34px; }
  .zgroup .zl { min-width: 0; height: 28px; font-size: 10px; letter-spacing: 0; border: 0; border-top: 1px solid var(--ui-br); border-bottom: 1px solid var(--ui-br); }
}
/* phones: a horizontal row in the free strip under the header (top-left), never over the book frame */
@media (max-width: 600px) {
  .pager > .zoomctl { position: fixed; top: 72px; margin-top: 0 !important; left: max(12px, env(safe-area-inset-left)); right: auto; transform: none; flex-direction: row; gap: 6px; }
  .zgroup { flex-direction: row; height: 34px; width: auto; border-radius: 99px; }
  .zgroup button { width: auto; }
  .zgroup .zb { width: 32px; height: 100%; }
  .zgroup .zl { min-width: 46px; height: 100%; font-size: 10.5px; border: 0; border-left: 1px solid var(--ui-br); border-right: 1px solid var(--ui-br); }
}
/* classic book zoomed in: the scene is scaled by app/classiczoom.js */
.scene.zoomed .float { animation: none; }      /* a running transform animation pins the raster scale: stop it so the pages re-rasterise sharp */
