/* onaiagents — the utility tools.

   Shared by /audio-to-text, /text-to-speech, /chat-with-pdf and /youtube-summarizer.
   Tokens, nav, footer, type (.disp), buttons (.btn-go, .xlk) and reveals come from
   explore.css. This file adds the page frame they share and then one block per tool.

   Each tool is built around one object rather than a form in a card: a reel you drop
   audio on, a ring of voices, a sheet of paper, a timeline. Those objects are round or
   paper-shaped on purpose; the rest of the page stays on the catalogue grid. */

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: cubic-bezier(.19, 1, .22, 1); }

.pg-tool { --ring: rgba(241, 237, 228, .3); }
.pg-tool main { overflow-x: clip; }
.pg-tool [hidden] { display: none !important; }

/* ── page head ─────────────────────────────────────────────────────────────── */
.th { padding: clamp(22px, 3vw, 44px) 0 0; }
.th-top { display: flex; justify-content: space-between; align-items: center; gap: 14px 28px; flex-wrap: wrap; }
/* The headline sits on one line with the explanation beside it, so the tool itself
   starts in the first screen instead of under a poster. */
.th-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 36ch); gap: 14px clamp(24px, 4vw, 70px); align-items: end; margin-top: clamp(12px, 1.6vw, 22px); padding-bottom: clamp(16px, 2vw, 26px); border-bottom: 1px solid var(--rule-2); }
.th h1 { font-size: clamp(2.9rem, 7.2vw, 7.6rem); }
.th h1 .ln { display: inline-block; vertical-align: bottom; margin-right: .2em; }
.th h1 .sig { color: var(--sig); }
.th h1 > small { margin-top: 12px; }
.th .xh-sub { margin: 0 0 4px; max-width: 40ch; font-size: clamp(.98rem, 1.05vw, 1.08rem); }
@media (max-width: 860px) { .th-main { grid-template-columns: minmax(0, 1fr); } .th .xh-sub { max-width: 46ch; } }

/* ── the run meter: free runs as tally marks, or the balance and this run's price ── */
.tm { display: flex; align-items: center; gap: 12px; min-height: 26px; font: 500 12px/1 var(--m); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.tm b { font-weight: 500; color: var(--paper); font-variant-numeric: tabular-nums; }
.tm-ticks { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.tm-ticks i { width: 3px; height: 100%; background: var(--paper); transform-origin: 50% 100%; transition: height .7s var(--e), background-color .4s; }
.tm-ticks i.used { height: 28%; background: var(--mute); }
.tm-ticks i.next { background: var(--sig); }
.tm-est { padding-left: 12px; border-left: 1px solid var(--rule-2); }
.tm-est b { color: var(--sig); }
.tm img { width: 14px; height: 14px; }
.tm.bump b { animation: tmbump .7s var(--e); }
@keyframes tmbump { 30% { transform: translateY(-5px); color: var(--sig); } }
.tm b { display: inline-block; }

/* ── small text actions ────────────────────────────────────────────────────── */
.ta { position: relative; padding: 8px 0; border: 0; background: none; cursor: pointer; color: var(--paper); font: 500 12px/1 var(--m); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.ta::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: var(--paper); transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--e); }
.ta:hover::after, .ta:focus-visible::after, .ta.on::after { transform: none; }
.ta.on { color: var(--sig); } .ta.on::after { background: var(--sig); }
.ta:disabled { color: var(--mute); cursor: default; }
.ta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px clamp(14px, 2vw, 26px); }

.tnote { margin: 0; font: 500 12px/1.5 var(--m); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.tnote a { color: var(--paper); }
.terr { margin: 16px 0 0; padding-left: 14px; border-left: 2px solid var(--sig); color: var(--paper); font-size: 15px; line-height: 1.5; max-width: 56ch; }
.terr a { color: var(--sig); }

/* ── the curtain that takes a visitor to pricing ───────────────────────────── */
.tcurtain { position: fixed; inset: 0; z-index: 200; display: grid; align-content: center; gap: 18px; padding: var(--pad); background: var(--sig); color: #0B0A09; clip-path: inset(100% 0 0 0); transition: clip-path .9s var(--e); }
.tcurtain.in { clip-path: inset(0); }
.tcurtain b { font: 800 clamp(2.6rem, 9vw, 9rem)/.86 var(--f); font-stretch: 62%; text-transform: uppercase; }
.tcurtain span { font: 500 13px/1.4 var(--m); letter-spacing: .08em; text-transform: uppercase; }

.ttoast { position: fixed; left: 50%; bottom: 26px; z-index: 190; transform: translate(-50%, 30px); opacity: 0; padding: 12px 18px; background: var(--paper); color: #0B0A09; font: 500 12px/1 var(--m); letter-spacing: .08em; text-transform: uppercase; pointer-events: none; transition: transform .6s var(--e), opacity .3s; }
.ttoast.in { transform: translate(-50%, 0); opacity: 1; }

/* ── stage frame ───────────────────────────────────────────────────────────── */
.stage { padding: clamp(22px, 3vw, 44px) 0 0; }
.stage-rule { margin-top: clamp(40px, 6vw, 90px); border-top: 1px solid var(--rule-2); }

/* ── three steps, set as running text with large numerals ──────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 70px); padding-top: clamp(26px, 3vw, 44px); }
.steps li { list-style: none; }
.steps { margin: 0; padding-left: 0; }
.steps b { display: block; font: 800 clamp(4rem, 9vw, 9rem)/.8 var(--f); font-stretch: 62%; color: transparent; -webkit-text-stroke: 1px var(--ring); transition: color .6s, -webkit-text-stroke-color .6s; }
.steps li:hover b { color: var(--sig); -webkit-text-stroke-color: var(--sig); }
.steps h3 { margin: 18px 0 8px; font: 800 clamp(1.2rem, 1.7vw, 1.6rem)/1 var(--f); font-stretch: 75%; text-transform: uppercase; }
.steps p { margin: 0; color: var(--dim); font-size: 15.5px; line-height: 1.55; max-width: 34ch; }

/* ── price, said once and plainly ──────────────────────────────────────────── */
.tprice { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 5vw, 90px); align-items: end; padding-top: clamp(26px, 3vw, 44px); }
.tprice-fig { font: 800 clamp(3.4rem, 11vw, 12rem)/.8 var(--f); font-stretch: 62%; text-transform: uppercase; }
.tprice-fig small { display: block; margin-top: 14px; font: 500 12px/1.4 var(--m); font-stretch: 100%; letter-spacing: .1em; color: var(--sig); }
.tprice p { margin: 0 0 16px; color: var(--dim); font-size: 16px; line-height: 1.55; max-width: 46ch; }
.tprice p b { color: var(--paper); font-weight: 600; }

@media (max-width: 860px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr); column-gap: 14px; align-items: start; }
  .steps b { grid-row: 1 / 3; font-size: 4.4rem; } .steps h3 { margin-top: 6px; }
  .tprice { grid-template-columns: minmax(0, 1fr); }
}

