/* Presentations — deck list, slide editor, present mode and print.

   A slide is one box with `container-type: size`, and everything inside it is
   placed in percentages and sized in container units. The same markup is a rail
   thumbnail, an editor stage, a projector slide and a printed page. */

.pres-page { display: flex; flex-direction: column; gap: var(--panel-gap); }
/* Resources' own .resources-library splits 31% of a container that's already
   shrunk by its 28%-wide preview panel — effectively ~22% of the full page.
   Without a preview panel here, that same 31% would compute against the
   whole width instead, rendering visibly wider. Pinned to the same ~22% of
   the full page so the two tree panels (and their width:100% buttons) match. */
.pres-page .resources-library { grid-template-columns: minmax(180px, 22%) minmax(0, 1fr); }
/* No gap: the bar is joined to the slide, and what follows sets its own space. */
.pres-editor { display: flex; flex-direction: column; }
.pres-page [hidden], .pres-editor [hidden] { display: none; }

.pres-blank { margin: 0; color: var(--muted); font-size: var(--text-reading); }

/* ------------------------------------------------------------- deck list */

.pres-deck-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pres-deck {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line); border-radius: 3px; background: var(--paper-raised);
  box-shadow: 0 9px 28px rgba(34, 31, 25, .045);
}
.pres-deck-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px;
  border: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit;
}
/* The deck's own first slide, small — a thumbnail is the slide rather than a
   drawing of it, same as the rail and the locator. */
.pres-deck-thumb { flex: none; width: 108px; }
.pres-deck-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pres-deck-open:hover .pres-deck-title { color: var(--blue); }
.pres-deck-title { font: 400 17px/1.2 var(--serif); }
.pres-deck-meta { color: var(--muted); font-size: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; }
/* Groups the sort control with the count on the resources-browser-head's
   own right side — that shared header lays out exactly two flex children
   (see resources.css), so both live in one wrapper rather than a third. */
.pres-deck-head-actions { flex: none; display: flex; align-items: center; gap: 14px; }
.pres-deck-head-actions > span { color: var(--muted); font-size: var(--text-meta); }
.pres-deck-sort { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--text-meta); }
.pres-deck-sort select { border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink); font: inherit; padding: 2px 4px; cursor: pointer; }

/* A phone gets a flat, read-only list — no tree, no delete, one tap straight
   into presenting. */
.pres-page-mobile .pres-deck { box-shadow: none; }
.pres-page-mobile .pres-deck-thumb { width: 86px; }

/* An imported PDF's row: a plain page mark rather than a slide thumbnail —
   there's no block content to draw one from. */
.pres-pdf-thumb {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 3px; background: var(--paper);
  color: var(--muted); font: 600 var(--text-label)/1 var(--sans); letter-spacing: var(--tracking-label);
}
.pres-pdf-thumb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* --------------------------------------------------------- folder browser */

/* The tree itself is the shared folder-tree component (core/base.css's
   .tree-row-line — see /style#folder-trees), already on the page since every
   page's stylesheet loads up front. Only the folder-settings "⋮" (opens
   askRenameOrDelete) is added here, floated on top rather than fighting the
   row's own flex layout — Files and Resources do the same for their own
   trees, each with its own copy of this recipe. */
.resource-tree .tree-row-line { position: relative; }
.pres-tree-row-actions {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 2px; opacity: 0;
}
.resource-tree .tree-row-line:hover .pres-tree-row-actions { opacity: 1; }
.resources-browser .pres-deck-list,
.resources-browser .pres-blank { padding: 14px 17px; }
.resources-browser .pres-deck-list { gap: 10px; }
/* A subfolder's run of decks, opened inside its parent rather than requiring
   a click into the subfolder itself. */
.pres-group-heading {
  margin: 0; padding: 14px 17px 0; color: var(--muted);
  font: 600 var(--text-label)/1 var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase;
}
.pres-group-heading + .pres-deck-list { padding-top: 8px; }

/* ---------------------------------------------------------------- editor */

/* The controls belong to the slide, so they sit on it: one bar, joined by a
   hairline to the top edge of the page being edited. */
.deck-bar {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 3px 3px 0 0;
  background: var(--paper-raised);
}
/* Title and state share the row: two rows of chrome over a slide is one too
   many. */
