/* Quick View — one stage that shows a PDF, a deck, an SVG, an image, text or media.
   The toolbar is one bar whose groups appear only for the kinds they mean something
   for: body carries .paged / .scalable / .zoomable / .code / .toggleable and the
   `only-*` classes below hide themselves against those. */

:root {
  --ink: #191918;
  --muted: #6c6a63;
  --paper: #f4f0e8;
  --card: #fffdf8;
  --line: rgba(25, 25, 24, .14);
  --teal: #0e7c86;
  --font: "Manrope", system-ui, -apple-system, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;

  --stage-bg: #e6e1d7;
  --stage-fg: #6c6a63;

  --pad-x: 20px;
  --pad-top: 26px;
  --pad-bottom: 34px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }

/* ---------- toolbar ----------
   The qpkit mark is `position: fixed` from nav.js; the bar is lifted to the
   top of the page and keeps a slot clear for it, so the two read as one row.
   Past 1900px the bar has centred away from the mark and the slot is dropped. */

.__accessbox-quick-view .__accessbox-nav { top: 18px; left: 24px; }

.bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  width: min(1760px, calc(100% - 28px));
  min-height: 54px;
  margin: 12px auto 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  box-shadow: 0 3px 14px rgba(48, 42, 31, .05);
}

@media (max-width: 1900px) {
  .bar { padding-left: 62px; }
}

/* the bar survives a file that wouldn't open, so there is still a way out */
body:not(.has-file) .bar,
body.presenting .bar { display: none; }

body:not(.has-doc) .only-doc,
body:not(.paged) .only-paged,
body:not(.zoomable) .only-zoom,
body:not(.scalable) .only-scalable,
body:not(.code) .only-code,
body:not(.toggleable) .only-toggle { display: none; }

.file-chip {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 0 4px 0 10px;
  border-radius: 10px;
}

.file-dot {
  display: grid;
  width: 26px;
  height: 26px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
}

.file-meta { min-width: 0; }

