/* Slide-editor chrome. Dormant until body.editing. */

/* --ed-barh is the toolbar's measured height; everything below keys off it
   so nothing overlaps the slide — the stage shrinks instead. The bar keeps
   ONE row: what does not fit moves into More ▾ (fitBar), so the height no
   longer changes with the window and the stage under it stays put. */
:root { --ed-barh: 36px; }
/* above the inspector (410): More ▾ opens inside the bar, and the bar's own
   stacking put it under the inspector (Fredo, 2026-10-20) */
#ed-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 415;
  display: none; align-items: center; flex-wrap: nowrap; overflow: hidden;
  gap: 6px; padding: 6px 10px;
  background: #1d1f24; color: #dfe2ea;
  font: 13px/1.4 system-ui, -apple-system, sans-serif;
  box-shadow: 0 1px 6px #0008; }
body.editing #ed-bar { display: flex; }
#ed-bar button { font: inherit; color: #dfe2ea; background: #33363e;
  border: 0; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
#ed-bar button:hover { background: #454955; }
#ed-bar button.ed-primary { background: #3d6adf; color: #fff; }
#ed-bar .ed-sep { width: 1px; height: 18px; background: #454955;
  margin: 0 3px; }
/* The bar is three jobs, not one list: what acts on the DECK's slides,
   what acts INSIDE the current slide, and between them the ones that do
   either — a demo or a video can land here or on a slide of its own. */
/* the grouping is carried by the gaps and the panels alone: labels on
   every group made the bar read as a form */
/* nowrap and no shrinking: a group that wraps inside itself puts the bar on
   three rows however little the bar itself wraps, and it also hides the
   overflow from scrollWidth, so fitBar could not tell the row was too long. */
#ed-bar .ed-group { display: inline-flex; align-items: center; gap: 5px;
  flex: 0 0 auto; flex-wrap: nowrap; white-space: nowrap;
  padding: 3px 7px; border-radius: 9px; background: #262930;
  margin-right: 5px; }
#ed-bar .ed-group-mid { background: #2b3442; }
#ed-bar .ed-group-end { background: transparent; margin-left: auto;
  padding-right: 0; }
#ed-bar .ed-glabel { color: #78808f; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; margin-right: 3px; }
/* A <select> is as wide as its widest option, so "one before every
   section" and a dated version list were setting the width of the bar.
   Give each one the width of its own label — the popup shows the full
   text anyway — and drop the native chrome, since the label carries its
   own caret. */
#ed-bar select { font: inherit; color: #dfe2ea; background: #33363e;
  border: 0; border-radius: 6px; padding: 4px 8px; cursor: pointer;
  -webkit-appearance: none; appearance: none; }
#ed-bar select:hover { background: #454955; }
#ed-bar select[data-a="plansel"] { width: 68px; }
#ed-bar select[data-a="shapesel"] { width: 44px; text-overflow: clip; }
#ed-bar #ed-more-menu select[data-a="shapesel"] { width: 100%; }
/* two rows when one is not enough (fitBar adds .ed-two) */
#ed-bar.ed-two { flex-wrap: wrap; row-gap: 5px; overflow: visible; }
/* icon buttons: the name shows in More, the icon on the row */
#ed-bar button.ed-ic { padding: 4px 7px; display: inline-flex; align-items: center; gap: 6px; }
#ed-bar button.ed-ic .ed-svg { display: block; }
#ed-bar .ed-lbl { display: none; }
#ed-bar #ed-more-menu .ed-lbl { display: inline; }
#ed-bar select[data-a="versionsel"] { width: 92px; }
#ed-bar select[data-a="exportsel"] { width: 82px; }
#ed-status { min-width: 0; }
#ed-build { font-size: 10px; color: #5c6373; }
#ed-bar .ed-sp { flex: 1; }
/* A FIXED width. The status sat in the bar's flow and took the width of
   whatever it said, so "saved" and "slide removed · ⌘Z undoes" put the
   bar on one row and then two, and every change resized the stage under
   it (Fredo, 2026-09-15: "keeps flicking between one and two rows").
   A longer message is cut with an ellipsis; the whole of it is its title. */
#ed-status { color: #8a93a6; text-align: right; flex: 0 0 170px; width: 170px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#ed-hint { color: #8a93a6; }

/* what did not fit on the row. The menu is FIXED, so the bar's overflow
   does not clip it, and it lives inside #ed-bar, so the bar's own click
   delegation and every listener on the moved controls keep working. */
#ed-more-wrap { display: inline-flex; align-items: center; }
#ed-more-wrap[hidden] { display: none; }
#ed-more-menu { display: none; position: fixed; z-index: 420;
  top: calc(var(--ed-barh, 36px) + 4px); right: 10px;
  flex-direction: column; align-items: stretch; gap: 5px; padding: 8px;
  border-radius: 10px; background: #262930;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); }
#ed-more-menu.open { display: flex; }
#ed-bar #ed-more-menu button, #ed-bar #ed-more-menu select {
  width: 100%; text-align: left; }

body.editing .reveal { top: var(--ed-barh);
  left: var(--ed-navw, 0px);
  width: calc(100% - var(--ed-navw, 0px) - var(--ed-inspw, 0px));
  height: calc(100% - var(--ed-barh)); }

/* The inspector: what acts on the SELECTION lives here, the way Keynote
   has it, so the top bar can be about the deck. The text and shape bars
   are sections of it rather than floating panels. */
#ed-insp { position: fixed; right: 0; top: var(--ed-barh); bottom: 0;
  width: 208px; z-index: 410; display: none; flex-direction: column;
  background: #1d1f24; border-left: 1px solid #33363e; color: #dfe2ea;
  font: 12px/1.4 system-ui, -apple-system, sans-serif; }