.deck-identity { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.deck-title {
  flex: 1; min-width: 80px; height: 26px; padding: 0 4px; border: 1px solid transparent; border-radius: 2px;
  background: none; color: var(--ink); font: 400 16px/26px var(--serif);
}
.deck-title:hover { border-color: var(--line); }
.deck-title:focus { border-color: var(--blue); outline: none; background: var(--paper); }
.deck-meta { display: flex; align-items: center; gap: 10px; margin: 0; }
.deck-visibility {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0; border: 0; background: none;
  color: var(--muted); cursor: pointer; font: inherit; font-size: var(--text-meta);
  letter-spacing: var(--tracking-label); text-transform: uppercase;
}
.deck-visibility svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.deck-visibility:hover { color: var(--ink); }
.deck-visibility[aria-pressed="true"] { color: var(--blue); }
.deck-shared, .deck-status { display: inline-flex; align-items: center; height: 26px; color: var(--muted); font-size: var(--text-meta); letter-spacing: var(--tracking-label); text-transform: uppercase; }

.icon-button.is-dense svg { width: 15px; height: 15px; stroke-width: 1.6; }
.icon-button.is-dense:disabled { opacity: .35; cursor: default; }
.deck-group { position: relative; display: inline-flex; align-items: center; gap: 2px; }

.deck-menu-wrap { position: relative; }
.deck-menu {
  position: absolute; top: calc(100% + 5px); left: 0; min-width: 170px; max-height: 280px;
  overflow-y: auto; padding: 4px;
}
.deck-menu.is-right { right: 0; left: auto; min-width: 230px; }
.deck-menu[data-pres-insert-menu] { max-height: none; overflow-y: visible; }
.deck-menu[hidden] { display: none; }
.deck-menu button {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%;
  padding: 6px 9px; border: 0; border-radius: 2px; background: none; color: var(--ink); cursor: pointer;
  text-align: left; font: 400 12px/1.3 var(--sans);
}
.deck-menu button:hover { background: var(--blue-soft); color: var(--blue); }
.deck-menu button span { color: var(--muted); font-size: 10px; }
.deck-menu button:hover span { color: var(--blue); }
.deck-chevron { width: 12px; height: 12px; margin-left: 4px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.deck-visibility.is-shared { color: var(--blue); }
.deck-visibility .deck-chevron { width: 10px; height: 10px; margin-left: 2px; }

/* Zoom, and the locator that comes with it. */
.deck-zoom-level {
  min-width: 44px; height: 24px; padding: 0 4px; border: 1px solid transparent; border-radius: 3px;
  background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: var(--text-meta);
  font-variant-numeric: tabular-nums;
}
.deck-zoom-level:hover { border-color: var(--line); color: var(--ink); }

/* ------------------------------------------------------------ the surface */

.pres-stage-shell { position: relative; }
.pres-stage { position: relative; width: 100%; }

/* A PDF deck's own page can be any shape — no aspect-ratio box to size it
   against, the way a slide's 16:9 one does. Given room instead, and left to
   the browser's own PDF viewer to page and scroll inside it. */
.pres-pdf-frame { height: calc(100dvh - 220px); min-height: 480px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.pres-pdf-frame embed { display: block; width: 100%; height: 100%; border: 0; }
/* Zoomed, the slide grows inside a window that does not: the box keeps the
   height it had at rest, and what no longer fits is scrolled to. */
/* overflow-anchor: none — the browser's own scroll anchoring reads a redrawn
   slide as content shifting and puts the view back where it was. */
.pres-stage.is-zoomed { overflow: auto; overflow-anchor: none; overscroll-behavior: contain; border: 1px solid var(--line); border-top: 0; }
/* Space held, or the middle button down: the slide is being moved, not edited. */
.pres-stage.is-hand, .pres-stage.is-hand * { cursor: grab; }
.pres-stage.is-dragging-view, .pres-stage.is-dragging-view * { cursor: grabbing; }
.pres-bench.is-zoomed { width: auto; margin-inline: 0; }

/* Where you are, while the whole slide no longer fits. Click or drag it to
   move the window instead. */
.pres-map {
  position: absolute; right: 10px; bottom: 10px; z-index: 4; width: 168px; aspect-ratio: 16 / 9;
  overflow: hidden; border: 1px solid var(--line); border-radius: 2px; background: white;
  box-shadow: 0 6px 18px rgba(34, 31, 25, .12); cursor: pointer;
}
.pres-map[hidden] { display: none; }
.pres-map-page { position: absolute; inset: 0; pointer-events: none; }
.pres-map-page .pres-slide {
  position: absolute; top: 0; left: 0; width: 1280px; height: 720px; transform-origin: top left;
  border: 0; border-radius: 0; box-shadow: none; aspect-ratio: auto;
}
.pres-map-window { position: absolute; border: 1.5px solid var(--blue); background: rgba(24, 79, 209, .1); pointer-events: none; }
/* The slide, with a margin either side to park work that is not on it yet. The
   margins take the width the page's own margins leave, so the slide keeps the
   size it had. --slide-width is measured where it is known, in the editor. */
.pres-bench {
  width: 100vw; margin-inline: calc(50% - 50vw);
  display: grid; grid-template-columns: 1fr var(--slide-width, 100%) 1fr;
}
.pres-bench > .pres-slide { grid-column: 2; }
.pres-bench .pres-slide { border-left: 1px dashed var(--muted); border-right: 1px dashed var(--muted); }
.pres-frame.is-parked { opacity: .75; }

/* Notes belong to the slide above them, not to the deck below. */
.pres-notes-strip { width: 100%; margin-top: 10px; }
.pres-notes-details { border: 1px solid var(--line); border-radius: 3px; background: var(--paper-raised); }
.pres-notes-summary {
  display: flex; align-items: baseline; gap: 10px; padding: 7px 12px; cursor: pointer;
  list-style: none; user-select: none;
}
.pres-notes-summary::-webkit-details-marker { display: none; }
.pres-notes-summary:hover { background: rgba(23, 23, 19, .04); }
.pres-notes-preview { flex: 1; overflow: hidden; color: var(--muted); font-size: var(--text-body); text-overflow: ellipsis; white-space: nowrap; }
.pres-notes { width: 100%; min-height: 110px; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: var(--paper); font: inherit; font-size: var(--text-body); resize: vertical; }
.pres-notes:focus { outline: none; box-shadow: inset 2px 0 0 var(--blue); }
.pres-notes-read { padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper-raised); }
.pres-side-title { margin: 0; color: var(--muted); font: 400 var(--text-label)/1 var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.pres-side-notes { margin: 6px 0 0; color: var(--muted); font-size: var(--text-body); white-space: pre-wrap; }
.pres-bg-control { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.pres-bg-control input[type="color"] { width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; cursor: pointer; }
.pres-bg-control button { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-raised); color: var(--muted); font-size: var(--text-body); cursor: pointer; }
.pres-bg-control button:hover { color: var(--ink); }
.pres-footer-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: var(--text-body); margin-top: 14px;
}
.pres-footer-row:first-child { margin-top: 0; }
.pres-footer-row.is-column { flex-direction: column; align-items: stretch; gap: 4px; }
.pres-footer-menu { display: flex; flex-direction: column; padding: 12px 14px; width: 260px; }
.pres-footer-menu .pres-footer-row select,
.pres-footer-menu .pres-footer-row input[type="text"] { font: inherit; }
.pres-footer-hint { margin: 14px 0 0; color: var(--muted); font-size: var(--text-label); }
.pres-footer-image-pick { display: flex; align-items: center; gap: 8px; }
.pres-footer-image-preview { height: 28px; width: 28px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; }
.pres-footer-image-pick button { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-raised); color: var(--muted); font-size: var(--text-body); cursor: pointer; }
.pres-footer-image-pick button:hover { color: var(--ink); }

/* Review feedback, pinned to a spot on the slide rather than listed
   somewhere else — see commentPinsHtml/wireComments in index.js. */
.pres-slide.is-commenting { cursor: crosshair; }
.pres-comment-pin-wrap { position: absolute; z-index: 6; transform: translate(-50%, -50%); }
.pres-comment-pin {
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 2px solid var(--paper); border-radius: 50% 50% 50% 3px;
  background: var(--blue); color: white; cursor: pointer; box-shadow: 0 1px 4px rgba(23, 23, 19, .3);
}
.pres-comment-pin svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
.pres-comment-pin.is-resolved { background: var(--muted-line); }
.pres-comment-pin.is-open { outline: 2px solid var(--blue); outline-offset: 2px; }
.pres-comment-card {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 7; width: 220px; padding: 10px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--paper);
  box-shadow: 0 6px 18px rgba(23, 23, 19, .15); font-size: var(--text-body); cursor: default;
}
.pres-comment-card.is-resolved { opacity: .7; }
.pres-comment-card .pres-comment-head strong { color: var(--ink); }
.pres-comment-card p { margin: 4px 0; white-space: pre-wrap; }
.pres-comment-card textarea {
  width: 100%; min-height: 56px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--paper-raised); font: inherit; font-size: var(--text-body); resize: vertical; box-sizing: border-box;
}
.pres-comment-card-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.pres-comment-card-row button:not(.button) {
  padding: 0; border: 0; background: none; color: var(--muted); font-size: 10px;
  text-transform: uppercase; letter-spacing: .04em; cursor: pointer;
}
.pres-comment-card-row button:not(.button):hover { color: var(--ink); }
.pres-comment-card-row button.is-danger:hover { color: var(--red); }