/* ═════════════════════════ 1. AUDIO & VIDEO TO TEXT ═════════════════════════ */
.tr-grid { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: clamp(20px, 3vw, 40px); transition: grid-template-columns .9s var(--e); }
.tr[data-state="done"] .tr-grid { grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); justify-items: stretch; align-items: start; gap: clamp(24px, 5vw, 90px); }
.tr-side { display: grid; justify-items: center; gap: 14px; width: 100%; }
.tr[data-state="done"] .tr-side { position: sticky; top: 88px; }

/* the reel: a ring of bars that is the drop target, the progress and the player */
.reel { position: relative; width: min(74vw, 460px, 50vh); min-width: 240px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--paper); cursor: pointer; view-transition-name: reel; transition: width .9s var(--e), transform .6s var(--e); -webkit-tap-highlight-color: transparent; }
.tr[data-state="done"] .reel { width: min(62vw, 380px); }
.reel canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.reel-core { position: absolute; inset: 27%; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--ring); text-align: center; transition: background-color .5s, border-color .5s, transform .7s var(--e); }
.reel:hover .reel-core, .reel:focus-visible .reel-core { border-color: var(--paper); }
.reel.over { transform: scale(1.04); }
.reel.over .reel-core { background: var(--sig); border-color: var(--sig); color: #0B0A09; transform: scale(1.08); }
.reel-core > span { grid-area: 1 / 1; display: grid; gap: 8px; justify-items: center; padding: 8%; transition: opacity .45s, transform .7s var(--e); }
.reel-core b { font: 800 clamp(1.15rem, 2.5vw, 2rem)/.92 var(--f); font-stretch: 68%; text-transform: uppercase; }
.reel-core em { font: 500 11px/1.3 var(--m); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.reel.over .reel-core em { color: #0B0A09; }
.reel-busy, .reel-play, .reel-ready { opacity: 0; transform: scale(.9); pointer-events: none; }
.tr[data-state="ready"] .reel-idle, .tr[data-state="busy"] .reel-idle, .tr[data-state="done"] .reel-idle { opacity: 0; transform: scale(.9); }
.tr[data-state="ready"] .reel-ready, .tr[data-state="busy"] .reel-busy, .tr[data-state="done"] .reel-play { opacity: 1; transform: none; }
.reel-busy b { font-size: clamp(2rem, 5vw, 3.8rem); font-variant-numeric: tabular-nums; }
.reel-play i { width: 0; height: 0; margin-left: 8%; border-left: clamp(22px, 3vw, 34px) solid var(--paper); border-block: clamp(14px, 1.9vw, 21px) solid transparent; transition: border-color .3s; }
.reel.playing .reel-play i { width: clamp(22px, 3vw, 30px); height: clamp(26px, 3.6vw, 38px); margin: 0; border: 0; border-inline: clamp(7px, 1vw, 10px) solid var(--paper); }
.tr-file { text-align: center; }
.tr-file strong { display: block; max-width: 30ch; margin: 0 auto 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 15px/1.3 var(--f); }
.tr-go { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 22px; }
.tr-lang { display: inline-flex; align-items: center; gap: 10px; font: 500 12px/1 var(--m); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.tr-lang select { appearance: none; padding: 8px 2px; border: 0; border-bottom: 1px solid var(--ring); border-radius: 0; background: none; color: var(--paper); font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.tr-lang select option { color: #0B0A09; }
.tr-time { display: flex; align-items: center; gap: 18px; font: 500 12px/1 var(--m); letter-spacing: .08em; color: var(--dim); font-variant-numeric: tabular-nums; }
.tr-time b { color: var(--paper); font-weight: 500; }

.tr-out { min-width: 0; width: 100%; }
.tr-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font: 500 12px/1.4 var(--m); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.tr-meta b { color: var(--paper); font-weight: 500; }
.tr-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 26px; margin: 16px 0 0; padding: 10px 0; border-block: 1px solid var(--rule-2); }
.tr-find { flex: 1 1 160px; max-width: 280px; padding: 8px 0; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--paper); outline: 0; font: 500 12px/1 var(--m); letter-spacing: .06em; transition: border-color .3s; }
.tr-find:focus { border-color: var(--paper); } .tr-find::placeholder { color: var(--mute); text-transform: uppercase; }
.tr-text { padding-top: clamp(18px, 2.4vw, 34px); font: 400 clamp(1.15rem, 1.75vw, 1.75rem)/1.5 var(--f); letter-spacing: -.005em; }
.tr-text p { margin: 0 0 1.1em; max-width: 34em; }
.tr-text .w { cursor: pointer; border-radius: 2px; transition: color .25s, background-color .25s; }
.tr-text .w:hover { color: var(--sig); }
.tr-text.playing .w { color: var(--mute); }
.tr-text.playing .w.p { color: var(--paper); }
.tr-text .w.now { color: var(--sig) !important; }
.tr-text .w.hit { background: var(--sig); color: #0B0A09 !important; }
.tr-text.timed p { display: grid; grid-template-columns: 6.5ch minmax(0, 1fr); column-gap: 18px; margin-bottom: .7em; font-size: clamp(1rem, 1.3vw, 1.25rem); }
.tr-text time { padding-top: .45em; font: 500 12px/1 var(--m); letter-spacing: .06em; color: var(--sig); cursor: pointer; }
.tr-text:not(.timed) time { display: none; }
@media (max-width: 900px) {
  .tr[data-state="done"] .tr-grid { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .tr[data-state="done"] .tr-side { position: static; }
  .tr[data-state="done"] .reel { width: min(60vw, 260px); }
}

.tr .s-idle, .tr .s-ready, .tr .s-busy, .tr .s-done { display: none; }
.tr[data-state="idle"] .s-idle { display: block; }
.tr[data-state="ready"] .s-ready, .tr[data-state="busy"] .s-busy { display: flex; flex-wrap: wrap; justify-content: center; }
.tr[data-state="ready"] .tr-file.s-ready, .tr[data-state="busy"] .tr-file.s-busy { display: block; }
.tr[data-state="done"] .s-done { display: flex; }

/* ═════════════════════════════ 2. TEXT TO SPEECH ════════════════════════════ */
.sp-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: clamp(24px, 5vw, 90px); align-items: start; }
.sp-page { position: relative; }
.sp-text { display: block; width: 100%; min-height: 9.5em; padding: 0; border: 0; outline: 0; resize: none; overflow: hidden; background: none; color: var(--paper); caret-color: var(--sig); font: 500 clamp(1.5rem, 3.1vw, 3.1rem)/1.22 var(--f); font-stretch: 88%; letter-spacing: -.012em; }
.sp-text::placeholder { color: var(--mute); }
.sp-read { position: absolute; inset: 0 0 auto 0; margin: 0; pointer-events: none; white-space: pre-wrap; overflow-wrap: break-word; color: var(--mute); font: 500 clamp(1.5rem, 3.1vw, 3.1rem)/1.22 var(--f); font-stretch: 88%; letter-spacing: -.012em; }
.sp-read b { font-weight: inherit; color: var(--paper); }
.sp-page.reading .sp-text { color: transparent; caret-color: transparent; }
.sp-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 22px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
.sp-count { font: 500 12px/1 var(--m); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-variant-numeric: tabular-nums; }
.sp-count b { color: var(--paper); font-weight: 500; } .sp-count.over b { color: var(--sig); }

/* the voices: a ring of faces you turn, not a dropdown */
.sp-side { position: sticky; top: 80px; display: grid; gap: 14px; }
.sp-dial { position: relative; width: min(100%, 380px, 42vh); min-width: 280px; aspect-ratio: 1; margin-inline: auto; touch-action: none; user-select: none; }
.sp-ring { position: absolute; inset: 5.3%; border-radius: 50%; border: 1px solid var(--rule-2); transform: rotate(var(--turn, 0deg)); transition: transform 1s var(--e); cursor: grab; }
.sp-ring .sp-v { width: 11.86%; margin: -5.93% 0 0 -5.93%; transform: rotate(var(--a)) translateY(-421.5%); }
.sp-ring.drag { transition: none; cursor: grabbing; }
.sp-v { position: absolute; left: 50%; top: 50%; width: 10.6%; aspect-ratio: 1; margin: -5.3% 0 0 -5.3%; padding: 0; transform: rotate(var(--a)) translateY(-436%); border: 1px solid var(--ring); border-radius: 50%; background: var(--bg); color: var(--paper); cursor: pointer; font: 700 clamp(10px, 1.1vw, 13px)/1 var(--f); letter-spacing: .02em; text-transform: uppercase; transition: background-color .35s, color .35s, border-color .35s, opacity .35s; }
.sp-v span { display: block; transform: rotate(calc(var(--a) * -1 - var(--turn, 0deg))); transition: transform 1s var(--e); }
.sp-ring.drag .sp-v span { transition: none; }
.sp-v:hover { border-color: var(--paper); }
.sp-v.on { background: var(--paper); color: #0B0A09; border-color: var(--paper); }
.sp-v.dim { opacity: .22; }
.sp-hub { position: absolute; inset: 21%; display: grid; place-items: center; align-content: center; gap: 6px; border-radius: 50%; text-align: center; pointer-events: none; }
.sp-hub canvas { position: absolute; inset: -6%; width: 112%; height: 112%; }
.sp-hub b { position: relative; font: 800 clamp(1.8rem, 3.6vw, 3.2rem)/.9 var(--f); font-stretch: 62%; text-transform: uppercase; }
.sp-hub em { position: relative; font: 500 11px/1.3 var(--m); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.sp-hub button { position: relative; pointer-events: auto; margin-top: 8px; }
.sp-mark { position: absolute; left: 50%; top: -9px; width: 1px; height: 18px; background: var(--sig); }
.sp-acc { justify-content: center; }
.sp-dial.busy .sp-ring { animation: spbusy 5s linear infinite; }
@keyframes spbusy { to { rotate: 360deg; } }
.sp-dial:focus-visible { outline: 0; } .sp-dial:focus-visible .sp-ring { border-color: var(--paper); }
.sp-speed { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; font: 500 12px/1 var(--m); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.sp-speed input { appearance: none; width: 100%; height: 22px; margin: 0; background: linear-gradient(var(--rule-2), var(--rule-2)) 50% / 100% 1px no-repeat; cursor: pointer; }
.sp-speed input::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--paper); transition: transform .3s var(--e), background-color .3s; }
.sp-speed input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--paper); }
.sp-speed input:active::-webkit-slider-thumb { transform: scale(1.5); background: var(--sig); }
.sp-speed b { min-width: 4ch; text-align: right; color: var(--paper); font-weight: 500; }
.sp-run { justify-self: center; }

.sp-takes { margin: clamp(26px, 3vw, 44px) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule-2); }
.sp-take { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 0 clamp(12px, 2vw, 26px); padding: 14px 0; border-bottom: 1px solid var(--rule); animation: spin .8s var(--e) both; }
@keyframes spin { from { opacity: 0; transform: translateY(18px); } }
.sp-play { position: relative; width: 48px; aspect-ratio: 1; padding: 0; border: 1px solid var(--ring); border-radius: 50%; background: none; cursor: pointer; transition: background-color .3s, border-color .3s; }
.sp-play::before { content: ""; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%); border-left: 13px solid var(--paper); border-block: 8px solid transparent; }
.sp-play.on { background: var(--sig); border-color: var(--sig); }
.sp-play.on::before { left: 50%; width: 11px; height: 14px; border: 0; border-inline: 4px solid #0B0A09; }
.sp-take h3 { margin: 0 0 6px; font: 800 1.15rem/1 var(--f); font-stretch: 75%; text-transform: uppercase; }
.sp-take p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font-size: 14px; }
.sp-seek { grid-column: 2 / -1; height: 14px; margin-top: 6px; cursor: pointer; background: linear-gradient(var(--rule-2), var(--rule-2)) 0 50% / 100% 1px no-repeat; }
.sp-seek i { display: block; width: 0; height: 100%; background: linear-gradient(var(--sig), var(--sig)) 0 50% / 100% 3px no-repeat; }
@media (max-width: 900px) {
  .sp-grid { grid-template-columns: minmax(0, 1fr); }
  .sp-side { position: static; }
  .sp-dial { width: min(92vw, 400px); }
  .sp-ring .sp-v { width: 12.9%; margin: -6.45% 0 0 -6.45%; transform: rotate(var(--a)) translateY(-387.6%); }
  .sp-text { min-height: 5.2em; }
  .sp-take { grid-template-columns: 44px minmax(0, 1fr) auto; } .sp-take .ta.dl { grid-column: 3; } .sp-take time { display: none; }
}

/* ═════════════════════════════ 3. CHAT WITH PDF ═════════════════════════════ */
.pd-drop { display: grid; justify-items: center; gap: 22px; padding: clamp(10px, 3vw, 40px) 0 0; }
/* a sheet of paper lying on the desk, corner turned up */
.sheet { position: relative; width: min(64vw, 330px, 40vh); aspect-ratio: 1 / 1.34; padding: 0; border: 0; background: var(--paper); color: #0B0A09; cursor: pointer; rotate: -5deg; clip-path: polygon(0 0, calc(100% - 64px) 0, 100% 64px, 100% 100%, 0 100%); filter: drop-shadow(0 40px 50px rgba(0, 0, 0, .55)); transition: rotate .9s var(--e), scale .9s var(--e), background-color .4s; view-transition-name: sheet; }
.sheet::before { content: ""; position: absolute; right: 0; top: 0; width: 64px; height: 64px; background: linear-gradient(225deg, transparent 50%, #C9C3B6 50%); }
.sheet::after { content: ""; position: absolute; inset: 22% 14% 34% 14%; background: repeating-linear-gradient(#0B0A09 0 1px, transparent 1px 22px); opacity: .16; transition: opacity .4s; }
.sheet:hover, .sheet:focus-visible { rotate: -1.5deg; scale: 1.02; }
.sheet.over { rotate: 0deg; scale: 1.06; background: var(--sig); }
.sheet span { position: absolute; left: 14%; right: 14%; bottom: 10%; display: grid; gap: 8px; text-align: left; }
.sheet b { font: 800 clamp(1.5rem, 3.2vw, 2.4rem)/.9 var(--f); font-stretch: 62%; text-transform: uppercase; }
.sheet em { font: 500 11px/1.4 var(--m); font-style: normal; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.sheet.busy { animation: sheetbusy 1.6s var(--e) infinite alternate; }
@keyframes sheetbusy { to { rotate: 3deg; scale: 1.03; } }

.pd-work { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(22px, 4vw, 70px); align-items: start; }
.pd-desk { position: sticky; top: 76px; height: calc(100vh - 96px); overflow-y: auto; padding: 8px clamp(8px, 2vw, 28px) 40px 4px; scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; scroll-behavior: smooth; }
.pd-page { position: relative; margin: 0 0 clamp(18px, 2.4vw, 34px); background: var(--paper); filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .5)); transition: transform .7s var(--e), outline-color .4s; outline: 3px solid transparent; outline-offset: 5px; }
.pd-page:nth-child(odd) { rotate: -.5deg; } .pd-page:nth-child(even) { rotate: .4deg; }
.pd-page canvas { display: block; width: 100%; height: auto; }
.pd-page figcaption { position: absolute; left: -2px; top: 12px; translate: -100% 0; padding-right: 10px; font: 500 11px/1 var(--m); letter-spacing: .08em; color: var(--mute); writing-mode: vertical-rl; rotate: 180deg; }
.pd-page.cite { outline-color: var(--sig); transform: scale(1.015); }
.pd-page.cite figcaption { color: var(--sig); }
.pd-chat { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; min-height: calc(100vh - 96px); }
.pd-doc { padding-bottom: 16px; border-bottom: 1px solid var(--rule-2); }
.pd-doc h2 { margin: 0 0 10px; font: 800 clamp(1.5rem, 2.6vw, 2.6rem)/.95 var(--f); font-stretch: 68%; text-transform: uppercase; overflow-wrap: anywhere; }
.pd-log { padding: 8px 0 24px; }
.pd-q { margin: clamp(22px, 2.6vw, 36px) 0 12px; font: 800 clamp(1.3rem, 2vw, 2rem)/1.02 var(--f); font-stretch: 75%; text-transform: uppercase; animation: spin .7s var(--e) both; }
.pd-q::before { content: "Q"; margin-right: 12px; font: 500 12px/1 var(--m); letter-spacing: .1em; color: var(--sig); vertical-align: .5em; }
.pd-a { max-width: 40em; color: var(--paper); font-size: clamp(1.02rem, 1.2vw, 1.2rem); line-height: 1.62; animation: spin .9s var(--e) both; }
.pd-a p { margin: 0 0 .9em; } .pd-a ul { margin: 0 0 .9em; padding-left: 1.1em; } .pd-a li { margin-bottom: .35em; }
.pd-a li::marker { color: var(--sig); }
.pd-c { display: inline-block; margin: 0 1px; padding: 2px 5px 1px; border: 0; background: none; color: var(--sig); cursor: pointer; font: 500 .68em/1 var(--m); letter-spacing: .04em; vertical-align: .45em; box-shadow: inset 0 -1px 0 var(--sig); transition: background-color .3s, color .3s; }
.pd-c:hover, .pd-c:focus-visible { background: var(--sig); color: #0B0A09; }
.pd-wait { display: flex; gap: 6px; padding: 14px 0; }
.pd-wait i { width: 7px; height: 7px; border-radius: 50%; background: var(--paper); animation: pdwait 1.2s var(--e) infinite; }
.pd-wait i:nth-child(2) { animation-delay: .15s; } .pd-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes pdwait { 0%, 60%, 100% { opacity: .2; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-6px); } }
.pd-sugg { display: grid; margin: 14px 0 0; padding: 0; list-style: none; }
.pd-sugg button { display: flex; justify-content: space-between; gap: 16px; width: 100%; padding: 13px 0; border: 0; border-bottom: 1px solid var(--rule); background: none; color: var(--paper); cursor: pointer; text-align: left; font: 500 15.5px/1.35 var(--f); transition: padding .5s var(--e), color .3s; }
.pd-sugg button::after { content: "\2192"; color: var(--mute); transition: transform .5s var(--e), color .3s; }
.pd-sugg button:hover { padding-left: 12px; color: var(--sig); } .pd-sugg button:hover::after { transform: translateX(5px); color: var(--sig); }
.pd-ask { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; padding: 14px 0 18px; }
.pd-ask textarea { width: 100%; min-height: 54px; max-height: 180px; padding: 14px 0 12px; border: 0; border-bottom: 1px solid var(--rule-2); border-radius: 0; outline: 0; resize: none; background: none; color: var(--paper); caret-color: var(--sig); font: 500 clamp(1.05rem, 1.5vw, 1.4rem)/1.3 var(--f); transition: border-color .3s; }
.pd-ask textarea:focus { border-color: var(--paper); } .pd-ask textarea::placeholder { color: var(--mute); }
.pd-ask .tnote { grid-column: 1 / -1; }
.pd-tabs { display: none; }
@media (max-width: 900px) {
  .pd-work { grid-template-columns: minmax(0, 1fr); }
  .pd-desk { position: static; display: flex; gap: 14px; height: auto; margin-inline: calc(var(--pad) * -1); padding: 6px var(--pad) 22px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; }
  .pd-page { flex: 0 0 46vw; margin: 0; scroll-snap-align: center; rotate: 0deg !important; }
  .pd-page figcaption { position: static; translate: none; writing-mode: horizontal-tb; rotate: 0deg; padding: 6px 0 0; background: var(--bg); }
  .pd-chat { min-height: 60vh; }
}

/* ═══════════════════════════ 4. YOUTUBE SUMMARIZER ══════════════════════════ */
.yt-in { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0 18px; border-bottom: 2px solid var(--rule-2); transition: border-color .4s; }
.yt-in:focus-within { border-color: var(--paper); }
.yt-in input { width: 100%; padding: 10px 0 14px; border: 0; outline: 0; background: none; color: var(--paper); caret-color: var(--sig); font: 700 clamp(1.5rem, 4.4vw, 4.4rem)/1 var(--f); font-stretch: 75%; letter-spacing: -.02em; text-overflow: ellipsis; }
.yt-in input::placeholder { color: var(--mute); }
.yt-in .btn-go { margin-bottom: 12px; }
.yt-opts { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 26px; margin-top: 14px; }
.yt-paste { display: grid; gap: 14px; justify-items: start; margin-top: clamp(18px, 2.4vw, 32px); padding-left: clamp(14px, 2vw, 28px); border-left: 2px solid var(--sig); animation: spin .7s var(--e) both; }
.yt-paste .tnote { max-width: 70ch; }
.yt-paste textarea { width: 100%; max-width: 900px; min-height: 9em; padding: 14px 0; border: 0; border-block: 1px solid var(--rule-2); border-radius: 0; outline: 0; resize: vertical; background: none; color: var(--paper); caret-color: var(--sig); font: 400 15px/1.55 var(--m); transition: border-color .3s; }
.yt-paste textarea:focus { border-color: var(--paper); } .yt-paste textarea::placeholder { color: var(--mute); }
.yt-peek { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: clamp(18px, 3vw, 44px); align-items: center; margin-top: clamp(22px, 3vw, 40px); }
.yt-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); border-radius: 0 0 44px 0; }
.yt-frame img, .yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.yt-frame img { animation: ytin 1.1s var(--e) both; }
@keyframes ytin { from { opacity: 0; scale: 1.12; } }
.yt.busy .yt-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 74, 28, .55), transparent); translate: -100% 0; animation: ytscan 1.5s linear infinite; }
@keyframes ytscan { to { translate: 100% 0; } }
.yt-phase { margin: 0; padding: 0; list-style: none; font: 800 clamp(1.4rem, 3vw, 3rem)/1.05 var(--f); font-stretch: 68%; text-transform: uppercase; }
.yt-phase li { color: var(--mute); transition: color .5s; } .yt-phase li.on { color: var(--paper); } .yt-phase li.done { color: var(--mute); text-decoration: line-through 2px var(--sig); }

.yt-res { padding-top: clamp(28px, 4vw, 60px); }
.yt-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(22px, 4vw, 70px); align-items: end; padding-bottom: clamp(22px, 3vw, 40px); border-bottom: 1px solid var(--rule-2); }
.yt-head h2 { margin: 12px 0 0; font: 800 clamp(2rem, 5.4vw, 5.6rem)/.9 var(--f); font-stretch: 62%; text-transform: uppercase; }
.yt-tldr { margin: 0; font: 400 clamp(1.1rem, 1.55vw, 1.5rem)/1.45 var(--f); }
.yt-for { margin: 16px 0 0; color: var(--dim); font-size: 15px; line-height: 1.5; }
.yt-for b { font: 500 11px/1 var(--m); letter-spacing: .1em; text-transform: uppercase; color: var(--sig); display: block; margin-bottom: 6px; }
.yt-body { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(22px, 5vw, 90px); align-items: start; padding-top: clamp(22px, 3vw, 44px); }
.yt-stick { position: sticky; top: 84px; display: grid; gap: 18px; }
.yt-h { margin: 0 0 6px; font: 500 12px/1 var(--m); letter-spacing: .1em; text-transform: uppercase; color: var(--sig); }
.yt-take { margin: 0; padding: 0; list-style: none; counter-reset: tk; }
.yt-take li { counter-increment: tk; display: grid; grid-template-columns: 2.4ch minmax(0, 1fr) auto; gap: 0 14px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--rule); font-size: 15.5px; line-height: 1.45; }
.yt-take li::before { content: counter(tk, decimal-leading-zero); font: 500 11px/1 var(--m); color: var(--mute); }
.yt-t { padding: 0; border: 0; background: none; cursor: pointer; color: var(--sig); font: 500 12px/1 var(--m); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.yt-t:hover { text-decoration: underline; text-underline-offset: 4px; }

/* the timeline: a line that fills as you read down it, a dot per chapter */
.yt-line { position: relative; margin: 0; padding: 0 0 0 clamp(34px, 4vw, 60px); list-style: none; }
.yt-line::before, .yt-line::after { content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 1px; background: var(--rule-2); }
.yt-line::after { background: var(--sig); transform: scaleY(var(--fill, 0)); transform-origin: 50% 0; width: 3px; left: 8px; transition: transform .25s linear; }
.yt-ch { position: relative; padding: 0 0 clamp(26px, 3.4vw, 50px); cursor: pointer; }
.yt-ch::before { content: ""; position: absolute; left: calc(clamp(34px, 4vw, 60px) * -1 + 1px); top: 8px; z-index: 1; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--ring); background: var(--bg); transition: background-color .4s, border-color .4s, transform .6s var(--e); }
.yt-ch.seen::before { background: var(--sig); border-color: var(--sig); }
.yt-ch:hover::before { transform: scale(1.5); border-color: var(--paper); }
.yt-ch .yt-t { display: block; margin-bottom: 10px; }
.yt-ch h3 { margin: 0 0 10px; font: 800 clamp(1.6rem, 3vw, 3.2rem)/.92 var(--f); font-stretch: 62%; text-transform: uppercase; transition: transform .6s var(--e), color .3s; }
.yt-ch:hover h3 { transform: translateX(8px); color: var(--sig); }
.yt-ch p { margin: 0; max-width: 46ch; color: var(--dim); font-size: 16px; line-height: 1.55; }
.yt-quote { margin: clamp(26px, 3vw, 44px) 0 0; padding: 0; border: 0; }
.yt-quote p { margin: 0 0 10px; font: 700 clamp(1.4rem, 2.6vw, 2.7rem)/1.08 var(--f); font-stretch: 75%; letter-spacing: -.01em; }
.yt-quote p::before { content: "\201C"; color: var(--sig); }
.yt-quote p::after { content: "\201D"; color: var(--sig); }
.yt-script { margin-top: clamp(30px, 4vw, 60px); border-top: 1px solid var(--rule-2); }
.yt-script summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; cursor: pointer; list-style: none; font: 800 clamp(1.2rem, 1.8vw, 1.7rem)/1 var(--f); font-stretch: 75%; text-transform: uppercase; }
.yt-script summary::-webkit-details-marker { display: none; }
.yt-script summary::after { content: "+"; font: 400 1.6rem/1 var(--f); transition: transform .5s var(--e); }
.yt-script[open] summary::after { transform: rotate(45deg); }
.yt-lines { max-height: 62vh; overflow-y: auto; padding-right: 12px; scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
.yt-lines p { display: grid; grid-template-columns: 6.5ch minmax(0, 1fr); gap: 0 16px; margin: 0; padding: 7px 0; color: var(--dim); font-size: 15px; line-height: 1.5; }
.yt-lines p.hide { display: none; }
@media (max-width: 900px) {
  .yt-in { grid-template-columns: minmax(0, 1fr); } .yt-in .btn-go { justify-self: start; margin: 4px 0 16px; }
  .yt-peek, .yt-head, .yt-body { grid-template-columns: minmax(0, 1fr); }
  .yt-stick { position: static; }
  .yt-frame.pin { position: sticky; top: 0; z-index: 6; margin-inline: calc(var(--pad) * -1); border-radius: 0; }
}

/* ═══════════════════════════ 5. WATERMARK REMOVER ══════════════════════════ */
.wm-drop { display: grid; justify-items: center; gap: 20px; }
/* a loupe: the mark sits under the glass and comes off as you bring images to it */
.lens { position: relative; width: min(70vw, 420px, 48vh); min-width: 240px; aspect-ratio: 1; padding: 0; border: 1px solid var(--ring); border-radius: 50%; background: none; color: var(--paper); cursor: pointer; view-transition-name: lens; transition: transform .7s var(--e), background-color .5s, border-color .5s; }
.lens::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; background: repeating-conic-gradient(var(--ring) 0 .5deg, transparent .5deg 5deg); -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 9px), #000 calc(100% - 8px)); mask: radial-gradient(closest-side, transparent calc(100% - 9px), #000 calc(100% - 8px)); transition: transform 1.4s var(--e); }
.lens::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1px; height: 26%; background: var(--ring); translate: -50% -50%; box-shadow: 0 0 0 0 transparent; rotate: 0deg; }
.lens:hover::before, .lens.over::before { transform: rotate(40deg); }
.lens:hover, .lens:focus-visible { border-color: var(--paper); }
.lens.over { transform: scale(1.05); background: var(--bg-2); border-color: var(--sig); }
.lens-star { position: absolute; left: 50%; top: 40%; width: 26%; translate: -50% -50%; fill: var(--sig); transform-origin: 50% 50%; animation: lensstar 4.2s var(--e) infinite; }
@keyframes lensstar { 0%, 22% { opacity: 1; transform: scale(1) rotate(0deg); filter: blur(0); } 52%, 72% { opacity: 0; transform: scale(.5) rotate(60deg); filter: blur(6px); } 100% { opacity: 1; transform: scale(1) rotate(0deg); filter: blur(0); } }
.lens:hover .lens-star, .lens.over .lens-star { animation-duration: 1.6s; }
.lens-txt { position: absolute; left: 12%; right: 12%; top: 60%; display: grid; gap: 8px; justify-items: center; text-align: center; }
.lens-txt b { font: 800 clamp(1.2rem, 2.5vw, 2rem)/.92 var(--f); font-stretch: 68%; text-transform: uppercase; }
.lens-txt em { font: 500 11px/1.3 var(--m); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }

/* The action strip stays where it is in the page. It used to follow the scroll and sat on
   top of the pages (owner, 2026-11-19: "should not be sticky"). */
.wm-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 26px; padding: 12px 0; border-bottom: 1px solid var(--rule-2); }
.wm-bar .btn-go:disabled { opacity: .35; cursor: default; }
.wm-sheet { columns: 4 240px; column-gap: clamp(14px, 2vw, 28px); padding-top: clamp(20px, 3vw, 40px); }
.wm-print { break-inside: avoid; margin: 0 0 clamp(18px, 2.4vw, 34px); animation: spin .8s var(--e) both; }
.wm-img { position: relative; background: var(--bg-2); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.wm-img img { display: block; width: 100%; height: auto; }
.wm-img .wm-b { position: relative; transition: opacity .5s; }
.wm-img .wm-a + .wm-b { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; }
.wm-img.peek .wm-a + .wm-b { opacity: 1; transition-duration: .12s; }
.wm-img.peek::after { content: "Original"; position: absolute; left: 10px; top: 10px; padding: 6px 8px; background: #0B0A09; color: var(--paper); font: 500 10.5px/1 var(--m); letter-spacing: .1em; text-transform: uppercase; }
/* the close-up of the corner: a lens stuck to the print */
.wm-loupe { position: absolute; right: 8%; bottom: 8%; width: 38%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 2px solid var(--paper); box-shadow: 0 14px 30px rgba(0, 0, 0, .55); transform: scale(.4); opacity: 0; transition: transform .9s var(--e), opacity .4s; pointer-events: none; }
.wm-loupe canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.wm-loupe .wm-zb { transition: opacity 1.5s ease .7s; }
.wm-print.lifted .wm-loupe { transform: none; opacity: 1; }
.wm-print.lifted .wm-zb { opacity: 0; }
.wm-img.peek .wm-zb { opacity: 1 !important; transition-duration: .12s; transition-delay: 0s; }
.wm-print.is-busy .wm-img::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(100deg, transparent 30%, rgba(255, 74, 28, .5) 50%, transparent 70%); background-size: 260% 100%; animation: wmscan 1.3s linear infinite; }
@keyframes wmscan { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.wm-print.is-wait .wm-img, .wm-print.is-none .wm-img, .wm-print.is-fail .wm-img, .wm-print.is-maybe .wm-img { opacity: .5; }
.wm-print figcaption { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding-top: 10px; }
.wm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13.5px/1.3 var(--f); }
.wm-print .wm-tag { grid-column: 1; }
.wm-print figcaption .ta { grid-column: 2; grid-row: 1 / 3; }
.wm-print.is-done .wm-tag { color: var(--sig); }
@media (max-width: 560px) { .wm-sheet { columns: 2 140px; } .wm-print figcaption { grid-template-columns: minmax(0, 1fr); } .wm-print figcaption .ta { grid-column: 1; grid-row: auto; justify-self: start; } }

/* ══════════════════════════════ 6. THE PDF DESK ════════════════════════════ */
/* Pages are sheets of paper lying on the desk. They are moved by hand, cut between,
   turned and stamped; nothing here is a list of file names with buttons beside it. */
.dk-desk { display: flex; flex-wrap: wrap; align-items: flex-start; gap: clamp(20px, 2.6vw, 38px) clamp(10px, 1.4vw, 20px); padding-top: clamp(22px, 3vw, 42px); }
.dk-s { position: relative; width: clamp(128px, 14.5vw, 188px); margin: 0; cursor: grab; transition: transform .5s var(--e), opacity .3s; }
.dk-s:nth-of-type(odd) { rotate: -.7deg; } .dk-s:nth-of-type(even) { rotate: .6deg; }
.dk-s:hover { transform: translateY(-6px); }
.dk-s.lift { opacity: .3; transform: scale(.92) rotate(4deg); cursor: grabbing; }
.dk-p { display: grid; place-items: center; aspect-ratio: 1 / 1.38; overflow: hidden; background: var(--paper); filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .5)); }
.dk-in { display: grid; place-items: center; width: 100%; height: 100%; transition: transform .6s var(--e); }
.dk-in canvas, .dk-in img { display: block; max-width: 100%; max-height: 100%; pointer-events: none; }
.dk-s figcaption { display: flex; gap: 8px; align-items: baseline; padding-top: 9px; font: 500 11px/1.3 var(--m); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.dk-s figcaption b { color: var(--sig); font-weight: 500; }
.dk-s figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-tools { position: absolute; inset: 6px 6px auto 6px; display: flex; justify-content: space-between; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .4s var(--e); }
.dk-s:hover .dk-tools, .dk-s:focus-within .dk-tools { opacity: 1; transform: none; }
@media (hover: none) { .dk-tools { opacity: 1; transform: none; } }
.dk-tools button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: #0B0A09; color: var(--paper); cursor: pointer; font: 500 14px/1 var(--f); transition: background-color .25s, color .25s, transform .4s var(--e); }
.dk-tools button:hover { background: var(--sig); color: #0B0A09; transform: scale(1.12); }
.dk-desk.binding .dk-s { animation: dkbind .5s var(--e) infinite alternate; }
.dk-desk.binding .dk-s:nth-of-type(even) { animation-delay: .12s; }
@keyframes dkbind { to { transform: translateY(-10px); } }
/* a cut: the dashed line between two sheets opens up when you click it */
.dk-cut { position: relative; align-self: stretch; width: 22px; min-height: 150px; margin-inline: -8px; padding: 0; border: 0; background: none; cursor: pointer; transition: width .6s var(--e); }
.dk-cut i { position: absolute; left: 50%; top: 0; bottom: 30px; border-left: 1px dashed var(--rule-2); transition: border-color .3s; }
.dk-cut:hover i, .dk-cut:focus-visible i { border-color: var(--paper); }
.dk-cut::after { content: "\2702"; position: absolute; left: 50%; top: 42%; translate: -50% -50%; rotate: 90deg; color: var(--paper); font-size: 15px; opacity: 0; transition: opacity .3s, color .3s; }
.dk-cut:hover::after { opacity: .7; }
.dk-cut.on { width: clamp(44px, 5.4vw, 86px); }
.dk-cut.on i { border-left: 2px dashed var(--sig); }
.dk-cut.on::after { opacity: 1; color: var(--sig); }
/* sign: an ink pad, and the page you stamp */
.dk-sign { display: grid; grid-template-columns: minmax(250px, .62fr) minmax(0, 1.38fr); gap: clamp(22px, 4vw, 70px); align-items: start; padding-top: clamp(22px, 3vw, 42px); }
.dk-pad { position: sticky; top: 84px; display: grid; gap: 12px; }
.dk-pad canvas { display: block; width: 100%; aspect-ratio: 2.3 / 1; touch-action: none; cursor: crosshair; background: linear-gradient(rgba(11, 10, 9, .28), rgba(11, 10, 9, .28)) 50% 76% / 84% 1px no-repeat, var(--paper); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%); rotate: -1.2deg; transition: rotate .6s var(--e); }
.dk-pad.ready canvas { rotate: 0deg; }
.dk-view { display: grid; gap: 12px; min-width: 0; }
.dk-page { position: relative; background: var(--paper); filter: drop-shadow(0 22px 34px rgba(0, 0, 0, .55)); cursor: copy; user-select: none; -webkit-user-select: none; }
.dk-page canvas { display: block; width: 100%; height: auto; }
.dk-sig { position: absolute; cursor: move; touch-action: none; outline: 1px dashed var(--sig); outline-offset: 5px; animation: dkstamp .5s var(--e) both; }
@keyframes dkstamp { from { opacity: 0; scale: 1.5; } }
.dk-sig img { display: block; width: 100%; pointer-events: none; }
.dk-sig-x { position: absolute; right: -15px; top: -15px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: var(--sig); color: #0B0A09; cursor: pointer; font: 600 15px/1 var(--f); }
.dk-sig-r { position: absolute; right: -10px; bottom: -10px; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--sig); background: var(--paper); cursor: nwse-resize; }
/* compress: the weight before and after */
.dk-press { display: grid; gap: clamp(18px, 3vw, 38px); padding-top: clamp(24px, 4vw, 60px); }
.dk-nums { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 clamp(14px, 3vw, 44px); font: 800 clamp(3rem, 10.5vw, 10.5rem)/.82 var(--f); font-stretch: 62%; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.dk-nums i { font-style: normal; font-size: .45em; color: var(--mute); }
.dk-nums #dkNow { color: var(--sig); }
.dk-bar { position: relative; height: 10px; background: var(--rule); }
.dk-bar::after { content: ""; position: absolute; inset: 0; background: var(--sig); transform-origin: 0 50%; transform: scaleX(var(--k, 1)); transition: transform 1.6s var(--e); }
.dk-press.busy .dk-bar::after { animation: dkpress .9s var(--e) infinite alternate; }
@keyframes dkpress { to { transform: scaleX(.35); } }
@media (max-width: 900px) { .dk-sign { grid-template-columns: minmax(0, 1fr); } .dk-pad { position: static; } .dk-s { width: calc(33.33% - 10px); } }
@media (max-width: 480px) { .dk-s { width: calc(50% - 8px); } }

/* page text beside its sheet (reader and translator) */
.tx-pg { padding: 18px 0 20px; border-bottom: 1px solid var(--rule); animation: spin .7s var(--e) both; }
.tx-pg h3 { margin: 0 0 8px; }
.tx-t { max-width: 44em; white-space: pre-wrap; overflow-wrap: anywhere; font-size: clamp(1rem, 1.12vw, 1.12rem); line-height: 1.62; }

/* the PDF tools index: a fan of sheets that opens under the pointer */
.fan { position: relative; width: min(100%, 300px); aspect-ratio: 1 / .92; margin-left: auto; }
.fan i { position: absolute; left: 22%; bottom: 0; width: 52%; aspect-ratio: 1 / 1.36; background: var(--paper); transform-origin: 50% 110%; clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%); filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .5)); transition: rotate .9s var(--e), translate .9s var(--e); }
.fan i::after { content: ""; position: absolute; inset: 24% 14% 30%; background: repeating-linear-gradient(#0B0A09 0 1px, transparent 1px 16px); opacity: .16; }
.fan i:nth-child(1) { rotate: -15deg; background: #C9C3B6; } .fan i:nth-child(2) { rotate: -4deg; background: #DDD7CB; } .fan i:nth-child(3) { rotate: 8deg; }
.fan:hover i:nth-child(1), .th:hover .fan i:nth-child(1) { rotate: -27deg; translate: -8% 0; }
.fan:hover i:nth-child(3), .th:hover .fan i:nth-child(3) { rotate: 20deg; translate: 8% 0; }
.tl-group { margin: clamp(34px, 4.6vw, 70px) 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--rule-2); display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.tl-group h2 { margin: 0; font: 800 clamp(1.5rem, 2.6vw, 2.6rem)/1 var(--f); font-stretch: 68%; text-transform: uppercase; }
@media (max-width: 860px) { .fan { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .reel, .sheet, .sp-ring, .sp-v span, .tr-grid, .tcurtain { transition: none !important; animation: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
