/* THE JAR (/jar; M3-D). Loaded on the jar's page only (tools/render.mjs). The site's own vocabulary from base.css and
   furniture.css (paper tags, camera tape, typewriter paperwork, cut-paper captions); this file adds the room: one
   picture you act on, its three papers, and the phone's framing. Every move is stepped (on twos at 12 fps); nothing
   fades. Without JavaScript the picture is a still and the papers stack down the page after it. */

html[data-place="jar"], html[data-place="jar"] body { background: #0d0a07; }
html[data-place="jar"] #stage { display: none; } /* no world on this page */

/* ------------------------------------------------------------------ the set */
.jar-stage { position: relative; }
.js .jar-stage { position: fixed; z-index: 0; left: 0; top: 0; width: 100vw; height: var(--jar-h, 100dvh); overflow: hidden; background: #0d0a07; }
.js .jar-set { position: absolute; left: 0; top: 0; width: 1920px; height: 1072px; transform-origin: 0 0; }
.js .jar-set img, .jar-set .part { position: absolute; display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.js .jar-set .jar-plate { left: 0; top: 0; width: 1920px; height: 1072px; }
/* the phone's framing of the plate (plate x 560..1380), the same test as the script's layout */
@media (max-aspect-ratio: 9/10) { .js .jar-set .jar-plate { left: 560px; width: 820px; } }
.jar-set .coin { width: 54px; height: 54px; transform-origin: 50% 50%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55)); }
.jar-set .coin.inside { filter: brightness(0.8) contrast(0.92) saturate(0.85); }
.jar-set .slip { width: 120px; height: 34px; background: url(/shell/paper.webp) 0 0 / 80px, #efe6d2; background-blend-mode: multiply;
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.5); clip-path: polygon(0 6%, 100% 0, 99% 100%, 1% 94%); }