/* --------------------------------------------------------------- the deck */

/* Every slide, small, wrapping onto as many rows as it takes. */
.pres-film { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.pres-thumb { position: relative; cursor: pointer; }
.pres-thumb-page {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid var(--line); border-radius: 2px; background: white;
}
/* The slide itself at its own size, shrunk to the tile — a thumbnail is the
   slide rather than a drawing of it. */
.pres-thumb-page .pres-slide {
  position: absolute; top: 0; left: 0; width: 1280px; height: 720px;
  transform-origin: top left; transform: scale(var(--thumb-scale, .103));
  border: 0; border-radius: 0; box-shadow: none; aspect-ratio: auto; pointer-events: none;
}
.pres-thumb.is-active .pres-thumb-page { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.pres-thumb:focus-visible .pres-thumb-page { outline: 2px solid var(--blue); outline-offset: 2px; }
.pres-thumb.is-dragging { opacity: .3; }
.pres-thumb.is-drop-before .pres-thumb-page { box-shadow: inset 3px 0 0 var(--blue); }
.pres-thumb.is-drop-after .pres-thumb-page { box-shadow: inset -3px 0 0 var(--blue); }
.pres-thumb-number {
  position: absolute; left: 4px; bottom: 4px; min-width: 16px; padding: 1px 4px; border-radius: 2px;
  background: rgba(255, 255, 255, .82); color: var(--ink); font: 500 10px/1.4 var(--sans);
  font-variant-numeric: tabular-nums; text-align: center;
}
.pres-thumb-remove {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; padding: 0 0 1px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .86); color: var(--ink);
  cursor: pointer; font-size: 14px; line-height: 1; opacity: 0;
}
.pres-thumb-duplicate {
  position: absolute; top: 3px; right: 25px; width: 18px; height: 18px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .86); color: var(--ink);
  cursor: pointer; opacity: 0;
}
.pres-thumb:hover .pres-thumb-remove, .pres-thumb:focus-within .pres-thumb-remove,
.pres-thumb:hover .pres-thumb-duplicate, .pres-thumb:focus-within .pres-thumb-duplicate { opacity: 1; }
.pres-thumb-add {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9;
  border: 1px dashed var(--line); border-radius: 2px; background: none; color: var(--muted);
  cursor: pointer; font: 300 22px/1 var(--sans);
}
.pres-thumb-add:hover { border-color: var(--ink); color: var(--ink); }

/* ----------------------------------------------------------------- slide */

/* The same DejaVu subset pdf.js embeds into the exported PDF (see FONTS
   there) — the app's own --serif/--sans are display faces that vary or fall
   back to the OS's own substitute per platform, so a slide edited on screen
   in one of those and then exported came out in a visibly different face.
   Redeclaring --serif/--sans inside .pres-slide points every slide surface
   at the export's own faces instead, so the editor, the rail, presenting and
   the PDF all draw text with the same glyphs. */
@font-face { font-family: "Deck Sans"; src: url(/vendor/fonts/DejaVuSans.ttf); font-weight: 400; }
@font-face { font-family: "Deck Sans"; src: url(/vendor/fonts/DejaVuSans-Bold.ttf); font-weight: 700; }
@font-face { font-family: "Deck Serif"; src: url(/vendor/fonts/DejaVuSerif.ttf); font-weight: 400; }

.pres-slide {
  --sans: "Deck Sans", sans-serif;
  --serif: "Deck Serif", serif;
  container-type: size;
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid var(--line); border-radius: 3px; background: white;
  box-shadow: 0 9px 28px rgba(34, 31, 25, .045);
  font-size: 1.7cqi;
}
/* In the editor the slide lets its blocks' controls show outside it; presenting
   and printing keep the crop. */
.pres-slide.is-editable { overflow: visible; }
/* A dark slide background flips its text to stay readable — see
   isDarkColor(). A block with its own background (boxStyle()) sets its own
   color inline instead, which wins over this regardless. */
.pres-slide-dark .pres-title-block,
.pres-slide-dark .pres-text,
.pres-slide-dark .pres-table td,
.pres-slide-dark .pres-block-placeholder { color: white; }
.pres-slide-dark .pres-table td { border-color: rgba(255, 255, 255, .35); }
/* The same flip while a block is actively being typed into — a title, a
   text block, or a latex/mermaid source (all three share .pres-text-input)
   sit in their own transparent-background input/textarea rather than the
   read-only element the rules just above cover, so neither was reached by
   them and stayed dark-on-dark regardless of the slide. (.pres-caption-live
   isn't included: it keeps its own light paper background always, so its
   text stays dark on that regardless of the slide underneath it.) */
.pres-slide-dark .pres-title-input-block,
.pres-slide-dark .pres-text-input { color: white; }
/* A deck's own running footer/header — see footerHtml() in blocks.js. Not a
   block: no frame, never selected, never exported to a slide's own list of
   blocks, just drawn over whatever slide asked for it. */
.pres-footer {
  position: absolute; left: 4%; right: 4%; display: flex; align-items: center;
  gap: .6em; font: 500 1.3cqi var(--sans); color: var(--muted); pointer-events: none;
}
.pres-footer-bottom { bottom: 1.6%; }
.pres-footer-top { top: 1.6%; }
.pres-footer-sep { opacity: .5; }
.pres-footer-image { height: 1.8em; width: auto; display: block; }
.pres-slide-dark .pres-footer { color: rgba(255, 255, 255, .75); }
/* Dragging a block should move it, not sweep a text selection across it. */
.pres-slide.is-editable .pres-frame { user-select: none; }
.pres-slide.is-editable .pres-frame textarea,
.pres-slide.is-editable .pres-frame input { user-select: text; }
/* A picture dragged in from the desktop is welcome here. */
.pres-slide.is-file-over { outline: 2px dashed var(--blue); outline-offset: -2px; background: var(--blue-soft); }