.file-name {
  display: block;
  overflow: hidden;
  max-width: 24ch;
  font-size: .81rem;
  font-weight: 700;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-sub {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sep {
  width: 1px;
  height: 24px;
  flex: none;
  background: var(--line);
}

.spacer { flex: 1 1 auto; }

.group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(25, 25, 24, .05);
}

.btn {
  display: inline-flex;
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: background .16s, color .16s, transform .16s;
}

/* hover looks only where there is hover: a finger leaves :hover on the button it tapped */
@media (hover: hover) {
  .btn:hover { background: rgba(25, 25, 24, .08); }
}
.btn:active { transform: scale(.96); }
.btn[aria-pressed="true"] { color: #fff; background: var(--ink); }
.btn[disabled] { opacity: .35; cursor: default; }
.btn[disabled]:hover { background: transparent; }
.btn:focus-visible { outline: 3px solid rgba(14, 124, 134, .3); outline-offset: 2px; }

.btn.primary { color: #fff; background: var(--teal); }
@media (hover: hover) {
  .btn.primary:hover { background: #0a6570; }
}

.btn.icon { padding: 0; }

.readout {
  min-width: 54px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .69rem;
  text-align: center;
  cursor: pointer;
}

.readout:hover { color: var(--ink); }

.counter {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .69rem;
}

.counter input {
  width: 42px;
  padding: 5px 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--card);
  font-family: var(--mono);
  font-size: .69rem;
  text-align: center;
  -moz-appearance: textfield;
}

.counter input::-webkit-outer-spin-button,
.counter input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }

.swatches { display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: rgba(25, 25, 24, .05); }

.swatch {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(25, 25, 24, .16);
  border-radius: 8px;
  cursor: pointer;
  transition: transform .16s, box-shadow .16s;
}

.swatch:hover { transform: translateY(-1px); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.swatch[data-stage="light"] { background: #f0ece3; }
.swatch[data-stage="dim"] { background: #8e8a80; }
.swatch[data-stage="dark"] { background: #1c1c1b; }
.swatch[data-stage="grid"] {
  background:
    linear-gradient(45deg, rgba(25, 25, 24, .18) 25%, transparent 25% 75%, rgba(25, 25, 24, .18) 75%) 0 0 / 10px 10px,
    linear-gradient(45deg, rgba(25, 25, 24, .18) 25%, transparent 25% 75%, rgba(25, 25, 24, .18) 75%) 5px 5px / 10px 10px,
    #f6f4ef;
}

/* ---------- open files strip ---------- */

.tabs {
  display: flex;
  overflow-x: auto;
  flex: none;
  gap: 6px;
  width: min(1760px, calc(100% - 28px));
  margin: 8px auto 0;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

body:not(.multi) .tabs,
body.presenting .tabs { display: none; }

.tab {
  display: inline-flex;
  min-width: 0;
  height: 30px;
  flex: none;
  align-items: center;
  gap: 7px;
  padding: 0 6px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: -.01em;
  transition: background .16s, color .16s;
  /* a finger may still swipe the strip sideways; a held tab is a reorder */
  touch-action: pan-x;
  user-select: none;
}

.tab:hover { background: #fff; }

.tab.dragging {
  position: relative;
  z-index: 3;
  box-shadow: 0 6px 18px rgba(25, 25, 24, .22);
  cursor: grabbing;
}

body.tab-dragging, body.tab-dragging .tab { cursor: grabbing; }
.tab[aria-selected="true"] { color: #fff; border-color: transparent; background: var(--ink); }

.tab-name {
  overflow: hidden;
  max-width: 18ch;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-x {
  display: grid;
  width: 18px;
  height: 18px;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  opacity: .5;
  cursor: pointer;
}

@media (hover: hover) {
  .tab-x:hover { background: rgba(125, 125, 125, .3); opacity: 1; }
}

/* no hover to find it with a finger, so the close button is plain and finger-sized */
@media (hover: none) and (pointer: coarse) {
  .tab { height: 38px; padding-right: 3px; }
  .tab-x { width: 32px; height: 32px; opacity: .75; }
}

/* ---------- stage ---------- */

.stage-shell {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  width: min(1760px, calc(100% - 28px));
  margin: 10px auto 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--stage-bg);
  transition: background .2s;
}

body.presenting .stage-shell {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #0d0d0c;
}

/* Where there is no Fullscreen API (iPhone Safari) the stage is pinned over the
   page instead, above the qpkit mark, clear of the notch and home bar. */
body.faux-full { background: #0d0d0c; }

body.faux-full .stage-shell {
  position: fixed;
  z-index: 100000;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
}

.stage {
  overflow: auto;
  flex: 1 1 auto;
  padding: var(--pad-top) var(--pad-x) var(--pad-bottom);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

body.presenting .stage {
  --pad-x: 0px;
  --pad-top: 0px;
  --pad-bottom: 0px;
}

/* One page, or media, sits in the middle of the stage rather than at the top.
   `safe` matters: centring an item bigger than its scroll container otherwise
   puts the top-left corner out of reach of the scrollbars. */
.stage.center { display: grid; place-items: center; place-items: safe center; }
body:not(.has-doc) .stage { display: grid; place-items: center; }

/* a document's pinch is its own zoom (quick-view.js); one finger still scrolls */
.stage.pinchable { touch-action: pan-x pan-y; }

.stage.pannable { cursor: grab; }
.stage.panning { cursor: grabbing; scroll-behavior: auto; }
.stage.panning * { pointer-events: none; }

/* the board: one thing on a table, moved by a transform rather than scrolled */
.stage.board {
  position: relative;
  overflow: hidden;
  padding: 0;
  touch-action: none;
}

#doc.board {
  position: absolute;
  top: 0;
  left: 0;
  width: max-content;
  margin: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.stage::-webkit-scrollbar { width: 11px; height: 11px; }
.stage::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 8px; background: rgba(25, 25, 24, .22); background-clip: content-box; }
.stage::-webkit-scrollbar-thumb:hover { background-color: rgba(25, 25, 24, .38); }

#doc { width: max-content; margin: 0 auto; }
body:not(.has-doc) #doc { display: none; }

/* text and framed documents fill the stage instead of sizing to their content */
#doc[data-mode="text"], #doc[data-mode="frame"] { width: 100%; margin: 0; }
#doc[data-mode="frame"] { height: 100%; }
#doc[data-mode="media"] { display: grid; width: 100%; height: 100%; place-items: center; }

/* ---------- pages (pdf, images, svg, slides) ---------- */

.qv-page {
  position: relative;
  display: block;
  margin: 0 auto 20px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(25, 25, 24, .14), 0 14px 34px rgba(25, 25, 24, .12);
}

.qv-page:last-child { margin-bottom: 0; }
.qv-page > canvas, .qv-page > img { display: block; width: 100%; height: auto; }

/* an SVG or a transparent PNG shows the backdrop through it, so no white sheet */
.qv-page.bare { background: transparent; box-shadow: none; }
.qv-page.bare > img { box-shadow: 0 2px 4px rgba(25, 25, 24, .1), 0 14px 34px rgba(25, 25, 24, .1); }

#doc.single .qv-page { display: none; }
#doc.single .qv-page.is-active { display: block; margin-bottom: 0; }

/* pptx-preview renders its own wrapper tree; these override its inline look */
#doc .pptx-preview-wrapper { margin: 0 !important; background: transparent !important; }
#doc .pptx-preview-slide-wrapper { margin: 0 auto 20px !important; border-radius: 3px; }
#doc.single .pptx-preview-slide-wrapper.is-active { margin-bottom: 0 !important; }
body.presenting #doc .qv-page { border-radius: 0; box-shadow: none; }

.qv-pending {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .7rem;
}

/* ---------- text ---------- */

.qv-text {
  width: min(94ch, 100%);
  margin: 0 auto;
  padding: 26px 28px 40px;
  border-radius: 12px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 2px 4px rgba(25, 25, 24, .1), 0 14px 34px rgba(25, 25, 24, .1);
  font-size: calc(1rem * var(--tscale, 1));
  tab-size: 4;
}

.qv-text pre {
  margin: 0;
  font-family: var(--mono);
  font-size: .82em;
  line-height: 1.62;
  white-space: pre;
}

.qv-text.prose pre { font-family: var(--font); font-size: .93em; line-height: 1.72; white-space: pre-wrap; overflow-wrap: break-word; }
.qv-text.wrap pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.qv-table-wrap { overflow-x: auto; }

.qv-text table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: .76em;
}

.qv-text th, .qv-text td {
  max-width: 46ch;
  padding: 7px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
}

.qv-text thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  box-shadow: inset 0 -1px 0 var(--line);
  font-weight: 700;
}

.qv-text tbody tr:nth-child(even) { background: rgba(25, 25, 24, .025); }

.qv-truncated {
  margin: 18px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .68rem;
}

/* ---------- markdown ----------
   Rendered into the page (through the allowlist in quick-view.js) rather than an
   iframe, so the words stay selectable and the browser's own find works. */

.qv-text.md { line-height: 1.72; }
.qv-text.md > :first-child { margin-top: 0; }
.qv-text.md h1, .qv-text.md h2, .qv-text.md h3,
.qv-text.md h4, .qv-text.md h5, .qv-text.md h6 { margin: 1.6em 0 .5em; line-height: 1.24; font-weight: 750; letter-spacing: -.03em; }
.qv-text.md h1 { font-size: 1.85em; }
.qv-text.md h2 { font-size: 1.42em; }
.qv-text.md h3 { font-size: 1.16em; }
.qv-text.md h1, .qv-text.md h2 { padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.qv-text.md p, .qv-text.md ul, .qv-text.md ol, .qv-text.md blockquote, .qv-text.md pre, .qv-text.md table { margin: 0 0 1.05em; }
.qv-text.md li { margin: .3em 0; }
.qv-text.md a[href] { color: var(--teal); text-underline-offset: 2px; }
.qv-text.md a:not([href]) { color: inherit; text-decoration: none; }   /* a link the allowlist disarmed */
.qv-text.md code { padding: .15em .36em; border-radius: 5px; background: rgba(25, 25, 24, .06); font-family: var(--mono); font-size: .86em; }
.qv-text.md pre { overflow-x: auto; padding: 14px 16px; border-radius: 10px; background: #f2efe8; white-space: pre; }
.qv-text.md pre code { padding: 0; background: none; font-size: .82em; }
.qv-text.md blockquote { padding-left: 14px; border-left: 3px solid rgba(14, 124, 134, .4); color: var(--muted); }
.qv-text.md img { max-width: 100%; border-radius: 8px; }
.qv-text.md hr { height: 1px; margin: 2em 0; border: 0; background: var(--line); }
.qv-text.md table { display: block; overflow-x: auto; width: max-content; max-width: 100%; font-family: var(--font); font-size: .92em; }
.qv-text.md th, .qv-text.md td { border: 1px solid var(--line); }
.qv-text.md input { margin-right: .4em; }

/* ---------- word documents ----------
   Same prose container as markdown, minus the conventions that belong to
   markdown rather than to a document: no rules under the headings, tighter
   leading, and paragraphs spaced the way Word spaces them. The blocks are
   measured in `.qv-flow` and dealt onto `.qv-sheet`s of the document's own
   paper size (see quick-view.js), so both must lay text out identically:
   same classes, same content width, both scrolling-context-forming. */

.qv-text.docx {
  font-size: calc(.94rem * var(--tscale, 1));
  line-height: 1.5;
}

.qv-text.docx h1, .qv-text.docx h2 { padding-bottom: 0; border-bottom: 0; }
.qv-text.docx h1 { font-size: 1.6em; }
.qv-text.docx h2 { font-size: 1.32em; }
.qv-text.docx h1, .qv-text.docx h2, .qv-text.docx h3,
.qv-text.docx h4, .qv-text.docx h5, .qv-text.docx h6 { margin: 1.1em 0 .4em; }
.qv-text.docx p { margin: 0 0 .62em; }
.qv-text.docx li { margin: .2em 0; }
.qv-text.docx sup a { text-decoration: none; }
.qv-text.docx img { max-width: 100%; max-height: var(--sheet-room, none); border-radius: 0; object-fit: contain; }

/* a document's table is part of the page, not a block that scrolls sideways */
.qv-text.docx table { display: table; width: 100%; max-width: 100%; border-collapse: collapse; font-size: .95em; }
.qv-text.docx th, .qv-text.docx td { max-width: none; padding: 5px 8px; }

/* the measuring column, and the tray the sheets are built in: laid out at full
   size but never seen (display: none would measure nothing at all) */
.qv-flow {
  position: absolute;
  top: 0;
  left: -12000px;
  overflow: hidden;
  max-width: none;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  visibility: hidden;
}

.qv-sheet { overflow: hidden; }            /* what cannot be split is clipped, not bled */

.qv-sheet-body {
  box-sizing: border-box;
  overflow: hidden;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

/* ---------- framed (markdown, html) ---------- */

.qv-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 2px 4px rgba(25, 25, 24, .1), 0 14px 34px rgba(25, 25, 24, .1);
}

/* ---------- media ---------- */

.qv-media { display: grid; justify-items: center; gap: 16px; max-width: 100%; }
.qv-media video { max-width: min(100%, 1400px); max-height: 78vh; border-radius: 10px; background: #000; box-shadow: 0 18px 44px rgba(0, 0, 0, .3); }
.qv-media audio { width: min(560px, 86vw); }

.qv-media-label {
  max-width: 60ch;
  margin: 0;
  color: var(--stage-fg);
  font-size: .85rem;
  font-weight: 650;
  letter-spacing: -.02em;
  text-align: center;
}

.qv-media-label.soft { font-weight: 500; opacity: .8; }
.qv-media-label.soft:empty { display: none; }
body.presenting .qv-media video { max-height: 96vh; border-radius: 0; }

/* ---------- empty + status states ---------- */

.dropzone {
  display: grid;
  width: min(660px, 100%);
  margin: auto;
  padding: clamp(34px, 6vw, 56px) 30px;
  border: 1.5px dashed rgba(25, 25, 24, .22);
  border-radius: 20px;
  background: rgba(255, 253, 248, .6);
  justify-items: center;
  text-align: center;
}

body.has-doc .dropzone { display: none; }

.dz-mark {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 18px;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 12px 26px rgba(14, 124, 134, .28);
  transform: rotate(-3deg);
}

.dropzone h1 {
  margin: 0 0 9px;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 750;
  letter-spacing: -.045em;
}

.dropzone p {
  max-width: 44ch;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.65;
}

.dz-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 20px 0 0;
  justify-content: center;
}

.dz-kind {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 253, 248, .8);
  font-family: var(--mono);
  font-size: .63rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.dz-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.status {
  display: none;
  width: min(470px, 100%);
  margin: auto;
  padding: 34px 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 16px 40px rgba(48, 42, 31, .08);
  text-align: center;
}

body.busy .status,
body.errored .status { display: block; }
body.busy .dropzone,
body.errored .dropzone { display: none; }

.status h2 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 700; letter-spacing: -.03em; }
.status p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.status .btn { margin-top: 20px; }

.status-form { display: none; gap: 8px; margin-top: 18px; justify-content: center; }
body.needs-key .status-form { display: flex; }
body.needs-key .status .btn.retry { margin-top: 12px; }

.status-form input {
  width: min(220px, 60%);
  padding: 0 11px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 18px;
  border: 2.5px solid rgba(25, 25, 24, .14);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

body.errored .spinner { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- fullscreen overlay ---------- */

.hud {
  position: absolute;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  display: none;
  width: max-content;
  max-width: calc(100% - 16px);
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 13px;
  color: #f6f4ef;
  background: rgba(20, 20, 19, .78);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  transition: opacity .3s;
}

body.presenting .hud { display: flex; }
/* a faded control is not there: a tap on it lands on the stage and only wakes the HUD */
body.presenting.idle .hud { opacity: 0; pointer-events: none; }
body.presenting.idle .stage { cursor: none; }
body.presenting.idle .stage.pannable { cursor: none; }

@media (hover: hover) {
  .hud .btn:hover { background: rgba(255, 255, 255, .14); }
}
.hud .readout { color: #cfccc4; }
.hud .readout:hover { color: #fff; }
.hud .pcount { padding: 0 8px; font-family: var(--mono); font-size: .7rem; white-space: nowrap; }
.hud .sep { background: rgba(255, 255, 255, .2); }

/* ---------- drag overlay ---------- */

.drag-veil {
  position: fixed;
  z-index: 9000;
  display: grid;
  padding: 22px;
  inset: 0;
  border: 3px dashed var(--teal);
  border-radius: 20px;
  background: rgba(244, 240, 232, .9);
  opacity: 0;
  place-items: center;
  pointer-events: none;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.03em;
  transition: opacity .15s;
}

body.dragging .drag-veil { opacity: 1; }

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.only-sm { display: none; }

@media (max-width: 1100px) {
  .file-sub { display: none; }
}

@media (max-width: 900px) {
  .file-name { max-width: 12ch; }
  .hide-sm { display: none; }
  .only-sm { display: inline; }
  .btn.wide span { display: none; }
  .btn.wide { padding: 0; }
  .qv-text { padding: 20px 18px 30px; border-radius: 10px; }
}

/* a small phone held sideways keeps one toolbar row, so the fit buttons are paid
   for in gaps rather than by squeezing the file name out or wrapping "/ 24" */
@media (max-width: 760px) {
  .bar { gap: 5px; }
  .file-chip { padding-left: 4px; }
  .counter { gap: 3px; }
  .counter span { white-space: nowrap; }
  .readout { min-width: 42px; }
}

/* below the smallest phone held sideways (667px) one row no longer fits them */
@media (max-width: 660px) {
  .bar { flex-wrap: wrap; }
  /* wrapped rows read better packed left than pushed apart */
  .bar .spacer { display: none; }
}

@media (max-width: 620px) {
  .__accessbox-quick-view .__accessbox-nav { top: 14px; left: 14px; }
  .bar { gap: 6px; min-height: 0; padding-left: 56px; }
  .stage-shell { border-radius: 14px; }
  .stage { --pad-x: 10px; --pad-top: 14px; --pad-bottom: 18px; }
}

/* keyboard shortcuts mean nothing to a phone */
@media (hover: none) and (pointer: coarse) {
  .dz-note { display: none; }

  /* a phone held upright fits a page by its width and leaves black below it,
     so the page sits in the middle rather than hanging from the top edge */
  body.presenting .stage { display: grid; place-items: center; place-items: safe center; }
}

/* the fingers zoom, so a phone's HUD drops − and + and keeps pages, fit and close */
@media (hover: none) and (pointer: coarse) and (max-width: 480px) {
  #zoomOut2, #zoomIn2 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: 2s !important; }
}