/* ------------------------------------------------------------------ doors: the object is the hotspot, its tag hangs off it */
.jar-doors, .jar-hot { display: none; }
.js .jar-doors { display: block; position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.js .jar-doors .obj { pointer-events: auto; }
.jar-doors .obj[aria-expanded="true"] .frame { visibility: visible; }
.jar-doors .obj.tag-side .tag { top: 6%; }
.jar-doors .obj.tag-left .tag { top: 8%; }
.jar-doors .obj.tag-left .tag .hole::after { rotate: -100deg; left: auto; right: -40px; bottom: 3px; }
/* M3-D last-repair6 (CDS-04): a tag that would sit under the mark hangs below its object (jar.ts fit) */
.js .jar-doors .obj.tag-low .tag { top: 100%; right: 0; left: auto; margin: 10px 0 0; }
.jar-doors .tag.swing { animation: swing 0.333s steps(1, end) both; }
/* the way back from paying with sound rolled this visit: he holds the coin over the slot until the visitor's press
   (jar.ts waitForPress); the tag hangs by the slot */
.jar-dropin { display: none; }
.js .jar-dropin { display: block; position: fixed; z-index: 6; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.jar-dropin .tag { font-size: var(--t-note); }

/* ------------------------------------------------------------------ the papers (paperwork over the set) */
.jar-paper { color: #1c1813; font: 400 var(--t-note)/var(--lh-body) var(--type); }
.js .jar-paper {
  position: fixed; z-index: 12; display: none; top: calc(var(--padt) + 70px);
  width: min(390px, 34vw); max-height: calc(100dvh - var(--padt) - var(--padb) - 170px); overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 24px 22px;
  background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.7);
}
.js .jar-paper.left { left: calc(var(--pad) + 8px); rotate: -0.8deg; }
.js .jar-paper.right { right: calc(var(--padr) + 8px); rotate: 0.7deg; }
.js .jar-paper.open { display: block; animation: jar-in 0.25s steps(1, end) both; }
@keyframes jar-in { 0% { translate: 0 -22px; } 33% { translate: 0 -9px; } 66%, 100% { translate: 0 0; } }
/* 2026-11-12: each paper has a headline. Its name is a quiet typed label (the tag that opened it says the same); the
   sentence under it is the biggest thing on the paper, in Klói's own hand; the small print is small, not tiny */
.paper-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 8px; }
.jar-paper h2 { margin: 0; font: 700 var(--t-small)/1 var(--type); letter-spacing: var(--track-label); }
.jar-paper h2:focus { outline: none; }
.jar-paper h2:focus-visible { outline: 2px solid #7a5a12; outline-offset: 4px; }
.paper-say { margin: 0 0 14px; font: 400 var(--t-sub)/1.14 var(--hand); letter-spacing: 0.01em; text-wrap: balance; color: #26262b; }
.jar-paper .small { margin: 10px 0 0; font-size: var(--t-small); line-height: 1.45; text-wrap: pretty; color: #4a3d2c; }
.jar-paper .note:empty { display: none; }
.jar-paper .note { font-weight: 700; color: #6b2a16; }

.often { display: flex; gap: 8px; margin: 0 0 12px; padding: 0; border: 0; }
.often label { position: relative; cursor: pointer; }
.often input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.often span { display: inline-flex; align-items: center; min-height: 36px; padding: 8px 12px 6px; font: 700 var(--t-small)/1 var(--type); letter-spacing: 0.1em;
  border: 1.5px solid rgba(40, 30, 18, 0.55); background: rgba(255, 252, 240, 0.35); }
.often input:checked + span { background: #f2cf6b; border-color: #5a4210; }
.often input:focus-visible + span { outline: 3px solid #7a5a12; outline-offset: 2px; }

.picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.pick { position: relative; display: grid; grid-template-rows: 54px auto auto; justify-items: center; align-content: start; gap: 4px;
  min-height: 112px; padding: 10px 6px 9px; text-align: center; background: rgba(255, 252, 240, 0.45); border: 1.5px solid rgba(40, 30, 18, 0.35); }
.pick:focus-visible { outline: 3px solid #7a5a12; outline-offset: 2px; }
.pick[aria-pressed="true"] { background: #f2cf6b; border-color: #5a4210; box-shadow: inset 0 0 0 1px #5a4210; }
.pick .heap { position: relative; width: 84px; height: 54px; }
.pick .heap img { position: absolute; width: 34px; height: 34px; filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, 0.5)); }
/* the heaps (no style attributes: the page's policy allows none) */
.heap.h1 .h0 { left: 25px; top: 12px; }
.heap.h2 .h0 { left: 14px; top: 14px; } .heap.h2 .h1 { left: 36px; top: 10px; }
.heap.h3 .h0 { left: 8px; top: 16px; } .heap.h3 .h1 { left: 30px; top: 8px; } .heap.h3 .h2 { left: 46px; top: 18px; }
.heap.h6 .h0 { left: 2px; top: 20px; } .heap.h6 .h1 { left: 22px; top: 12px; } .heap.h6 .h2 { left: 42px; top: 18px; }
.heap.h6 .h3 { left: 12px; top: 2px; } .heap.h6 .h4 { left: 34px; top: 0; } .heap.h6 .h5 { left: 52px; top: 6px; }
.pick .pick-l { font: 700 var(--t-small)/1.1 var(--type); letter-spacing: 0.08em; }
.pick .pick-v { font: 400 var(--t-sub)/1 var(--hand); }
/* a coin with no payment page for the chosen frequency (a typed amount cannot repeat): greyed, and one line says why */
.pick:disabled { cursor: default; color: rgba(28, 24, 19, 0.5); background: rgba(255, 252, 240, 0.2); border-style: dashed; }
.pick:disabled .heap img { filter: grayscale(1) brightness(0.9) opacity(0.45); }
.pick .pick-x { display: none; font: 700 var(--t-micro)/1.15 var(--type); letter-spacing: 0.06em; }
.pick:disabled .pick-v { display: none; }
.pick:disabled .pick-x { display: block; }
/* the way to stop a monthly coin: always in sight while the jar takes them */
.jar-manage a { color: #4a2a10; font-weight: 700; letter-spacing: 0.06em; text-decoration: underline; text-underline-offset: 3px; }
.jar-manage a:focus-visible, .jar-plain a:focus-visible { outline: 3px solid #7a5a12; outline-offset: 3px; }
/* the coins as plain links: only without JavaScript (the picks need it) */
.jar-plain { display: none; }
.no-js .jar-plain { display: grid; gap: 10px; list-style: none; margin: 14px 0 0; padding: 0; }
.no-js .jar-plain a { color: #1c1813; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.own { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; font: 700 var(--t-small)/1 var(--type); letter-spacing: var(--track-label); }
.own-field { display: inline-flex; align-items: center; gap: 4px; font: 400 var(--t-sub)/1 var(--hand); }
.own input, #jar-email { font: 400 var(--t-body)/1.2 var(--type); color: #1c1813; background: rgba(255, 252, 240, 0.7);
  border: 0; border-bottom: 2px solid #3b2f22; padding: 6px 4px 4px; border-radius: 0; }
.own input { width: 5.5em; }
.own input:focus-visible, #jar-email:focus-visible { outline: 3px solid #7a5a12; outline-offset: 2px; }

.jar-paper .drop, .jar-paper .post { margin: 4px 0 0 4px; }
.jar-paper .drop:disabled { filter: grayscale(0.8) brightness(0.86) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4)); cursor: default; }
.jar-paper .drop:focus-visible, .jar-paper .post:focus-visible, .pegs a.tag:focus-visible { outline: 3px solid #7a5a12; outline-offset: 3px; }
.jar-stamp { position: absolute; right: 18px; bottom: 54px; margin: 0; padding: 6px 10px 4px; rotate: -9deg;
  font: 700 var(--t-body)/1 'TF Stencil', var(--type); letter-spacing: 0.08em; color: var(--stamp);
  border: 3px solid var(--stamp); border-radius: 3px; mix-blend-mode: multiply; pointer-events: none; }

.letters-form { display: grid; gap: 6px; margin: 0; }
.letters-form label { font: 700 var(--t-small)/1 var(--type); letter-spacing: var(--track-label); }
#jar-email { width: 100%; }
.letters-form .post { justify-self: start; margin-top: 10px; }

.pegs { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 14px; }
.pegs li { padding-left: 4px; }
.pegs .off { cursor: default; }
.pegs .off::before { filter: grayscale(0.5) brightness(0.92); }
.pegs .soon { margin-left: 12px; padding: 3px 6px 2px; font: 700 var(--t-micro)/1 'TF Stencil', var(--type); letter-spacing: 0.08em; word-spacing: 0; color: var(--stamp);
  border: 2px solid var(--stamp); rotate: -6deg; }
.jar-paper .jar-novel { display: block; margin: 4px 0 16px; padding-bottom: 14px; border-bottom: 1px dashed rgba(60, 45, 30, 0.45); }

/* THE RECORDS (2026-11-11; content/music.json): their tag on the ELSEWHERE paper, then their own paper: the sleeves
   side by side, each with its PUT IT ON, and the place the player's frame is put into on that press (jar.ts) */
.records-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 16px; padding: 0 0 16px 4px; border-bottom: 1px dashed rgba(60, 45, 30, 0.45); }
.records-row .tag { cursor: pointer; font-size: var(--t-note); min-height: 44px; padding: 10px 16px 10px 30px; }
.records-row .tag::before { clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%); }
.records-row .tag .hole { left: 13px; width: 9px; height: 9px; margin-top: -4.5px; }
.records-row .tag .hole::after { display: none; }
.records-row .tag:focus-visible { outline: 3px solid #7a5a12; outline-offset: 3px; }
.records-say { flex: 1 1 130px; font-size: var(--t-small); line-height: 1.4; text-wrap: pretty; color: #4a3d2c; }
.no-js .records-row { display: none; }
.sleeves { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sleeve { display: flex; flex-direction: column; min-width: 0; }
.sleeve-w { display: flex; flex-direction: column; gap: 3px; margin: 0 0 8px; }
.sleeve-cover { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; margin: 0 0 5px; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45); }
.js .sleeve:not(.off) .sleeve-cover { cursor: pointer; }
.sleeve.off .sleeve-cover { filter: grayscale(0.35) brightness(0.94); }
/* a record's title is printed on its sleeve (the print voice); whose it is, a quiet typed label over it */
.sleeve-n { display: block; font: 700 var(--t-micro)/1.15 var(--type); letter-spacing: 0.1em; }
.sleeve-t { display: block; font: italic 400 var(--t-note)/1.22 var(--print); overflow-wrap: anywhere; }
.sleeve-g { display: block; font-size: var(--t-micro); line-height: 1.3; font-style: italic; color: #4a3d2c; }
.sleeve .play { margin: auto 0 0; min-height: 44px; padding: 8px 4px 6px; font: 700 var(--t-micro)/1.15 var(--type); letter-spacing: 0.04em; color: #1c1813;
  border: 1.5px solid rgba(40, 30, 18, 0.55); border-radius: 0; background: rgba(255, 252, 240, 0.45); cursor: pointer; }
.sleeve .play[aria-pressed="true"] { background: #f2cf6b; border-color: #5a4210; box-shadow: inset 0 0 0 1px #5a4210; }
.sleeve .play:focus-visible, .sleeve-plain:focus-visible { outline: 3px solid #7a5a12; outline-offset: 2px; }
.sleeve .soon { align-self: flex-start; margin: auto 0 12px 2px; padding: 3px 6px 2px; font: 700 var(--t-micro)/1 'TF Stencil', var(--type); letter-spacing: 0.08em;
  color: var(--stamp); border: 2px solid var(--stamp); rotate: -6deg; }
.sleeve-plain { display: none; }
.no-js .sleeve .play { display: none; }
.no-js .sleeve-plain { display: inline; margin-top: 6px; color: #1c1813; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.record-player { margin: 12px 0 0; }
/* the records' heading and CLOSE stay in reach while the paper scrolls under a tall player (CLOSE takes the record off) */
.js #card-records .paper-head, .js #card-comics .paper-head { position: sticky; top: -20px; z-index: 2; margin: -20px -24px 6px; padding: 20px 24px 4px;
  background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply; }
.record-player iframe { display: block; width: 100%; border: 0; border-radius: 8px; background: #121212; }

/* THE COMICS (2026-11-13; content/comics.json): their tag on the ELSEWHERE paper (the records' row, above), then their
   own paper: the books side by side, each its front cover, its number, its title and one link out to its reader; the
   books that give the ending away in a closed envelope, the office's own (a <details>: only a press opens it) */
/* (440 px, and the headline's foot a little closer: at 1280 x 720 the paper shows whole, the envelope closed) */
.js .jar-paper#card-comics { width: min(440px, 38vw); }
#card-comics .paper-say { margin-bottom: 9px; }
.comics { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.comic { display: flex; flex-direction: column; min-width: 0; }
.comic-cover { display: block; width: 100%; height: auto; aspect-ratio: 480 / 743; object-fit: cover; margin: 0 0 6px; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45); }
.comic-w { display: flex; flex-direction: column; gap: 3px; margin: 0 0 6px; }
/* a book's title is printed on its cover (the print voice); which book it is, a quiet typed label over it */
.comic-n { display: block; font: 700 var(--t-micro)/1.15 var(--type); letter-spacing: 0.1em; }
.comic-t { display: block; font: italic 400 var(--t-note)/1.22 var(--print); overflow-wrap: break-word; text-wrap: balance; }
.comic-read { display: flex; align-items: center; justify-content: center; width: 100%; margin: auto 0 0; min-height: 44px; padding: 8px 4px 6px; text-align: center;
  font: 700 var(--t-micro)/1.15 var(--type); letter-spacing: 0.04em; color: #1c1813; text-decoration: none; cursor: pointer;
  border: 1.5px solid rgba(40, 30, 18, 0.55); border-radius: 0; background: rgba(255, 252, 240, 0.45); }
.comic-read:focus-visible, .comic-visit:focus-visible { outline: 3px solid #7a5a12; outline-offset: 2px; }
@media (hover: hover) { .comic-read:hover { background: #f2cf6b; border-color: #5a4210; } }
/* round 7: the one small link out, under READ THE COMIC (the library's own name, in a new tab) */
.comic-visit { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; margin: 1px 0 0; padding: 3px 2px 1px;
  font: 700 var(--t-micro)/1.15 var(--type); letter-spacing: 0.02em; color: #4a3d2c; text-align: center; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) { .comic-visit:hover { color: #1c1813; } }
.no-js .comic-read, .no-js .comics-free { display: none; }
/* (round 7: READ THE COMIC and the link out under each cover made the paper taller; at 1280 x 720 it still shows whole,
   the envelope closed: a mouse's button a little lower, and on a short laptop the covers a little smaller) */
@media (pointer: fine) { .comic-read { min-height: 38px; } }
@media (max-height: 760px) and (min-aspect-ratio: 9/10) { .js .jar-paper#card-comics .comics:not(details .comics) .comic-cover { max-height: 166px; width: auto; max-width: 100%; align-self: center; } }
.jar-paper .envelope { margin: 10px 0 0; scroll-margin-top: 48px; background: url(/shell/paper.webp) 0 0 / 160px, #d9bf8c; background-blend-mode: multiply; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35); }
.jar-paper .envelope summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 52px; padding: 10px 14px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  font: 700 var(--t-small)/1.2 var(--type); letter-spacing: var(--track-label); color: #7a1f17; }
.jar-paper .envelope summary::-webkit-details-marker { display: none; }
.jar-paper .envelope summary small { font: italic 400 var(--t-small)/1 var(--type); letter-spacing: 0; color: #4a3a28; }
.jar-paper .envelope summary:focus-visible { outline: 3px solid #7a5a12; outline-offset: -4px; }
.jar-paper .envelope .flap { width: 26px; height: 18px; flex: none; border: 2px solid #7a1f17; background: linear-gradient(to bottom right, transparent 48%, #7a1f17 49% 52%, transparent 53%) left / 50% 100% no-repeat, linear-gradient(to bottom left, transparent 48%, #7a1f17 49% 52%, transparent 53%) right / 50% 100% no-repeat; }
.jar-paper .envelope[open] .flap { background: linear-gradient(to top right, transparent 48%, #7a1f17 49% 52%, transparent 53%) left / 50% 100% no-repeat, linear-gradient(to top left, transparent 48%, #7a1f17 49% 52%, transparent 53%) right / 50% 100% no-repeat; }
.jar-paper .envelope .comics { margin: 0; padding: 4px 12px 14px; }
.jar-paper .comics-free { margin-top: 8px; }
/* the audiobook's tape on the ELSEWHERE paper (2026-11-13): READ ALONG makes that paper long, so its heading and CLOSE
   stay in reach while it scrolls, as on the records' and the comics' papers */
.js #card-elsewhere:has(.sample) .paper-head { position: sticky; top: -20px; z-index: 2; margin: -20px -24px 6px; padding: 20px 24px 4px;
  background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply; }

/* ------------------------------------------------------------------ THE COMICS' reader (round 7, 2026-11-16; src/jar/comic-reader.ts)
   The book lies open on Klói's bench: the dark wood of the workshop under it, its pages with a paper's shadow and,
   in a spread, the fold between them; the book's name on a typed label, the count on a strip of tape, the page
   turned by paper tags. A turn is three held drawings on twos; nothing fades. Reduced motion: no turn at all. */
html.cr-open { overflow: hidden; }
.comic-reader { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--chalk); background-color: #160e07;
  /* the workshop itself, dimmed behind the book (the room's own picture, already on the page: nothing new is fetched) */
  background-image: radial-gradient(ellipse at 50% 46%, rgba(22, 14, 6, 0.7), rgba(12, 7, 3, 0.9) 70%), url(/jar/plate.jpg);
  background-image: radial-gradient(ellipse at 50% 46%, rgba(22, 14, 6, 0.7), rgba(12, 7, 3, 0.9) 70%), image-set(url(/jar/plate.avif) type('image/avif'), url(/jar/plate.webp) type('image/webp'), url(/jar/plate.jpg) type('image/jpeg'));
  background-size: cover; background-position: 50% 80%; }
@media (max-aspect-ratio: 9/10) {
  .comic-reader { background-image: radial-gradient(ellipse at 50% 46%, rgba(22, 14, 6, 0.7), rgba(12, 7, 3, 0.9) 70%), url(/jar/plate-s.jpg);
    background-image: radial-gradient(ellipse at 50% 46%, rgba(22, 14, 6, 0.7), rgba(12, 7, 3, 0.9) 70%), image-set(url(/jar/plate-s.avif) type('image/avif'), url(/jar/plate-s.webp) type('image/webp'), url(/jar/plate-s.jpg) type('image/jpeg')); }
}
.comic-reader[hidden], .comic-reader [hidden] { display: none !important; }
.cr-head { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: var(--padt) var(--padr) 4px var(--pad); }
.cr-h { flex: 1 1 14em; min-width: 0; margin: 0; font: 700 var(--t-small)/1.25 var(--type); letter-spacing: var(--track-label); color: var(--chalk); }
.cr-h .cr-t { font: italic 400 var(--t-note)/1.25 var(--print); letter-spacing: 0.01em; }
.cr-h:focus { outline: none; }
.cr-h:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.cr-count { margin: 0; padding: 7px 12px 5px; white-space: nowrap; rotate: -1deg; font: 700 var(--t-small)/1 var(--type); letter-spacing: 0.1em; color: var(--ink);
  background: url(/shell/paper.webp) 0 0 / 96px, var(--tape); background-blend-mode: multiply; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.cr-count:empty { visibility: hidden; }
.cr-close { min-height: 44px; padding: 10px 6px; font: 700 var(--t-small)/1 var(--type); letter-spacing: 0.12em; color: var(--chalk); cursor: pointer; }
.cr-stage { grid-column: 1; grid-row: 2; position: relative; display: flex; overflow: auto; overscroll-behavior: contain; padding: 8px; outline: none; touch-action: pan-y pinch-zoom; }
.comic-reader[data-mode="zoom"] .cr-stage { touch-action: auto; }
.cr-leaves { display: flex; margin: auto; }
.cr-leaf { position: relative; flex: none; width: var(--pw, 320px); aspect-ratio: 1200 / 1856; margin: 0; cursor: pointer;
  background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(0, 0, 0, 0.35); }
.cr-leaf img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.cr-leaf.wait img { visibility: hidden; } /* the paper shows until the page is in: never a blank flash, never a fade */
.cr-leaf.left::after, .cr-leaf.right::after { content: ''; position: absolute; top: 0; bottom: 0; width: 7%; pointer-events: none; }
.cr-leaf.left::after { right: 0; background: linear-gradient(to left, rgba(20, 12, 4, 0.34), transparent); }
.cr-leaf.right::after { left: 0; background: linear-gradient(to right, rgba(20, 12, 4, 0.34), transparent); }
.comic-reader[data-mode="zoom"] .cr-leaf { cursor: auto; }
.cr-stage.turn-fwd .cr-leaves { animation: cr-fwd 0.25s steps(1, end) both; }
.cr-stage.turn-back .cr-leaves { animation: cr-back 0.25s steps(1, end) both; }
@keyframes cr-fwd { 0% { translate: 28px 0; rotate: 0.7deg; } 33% { translate: 11px 0; rotate: 0.3deg; } 66%, 100% { translate: 0 0; rotate: 0deg; } }
@keyframes cr-back { 0% { translate: -28px 0; rotate: -0.7deg; } 33% { translate: -11px 0; rotate: -0.3deg; } 66%, 100% { translate: 0 0; rotate: 0deg; } }
.cr-note { position: absolute; left: 50%; top: 38%; translate: -50% 0; width: max-content; max-width: min(80%, 420px); margin: 0; padding: 10px 14px 8px; text-align: center;
  font: 400 var(--t-note)/1.4 var(--type); color: #1c1813; background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6); }
.cr-note:empty { display: none; }
.cr-nav { grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 18px; padding: 12px var(--padr) calc(var(--padb) + 2px) var(--pad); }
.cr-nav .tag, .cr-end .tag { cursor: pointer; text-decoration: none; }
.cr-nav .tag:disabled { cursor: default; filter: grayscale(0.85) brightness(0.62) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4)); }
.cr-nav .cr-back { order: 1; } .cr-nav .cr-wbtn { order: 2; } .cr-nav .cr-zoom { order: 3; } .cr-nav .cr-next { order: 4; }
.comic-reader button:focus-visible, .comic-reader a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* THE WORDS: a paper slip laid over the book (a phone, a laptop), or beside it on a wide desk */
.cr-words { grid-column: 1; grid-row: 2; align-self: end; justify-self: end; z-index: 2; margin: 0 calc(var(--padr) + 4px) 6px 0; width: min(380px, calc(100vw - var(--pad) - var(--padr) - 12px));
  max-height: min(50%, 520px); overflow: auto; overscroll-behavior: contain; padding: 14px 18px 16px; rotate: 0.5deg;
  font: 400 var(--t-note)/1.45 var(--type); color: #1c1813; background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.72); }
.cr-words h3 { margin: 0 0 4px; font: 700 var(--t-small)/1.2 var(--type); letter-spacing: var(--track-label); }
.cr-words p { margin: 0 0 6px; }
.cr-words .cr-seen { font-style: italic; color: #4a3d2c; }
.cr-wpage + .cr-wpage { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(60, 45, 30, 0.45); }
@media (min-width: 1100px) {
  .comic-reader.words-on { grid-template-columns: minmax(0, 1fr) min(360px, 30vw); }
  .comic-reader.words-on .cr-words { grid-column: 2; grid-row: 2; align-self: stretch; justify-self: stretch; width: auto; max-height: none; margin: 8px var(--padr) 8px 0; rotate: 0deg; }
}
/* the end of a book: a paper on the bench, the next book, the library, from the start, close */
.cr-end { margin: auto; max-width: min(560px, 100%); padding: 26px 28px 30px; text-align: center; rotate: -0.6deg; color: #1c1813;
  background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.72); }
.cr-end-h { margin: 0 0 20px; font: 400 var(--t-head)/1.15 var(--hand); }
.cr-end-h:focus { outline: none; }
.cr-end-h:focus-visible { outline: 2px solid #7a5a12; outline-offset: 4px; }
.cr-end-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 24px; }
.cr-end .tag .hole::after { display: none; } /* (tags laid on the paper: no strings over the next one) */
/* a phone: the book's number, the count and CLOSE on one row (the title is the cover's, and is read out); BACK and NEXT
   as their arrows, so they share one row with the words and CLOSER (their names are read out) */
@media (max-width: 560px) {
  .cr-head { flex-wrap: nowrap; gap: 10px; }
  .cr-h { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cr-h .cr-t { font-size: var(--t-small); }
  .cr-nav { flex-wrap: nowrap; gap: 10px; }
  .cr-nav .tag { font-size: var(--t-small); padding: 10px 12px 10px 27px; }
  .cr-nav .tape { font-size: 17px; padding: 7px 10px 5px; }
}
@media (max-width: 440px) {
  .cr-h .cr-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cr-nav .tag .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cr-nav .tag { min-width: 64px; justify-content: center; padding: 8px 14px 8px 30px; }
  .cr-nav .tag .arrow { font-size: 42px; line-height: 0.6; }
}
@media (max-height: 520px) and (min-aspect-ratio: 9/10) { /* a phone held sideways: the bars as thin as they can be */
  .cr-head { padding-bottom: 0; }
  .cr-nav { padding-top: 2px; }
}

/* M3-D last-repair6 (CDS-04): a short desk-shaped screen (a phone held sideways): the papers use the height, clear of
   the mark */
@media (max-height: 520px) and (min-aspect-ratio: 9/10) {
  .js .jar-paper { top: calc(var(--padt) + 50px); width: min(460px, 52vw); max-height: calc(100dvh - var(--padt) - var(--padb) - 112px); padding: 10px 16px 12px; }
  .js #card-records .paper-head, .js #card-comics .paper-head, .js #card-elsewhere:has(.sample) .paper-head { top: -10px; margin: -10px -16px 6px; padding: 10px 16px 4px; }
  .js .jar-paper#card-comics { width: min(520px, 56vw); }
  .js .often span { min-height: 30px; padding: 6px 10px 4px; }
  .js .jar-paper .drop { margin-top: 0; }
  .js .paper-say { margin-bottom: 6px; }
  .js .often { margin-bottom: 6px; }
  .js .picks { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
  .js .pick { grid-template-rows: 34px auto auto; min-height: 74px; padding: 4px 2px 5px; gap: 2px; }
  .js .pick .heap { scale: 0.7; transform-origin: 50% 0; margin-bottom: -16px; }
  .js .pick .pick-l { font-size: var(--t-micro); letter-spacing: 0.02em; }
  .js .pick .pick-v { font-size: var(--t-lead); }
  .js .paper-say { font-size: var(--t-lead); }
  .js .jar-paper .small { margin-top: 6px; }
  .js .jar-stamp { position: relative; right: auto; bottom: auto; display: inline-block; vertical-align: middle; margin: 0 0 0 14px; }
}

/* ------------------------------------------------------------------ the phone: the picture on top, the table below */
.js[data-jar="phone"] body { background: url(/shell/paper.webp) 0 0 / 220px, linear-gradient(180deg, #3a2716, #24170c 40%, #160e07); background-blend-mode: multiply; }
.js[data-jar="phone"] .jar-doors { top: var(--jar-h); bottom: auto; height: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 18px; padding: 22px 12px 0; }
.js[data-jar="phone"] .jar-doors .obj { position: relative; min-height: 0; }
.js[data-jar="phone"] .jar-doors .obj .frame { display: none; }
.js[data-jar="phone"] .jar-doors .obj .tag { position: relative; left: auto; right: auto; top: auto; margin: 0; font-size: var(--t-body); min-height: 50px; padding: 12px 18px 12px 34px; }
.js[data-jar="phone"] .jar-doors .obj.tag-left .tag .hole::after { rotate: 14deg; left: 3.5px; right: auto; }
.js[data-jar="phone"] .jar-hot { display: block; position: fixed; z-index: 3; }
.js[data-jar="phone"] .jar-paper { left: 8px; right: 8px; width: auto; top: calc(var(--jar-h) + 8px); max-height: calc(100dvh - var(--jar-h) - var(--padb) - 14px); rotate: 0deg; padding: 14px 16px 16px; }
.js[data-jar="phone"] #card-records .paper-head, .js[data-jar="phone"] #card-comics .paper-head, .js[data-jar="phone"] #card-elsewhere:has(.sample) .paper-head { top: -14px; margin: -14px -16px 6px; padding: 14px 16px 4px; }
.js[data-jar="phone"] .jar-paper#card-comics { width: auto; }
.js[data-jar="phone"] .comics { gap: 10px; }
.js[data-jar="phone"] .jar-paper .envelope .comics { padding: 4px 8px 12px; }
.js[data-jar="phone"].jar-open .furniture { display: none; }
.js[data-jar="phone"] .paper-say { margin-bottom: 8px; }
.js[data-jar="phone"] .often { margin-bottom: 8px; }
.js[data-jar="phone"] .picks { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
/* (one column the cell's own width: the heap is wider than a narrow phone's cell and pushed the cell's words off centre
   and, at 12 px, over its edge) */
.js[data-jar="phone"] .pick { grid-template-columns: minmax(0, 1fr); grid-template-rows: 38px auto auto; min-height: 92px; padding: 6px 2px 7px; gap: 3px; }
.js[data-jar="phone"] .pick .heap { scale: 0.7; transform-origin: 50% 0; margin-bottom: -16px; }
.js[data-jar="phone"] .pick .pick-l { font-size: var(--t-micro); letter-spacing: 0; white-space: normal; }
.js[data-jar="phone"] .pick .pick-v { font-size: var(--t-lead); }
.js[data-jar="phone"] .jar-paper .small { margin-top: 6px; }
/* M3-D last-repair6 (CDS-03): on a phone the stamp lands beside DROP IT IN (in the flow), never over a pick */
.js[data-jar="phone"] .jar-stamp { position: relative; right: auto; bottom: auto; display: inline-block; vertical-align: middle; margin: 4px 0 0 14px; }

/* ------------------------------------------------------------------ without JavaScript: the still, then the papers */
.no-js[data-place="jar"] body { display: flex; flex-direction: column; }
.no-js[data-place="jar"] .top { order: 0; }
.no-js[data-place="jar"] #panel { order: 1; }
.no-js[data-place="jar"] #script { order: 2; }
.no-js .jar-set { max-width: 780px; margin: 18px auto 0; padding: 0 16px; }
.no-js .jar-plate { display: block; width: 100%; height: auto; }
.no-js .jar-paper { display: block; max-width: 748px; margin: 18px auto; padding: 26px clamp(20px, 7.4%, 56px) 28px; position: relative; font-size: var(--t-body);
  background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply; }
.no-js .jar-paper h2 { font-size: var(--t-note); }
.no-js .jar-paper .small { font-size: var(--t-note); }
.no-js #card-jar .paper-say, .no-js .jar-paper .close, .no-js .jar-paper .drop, .no-js .picks, .no-js .often, .no-js .own, .no-js .jar-stamp, .no-js .letters-form.closed { display: none; }

/* stillness: reduced motion is honoured at once (base.css stops every animation; the parts stand at rest in jar.ts) */
@media (forced-colors: active), (prefers-contrast: more) {
  .jar-paper, .js .jar-paper .paper-head, .jar-paper .envelope { background-image: none !important; }
  .sleeve .play, .comic-read, .jar-paper .envelope { border: 2px solid CanvasText; }
  .comic-reader, .cr-leaf, .cr-words, .cr-end, .cr-note, .cr-count { background-image: none !important; }
  .cr-words, .cr-end, .cr-note { border: 2px solid CanvasText; }
  .pick { border: 2px solid CanvasText; }
}