/* Blocks sit where they were put; later ones draw over earlier ones. */
/* A frame's own font-size, alignment and vertical placement come from the
   document; only what does not vary lives here. */
.pres-frame { position: absolute; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pres-slide.is-editable .pres-frame { border: 1px solid transparent; border-radius: 2px; cursor: move; }
/* An empty title/text block's outline, so its box reads as a placeholder
   without a fill — gone the moment there's real text, since .pres-block-placeholder
   only renders while the block is empty. Hover/selected below still win. */
.pres-slide.is-editable .pres-frame:has(.pres-block-placeholder) { border-style: dashed; border-color: var(--muted); }
.pres-slide.is-editable .pres-frame:hover { border-color: var(--line); }
.pres-slide.is-editable .pres-frame.is-selected { border-color: var(--blue); }
.pres-resize { display: none; }
.pres-slide.is-editable .pres-frame.is-selected .pres-resize {
  display: block; position: absolute; right: -5px; bottom: -5px; width: 11px; height: 11px;
  border: 1px solid var(--blue); border-radius: 2px; background: var(--paper); cursor: nwse-resize;
}
.pres-slot-empty { margin: 0; color: var(--muted); }
.pres-marquee { position: absolute; z-index: 2; border: 1px solid var(--blue); background: rgba(24, 79, 209, .08); pointer-events: none; }
/* A smart-alignment guide while dragging (grid off) — see startDrag. */
.pres-snap-line { position: absolute; z-index: 3; background: var(--red); pointer-events: none; }
.pres-snap-line.is-x { top: -8%; bottom: -8%; width: 1px; }
.pres-snap-line.is-y { left: -8%; right: -8%; height: 1px; }
/* The grid is drawn only while it is on, and only in the editor. */
/* Square cells: 2.5% across the width, the same distance down a 16:9 height. */
.pres-slide.has-grid {
  background-image:
    repeating-linear-gradient(to right, rgba(23, 23, 19, .08) 0 1px, transparent 1px var(--grid)),
    repeating-linear-gradient(to bottom, rgba(23, 23, 19, .08) 0 1px, transparent 1px var(--grid-down));
}
/* Dark ink lines vanish against a dark slide background — the same flip
   isDarkColor() already drives for text (see .pres-slide-dark above). */
.pres-slide-dark.has-grid {
  background-image:
    repeating-linear-gradient(to right, rgba(255, 255, 255, .14) 0 1px, transparent 1px var(--grid)),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, .14) 0 1px, transparent 1px var(--grid-down));
}

/* Undo, and the states behind it. */

.pres-history-time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.pres-history-empty { margin: 0; padding: 8px; color: var(--muted); font-size: var(--text-body); }

/* A caption being written sits where it will read. */
.pres-caption-live {
  width: 100%; margin-top: .4em; padding: .15em .3em; border: 1px solid var(--blue); border-radius: 2px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: .75em;
}
.pres-slide.is-editable figcaption { cursor: text; }

/* Controls float over the stage, in page pixels rather than slide units, so
   they stay legible however small the block is. `[hidden]` is spelled out
   because the rule below sets display. */
.pres-tools[hidden] { display: none; }
.pres-tools {
  position: absolute; z-index: 3; user-select: none;
  display: flex; align-items: center; gap: 4px; padding: 3px 5px;
  border: 1px solid var(--line); border-radius: 3px; background: var(--paper-raised);
  box-shadow: 0 6px 18px rgba(34, 31, 25, .1); white-space: nowrap; cursor: default;
}
.pres-tools-kind { padding: 0 4px; color: var(--muted); font: 400 9px/1 var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.pres-tool {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px;
  padding: 0; border: 0; border-radius: 2px; background: transparent; color: var(--ink); cursor: pointer;
}
.pres-tool.is-wide { width: auto; padding: 0 8px; font: 400 11px/1 var(--sans); }
.pres-tool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pres-tool:hover { background: var(--blue-soft); color: var(--blue); }
.pres-tool.is-on { color: var(--blue); }
.pres-tool[data-pres-tool="remove"]:hover { background: rgba(181, 59, 47, .12); color: var(--red); }
.pres-tool.is-tight { width: 22px; height: 22px; }
.pres-tool.is-tight svg { width: 13px; height: 13px; stroke-width: 1.4; }
.pres-tools-group { display: inline-flex; gap: 1px; padding: 0 2px; }
.pres-tools-size select {
  height: 22px; padding: 0 2px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper);
  font: 400 11px/1 var(--sans); color: var(--ink);
}
.pres-tools-caption { width: 130px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); font: 400 11px/1.4 var(--sans); }
.pres-tool-color { width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 2px; background: none; cursor: pointer; }

/* Which slide a copy lands on. */
/* A locked block says so, and shows no resize grip. */
.pres-slide.is-editable .pres-frame.is-locked { cursor: default; }
.pres-slide.is-editable .pres-frame.is-locked.is-selected { border-style: dashed; }
.pres-slide.is-editable .pres-frame.is-locked .pres-resize { display: none; }

/* Rendered markdown sizes itself off the slide, overriding the fixed scale in
   core/markdown.css that serves notes and notebook entries. */
.pres-slide .md { font-size: 1em; line-height: 1.45; }
.pres-slide .md > :first-child { margin-top: 0; }
.pres-slide .md h1 { margin: 0 0 .4em; font-size: 1.75em; }
.pres-slide .md h2 { margin: 0 0 .4em; font-size: 1.35em; }
.pres-slide .md h3 { margin: 0 0 .4em; font-size: 1.1em; }
.pres-slide .md p, .pres-slide .md ul, .pres-slide .md ol { margin: 0 0 .6em; }
.pres-slide .md li + li { margin-top: .25em; }
.pres-slide .md code, .pres-slide .md pre { font-size: .85em; }
.pres-text { overflow: hidden; overflow-wrap: anywhere; }
.pres-title-block { margin: 0; overflow: hidden; overflow-wrap: anywhere; font: 400 1.9em/1.15 var(--serif); }
/* Editor-only hint on an empty title/text block — see renderBlock's
   placeholder option. Never reached by renderSlide, so it never shows in
   Present Mode, a thumbnail, an export or a read-only view. */