body.editing #ed-insp { display: flex; }
#ed-insp.closed { width: 16px; }
#ed-insp.closed .ed-insp-body, #ed-insp.closed .ed-insp-empty,
#ed-insp.closed .ed-insp-head { font-size: 0; padding: 0; }
#ed-insp.closed .ed-insp-body, #ed-insp.closed .ed-insp-empty {
  display: none; }
.ed-insp-head { display: flex; align-items: center; justify-content: space-between;
  padding: 5px 4px 5px 10px; background: #23252b; color: #8a93a6;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; }
#ed-insp-toggle { width: 16px; height: 20px; padding: 0; border: 0;
  background: #2b2e36; color: #8a93a6; cursor: pointer; font-size: 12px; }
#ed-insp-toggle:hover { color: #fff; }
.ed-insp-body { flex: 1; overflow-y: auto; }
#ed-insp.nothing .ed-insp-body { display: none; }
.ed-insp-empty { display: none; padding: 14px 12px; color: #6c7382; }
#ed-insp.nothing .ed-insp-empty { display: block; }
.ed-insp-sec { padding: 8px 10px; border-bottom: 1px solid #2a2d34; }
.ed-insp-title { color: #78808f; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.ed-insp-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
.ed-insp-row button { font: inherit; color: #dfe2ea; background: #33363e;
  border: 0; border-radius: 6px; padding: 4px 9px; cursor: pointer; }
.ed-insp-row button:hover { background: #454955; }
.ed-insp-row button:disabled { opacity: 0.4; cursor: default; }
/* crop is a MODE, so its button stays lit while you are in it */
.ed-insp-row button.on { background: #d97706; color: #fff; }

/* the two property bars, now sections rather than floating panels */
#ed-insp #ed-stylebar, #ed-insp #ed-shapebar {
  position: static; top: auto; left: auto; flex-wrap: wrap;
  border-radius: 0; box-shadow: none; background: transparent;
  padding: 8px 10px; border-bottom: 1px solid #2a2d34; }
#ed-insp #ed-stylebar select { max-width: 100%; }
#ed-insp #ed-shapebar label { gap: 4px; }

/* The slide list down the left, Keynote style: where you are in the
   deck, always in view. The sorter stays the separate whole-window mode
   for reordering in bulk. */
#ed-nav { position: fixed; left: 0; top: var(--ed-barh); bottom: 0;
  width: 158px; z-index: 410; display: none; background: #1d1f24;
  border-right: 1px solid #33363e;
  font: 12px/1.3 system-ui, -apple-system, sans-serif; color: #dfe2ea; }
body.editing #ed-nav { display: block; }
#ed-nav.closed { width: 16px; }
#ed-nav.closed #ed-nav-list { display: none; }
#ed-nav-toggle { position: absolute; right: 0; top: 0; z-index: 2;
  width: 16px; height: 20px; padding: 0; border: 0; cursor: pointer;
  background: #2b2e36; color: #8a93a6; font: 12px/1 system-ui, sans-serif; }
#ed-nav-toggle:hover { color: #fff; }
#ed-nav-list { position: absolute; inset: 20px 0 0 0; overflow-y: auto;
  padding: 4px 4px 40px; }
.ed-navitem { position: relative; display: flex; align-items: flex-start;
  gap: 3px; padding: 3px; border-radius: 5px; cursor: pointer;
  border: 1.5px solid transparent; }
.ed-navitem:hover { background: #262930; }
.ed-navitem.sel { border-color: #3d6adf; background: #3d6adf22; }
/* cut with ⌘X, waiting for ⌘V to move them */
.ed-navitem.cut, .ed-tile.cut { opacity: 0.4; border-style: dashed; }
.ed-navitem.cur .ed-thumbbox { outline: 2px solid #3d6adf; }
.ed-navitem.skipped .ed-thumbbox { opacity: 0.35; }
.ed-navnum { width: 16px; text-align: right; color: #78808f;
  font-size: 10px; padding-top: 2px; flex: 0 0 auto; }
.ed-navcaret { position: absolute; left: 6px; right: 6px; height: 2px;
  background: #3d6adf; pointer-events: none; }

/* text style bar: floats under the main bar when a text box is selected */
#ed-stylebar { position: fixed; top: calc(var(--ed-barh) + 6px);
  left: 10px; z-index: 405;
  display: none; align-items: center; gap: 5px; padding: 5px 8px;
  background: #23252b; color: #dfe2ea; border-radius: 8px;
  box-shadow: 0 4px 16px #0008;
  font: 13px/1.4 system-ui, -apple-system, sans-serif; }
#ed-stylebar select, #ed-stylebar input[type="number"] {
  font: inherit; color: #fff; background: #16171b;
  border: 1px solid #454955; border-radius: 6px; padding: 3px 6px; }
#ed-stylebar input[type="number"] { width: 52px; text-align: center; }
/* the native spinner is invisible on a dark bar — clicking where it
   would be changed the size with nothing to show for it */
#ed-stylebar input[type="number"]::-webkit-inner-spin-button,
#ed-stylebar input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0; }
#ed-stylebar .ed-sizeset { display: inline-flex; align-items: stretch;
  gap: 2px; }
#ed-stylebar .ed-sizeset button { min-width: 22px; padding: 0 6px;
  font-weight: 700; }
#ed-stylebar button { font: inherit; color: #dfe2ea; background: #33363e;
  border: 0; border-radius: 6px; padding: 3px 9px; cursor: pointer; }
#ed-stylebar button:hover { background: #454955; }
#ed-stylebar input[type="color"] { width: 30px; height: 26px; padding: 0;
  border: 1px solid #454955; border-radius: 6px; background: #16171b; }

/* selection + handles */
.ed-selected { outline: 1.5px solid #3d6adf !important; }
/* Cmd-A: every element on the slide. No resize handles on a set — they
   belong to one box — so the outline is the whole feedback. */
.ed-multi { outline: 1.5px dashed #3d6adf !important;
            background: rgba(61, 106, 223, 0.06); }
.ed-handle { position: absolute; width: 9px; height: 9px; z-index: 300;
  background: #fff; border: 1.5px solid #3d6adf; border-radius: 2px; }
.ed-handle.nw { cursor: nwse-resize; } .ed-handle.se { cursor: nwse-resize; }
.ed-handle.ne { cursor: nesw-resize; } .ed-handle.sw { cursor: nesw-resize; }
.ed-handle.n { cursor: ns-resize; }   .ed-handle.s { cursor: ns-resize; }
.ed-handle.w { cursor: ew-resize; }   .ed-handle.e { cursor: ew-resize; }
body.ed-cropping .ed-handle { border-color: #d97706; background: #fff7e6;
  border-radius: 50%; }
body.ed-cropping .ed-selected { outline-color: #d97706 !important; }

/* Where the slide ends. A white slide on a white page gives no edge at
   all, so a box dragged past it just fades out of the show with nothing
   to say why. Editing only: the shadow and the surround would be wrong
   in front of an audience. */
body.editing .reveal { background: #e7e9ee; }
body.editing .kslide {
  outline: 1px solid rgba(61, 106, 223, 0.5);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.13); }

/* while editing, embedded content must not eat the mouse */
body.editing .kslide iframe, body.editing .kslide video {
  pointer-events: none; }
/* one box in use: its own controls take the mouse (editor.js startLive) */
body.editing .kslide .shp.ed-live iframe, body.editing .kslide .shp.ed-live video {
  pointer-events: auto; }
body.editing .kslide .shp.ed-live { cursor: auto;
  outline: 3px solid #2a9d4b !important; outline-offset: 2px; }
#ed-inspector button.on, .ed-insp-row button.on { background: #2a9d4b; color: #fff; }
body.editing .kslide .shp { cursor: move; }
body.editing .kslide .tf[contenteditable="true"] { cursor: text;
  outline: 1px dashed #3d6adf55; }

.ed-added-iframe iframe, .ed-added-iframe video { width: 100%; height: 100%;
  border: 0; display: block; }

/* Course-notes links, INSIDE the slide: a strip along the foot of the
   stage, so it scales with the slide and travels into the PDF and the
   exported deck instead of being browser chrome. Placed in the lowest
   band the slide's own content leaves free; `over` is the last resort,
   where it carries a backing so it stays legible on top of something. */
.kslide .ed-notesbox { display: flex; gap: 1.1em; align-items: baseline;
  flex-wrap: wrap; z-index: 3; pointer-events: auto;
  font-family: system-ui, -apple-system, sans-serif; line-height: 1.3; }
.kslide .ed-notesbox.over { background: rgba(255, 255, 255, 0.82);
  border-radius: 4px; padding: 2px 6px; }
.kslide .ed-notesbox .ed-notes-label { color: #9a9aa4; font-weight: 600;
  text-transform: uppercase; font-size: 0.72em; letter-spacing: 0.06em; }
.kslide .ed-notesbox .ed-notes-item { display: inline-flex; gap: 0.4em;
  align-items: baseline; min-width: 0; }
.kslide .ed-notesbox .ed-notes-title { color: #6a6a74; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 22em; }
.kslide .ed-notesbox a { color: #fff; background: #8a7ab0;
  text-decoration: none; white-space: nowrap; font-size: 0.78em;
  font-weight: 600; padding: 0.1em 0.5em; border-radius: 0.7em; }
.kslide .ed-notesbox a:nth-of-type(2) { background: #7a2018; }
.kslide .ed-notesbox a:hover { filter: brightness(1.15); }
body.editing .kslide .ed-notesbox { opacity: 0.55; }
/* the PDF export captures the slide alone — and these are part of it now */

/* presenter fullscreen button (view mode) */
#ed-fsview { position: fixed; left: 14px; bottom: 14px; z-index: 200;
  font: 18px/1 system-ui, sans-serif; color: #444; background: #ffffffcc;
  border: 1px solid #0002; border-radius: 8px; width: 34px; height: 34px;
  cursor: pointer; opacity: 0.35; transition: opacity 0.15s; }
#ed-fsview:hover { opacity: 1; }
body.editing #ed-fsview { display: none; }

/* local-only edit button, above the fullscreen one */
#ed-editview { position: fixed; left: 14px; bottom: 54px; z-index: 200;
  font: 16px/1 system-ui, sans-serif; color: #444; background: #ffffffcc;
  border: 1px solid #0002; border-radius: 8px; width: 34px; height: 34px;
  cursor: pointer; opacity: 0.35; transition: opacity 0.15s; }
#ed-editview:hover { opacity: 1; }
body.editing #ed-editview, body.replaying #ed-editview,
body.pdfshot #ed-editview { display: none; }
:fullscreen #ed-fsview, :-webkit-full-screen #ed-fsview { opacity: 0.15; }

/* snap guides while dragging */
.kslide .ed-guide { position: absolute; background: #e0409088;
  z-index: 290; pointer-events: none; }

/* slide sorter */
#ed-sorter { position: fixed; inset: var(--ed-barh) 0 0 0; z-index: 415;
  display: none; flex-direction: column; background: #17181c;
  font: 13px/1.4 system-ui, -apple-system, sans-serif; color: #dfe2ea; }
#ed-sorter.open { display: flex; }
#ed-sorter-bar { display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; background: #1d1f24; }
#ed-sorter-bar button { font: inherit; color: #dfe2ea; background: #33363e;
  border: 0; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
#ed-sorter-bar button:hover { background: #454955; }
#ed-sorter-bar .ed-sp { flex: 1; }
.ed-sorter-hint { color: #8a93a6; }
#ed-sorter-grid { flex: 1; overflow-y: auto; position: relative;
  display: flex; flex-wrap: wrap; gap: 12px; padding: 14px;
  align-content: flex-start; }
.ed-tile { width: 180px; cursor: pointer; border-radius: 6px;
  user-select: none; -webkit-user-select: none;
  padding: 2px; border: 2px solid transparent; }
.ed-tile.sel { border-color: #3d6adf; background: #3d6adf22; }
.ed-tile.skipped .ed-thumbbox { opacity: 0.35; }
.ed-tile.skipped .ed-tile-num { color: #d0a020; }
.ed-thumbbox { position: relative; width: 176px; overflow: hidden;
  background: #fff; border-radius: 4px; }
.ed-thumb-ph { background: #9aa4b8; opacity: 0.6; }
.ed-tile-num { text-align: center; color: #8a93a6; font-size: 11px;
  padding-top: 3px; }
.ed-caret { position: absolute; width: 3px; background: #3d6adf;
  border-radius: 2px; pointer-events: none; }

/* shape style bar (sits beside the text one) */
#ed-shapebar { position: fixed; top: calc(var(--ed-barh) + 6px);
  left: 10px; z-index: 405;
  display: none; align-items: center; gap: 10px; padding: 5px 9px;
  background: #23252b; color: #dfe2ea; border-radius: 8px;
  box-shadow: 0 4px 16px #0008;
  font: 13px/1.4 system-ui, -apple-system, sans-serif; }
#ed-shapebar label { display: flex; gap: 4px; align-items: center; }
#ed-shapebar span { display: flex; gap: 8px; align-items: center; }
#ed-shapebar input[type="color"] { width: 28px; height: 24px; padding: 0;
  border: 1px solid #454955; border-radius: 5px; background: #16171b; }
#ed-shapebar input[type="number"] { width: 52px; font: inherit;
  color: #fff; background: #16171b; border: 1px solid #454955;
  border-radius: 5px; padding: 2px 4px; }
#ed-shapebar input[type="range"] { width: 80px; accent-color: #3d6adf; }
#ed-shapebar button { font: inherit; color: #dfe2ea; background: #33363e;
  border: 0; border-radius: 6px; padding: 3px 8px; cursor: pointer; }
#ed-shapebar button:hover { background: #454955; }
/* a shape whose fill is none must still be grabbable by its box */
.kslide .shp > svg { pointer-events: none; }

/* big-lesson embed */
.ed-lesson-box { width: 100%; height: 100%; overflow: hidden;
  padding: 14px 20px; box-sizing: border-box;
  border-left: 5px solid #b8860b; background: #fffdf4;
  font: 22px/1.45 Georgia, serif; color: #222; }
.ed-lesson-head { font-weight: 700; margin-bottom: 0.5em;
  font-size: 1.15em; }
.ed-lesson-id { color: #b8860b; font: 700 0.8em system-ui, sans-serif;
  margin-right: 0.4em; }
.ed-lesson-body p { margin: 0.4em 0; }

/* lesson search panel (reuses the demo panel look) */
#ed-lessonpanel { position: fixed; top: calc(var(--ed-barh) + 8px);
  right: 12px; width: 380px;
  max-height: 70vh; z-index: 410; display: none; flex-direction: column;
  background: #23252b; color: #dfe2ea; border-radius: 10px;
  box-shadow: 0 8px 30px #000a;
  font: 13px/1.4 system-ui, -apple-system, sans-serif; }
#ed-lessonpanel.open { display: flex; }
#ed-lessonpanel input { margin: 10px; padding: 7px 10px; font: inherit;
  color: #fff; background: #16171b; border: 1px solid #454955;
  border-radius: 7px; outline: none; }
#ed-lessonpanel .ed-search-results { overflow-y: auto; padding: 0 6px 8px; }

/* demo search panel */
#ed-demo { position: fixed; top: calc(var(--ed-barh) + 8px);
  right: 12px; width: 380px;
  max-height: 70vh; z-index: 410; display: none; flex-direction: column;
  background: #23252b; color: #dfe2ea; border-radius: 10px;
  box-shadow: 0 8px 30px #000a;
  font: 13px/1.4 system-ui, -apple-system, sans-serif; }
#ed-demo.open { display: flex; }
#ed-demo input { margin: 10px; padding: 7px 10px; font: inherit;
  color: #fff; background: #16171b; border: 1px solid #454955;
  border-radius: 7px; outline: none; }
#ed-demo-results { overflow-y: auto; padding: 0 6px 8px; }
#ed-demo { width: 430px; }
#ed-demo .ed-kindrow { display: flex; flex-wrap: wrap; gap: 4px;
  padding: 0 12px 8px; }
.ed-kindchip { font: 11px/1.4 system-ui, sans-serif; color: #aab2c4;
  background: #2c2f36; border: 1px solid #3a3d45; border-radius: 11px;
  padding: 2px 9px; cursor: pointer; }
.ed-kindchip:hover { background: #383b44; }
.ed-kindchip.on { background: #3d6adf; border-color: #3d6adf;
  color: #fff; }
.ed-kindbadge { width: 72px; height: 48px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px; background: #2c2f36; color: #aab2c4;
  font: 600 18px/1 ui-monospace, Menlo, monospace; }
.ed-kindbadge.k-equation { color: #8ec7ff; }
.ed-kindbadge.k-algorithm { color: #9ae6b4; font-size: 15px; }
.ed-kindbadge.k-lesson { color: #e8c35a; }
#ed-demo .ed-demo-item img { object-fit: contain; background: #fff; }
#ed-demo .ed-opts { display: flex; gap: 14px; padding: 0 12px 8px;
  color: #aab2c4; }

/* + YouTube asks for the URL and where to put it in one small dialog:
   a prompt() cannot carry a checkbox. */
#ed-ytdlg { position: fixed; z-index: 60; display: none;
  top: calc(var(--ed-barh, 36px) + 12px); left: 12px; width: 340px;
  padding: 12px; border-radius: 10px; background: #24262c;
  color: #dfe3ea; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font: 13px/1.4 system-ui, -apple-system, sans-serif; }
#ed-ytdlg.open { display: block; }
#ed-ytdlg h4 { margin: 0 0 8px; font-size: 13px; color: #aab2c4; }
#ed-ytdlg input[type="text"] { width: 100%; box-sizing: border-box;
  padding: 6px 8px; border: 1px solid #3b3f49; border-radius: 6px;
  background: #191b20; color: #e8ebf1; font: inherit; }
#ed-ytdlg label { display: flex; align-items: center; gap: 6px;
  margin: 9px 0 11px; cursor: pointer; color: #aab2c4; }
#ed-ytdlg .ed-yt-row { display: flex; gap: 8px; justify-content: flex-end; }
#ed-ytdlg button { padding: 5px 12px; border: 1px solid #3b3f49;
  border-radius: 7px; background: #2c2f37; color: #dfe3ea;
  font: inherit; cursor: pointer; }
#ed-ytdlg button.ed-primary { background: #3d6adf; border-color: #3d6adf;
  color: #fff; font-weight: 600; }

/* A new slide's "Title" / "text" prompts are for the author. Outside edit
   mode (presenting, the presenter view, the site, the PDF) they are not
   drawn; typing into one makes it content (Fredo, 2026-09-15). */
/* Author-only: a placeholder today, anything the author sees and the room
   does not tomorrow. Hidden outside editing (the presenter window and the
   site are never in editing) and in print. */
body:not(.editing) .kslide .ed-ph,
body:not(.editing) .kslide .ed-author { visibility: hidden; }
@media print {
  .kslide .ed-ph, .kslide .ed-author { visibility: hidden !important; }
}

/* the editor's own dialog, in place of alert/confirm/prompt */
#ed-dlg { position: fixed; inset: 0; z-index: 2147483000; display: flex;
  align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.32);
  font: 13px/1.45 system-ui, -apple-system, sans-serif; }
#ed-dlg .ed-dlg-box { min-width: 280px; max-width: min(480px, 92vw);
  padding: 14px 16px; border-radius: 10px; background: #24262c; color: #dfe3ea;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); }
#ed-dlg .ed-dlg-msg { white-space: pre-wrap; margin-bottom: 12px; }
#ed-dlg input { width: 100%; box-sizing: border-box; padding: 6px 8px;
  margin-bottom: 12px; border: 1px solid #3b3f49; border-radius: 6px;
  background: #191b20; color: #e8ebf1; font: inherit; }
#ed-dlg .ed-dlg-row { display: flex; gap: 8px; justify-content: flex-end; }
#ed-dlg button { padding: 5px 12px; border: 1px solid #3b3f49;
  border-radius: 7px; background: #2c2f37; color: #dfe3ea; font: inherit;
  cursor: pointer; }
#ed-dlg button.ed-primary { background: #3d6adf; border-color: #3d6adf;
  color: #fff; font-weight: 600; }
@media print { #ed-dlg { display: none !important; } }

/* an equation's LaTeX, with its rendering underneath */
#ed-eqdlg { position: fixed; z-index: 60; display: none;
  top: calc(var(--ed-barh, 36px) + 12px); left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px)); padding: 12px; border-radius: 10px;
  background: #24262c; color: #dfe3ea; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font: 13px/1.4 system-ui, -apple-system, sans-serif; }
#ed-eqdlg.open { display: block; }
#ed-eqdlg h4 { margin: 0 0 8px; font-size: 13px; color: #aab2c4; }
#ed-eqdlg textarea { width: 100%; box-sizing: border-box; padding: 6px 8px;
  border: 1px solid #3b3f49; border-radius: 6px; background: #191b20;
  color: #e8ebf1; font: 13px/1.45 Menlo, Consolas, monospace; resize: vertical; }
#ed-eq-prev { margin: 10px 0; padding: 10px; min-height: 40px; overflow-x: auto;
  border-radius: 6px; background: #fff; color: #111; font-size: 22px; }
#ed-eqdlg .ed-yt-row { display: flex; gap: 8px; justify-content: flex-end;
  align-items: center; }
#ed-eqdlg .ed-eq-hint { margin-right: auto; color: #7d8596; font-size: 12px; }
#ed-eqdlg button { padding: 5px 12px; border: 1px solid #3b3f49;
  border-radius: 7px; background: #2c2f37; color: #dfe3ea;
  font: inherit; cursor: pointer; }
#ed-eqdlg button.ed-primary { background: #3d6adf; border-color: #3d6adf;
  color: #fff; font-weight: 600; }

/* pseudocode pulled in from the book */
.kslide .ed-algo { margin: 0; padding: 14px 18px; overflow: hidden;
  background: #f7f8fa; border-left: 4px solid #6a4a86;
  font: 20px/1.45 ui-monospace, Menlo, monospace; color: #24242c;
  white-space: pre-wrap; box-sizing: border-box; height: 100%; }
.kslide .ed-algo .c-kw { color: #8a2018; font-weight: 600; }
.kslide .ed-algo .c-num { color: #2f6f4f; }
.kslide .ed-algo .c-str { color: #2c6fbb; }
.kslide .ed-algo .c-com { color: #7a7a86; font-style: italic; }
#ed-demo .ed-opts label { display: flex; gap: 5px; align-items: center;
  cursor: pointer; }
.ed-demo-item { display: flex; gap: 9px; padding: 7px 6px; cursor: pointer;
  border-radius: 7px; align-items: center; }
.ed-demo-item:hover { background: #33363e; }
.ed-demo-item img { width: 72px; height: 48px; object-fit: cover;
  border-radius: 5px; background: #16171b; flex: 0 0 auto; }
.ed-demo-item .t { font-weight: 600; }
.ed-demo-item .d { color: #8a93a6; font-size: 12px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.ed-demo-item .c { color: #6f7788; font-size: 11px; }

/* build stamp: which editor.js is actually running */
#ed-build { font: 10px/1 ui-monospace, Menlo, monospace; color: #6f7788;
  background: #16171b; border-radius: 4px; padding: 3px 5px;
  letter-spacing: 0.04em; }

/* --- two-level hierarchy: section headers and title slides ---------- */
.ed-sechead { flex: 1 0 100%; display: flex; align-items: baseline;
  gap: 8px; margin: 14px 0 2px; padding: 5px 10px; cursor: pointer;
  background: #23252b; border-left: 4px solid #e0a03a;
  border-radius: 5px; user-select: none; }
.ed-sechead:hover { background: #2b2e36; }
.ed-sechev { color: #e0a03a; font-size: 11px; transition: transform .12s;
  display: inline-block; }
.ed-sechead.closed .ed-sechev { transform: rotate(-90deg); }
.ed-sectitle { font-weight: 600; color: #f0e2c8; }
.ed-seccount { color: #7f8798; font-size: 11px; }
/* the title slide itself, so it is obvious in the grid */
.ed-tile.istitle .ed-thumbbox { outline: 3px solid #e0a03a;
  outline-offset: -3px; }
.ed-tile.istitle .ed-tile-num { color: #e0a03a; font-weight: 600; }
.ed-tile.istitle .ed-tile-num::before { content: "§ "; }

/* --- the plan slide ------------------------------------------------- */
.kslide .ed-plan { width: 100%; height: 100%; overflow: hidden;
  box-sizing: border-box; padding: 8px 14px;
  font: 30px/1.35 Helvetica, Arial, sans-serif; color: #1c1c22; }
.kslide .ed-plan-head { font-weight: 700; font-size: 1.25em;
  margin-bottom: 0.5em; }
.kslide .ed-plan-list { margin: 0; padding-left: 1.4em; }
.kslide .ed-plan-list li { margin: 0.18em 0; cursor: pointer; }
.kslide .ed-plan-list li:hover span { text-decoration: underline;
  color: #2c6fbb; }
.kslide .ed-plan-empty { color: #8a8a94; font-size: 0.6em;
  margin-top: 0.6em; }
body.editing .kslide .ed-plan-list li { cursor: inherit; }
body.editing .kslide .ed-plan-list li:hover span { text-decoration: none;
  color: inherit; }

/* plan progress: where the lecture has got to */
.kslide .ed-plan-list li.now { font-weight: 700; }
.kslide .ed-plan-list li.now::marker { font-weight: 700; }
.kslide .ed-plan-list li.done { color: #9a9aa4; }
.kslide .ed-plan-list li.todo { color: #4a4a52; }
.kslide .ed-plan-list li.now > span { box-shadow: inset 0 -0.42em 0
  rgba(224, 160, 58, 0.42); }
#ed-bar #ed-plansel.on { background: #e0a03a; color: #23252b; }
#ed-bar #ed-hidetitles.on { background: #e0a03a; color: #23252b;
  font-weight: 600; }

/* controls that do not apply right now */
#ed-bar button:disabled, #ed-sorter-bar button:disabled {
  opacity: 0.35; cursor: default; }
#ed-bar button:disabled:hover { background: #33363e; }
#ed-sorter-bar button:disabled:hover { background: #33363e; }

/* the block arrow's adjustment grip, and the rotate grip */
.ed-handle.adjust { width: 12px; height: 12px; border-radius: 50%;
  background: #e0a03a; border-color: #a9761f; cursor: move; }
.ed-handle.rotate { width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border-color: #3d6adf; cursor: grab; }
.ed-handle.rotate::after { content: "⟳"; position: absolute; inset: -1px;
  font: 10px/12px system-ui, sans-serif; color: #3d6adf;
  text-align: center; }
#ed-shapebar input[type="range"]#ed-sh-swr { width: 110px; }

/* reveal caps media at 95% of the stage; slide content is placed by us */
.kslide video, .kslide img, .kslide iframe { max-width: none;
  max-height: none; }

/* same wrapping rules for boxes added in the editor (the deck CSS is
   baked at conversion time, so state them here too) */
.kslide .tf .p { overflow-wrap: break-word; }
.kslide .tf .p[style*="display:flex"] { align-items: flex-start; }
.kslide .tf .p[style*="display:flex"] .ptxt { flex: 1 1 auto;
  min-width: 0; width: auto; }
.kslide .tf .p .bul { flex: 0 0 auto; }

/* $$ … $$ typed in a text box, rendered on the way out. It sits in the
   line like a word and takes the run's size from the em-based KaTeX
   metrics; while the box is open it is back to source text. */
.kslide .ed-imath { display: inline-block; vertical-align: baseline; }
.kslide .ed-imath .katex { font-size: 1em; }

/* what the from-book panel guessed before anything was typed */
#ed-demo .ed-demo-note { padding: 4px 8px 8px; color: #7f8798;
  font-size: 11px; }

/* the loop is waiting for the gesture its browser insists on */
.kslide .ed-loops-play { position: absolute; right: 14px; bottom: 14px;
  z-index: 2; padding: 5px 11px; border-radius: 20px;
  background: rgba(0, 0, 0, 0.55); color: #fff; pointer-events: none;
  font: 13px/1 system-ui, -apple-system, sans-serif; letter-spacing: 0.02em; }

/* rubber band on the slide, and what it is touching */
.kslide .ed-marquee { position: absolute; z-index: 295; pointer-events: none;
  border: 1px solid #3d6adf; background: rgba(61, 106, 223, 0.10); }
body.editing .kslide .shp.ed-marqhit { outline: 1.5px dashed #3d6adf99; }

/* ---- animation steps ------------------------------------------------
   An element with a step is a reveal fragment. While editing, every one
   of them must be visible and say which step it is on: you cannot move
   a box you cannot see, and the whole point of the list in the
   inspector is to know what comes when. */
body.editing .reveal .fragment,
body.editing .reveal .fragment.visible {
  opacity: 1 !important; visibility: visible !important;
  /* reveal gives every fragment `transition: all .2s`, so a box with a step
     eased a fifth of a second behind the cursor on every drag and resize:
     "editing the line that is animated is very rubbery" (Fredo, 2026-10-07) */
  transition: none !important; }
body.editing .shp[data-ed-step]::after {
  content: attr(data-ed-step); position: absolute; left: -9px; top: -9px;
  min-width: 16px; height: 16px; padding: 0 3px; border-radius: 9px;
  background: #3d6adf; color: #fff; font: 600 11px/16px system-ui, sans-serif;
  text-align: center; z-index: 90; pointer-events: none;
  box-shadow: 0 0 0 2px #fff; }
body.editing .shp[data-ed-step] { outline: 1px dashed #3d6adf88; }

#ed-insp-anim label { color: #666; font-size: 12px; margin-right: 6px; }
#ed-insp-anim #ed-step { width: 56px; }
#ed-steplist { margin-top: 6px; }
/* the build preview (2026-10-22): what arrives after the stage shown is
   hidden, and the step badges go, since the slide is shown as the room sees it */
body.editing .reveal .fragment.ed-pvhide, body.editing .reveal .ed-pvhide {
  opacity: 0 !important; visibility: hidden !important; }
body.editing.ed-previewing .shp[data-ed-step]::after { display: none; }
body.editing.ed-previewing .shp[data-ed-step] { outline: none; }
.ed-pvrow { margin-top: 8px; align-items: center; gap: 4px; }
.ed-pvrow .ed-pvlab { color: #666; font-size: 12px; margin-right: 4px; }
.ed-pvat { color: #666; font-size: 12px; margin-left: 6px; }
.ed-insp-note { color: #777; font-size: 11.5px; line-height: 1.35; }
.ed-steprow { display: flex; align-items: center; gap: 5px;
  margin: 3px 0; }
.ed-steprow .ed-stepno { min-width: 22px; background: #3d6adf;
  color: #fff; border: 0; border-radius: 6px; padding: 2px 5px;
  cursor: pointer; font-weight: 600; }
.ed-steprow .ed-stepn { flex: 1; color: #555; font-size: 11.5px; }
.ed-steprow button[data-a="stepup"], .ed-steprow button[data-a="stepdown"] {
  padding: 1px 5px; }

/* A converted slide positions every picture itself: the shape's box IS
   the picture's box, at the coordinates PowerPoint gave it. The reveal
   theme's `.reveal img { margin: var(--r-block-margin) 0 }` is meant for
   an image sitting in prose, and on a slide it pushed every picture
   20px below the box that owns it, and 20px past its bottom edge. The
   selection outline looking too high is how it shows in the editor; the
   picture is in the wrong place in the show too. Inline is the same
   story: a baseline gap under a picture that fills its own box. */
.kslide .shp > img { margin: 0; display: block; }

/* ---- generate an illustration -------------------------------------- */
#ed-gendlg { position: fixed; right: 16px; bottom: 16px; width: 560px;
  max-height: 82vh; z-index: 700; display: none; flex-direction: column;
  gap: 8px; padding: 12px 14px; border-radius: 12px;
  background: #1d1f24f2; color: #dfe2ea; box-shadow: 0 8px 30px #0007;
  font: 13px/1.4 system-ui, -apple-system, sans-serif; }
#ed-gendlg.open { display: flex; }
.ed-gen-head { font-weight: 600; }
#ed-gendlg textarea { font: inherit; color: #dfe2ea; background: #2a2d34;
  border: 1px solid #3a3e47; border-radius: 8px; padding: 7px 9px;
  resize: vertical; }
#ed-gen-models { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-gen-m { font: inherit; color: #b9c0cd; background: #2a2d34;
  border: 1px solid #3a3e47; border-radius: 999px; padding: 4px 11px;
  cursor: pointer; display: flex; align-items: baseline; gap: 6px; }
.ed-gen-m:hover { background: #343841; }
.ed-gen-m.on { background: #2f6a4c; border-color: #3d8a63; color: #eaf5ee; }
.ed-gen-m:disabled { opacity: .38; cursor: default; }
.ed-gen-price { font-size: 11px; opacity: .75;
  font-variant-numeric: tabular-nums; }
.ed-gen-row { display: flex; align-items: center; gap: 7px; }
#ed-gendlg select, #ed-gendlg > .ed-gen-row button { font: inherit;
  color: #dfe2ea; background: #33363e; border: 0; border-radius: 7px;
  padding: 5px 9px; cursor: pointer; }
#ed-gendlg > .ed-gen-row button:hover { background: #454955; }
#ed-gendlg #ed-gen-go { background: #2f6a4c; }
#ed-gendlg #ed-gen-go:disabled { opacity: .5; cursor: default; }
#ed-gen-msg { flex: 1; color: #9aa3b4; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ed-gen-out { display: flex; flex-wrap: wrap; gap: 8px; overflow: auto; }
.ed-gen-card { width: 168px; background: #26292f; border-radius: 8px;
  padding: 6px; }
.ed-gen-card .ed-gen-name { font-size: 11px; color: #9aa3b4;
  margin-bottom: 4px; }
.ed-gen-card img { width: 100%; display: block; border-radius: 5px;
  background: #fff; cursor: pointer; }
.ed-gen-card img:hover { outline: 2px solid #3d8a63; }
.ed-gen-card .ed-gen-state { font-size: 11px; color: #8f97a8; }
.ed-gen-card.failed .ed-gen-state { color: #e08c7a; }
.ed-gen-card.waiting { animation: ed-gen-pulse 1.4s infinite; }
@keyframes ed-gen-pulse { 50% { opacity: .55; } }
.ed-gen-card.placed { outline: 2px solid #3d8a63; }
.ed-gen-card.placed .ed-gen-name::after { content: " · on the slide";
  color: #7fc79f; }
#ed-gendlg #ed-gen-all { background: #2a3a5c; }

/* ?print=1: the figures are already in place, so show them on screen too
   (headless prints what it lays out, and this makes the mode visible if
   you ever open it by hand) */
body.ed-printing .ed-added-iframe iframe { display: none !important; }
body.ed-printing img.ed-printfig { display: block !important; }

/* A deck whose lecture has not happened yet (deck_schedule.py + editor.js).
   Bottom left, out of the way of the notes strip's links and of the room
   camera, which sits top right. It PRINTS, because a PDF of a draft deck
   that does not say so is the same problem one step further from us. */
#cp-prelim { position: fixed; left: 10px; bottom: 8px; z-index: 400;
  font: 600 11px/1 system-ui, -apple-system, sans-serif;
  letter-spacing: .08em; text-transform: uppercase;
  color: #8a6a00; background: #fff3c4cc; border: 1px solid #e3c65a;
  border-radius: 4px; padding: 4px 8px; pointer-events: none; }
@media print {
  #cp-prelim { position: absolute; }
}



/* The build list: rows you drag, pick and merge (editor.js buildStepList). */
.ed-steprow { display: flex; align-items: center; gap: .35rem; padding: 2px 4px;
  border-radius: 4px; cursor: grab; user-select: none; }
.ed-steprow:hover { background: #eef1f6; }
.ed-steprow.picked { background: #dbe6ff; box-shadow: inset 0 0 0 1px #7ea2e8; }
.ed-steprow.dragging { opacity: .5; cursor: grabbing; }
.ed-steprow.over { box-shadow: inset 0 2px 0 #3d6adf; }
.ed-stepgrip { color: #9aa3b2; cursor: grab; }
.ed-steprow .ed-stepno { min-width: 1.2em; text-align: center;
  font-variant-numeric: tabular-nums; color: #445; }
.ed-stepmerge { margin-top: .3rem; }

/* A link that is down, marked for the author and never for the room
   (link_check.py, 2026-09-22). Dead is struck through; stale means the page
   is served and its content no longer runs, so it keeps its text and takes a
   dotted underline. The little badge says which without a hover. */
.cp-dead-link { text-decoration-color: #c2410c !important; }
.cp-dead-link[data-cp-dead="dead"] { text-decoration: line-through !important;
  text-decoration-thickness: 2px !important; opacity: .75; }
.cp-dead-link[data-cp-dead="stale"] { text-decoration: underline dotted !important;
  text-decoration-thickness: 2px !important; }
.cp-dead-link::after { content: attr(data-cp-dead); margin-left: .35em;
  padding: 0 .3em; border-radius: 3px; background: #c2410c; color: #fff;
  font-size: .55em; vertical-align: super; letter-spacing: .04em;
  text-decoration: none; font-style: normal; }

/* the inspector with nothing selected is about the slide itself */
.ed-insp-empty .ed-insp-title { padding: 0 0 6px; }
.ed-slidebg { display: flex; align-items: center; gap: 8px; }
.ed-slidebg input[type=color] { width: 34px; height: 22px; padding: 0; border: 1px solid #c8ccd4;
  border-radius: 4px; background: none; cursor: pointer; }
.ed-insp-hint { margin-top: 12px; font-size: 12px; color: #6c7382; }

/* right-click on a slide in the navigator or the sorter */
.ed-ctxmenu { position: fixed; z-index: 800; padding: 5px; border-radius: 8px;
  background: #262930; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); }
.ed-ctxmenu button { display: block; min-width: 130px; text-align: left;
  font: 13px/1.4 system-ui, -apple-system, sans-serif; color: #dfe2ea;
  background: none; border: 0; border-radius: 5px; padding: 5px 10px;
  cursor: pointer; }
.ed-ctxmenu button:hover { background: #3a6fd8; color: #fff; }

/* a skipped slide opened for editing: say so on the stage */
body.editing .reveal .slides > section.ed-visiting::after {
  content: "skipped \00b7 not in the show"; position: absolute; top: 8px; right: 10px;
  z-index: 50; padding: 3px 9px; border-radius: 6px; background: #d0a020; color: #111;
  font: 600 15px/1.3 system-ui, -apple-system, sans-serif; pointer-events: none; }

/* a box another writer just changed (live updates) */
@keyframes ed-remote-flash {
  0% { outline-color: rgba(47, 128, 237, 0.95); }
  100% { outline-color: rgba(47, 128, 237, 0); } }
.shp.ed-remote { outline: 3px solid rgba(47, 128, 237, 0);
  outline-offset: 2px; animation: ed-remote-flash 2.5s ease-out; }

/* The camera's seat sits under the slide's text and pictures (Fredo, 2026-09-29:
   "In general put the PIP box under text"). isolation keeps the negative
   z-index inside the slide, above its background. A z set by hand on the seat
   (bring to front) is inline and still wins. */
.kslide { isolation: isolate; }
.kslide > .shp[data-ed-id="camera-seat"] { z-index: -1; }

/* A hanging indent written on the paragraph (padding-left with a negative
   text-indent, the bullet typed as text) applied twice: the indent moved the
   inline-block .ptxt left, and .ptxt, inheriting it, moved its own first line
   left again, so bullets sat one bullet-width outside the box (Fredo,
   2026-10-20, ws-agents-oct21). As a block, .ptxt starts at the padding and
   only its first line hangs. */
.kslide .p[style*="text-indent"] .ptxt { display: block; width: auto; }
/* a group whose controls have all moved into More leaves no empty pill */
#ed-bar .ed-group:empty { display: none; }