.pres-block-placeholder { color: var(--muted); opacity: .55; font-style: italic; pointer-events: none; }
/* Blends into the slide instead of sitting in its own boxed card on top of
   it: the frame around a selected block already goes blue while editing
   (.pres-frame.is-selected above), so a border/background here was doubling
   that up and hiding the slide's own background under a paper-colored one. */
.pres-title-input-block, .pres-text-input { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; outline: none; }
/* Same size/weight/family as .pres-title-block's own rendered <h2> below, so
   typing a title already looks like the title it becomes. */
.pres-title-input-block { width: 100%; font: 400 1.9em/1.15 var(--serif); color: var(--ink); }
/* .pres-text .md sets no font-family of its own, so "font: inherit" alone
   already lands on the same one — the family/size override this used to
   carry (var(--sans) at .9em) was a different, smaller look than the slide
   itself renders. */
.pres-text-input { width: 100%; height: 100%; font: inherit; resize: none; }
.pres-figure { display: flex; flex-direction: column; gap: .5em; margin: 0; min-height: 0; height: 100%; }
.pres-figure img { min-height: 0; max-height: 100%; object-fit: contain; }
.pres-figure figcaption { color: var(--muted); font-size: .7em; text-align: center; }
.pres-shape { display: block; width: 100%; height: 100%; }
.pres-mark { display: block; width: 100%; height: 100%; }
.pres-video { display: block; width: 100%; height: 100%; border: 0; background: #000; }
/* An iframe (YouTube/Vimeo) or a <video>'s own controls otherwise eat the
   click before it ever reaches .pres-frame's own pointerdown handler — a
   video block could be looked at but not selected, moved or deleted. Present
   Mode leaves this alone: there, the video is meant to be interacted with. */
.pres-slide.is-editable .pres-frame .pres-video { pointer-events: none; }
.pres-table { width: 100%; height: 100%; border-collapse: collapse; font-size: .85em; }
.pres-table td { padding: .4em .6em; border: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.pres-table td[contenteditable]:focus { outline: 2px solid var(--blue); outline-offset: -2px; }
.pres-latex { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; overflow: auto; }
.pres-latex .katex-display { margin: 0; }
.pres-mermaid { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; overflow: auto; }
.pres-mermaid svg { max-width: 100%; max-height: 100%; }

/* ------------------------------------------------------------- composer */

/* A full screen of Python: the code needs the room, the figure needs to be
   watched while it changes, and the file list stays out of the way until it is
   wanted. */
.pres-composer {
  position: fixed; inset: 0; z-index: 1100; display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--paper);
}
/* Mounted into a tab's own content area (see openComposer's `host` option)
   instead of taking over the screen — same layout, sized like any other
   home-tab panel (--home-workspace-height, set in projects.css). */
.pres-composer.is-inline {
  position: static; inset: auto; z-index: auto;
  height: var(--home-workspace-height, 620px); max-height: var(--home-workspace-height, 620px);
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
}
/* "Fill the screen" (see data-code-fullscreen): the same inline composer,
   temporarily sized like the deck editor's own full takeover instead of
   remounting anything. */
.pres-composer.is-inline.is-full {
  position: fixed; inset: 0; z-index: 1100;
  height: auto; max-height: none; border: 0; border-radius: 0;
}
.pres-composer-bar {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  border-bottom: 1px solid var(--line); background: var(--paper-raised);
}
.pres-composer-title { flex: 1; margin: 0; font: 400 19px/1.1 var(--serif); }
/* Its own margin, not the title's flex:1, holds the right edge — inline mode
   drops the title, and Stop/Run/Done-or-fullscreen still belong together on
   the right regardless of whether Stop (hidden until a run starts) is the
   first child at the time. */
/* Inline mode's row gained three more buttons (save/my snippets/copy for
   ixdat, moved up from the footer) — wrap rather than clip on a narrower tab. */
.pres-composer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 12px; margin-left: auto; }
.pres-composer-bar .button { min-height: 32px; padding: 0 14px; font-size: var(--text-control); }
.pres-composer-bar kbd { margin-left: 6px; opacity: .55; font: inherit; font-size: 10px; }
.pres-code-state { color: var(--muted); font-size: var(--text-meta); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.pres-code-state[data-state="busy"] { color: var(--blue); }
.pres-code-state[data-state="ok"] { color: var(--green); }
.pres-code-state[data-state="bad"] { color: var(--red); }

.pres-composer-body {
  min-height: 0; display: grid;
  --tree-width: 246px; --right-width: 520px; --console-height: 220px;
  grid-template-columns: var(--tree-width) 5px minmax(320px, 1fr) 5px var(--right-width);
}
/* Every panel edge is a rule you can drag; they all behave the same way. */
.pres-splitter { cursor: col-resize; background: var(--line); touch-action: none; }
.pres-splitter.is-horizontal { cursor: row-resize; height: 5px; }
.pres-splitter:hover, .pres-splitter:focus-visible { background: var(--blue); outline: none; }
.pres-code-column { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.pres-code-wrap { position: relative; min-height: 0; overflow: hidden; }

/* The editor's own status line: mode on the left, the two switches a vim user
   wants within reach, and the keys that matter kept in view. */
.pres-code-bar {
  display: flex; align-items: center; gap: 12px; padding: 5px 12px;
  border-top: 1px solid var(--line); background: var(--paper-raised);
  font-size: var(--text-meta); letter-spacing: var(--tracking-label);
}
.pres-mode {
  padding: 2px 8px; border-radius: 2px; background: var(--ink); color: var(--paper);
  font-weight: 500; text-transform: uppercase;
}
.pres-mode[data-mode="insert"] { background: var(--green); }
.pres-mode[data-mode="visual"] { background: #8b5aa6; }
.pres-mode[data-mode="replace"] { background: var(--red); }
.pres-bar-toggle, .pres-bar-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0;
  background: none; color: var(--muted); cursor: pointer;
  font: inherit; font-size: var(--text-meta); letter-spacing: var(--tracking-label); text-transform: uppercase;
}
.pres-bar-toggle:hover, .pres-bar-link:hover { color: var(--ink); }
.pres-bar-dot { width: 7px; height: 7px; border: 1px solid var(--muted); border-radius: 50%; }
.pres-bar-toggle[aria-pressed="true"] { color: var(--blue); }
.pres-bar-toggle[aria-pressed="true"] .pres-bar-dot { border-color: var(--blue); background: var(--blue); }
.pres-bar-link { text-decoration: underline; text-underline-offset: 3px; }
.pres-bar-hint { flex: 1; color: var(--muted); text-align: right; font-family: var(--mono); letter-spacing: 0; text-transform: none; }
.pres-bar-hint.is-loud { color: var(--blue); }
/* CodeMirror draws the editor; these rules give it the app's paper, its type
   scale and the height of the pane it sits in. */
.pres-code-wrap .CodeMirror {
  width: 100%; height: 100%; background: white; color: var(--ink);
  font: 13px/1.7 var(--mono);
}
.pres-code-wrap .CodeMirror-gutters { border-right: 1px solid var(--line); background: white; }
.pres-code-wrap .CodeMirror-linenumber { color: var(--muted); font-size: 11px; }
.pres-code-wrap .CodeMirror-cursor { border-left: 1.5px solid var(--ink); }
.pres-code-wrap .CodeMirror-selected { background: var(--blue-soft); }
.pres-code-wrap .cm-comment { color: var(--muted); font-style: italic; }
.pres-code-wrap .cm-string, .pres-code-wrap .cm-string-2 { color: var(--green); }
.pres-code-wrap .cm-keyword { color: var(--blue); }
.pres-code-wrap .cm-builtin { color: #8b5aa6; }
.pres-code-wrap .cm-number { color: var(--red); }
.pres-code-wrap .cm-def, .pres-code-wrap .cm-variable-2 { color: var(--ink); }
/* Vim's `:` line and its fat block cursor. */
.pres-code-wrap .CodeMirror-dialog { padding: 4px 8px; border-bottom: 1px solid var(--line); background: var(--paper-raised); font-size: 12px; }
.pres-code-wrap .CodeMirror-dialog input { border: 0; background: transparent; color: var(--ink); font: inherit; font-family: var(--mono); }
.pres-code-wrap .cm-fat-cursor .CodeMirror-cursor { background: rgba(24, 79, 209, .45); border: 0; }
.pres-ghost-text { border-radius: 2px; background: var(--blue-soft); color: var(--blue); white-space: pre; }

.pres-composer-right { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) 5px var(--console-height); border-left: 1px solid var(--line); }
.pres-preview { position: relative; min-height: 0; display: grid; background: white; }
/* What the run is doing, laid over the figure rather than beside it: the panel
   keeps one child in flow, so nothing moves when the status appears. `[hidden]`
   is spelled out because .pres-code-preview sets display and would win. */
.pres-phase {
  position: absolute; inset: 0; z-index: 1; display: grid; place-content: center;
  padding: 0 32px; background: white; text-align: center;
}
.pres-preview [hidden] { display: none; }
.pres-phase-text { margin: 0; font: 400 20px/1.25 var(--serif); color: var(--ink); }
.pres-phase[data-state="busy"] .pres-phase-text { color: var(--blue); }
.pres-phase[data-state="bad"] .pres-phase-text { color: var(--red); }
.pres-phase-sub { margin: 6px 0 0; color: var(--muted); font-size: var(--text-body); line-height: 1.5; }
.pres-phase-sub:empty { display: none; }
.pres-figure-meta {
  position: absolute; left: 12px; bottom: 10px; color: var(--muted);
  font-size: var(--text-meta); letter-spacing: var(--tracking-label); text-transform: uppercase;
}
.pres-preview-actions { position: absolute; top: 10px; right: 12px; display: flex; align-items: center; gap: 6px; }
.pres-preview-maximize {
  width: 26px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, .9);
  color: var(--muted); opacity: 0; transition: opacity .12s;
}
.pres-preview:hover .pres-preview-maximize, .pres-preview-maximize:focus-visible,
.pres-preview-maximize[aria-pressed="true"] { opacity: 1; }
.pres-preview-maximize:hover { color: var(--ink); }
.pres-copy-figure {
  padding: 3px 10px; border: 1px solid var(--line);
  border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--muted); cursor: pointer;
  font: inherit; font-size: 11px; opacity: 0; transition: opacity .12s;
}
.pres-preview:hover .pres-copy-figure, .pres-copy-figure:focus-visible { opacity: 1; }
.pres-copy-figure:hover { border-color: var(--ink); color: var(--ink); }

/* "Fill the content area" (see data-code-maximize): the figure column takes
   the whole composer body, tree/code/console tucked away rather than resized
   to nothing — resizing them back out is what the splitters are for. */
.pres-composer.is-figure-max .pres-tree,
.pres-composer.is-figure-max [data-splitter],
.pres-composer.is-figure-max .pres-code-column,
.pres-composer.is-figure-max [data-splitter-right],
.pres-composer.is-figure-max [data-splitter-console],
.pres-composer.is-figure-max .pres-code-console { display: none; }
.pres-composer.is-figure-max .pres-composer-body { grid-template-columns: minmax(0, 1fr); }
.pres-composer.is-figure-max .pres-composer-right { grid-template-rows: minmax(0, 1fr); border-left: 0; }
.pres-code-preview { display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto; background: white; }
.pres-code-preview img { max-width: 100%; max-height: 100%; }
/* min-height: 0 is what makes this scroll: a grid item defaults to min-height
   auto and grows past its track rather than overflowing inside it. */
.pres-code-console { min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: white; }
.pres-code-out, .pres-code-trace {
  margin: 0; padding: 12px 18px; white-space: pre-wrap; word-break: break-word;
  font: 12px/1.6 var(--mono);
}
.pres-code-trace { background: rgba(181, 59, 47, .07); color: var(--red); }
.pres-console-hint { margin: 0; padding: 12px 18px; color: var(--muted); font-size: var(--text-body); }

/* The collections tree. Same shape as the organization tab's drawer — indent
   token, hover wash, tabular counts — kept here rather than borrowed, so that
   stylesheet stays free to change. */
.pres-tree { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); border-right: 1px solid var(--line); background: var(--paper-raised); }
.pres-tree-title { margin: 0; padding: 14px 16px 8px; color: var(--muted); font: 400 var(--text-label)/1 var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.pres-tree-body { overflow-y: auto; padding: 0 8px 14px; }
.pres-tree-section + .pres-tree-section { margin-top: 14px; }
.pres-tree-section-title {
  margin: 0; padding: 6px 6px 4px; color: var(--muted);
  font: 400 var(--text-meta)/1 var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase;
}
.pres-tree-loading { margin: 0; padding: 4px 6px 4px var(--indent, 6px); color: var(--muted); font-size: 10px; }
.pres-tree-drag {
  position: fixed; top: -1000px; left: -1000px; padding: 4px 8px; border-radius: 3px;
  background: var(--ink); color: white; font: 11px var(--mono);
}
.pres-tree-row { display: flex; align-items: center; gap: 4px; padding-left: var(--indent); border-radius: 2px; }
.pres-tree-row:hover { background: rgba(23, 23, 19, .05); }
.pres-tree-row.is-armed { background: var(--blue-soft); }
/* A file with no parsed data is shown, so it can be found, and marked, so it is
   not mistaken for something plottable. */
.pres-tree-row.is-dim .pres-tree-label { color: var(--muted); font-style: italic; }
.pres-tree-row.is-armed .pres-tree-label { color: var(--blue); }
.pres-tree-caret:disabled { opacity: .35; cursor: default; }
.pres-tree-caret {
  width: 16px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 9px;
}
.pres-tree-label {
  flex: 1; min-width: 0; padding: 5px 4px; border: 0; overflow: hidden; background: transparent;
  color: inherit; cursor: pointer; text-align: left; text-overflow: ellipsis; white-space: nowrap; font-size: 11px;
}
.pres-tree-label:hover { color: var(--blue); }
.pres-tree-count { padding-right: 6px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }


/* ------------------------------------------------------------- templates */

/* A shelf, not a gallery: names and purposes read down the page, and a step
   opens where it sits. */
/* A fixed box: the shelf scrolls inside it, so opening a template does not
   resize the panel under the pointer. */
.pres-templates { width: min(680px, 94vw); height: min(660px, 86vh); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.pres-templates-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line); background: var(--paper-raised);
}
.pres-templates-title { margin: 0; font: 400 21px/1.1 var(--serif); }
.pres-templates-sub { margin: 4px 0 0; color: var(--muted); font-size: var(--text-body); }
.pres-templates-body { flex: 1; min-height: 0; overflow-y: auto; }

.pres-template { border-bottom: 1px solid var(--line); }
.pres-template-head { display: flex; flex-direction: column; gap: 2px; padding: 12px 20px; cursor: pointer; list-style: none; user-select: none; }
.pres-template-head::-webkit-details-marker { display: none; }
.pres-template-head:hover { background: rgba(23, 23, 19, .04); }
.pres-template[open] .pres-template-head { background: rgba(23, 23, 19, .04); }
.pres-template-name { font: 400 15px/1.2 var(--serif); }
.pres-template-purpose { color: var(--muted); font-size: var(--text-body); }
.pres-template-body { padding: 4px 20px 16px; }

.pres-step + .pres-step { margin-top: 14px; }
.pres-step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.pres-step-label { margin: 0; color: var(--muted); font: 400 var(--text-label)/1 var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.pres-step-actions { display: flex; gap: 6px; }
.pres-step-action {
  padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  color: var(--muted); cursor: pointer; font: inherit; font-size: 11px;
}
.pres-step-action:hover { border-color: var(--ink); color: var(--ink); }
.pres-step-action.is-primary { border-color: var(--blue); color: var(--blue); }
.pres-step-action.is-primary:hover { background: var(--blue-soft); }
.pres-step-code {
  margin: 0; padding: 10px 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 3px;
  background: white; font: 12px/1.6 var(--mono);
}
.pres-template-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------- keys and settings */

/* Two columns, because the question people arrive with is "which of my config
   works here" — so the answer sits beside the box rather than under it. */
.pres-keys { width: min(940px, 95vw); max-height: 88vh; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.pres-keys-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line); background: var(--paper-raised);
}
.pres-keys-title { margin: 0; font: 400 21px/1.1 var(--serif); }
.pres-keys-sub { margin: 4px 0 0; color: var(--muted); font-size: var(--text-body); }

.pres-keys-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 268px; }
.pres-keys-editor { display: flex; flex-direction: column; min-height: 0; gap: 8px; padding: 16px 20px 18px; }
.pres-keys-label { margin: 0; color: var(--muted); font: 400 var(--text-label)/1 var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.pres-keys-input {
  flex: 1; min-height: 260px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--paper); color: var(--ink);
  font: 12.5px/1.7 var(--mono); resize: none; white-space: pre; tab-size: 2;
}
.pres-keys-input:focus { border-color: var(--blue); outline: none; box-shadow: inset 2px 0 0 var(--blue); }
.pres-keys-problems {
  padding: 10px 12px; border-left: 2px solid var(--red); border-radius: 0 3px 3px 0;
  background: rgba(181, 59, 47, .07); color: var(--red);
  font: 11.5px/1.6 var(--mono);
}
.pres-keys-problems p { margin: 0 0 3px; }
.pres-keys-problems p:last-child { margin-bottom: 0; }

/* The ledger: every directive that lands, and one line naming what cannot. */
.pres-keys-ref { min-height: 0; overflow-y: auto; padding: 16px 20px 18px; border-left: 1px solid var(--line); background: var(--paper-raised); }
.pres-keys-group + .pres-keys-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pres-keys-note { margin: 5px 0 0; color: var(--muted); font-size: var(--text-body); line-height: 1.5; }
.pres-keys-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; }
.pres-keys-chips code {
  padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  color: var(--ink); font: 11px/1.6 var(--mono);
}
.pres-keys-group.is-out .pres-keys-label { color: var(--red); }

.pres-keys-foot {
  display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  border-top: 1px solid var(--line); background: var(--paper-raised);
}
.pres-keys-restore {
  padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer;
  font: inherit; font-size: var(--text-body); text-decoration: underline; text-underline-offset: 3px;
}
.pres-keys-restore:hover { color: var(--ink); }
.pres-keys-status { flex: 1; color: var(--muted); font-size: var(--text-body); }

/* --------------------------------------------------------------- present */

/* One slide, as large as the screen allows, on its own ground. Zoomed, the
   slide is positioned and sized in plain pixels rather than by a transform —
   the same numbers the pointer-anchored zoom and the locator both read. */
.pres-present { position: fixed; inset: 0; z-index: 1100; background: #111; }
body.is-presenting { overflow: hidden; }
.pres-present:focus { outline: none; }
.pres-viewport { position: absolute; inset: 0; overflow: hidden; }
.pres-screen { position: absolute; }
.pres-present .pres-slide { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; aspect-ratio: 16 / 9; }
/* The middle button down: the slide is being moved, not clicked past. */
.pres-present.is-dragging-view, .pres-present.is-dragging-view * { cursor: grabbing; }
.pres-present-bar {
  position: absolute; right: 16px; bottom: 14px; z-index: 2; display: flex; align-items: center; gap: 10px;
  opacity: .25; transition: opacity .15s;
}
.pres-present-bar:hover, .pres-present:focus-within .pres-present-bar { opacity: 1; }
.pres-present-count { color: white; font-size: var(--text-body); font-variant-numeric: tabular-nums; }
.pres-present-button {
  min-height: var(--tap); padding: 0 12px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
  background: rgba(0, 0, 0, .35); color: white; cursor: pointer; font: inherit; font-size: var(--text-control);
}
.pres-present-button:hover { background: rgba(255, 255, 255, .15); }
.pres-present-button.is-on { border-color: #e5484d; background: rgba(229, 72, 77, .35); }
.pres-present-zoom { display: inline-flex; align-items: center; gap: 4px; }
.pres-present-zoom-level { min-width: 48px; font-variant-numeric: tabular-nums; }
/* Held over the slide while lasering — real cursor hidden underneath it, the
   same trade a clicker's own laser makes. Positioned in plain pixels by
   pointermove above, same coordinate space applyBox() already uses. */
.pres-present.is-lasering .pres-viewport { cursor: none; }
.pres-laser-dot {
  position: absolute; z-index: 3; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; background: radial-gradient(circle, #ff4d4d 0%, rgba(255, 77, 77, .55) 55%, transparent 75%);
  box-shadow: 0 0 12px 3px rgba(255, 60, 60, .65); pointer-events: none;
}

/* The locator: where you are, once the slide no longer fits the window.
   Click or drag it to move the window instead. */
.pres-present-locator {
  position: absolute; right: 16px; bottom: 58px; z-index: 2; width: 168px; aspect-ratio: 16 / 9;
  overflow: hidden; border: 1px solid rgba(255, 255, 255, .35); border-radius: 2px; background: #1a1a1a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4); cursor: pointer; opacity: .25; transition: opacity .15s;
}
.pres-present-locator:hover, .pres-present:focus-within .pres-present-locator { opacity: 1; }
.pres-present-locator[hidden] { display: none; }
.pres-present-locator-page { position: absolute; inset: 0; pointer-events: none; }
.pres-present-locator-page .pres-slide {
  position: absolute; top: 0; left: 0; width: 1280px; height: 720px; transform-origin: top left;
  border: 0; border-radius: 0; box-shadow: none; aspect-ratio: auto;
}
.pres-present-locator-window {
  position: absolute; border: 1.5px solid #4ea1ff; background: rgba(78, 161, 255, .18); pointer-events: none;
}

/* ------------------------------------------------------------------- pdf */

/* Where slides are laid out to be photographed: off to the side, at the exact
   size of a page, and free of the crop the on-screen slide keeps. */
.pres-pdf-stage { position: fixed; left: -20000px; top: 0; width: 1280px; height: 720px; }
.pres-pdf-stage .pres-slide {
  width: 1280px; height: 720px; border: 0; border-radius: 0; box-shadow: none;
  aspect-ratio: auto; background: white;
}
/* A line that runs a shade long shows rather than disappears: fonts substitute
   between screens and the metrics move with them. */
.pres-pdf-stage .pres-text, .pres-pdf-stage .pres-title-block { overflow: visible; }

/* ------------------------------------------------------------ narrow view */

/* --------------------------------------------------------------- snippets */

/* A shelf, like templates, but the shelf is filled by whoever opens it: a
   save row above the list, and only that person's own rows can be edited or
   removed. A preview pane sits beside the list, because the two things that
   tell a snippet apart — what it draws, what it says — are both worth
   seeing before picking one. */
.pres-snippets { width: min(1040px, 96vw); height: min(720px, 88vh); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.pres-snippets-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line); background: var(--paper-raised);
}
.pres-snippets-title { margin: 0; font: 400 21px/1.1 var(--serif); }
.pres-snippets-sub { margin: 4px 0 0; color: var(--muted); font-size: var(--text-body); }

.pres-snippets-save { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.pres-snippets-name {
  flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 3px;
  background: white; font: inherit; font-size: var(--text-body);
}
.pres-snippets-name:focus { border-color: var(--blue); outline: none; }

.pres-snippets-toolbar { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.pres-snippets-toolbar input { width: 100%; }

.pres-snippets-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pres-snippets-list-pane { min-height: 0; overflow-y: auto; border-right: 1px solid var(--line); }
.pres-snippets-preview { min-height: 0; overflow-y: auto; padding: 18px 20px; background: var(--paper-raised); }
.pres-snippets-hint { margin: 0; padding: 20px; color: var(--muted); font-size: var(--text-body); }
.pres-snippets-preview .pres-snippets-hint { padding: 0; }
.pres-snippets-preview-title { margin: 0 0 2px; font: 400 17px/1.2 var(--serif); }
.pres-snippets-preview-meta { margin: 0 0 12px; color: var(--muted); font-size: var(--text-meta); }
.pres-snippets-preview-figure {
  display: block; max-width: 100%; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 3px;
  background: white;
}
.pres-snippets-preview-code { max-height: none; }

.pres-snippets-list { list-style: none; margin: 0; padding: 0; }
.pres-snippet {
  display: flex; flex-direction: column; gap: 8px; padding: 11px 20px; border-bottom: 1px solid var(--line);
}
.pres-snippet.is-selected { background: var(--blue-soft); }
.pres-snippet-main {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; border: 0; background: none; padding: 0;
  cursor: pointer; text-align: left; font: inherit;
}
.pres-snippet-name { font: 400 15px/1.2 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.pres-snippet-meta { color: var(--muted); font-size: var(--text-body); }
.pres-snippet-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pres-step-action.is-danger { border-color: var(--red); color: var(--red); }
.pres-step-action.is-danger:hover { background: rgba(157, 50, 39, .08); }

@media (max-width: 760px) {
  .pres-snippets-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .pres-snippets-list-pane { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .pres-composer-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); }
  .pres-tree { grid-template-rows: auto; max-height: 26vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .pres-composer-right { border-left: 0; border-top: 1px solid var(--line); }
  .pres-splitter { display: none; }
  .pres-code-wrap { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 700px) {
  .pres-keys-body { grid-template-columns: minmax(0, 1fr); }
  .pres-keys-ref { border-left: 0; border-top: 1px solid var(--line); }
  .pres-title-input { font-size: 18px; }
  .pres-rail-remove { opacity: 1; }
}
