/* ===========================================================================
 * LEVEL BUILDER — the editor in the site's "flyer" design.
 *
 * Loaded by editor.html AFTER admin.css and flyer-theme.css. flyer-theme.css
 * supplies the fonts (Bungee / Atma / Alegreya Sans, self-hosted), the --fl-*
 * palette and the .site-brand logo; this file builds the tool on top of them:
 *
 *   - the pixel sky behind everything and a strip of grass under the panels
 *   - the Keep the Beat Going logo leading the header
 *   - scaled-down 8-bit block buttons: a notched dark outline, a coloured rim,
 *     a bevel and a hard lip the button sinks into when pressed
 *     (red + yellow rim = Test play, green = save, blue = everything else,
 *     white = quiet / navigation)
 *   - flat flyer-blue panels with a navy outline and a hard offset shadow
 *   - the canvas in a console bezel (navy, yellow rim), as the game is
 *
 * It is a dense working tool, so sizes are compact and body text uses the
 * 700 weight of Alegreya Sans (the site's Thin is unreadable at 13px).
 * Every element id the editor's script and the probes rely on is unchanged;
 * this file only restyles.
 * ------------------------------------------------------------------------ */

:root {
  color-scheme: light;
  --ed-ink: var(--fl-ink, #16192b);
  --ed-navy: var(--fl-navy, #10244a);
  --ed-blue: var(--fl-blue, #2459a6);
  --ed-blue-2: var(--fl-blue-2, #3a78c2);
  --ed-blue-hi: var(--fl-blue-hi, #7cb8ec);
  --ed-blue-lo: var(--fl-blue-lo, #173f7d);
  --ed-sky: var(--fl-sky, #439ed7);
  --ed-red: var(--fl-red, #e52629);
  --ed-yellow: var(--fl-yellow, #ffd200);
  --ed-yellow-hi: var(--fl-yellow-hi, #fff07a);
  --ed-yellow-lo: var(--fl-yellow-lo, #e09a00);
  --ed-green: var(--fl-green, #1fa64a);
  --ed-green-hi: var(--fl-green-hi, #6ad98a);
  --ed-lip: rgba(16, 36, 74, 0.55);
  --ed-text: #ffffff;
  --ed-text-2: #dcecff;
  --ed-heading: var(--fl-font-heading, "Bungee", "Arial Black", sans-serif);
  --ed-sub: var(--fl-font-sub, "Atma", "Trebuchet MS", sans-serif);
  --ed-body: var(--fl-font-body, "Alegreya Sans", "Trebuchet MS", sans-serif);

  /* admin.css tokens the inline markup still reads (var(--good) etc.) */
  --good: #6ad98a;
  --warn: #ffd200;
  --bad: #ff8a80;
  --line: var(--ed-navy);
  --muted: #cfe0f7;
  --ink-3: #cfe0f7;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ed-text);
  font: 700 14px/1.4 var(--ed-body);
  background: var(--ed-sky) url("Graphics/flyer/sky-blocks.png") center top / cover no-repeat fixed;
  image-rendering: auto;
}

/* flyer-theme.css paints the sky with body pseudo-elements on pages that
   load styles.css; the editor paints its own, so keep those out of the way. */
body::before, body::after { content: none !important; }

button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--ed-text-2); font-weight: 700; }
a { color: var(--ed-yellow-hi); }

:focus-visible { outline: 3px dashed #fff; outline-offset: 3px; border-radius: 0; }

/* ------------------------------------------------------------- header -- */
header.ed-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 14px 4px;
  position: relative;
  z-index: 3;
}

.ed-brand.site-brand {
  order: 0;
  margin: 0;
  line-height: 0;
  flex: 0 0 auto;
}
.ed-brand.site-brand img { width: 92px; height: auto; }

.ed-title { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.ed-title .brand {
  margin: 0;
  font: 400 19px/1.05 var(--ed-heading);
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 3px 3px 0 var(--ed-navy);
  white-space: nowrap;
}
.ed-title .brand small {
  display: block;
  margin-top: 2px;
  font: 700 13px/1.2 var(--ed-sub);
  color: var(--ed-yellow);
  text-shadow: 2px 2px 0 var(--ed-navy);
  letter-spacing: 0.02em;
}

.ed-actions {
  flex: 1 1 520px;
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px 14px;
  min-width: 0;
}
.ed-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 9px; }

/* Level settings: a navy band under the header. */
.ed-stagebar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 2px 12px 0;
  padding: 6px 12px;
  background: var(--ed-navy);
  border: 3px solid var(--ed-ink);
  box-shadow: inset 0 3px 0 0 rgba(255, 255, 255, 0.1), 5px 5px 0 0 var(--ed-lip);
  position: relative;
  z-index: 2;
}
.ed-stagebar .ed-stagebar-title {
  font: 400 11px/1 var(--ed-heading);
  color: var(--ed-yellow);
  letter-spacing: 0.03em;
}
#publish-status { margin-left: auto; color: var(--ed-yellow-hi); font-size: 13px; }

label.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font: 700 13px/1.2 var(--ed-body);
  white-space: nowrap;
}
label.inline input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--ed-yellow); }

/* ------------------------------------------------------------- inputs -- */
input.text, select.text, .prop input, .prop select, .pd-card input.text {
  border: 2px solid var(--ed-navy);
  border-radius: 0;
  background-color: #fff;
  color: var(--ed-navy);
  font: 700 14px/1.2 var(--ed-body);
  padding: 4px 7px;
  min-height: 30px;
  box-shadow: inset 2px 2px 0 0 #d5e3f5;
}
input.text::placeholder { color: #6b7fa3; opacity: 1; }
input.text:focus, select.text:focus, .prop input:focus, .prop select:focus {
  outline: 3px solid var(--ed-yellow);
  outline-offset: 0;
  border-color: var(--ed-ink);
  box-shadow: inset 2px 2px 0 0 #d5e3f5;
}
input.text:disabled, .prop input:disabled { background: #dfe8f5; color: #4b5f82; }
input[type="range"] { accent-color: var(--ed-yellow); }

/* ------------------------------------------------- 8-bit block buttons -- *
 * The same construction as the site's .primary-button, scaled down: four
 * offset shadows for the notched outline, an inset rim, a bevel, and the lip.
 * `:root .btn` rather than `.btn`: admin.css (loaded first) has two-class
 * rules such as `.btn.ghost { background: transparent }` that would
 * otherwise beat the face colour.
 * ------------------------------------------------------------------------ */
:root .btn, :root .seg button, :root .slot-nudge {
  --face: #2f6fbe;
  --rim: var(--ed-blue-hi);
  --hi: #4f8fd8;
  --lo: var(--ed-blue-lo);
  --txt: #fff;
  --o: 3px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 0;
  margin: 0 0 4px;
  padding: 7px 10px 6px;
  background: var(--face);
  color: var(--txt);
  font: 400 10.5px/1.2 var(--ed-heading);
  letter-spacing: 0.02em;
  text-shadow: 1px 1px 0 rgba(22, 25, 43, 0.75);
  white-space: nowrap;
  cursor: pointer;
  filter: none;
  box-shadow:
    0 calc(var(--o) * -1) 0 0 var(--ed-ink),
    0 var(--o) 0 0 var(--ed-ink),
    calc(var(--o) * -1) 0 0 0 var(--ed-ink),
    var(--o) 0 0 0 var(--ed-ink),
    inset 0 0 0 2px var(--rim),
    inset 4px 4px 0 0 var(--hi),
    inset -4px -4px 0 0 var(--lo),
    0 7px 0 0 var(--ed-lip);
  transition: transform 90ms steps(2), filter 90ms steps(2);
}
:root .btn:hover, :root .seg button:hover, :root .slot-nudge:hover {
  transform: translateY(1px);
  filter: brightness(1.08);
  box-shadow:
    0 calc(var(--o) * -1) 0 0 var(--ed-ink),
    0 var(--o) 0 0 var(--ed-ink),
    calc(var(--o) * -1) 0 0 0 var(--ed-ink),
    var(--o) 0 0 0 var(--ed-ink),
    inset 0 0 0 2px var(--rim),
    inset 4px 4px 0 0 var(--hi),
    inset -4px -4px 0 0 var(--lo),
    0 6px 0 0 var(--ed-lip);
}
:root .btn:active, :root .seg button:active, :root .slot-nudge:active {
  transform: translateY(4px);
  box-shadow:
    0 calc(var(--o) * -1) 0 0 var(--ed-ink),
    0 var(--o) 0 0 var(--ed-ink),
    calc(var(--o) * -1) 0 0 0 var(--ed-ink),
    var(--o) 0 0 0 var(--ed-ink),
    inset 0 0 0 2px var(--rim),
    inset -4px -4px 0 0 var(--hi),
    inset 4px 4px 0 0 var(--lo),
    0 3px 0 0 var(--ed-lip);
}
.btn:focus-visible, .seg button:focus-visible, .slot-nudge:focus-visible { outline: 2px dashed #fff; outline-offset: 6px; }
:root .btn:disabled, :root .btn:disabled:hover {
  --face: #9aa9bb; --rim: #d4dde8; --hi: #b9c6d4; --lo: #6f7e90;
  cursor: not-allowed; transform: none; filter: none;
}

/* Test play — the main action: red with the yellow rim. */
.btn.primary { --face: var(--ed-red); --rim: var(--ed-yellow); --hi: #ff6265; --lo: #a8151a; }
/* Save / go. */
.btn.good { --face: var(--ed-green); --rim: #b6f05a; --hi: var(--ed-green-hi); --lo: #11702f; }
/* Delete. */
.btn.bad { --face: #b3241f; --rim: #ffb0a4; --hi: #e0544c; --lo: #73120e; }
/* Quiet: a white block with navy text, like the site's nav links. */
:root .btn.ghost {
  --face: #fff; --rim: #fff; --hi: #fff; --lo: #c4d6ee; --txt: var(--ed-navy);
  text-shadow: none;
}
:root .btn.ghost:hover { --face: var(--ed-yellow-hi); --rim: var(--ed-yellow-hi); --hi: var(--ed-yellow-hi); --lo: var(--ed-yellow-lo); }
:root .btn.sm { padding: 5px 8px 4px; font-size: 9.5px; --o: 2px; }
.btn .ico { font-size: 13px; line-height: 1; text-shadow: none; }

/* ------------------------------------------------------------- layout -- */
.body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr) 318px;
  gap: 14px;
  padding: 12px 14px 30px;
  /* the panels stand on the grass, as the site's pages do */
  background: url("Graphics/flyer/grass-tile.png") repeat-x left bottom / auto 34px;
  image-rendering: auto;
}
.body:focus { outline: none; }

.panel, .palette, .inspector .card {
  border: 3px solid var(--ed-navy);
  background: var(--ed-blue);
  box-shadow: inset 0 3px 0 0 rgba(255, 255, 255, 0.14), 5px 5px 0 0 var(--ed-lip);
}

/* ------------------------------------------------------------ palette -- */
.palette {
  min-height: 0;
  overflow-y: auto;
  padding: 8px 9px 6px 11px;
  scrollbar-width: thin;
  scrollbar-color: var(--ed-blue-hi) var(--ed-blue-lo);
}
.palette .pal-head {
  margin: 0 0 6px;
  font: 400 12px/1.2 var(--ed-heading);
  color: #fff;
  text-shadow: 2px 2px 0 var(--ed-navy);
}
.palette .pal-tip { margin: 0 0 8px; font-size: 12px; line-height: 1.3; color: var(--ed-text-2); }
.palette h4 {
  margin: 12px 0 8px;
  font: 700 14px/1.1 var(--ed-sub);
  color: var(--ed-yellow);
  text-shadow: 2px 2px 0 var(--ed-navy);
  letter-spacing: 0.02em;
}
.pal-group:first-of-type h4 { margin-top: 2px; }
.pal-tiles { display: flex; flex-direction: column; gap: 9px; padding: 2px 3px 4px 2px; }

.pal-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 4px 6px 4px 4px;
  background: #fff;
  color: var(--ed-navy);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  box-shadow:
    0 -2px 0 0 var(--ed-ink), 0 2px 0 0 var(--ed-ink), -2px 0 0 0 var(--ed-ink), 2px 0 0 0 var(--ed-ink),
    inset -3px -3px 0 0 #c4d6ee,
    0 5px 0 0 var(--ed-lip);
  transition: transform 90ms steps(2), background 90ms steps(2);
}
.pal-item:hover { background: var(--ed-yellow-hi); transform: translateY(1px); }
.pal-item:focus-visible { outline: 2px dashed #fff; outline-offset: 5px; }
.pal-item.armed {
  background: var(--ed-yellow);
  box-shadow:
    0 -2px 0 0 var(--ed-ink), 0 2px 0 0 var(--ed-ink), -2px 0 0 0 var(--ed-ink), 2px 0 0 0 var(--ed-ink),
    inset 3px 3px 0 0 var(--ed-yellow-hi), inset -3px -3px 0 0 var(--ed-yellow-lo),
    0 2px 0 0 var(--ed-lip);
  transform: translateY(3px);
}
.pal-item[data-locked] { cursor: not-allowed; opacity: 0.6; filter: grayscale(0.7); }
.pal-item[data-locked]:hover { background: #fff; transform: none; }
.pal-item .sw {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--ed-sky);
  box-shadow: inset 0 0 0 2px var(--ed-navy), inset 0 -8px 0 0 rgba(31, 166, 74, 0.35);
  font-size: 18px; /* emoji fallback */
  line-height: 1;
}
.pal-item .sw canvas { width: 38px; height: 38px; display: block; }
.pal-item .nm { font: 700 14px/1.1 var(--ed-sub); color: var(--ed-navy); }
.pal-item .hint {
  margin-top: 1px;
  font: 700 11.5px/1.18 var(--ed-body);
  color: #3a4e74;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pal-item .lock { color: #8a1c17; }

/* --------------------------------------------------------- the stage -- */
.stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 3px solid var(--ed-ink);
  background: var(--ed-navy);
  box-shadow: inset 0 0 0 3px var(--ed-yellow), 6px 6px 0 0 var(--ed-lip);
  padding: 3px;
}
.stage-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 6px 9px 5px;
  color: #fff;
}
.stage-tools .zoom-wrap input[type="range"] { width: 120px; }
.stage-tools .hint-line { color: var(--ed-text-2); font-size: 12.5px; }
.kbd {
  display: inline-block;
  padding: 0 5px;
  background: #fff;
  color: var(--ed-navy);
  font: 400 10px/1.5 var(--ed-heading);
  box-shadow: 0 2px 0 0 var(--ed-lip);
}
.stage-tools.is-armed .hint-line { display: none; }
.armed-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px 3px 9px;
  background: var(--ed-yellow);
  color: var(--ed-navy);
  font: 700 13px/1.2 var(--ed-sub);
  box-shadow: 0 0 0 2px var(--ed-ink), 3px 3px 0 0 var(--ed-lip);
}
.armed-chip button {
  border: 0; border-radius: 0; cursor: pointer;
  background: var(--ed-navy); color: #fff; font: 400 9px/1.6 var(--ed-heading); padding: 2px 6px;
}

/* The level sits on the BOTTOM of the viewport, as the game's camera shows
   it: zoomed out, the spare room is sky above it, not a void below the
   ground. (margin-top:auto rather than justify-content:flex-end, which would
   make the top of a tall stage unreachable by scrolling.) */
.canvas-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 6px;
  background: #0b1c33;
  border: 2px solid var(--ed-ink);
  scrollbar-color: var(--ed-yellow) var(--ed-navy);
}
#editor-canvas { display: block; flex: none; margin-top: auto; image-rendering: auto; cursor: crosshair; touch-action: manipulation; }
#editor-canvas.placing { cursor: copy; }
.stage-status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 5px 10px 4px;
  font-size: 12.5px;
  color: var(--ed-text-2);
}
.stage-status #st-score { margin-left: auto; color: #fff; }

/* ---------------------------------------------------------- inspector -- */
.inspector {
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--ed-blue-hi) var(--ed-blue-lo);
}
.inspector .card { padding: 10px 12px 12px; margin: 0; }
.inspector h3, .card h3 {
  margin: 0 0 8px;
  font: 700 16px/1.15 var(--ed-sub);
  color: var(--ed-yellow);
  text-shadow: 2px 2px 0 var(--ed-navy);
  letter-spacing: 0.01em;
  text-transform: none;
}
.inspector h3 .muted { color: #fff; font: 700 15px var(--ed-sub); text-shadow: 2px 2px 0 var(--ed-navy); }

.insp-hero {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 10px;
  padding: 6px;
  background: var(--ed-blue-2);
  box-shadow: inset 0 0 0 2px var(--ed-navy);
}
.insp-hero .sw {
  width: 52px; height: 52px; display: grid; place-items: center;
  background: var(--ed-sky); box-shadow: inset 0 0 0 2px var(--ed-navy), inset 0 -10px 0 0 rgba(31, 166, 74, 0.35);
}
.insp-hero .sw canvas { width: 48px; height: 48px; }
.insp-hero p { margin: 0; font-size: 13px; line-height: 1.3; color: #fff; }
.insp-empty { margin: 0; color: var(--ed-text-2); font-size: 13.5px; line-height: 1.4; }
.insp-sec {
  margin: 10px 0 6px;
  padding-top: 8px;
  border-top: 2px dashed rgba(255, 255, 255, 0.28);
  font: 700 13px/1.2 var(--ed-sub);
  color: var(--ed-yellow-hi);
}
.prop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 4px 8px;
  align-items: center;
  margin-bottom: 7px;
}
.prop label { color: #fff; font-size: 13px; line-height: 1.2; }
.prop label small { display: block; color: var(--ed-text-2); font-size: 11.5px; font-weight: 700; }
.prop input, .prop select { width: 100%; }
.prop:has(select) { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.prop.wide { grid-template-columns: minmax(0, 1fr); }
.prop-note { margin: -2px 0 8px; color: var(--ed-text-2); font-size: 12px; line-height: 1.3; }
#insp-del { margin-top: 8px; }

/* checker */
.score-badge { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font: 400 24px/1.1 var(--ed-heading); text-shadow: 2px 2px 0 var(--ed-navy); }
.score-badge .muted { font: 700 13px/1.2 var(--ed-body) !important; text-shadow: none; color: var(--ed-text-2); }
#difficulty-panel {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--ed-navy);
  box-shadow: inset 0 0 0 2px var(--ed-ink);
}
#difficulty-panel:empty { display: none; }
.diff-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.diff-head b { font: 700 14px var(--ed-sub); color: #fff; }
.diff-band {
  padding: 2px 7px 1px;
  font: 400 10px/1.4 var(--ed-heading);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 0 0 2px var(--ed-ink);
}
.diff-band.good { background: var(--ed-green); color: #fff; }
.diff-band.warn { background: var(--ed-yellow); color: var(--ed-navy); }
.diff-band.bad { background: var(--ed-red); color: #fff; }
.diff-note { color: var(--ed-text-2); font-size: 12.5px; margin: 6px 0 8px; }
.diff-row { display: grid; grid-template-columns: 124px 1fr 24px; align-items: center; gap: 8px; font-size: 12.5px; margin: 4px 0; }
.diff-row i {
  height: 8px; display: block; min-width: 4px;
  background: repeating-linear-gradient(90deg, var(--ed-yellow) 0 6px, #ff9a2e 6px 12px);
  box-shadow: 0 0 0 1px var(--ed-ink);
}
.diff-row b { text-align: right; color: #fff; }
#lint-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.lint-item {
  padding: 6px 9px 7px 12px;
  background: #fff;
  color: var(--ed-navy);
  cursor: pointer;
  box-shadow: inset 5px 0 0 0 var(--ed-blue-hi), 0 0 0 2px var(--ed-ink), 3px 3px 0 2px var(--ed-lip);
}
.lint-item:hover { background: var(--ed-yellow-hi); }
.lint-item.error { box-shadow: inset 5px 0 0 0 var(--ed-red), 0 0 0 2px var(--ed-ink), 3px 3px 0 2px var(--ed-lip); }
.lint-item.warn { box-shadow: inset 5px 0 0 0 var(--ed-yellow-lo), 0 0 0 2px var(--ed-ink), 3px 3px 0 2px var(--ed-lip); }
.lint-item.a11y { box-shadow: inset 5px 0 0 0 #8e5bd6, 0 0 0 2px var(--ed-ink), 3px 3px 0 2px var(--ed-lip); }
.lint-item .t { font: 700 14px/1.2 var(--ed-sub); color: var(--ed-navy); }
.lint-item .d { font-size: 12.5px; line-height: 1.32; color: #2c3d5f; margin-top: 2px; }
.lint-item .fix { font-size: 12.5px; line-height: 1.32; color: #0d6b33; margin-top: 3px; }
.lint-empty {
  padding: 7px 9px;
  background: var(--ed-green);
  color: #fff;
  font: 700 14px/1.3 var(--ed-sub);
  box-shadow: 0 0 0 2px var(--ed-ink), 3px 3px 0 2px var(--ed-lip);
}
.legend-card ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; color: var(--ed-text-2); }
.legend-card li b { color: #fff; }

/* -------------------------------------------------------------- modal -- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 18px;
  background: rgba(16, 36, 74, 0.55);
  backdrop-filter: none;
}
.modal {
  width: min(1080px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 4px solid var(--ed-ink);
  border-radius: 0;
  background: var(--ed-blue);
  box-shadow: inset 0 0 0 4px var(--ed-blue-2), 10px 10px 0 0 rgba(16, 36, 74, 0.6);
  color: #fff;
}
.modal-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  padding: 12px 14px 10px;
  border-bottom: 3px solid var(--ed-navy);
}
.modal-head h3 { margin: 0; font: 400 19px/1.1 var(--ed-heading); color: #fff; text-shadow: 3px 3px 0 var(--ed-navy); }
.modal-head .spacer { margin-left: auto; }
.modal-body { padding: 14px; overflow-y: auto; }
.modal-foot { margin: 0; padding: 9px 14px; background: var(--ed-navy); color: var(--ed-text-2); font-size: 13px; border-top: 3px solid var(--ed-ink); }
.modal-foot b { color: #fff; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 8px 10px; border: 0; border-radius: 0; overflow: visible; padding: 3px; }
:root .seg button { --face: #fff; --rim: #fff; --hi: #fff; --lo: #c4d6ee; --txt: var(--ed-navy); text-shadow: none; font-size: 10px; }
:root .seg button.on, :root .seg button[aria-selected="true"] { --face: var(--ed-yellow); --rim: var(--ed-yellow); --hi: var(--ed-yellow-hi); --lo: var(--ed-yellow-lo); }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.lib-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; color: #fff; font: inherit;
  border: 3px solid var(--ed-navy); border-radius: 0; background: var(--ed-blue-2); overflow: hidden; cursor: default;
  box-shadow: 5px 5px 0 0 var(--ed-lip);
}
.lib-card:hover { border-color: var(--ed-ink); }
.lib-card canvas { display: block; width: 100%; height: 96px; background: #0b1c33; border-bottom: 3px solid var(--ed-navy); image-rendering: auto; }
.lib-card .meta { padding: 8px 10px; }
.lib-card .nm { font: 700 16px/1.2 var(--ed-sub); color: #fff; text-shadow: 2px 2px 0 var(--ed-navy); }
.lib-card .st { color: var(--ed-text-2); font-size: 12px; margin-top: 3px; line-height: 1.5; }
.lib-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.lib-card .row { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px 10px 12px; }
.tag { font-size: 11.5px; padding: 1px 7px; background: #fff; color: var(--ed-navy); box-shadow: 0 0 0 2px var(--ed-navy); border-radius: 0; border: 0; }
.lib-empty { color: var(--ed-text-2); padding: 30px; text-align: center; grid-column: 1 / -1; font-size: 14px; }
.tokenbar {
  display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center;
  margin-bottom: 14px; padding: 10px 12px;
  background: var(--ed-navy); box-shadow: inset 0 0 0 2px var(--ed-ink);
}
.tokenbar input { flex: 1 1 200px; }

/* campaign order — its blocks are direct children of the library grid, so
   each one spans the full width instead of becoming a squeezed grid cell. */
.lib-grid > .warnbox, .lib-grid > .order-sched, .lib-grid > .order-wrap,
.lib-grid > .muted, .lib-grid > .banner { grid-column: 1 / -1; }
.lib-grid > .warnbox { margin-bottom: 0; }
.order-sched { margin: 0 !important; }
.order-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
@media (max-width: 820px) { .order-wrap { grid-template-columns: minmax(0, 1fr); } }
.order-list { display: flex; flex-direction: column; gap: 9px; min-height: 60px; }
.order-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 9px;
  border: 3px solid var(--ed-navy); border-radius: 0; background: var(--ed-blue-2);
  box-shadow: 3px 3px 0 0 var(--ed-lip);
}
.order-row.custom { background: #1c7f4a; border-color: #0b4a28; }
.order-row.dragging { opacity: 0.4; }
.order-row.drop-before { box-shadow: 0 -5px 0 0 var(--ed-yellow); }
.order-row.drop-after { box-shadow: 0 5px 0 0 var(--ed-yellow); }
.order-row .grip { cursor: grab; color: #fff; font-size: 15px; user-select: none; }
.order-row .pos { width: 26px; text-align: right; font: 400 11px var(--ed-heading); color: var(--ed-yellow); }
.order-row canvas { width: 92px; height: 34px; background: #0b1c33; border: 2px solid var(--ed-navy); border-radius: 0; flex: 0 0 92px; }
.order-row .nm { font: 700 14px/1.2 var(--ed-sub); flex: 1 1 auto; min-width: 0; }
.order-row .nm small { display: block; color: var(--ed-text-2); font: 700 12px var(--ed-body); }
.order-row .acts { display: flex; gap: 5px; }
.order-row .acts button {
  border: 0; border-radius: 0; cursor: pointer; padding: 3px 7px; font: 400 11px/1.2 var(--ed-heading);
  background: #fff; color: var(--ed-navy); box-shadow: 0 0 0 2px var(--ed-ink), 0 3px 0 2px var(--ed-lip);
}
.order-row .acts button.bad { background: #ffd7d3; color: #8a1c17; }
.order-row .acts button:hover { background: var(--ed-yellow-hi); }
.order-pool { padding: 10px; background: var(--ed-navy); box-shadow: inset 0 0 0 2px var(--ed-ink), 4px 4px 0 0 var(--ed-lip); }
.order-pool h4 { margin: 0 0 8px; font: 700 14px var(--ed-sub); color: var(--ed-yellow); }
.src-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 0;
  font: 400 9px/1.6 var(--ed-heading); letter-spacing: 0.03em; vertical-align: middle; white-space: nowrap;
}
.src-tag.builtin { background: #fff; color: var(--ed-navy); }
.src-tag.custom { background: var(--ed-yellow); color: var(--ed-navy); }
.pool-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 8px; font-size: 13px;
  background: var(--ed-blue); border: 2px solid var(--ed-ink); border-radius: 0;
}
.pool-item .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warnbox {
  margin-bottom: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45;
  border: 3px solid var(--ed-ink); border-radius: 0;
  background: #fff4bf; color: var(--ed-navy);
  box-shadow: inset -5px -5px 0 0 rgba(224, 154, 0, 0.35), 4px 4px 0 0 var(--ed-lip);
}
.warnbox b { color: var(--ed-navy); }
.warnbox .muted { color: #4a4220; }
.warnbox a { color: #0b4fae; }
.warnbox input { min-height: 28px; }
.order-sched b { font-family: var(--ed-sub); }
.banner.info {
  padding: 9px 12px; font-size: 13.5px; line-height: 1.4;
  background: var(--ed-navy); color: var(--ed-text-2); box-shadow: inset 0 0 0 2px var(--ed-ink); border: 0; border-radius: 0;
}

/* design gallery */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.theme-card {
  padding: 0; text-align: left; color: #fff; font: inherit; cursor: pointer; overflow: hidden;
  border: 3px solid var(--ed-navy); border-radius: 0; background: var(--ed-blue-2); box-shadow: 4px 4px 0 0 var(--ed-lip);
}
.theme-card:hover { background: #4c89d2; }
.theme-card[aria-pressed="true"] { border-color: var(--ed-ink); box-shadow: 0 0 0 3px var(--ed-yellow), 4px 4px 0 3px var(--ed-lip); }
.theme-card canvas { display: block; width: 100%; height: 84px; border-bottom: 3px solid var(--ed-navy); }
.theme-card .tm { padding: 7px 9px; }
.theme-card .tm b { display: block; font: 700 14px/1.2 var(--ed-sub); }
.theme-card .tm span { font-size: 11.5px; color: var(--ed-text-2); }
.theme-sec { margin: 6px 0 10px; font: 700 15px var(--ed-sub); color: var(--ed-yellow); text-shadow: 2px 2px 0 var(--ed-navy); }
.fx-row { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; margin: 14px 0 4px; }
.fx-row b { font: 700 14px var(--ed-sub); }

/* -------------------------------------------------------------- toast -- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 200;
  max-width: min(92vw, 640px);
  padding: 9px 14px;
  border: 0; border-radius: 0;
  background: var(--ed-navy); color: #fff;
  font: 700 15px/1.35 var(--ed-sub);
  box-shadow: 0 0 0 3px var(--ed-ink), inset 0 0 0 2px var(--ed-blue-hi), 6px 6px 0 3px var(--ed-lip);
}
.toast.good { background: var(--ed-green); box-shadow: 0 0 0 3px var(--ed-ink), inset 0 0 0 2px #b6f05a, 6px 6px 0 3px var(--ed-lip); }
.toast.bad { background: #b3241f; box-shadow: 0 0 0 3px var(--ed-ink), inset 0 0 0 2px #ffb0a4, 6px 6px 0 3px var(--ed-lip); }
.toast.warn { background: var(--ed-yellow); color: var(--ed-navy); box-shadow: 0 0 0 3px var(--ed-ink), inset 0 0 0 2px var(--ed-yellow-hi), 6px 6px 0 3px var(--ed-lip); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: ed-rise 0.16s steps(3) both; } }
@keyframes ed-rise { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------------------------------------- player mode: dialog & reels -- */
.pd-host {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center; padding: 14px;
  background: rgba(16, 36, 74, 0.55);
}
.pd-card {
  width: min(94vw, 560px);
  max-height: 92vh;
  overflow-y: auto;
  padding: 18px 18px 16px;
  border: 4px solid var(--ed-ink);
  background: var(--ed-blue);
  color: #fff;
  font: 700 15px/1.45 var(--ed-body);
  box-shadow: inset 0 0 0 4px var(--ed-blue-2), 10px 10px 0 0 rgba(16, 36, 74, 0.6);
}
.pd-card h3 { margin: 0 0 10px; font: 400 19px/1.2 var(--ed-heading); color: #fff; text-shadow: 3px 3px 0 var(--ed-navy); }
.pd-card .pd-body { color: var(--ed-text-2); }
.pd-card .pd-body b { color: #fff; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 16px; }
.pd-code {
  margin: 14px 0 4px; text-align: center;
  font: 400 30px/1.1 var(--ed-heading); letter-spacing: 0.06em;
  color: var(--ed-yellow); text-shadow: 3px 3px 0 var(--ed-navy);
}
.pd-link { margin: 0; text-align: center; word-break: break-all; font-size: 14px; }
.pd-link a { color: #fff; }
.pd-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  margin-top: 12px; padding: 8px 10px;
  background: #fff; color: var(--ed-navy);
  box-shadow: 0 0 0 3px var(--ed-ink), 4px 4px 0 3px var(--ed-lip);
}
.pd-row .pd-name { font: 700 15px/1.2 var(--ed-sub); }
.pd-row .pd-meta { color: #3a4e74; font-size: 13px; }
.pd-row .pd-btns { display: flex; flex-wrap: wrap; gap: 8px 9px; }

.slot-machine { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: center; margin: 14px 0 4px; }
.slot-reel-group { display: grid; gap: 9px; }
.slot-window {
  position: relative; height: 156px; overflow: hidden;
  border: 3px solid var(--ed-ink); border-radius: 0;
  /* the payline: a lit blue row between two yellow rules */
  background:
    linear-gradient(var(--ed-yellow), var(--ed-yellow)) 0 50px / 100% 3px no-repeat,
    linear-gradient(var(--ed-yellow), var(--ed-yellow)) 0 103px / 100% 3px no-repeat,
    linear-gradient(var(--ed-blue-2), var(--ed-blue-2)) 0 52px / 100% 52px no-repeat,
    var(--ed-navy);
  box-shadow: inset 0 0 0 2px var(--ed-blue-hi);
}
.slot-window::before, .slot-window::after { content: ""; position: absolute; left: 0; right: 0; height: 48px; pointer-events: none; z-index: 2; }
.slot-window::before { top: 0; background: linear-gradient(rgba(16, 36, 74, 0.92), rgba(16, 36, 74, 0)); }
.slot-window::after { bottom: 0; background: linear-gradient(rgba(16, 36, 74, 0), rgba(16, 36, 74, 0.92)); }
.slot-strip { list-style: none; margin: 0; padding: 0; will-change: transform; }
.slot-strip li {
  height: 52px; display: flex; align-items: center; justify-content: center; text-align: center;
  font: 400 clamp(0.62rem, 2.2vw, 0.86rem)/1 var(--ed-heading);
  letter-spacing: 0.02em; color: #fff; text-shadow: 2px 2px 0 var(--ed-ink);
}
:root .slot-nudge { --face: #fff; --rim: #fff; --hi: #fff; --lo: #c4d6ee; --txt: var(--ed-navy); text-shadow: none; font-size: 11px; padding: 4px 0; width: 100%; }
.slot-spin-button { font-size: 12px !important; padding: 12px 14px !important; }
.slot-spin-button:disabled { cursor: wait; }
.slot-result { text-align: center; margin: 10px 0 0; font-size: 14px; color: var(--ed-text-2); }
.slot-result strong { display: block; margin-top: 2px; color: var(--ed-yellow); font: 400 18px/1.2 var(--ed-heading); text-shadow: 2px 2px 0 var(--ed-navy); }
@media (max-width: 640px) {
  .slot-machine { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .slot-spin-button { grid-column: 1 / -1; }
}

/* =================================================== narrower screens === */
@media (max-width: 1240px) {
  .body { grid-template-columns: 196px minmax(0, 1fr) 296px; gap: 12px; }
  .ed-brand.site-brand img { width: 80px; }
}

/* Tablet: the inspector drops under the canvas, the page scrolls. */
@media (max-width: 1080px) {
  body { overflow: auto; height: auto; min-height: 100%; }
  .body {
    grid-template-columns: 196px minmax(0, 1fr);
    grid-template-areas: "palette stage" "inspector inspector";
    padding-bottom: 46px;
  }
  .palette { grid-area: palette; max-height: 74vh; }
  .stage { grid-area: stage; height: 74vh; min-height: 360px; }
  .inspector {
    grid-area: inspector;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    align-items: start;
    padding: 0;
  }
}

/* Phone: one column. The pieces become a strip you swipe sideways; tap a
   piece, then tap the level to drop it. */
@media (max-width: 720px) {
  header.ed-header { padding: 8px 10px 2px; gap: 8px 10px; }
  .ed-brand.site-brand img { width: 70px; }
  .ed-title .brand { font-size: 15px; }
  .ed-title .brand small { font-size: 12px; }
  .ed-actions { margin-left: 0; justify-content: flex-start; width: 100%; gap: 8px 10px; }
  .ed-group { gap: 8px; }
  :root .btn { font-size: 9.5px; padding: 6px 8px 5px; }
  .ed-stagebar { margin: 4px 8px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; }
  .ed-stagebar .ed-stagebar-title { grid-column: 1 / -1; }
  .ed-stagebar label.inline { justify-content: space-between; white-space: normal; }
  .ed-stagebar label.inline input.text { width: 92px !important; min-width: 0; }
  .ed-stagebar label.inline.lv-name-label, .ed-stagebar label.inline.lv-star-label { grid-column: 1 / -1; }
  .ed-stagebar label.inline.lv-star-label { justify-content: flex-start; }
  .ed-stagebar label.inline.lv-name-label input.text { width: 100% !important; max-width: 220px; }
  #publish-status { grid-column: 1 / -1; margin: 0; }
  .body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "palette" "stage" "inspector";
    gap: 12px;
    padding: 10px 8px 46px;
  }
  .palette {
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    gap: 14px;
    padding: 8px 10px 10px;
  }
  .palette .pal-head, .palette .pal-tip { display: none; }
  .pal-group { flex: 0 0 auto; }
  .palette h4 { margin: 0 0 6px; font-size: 12.5px; }
  .pal-tiles { flex-direction: row; gap: 10px; }
  .pal-item { grid-template-columns: 1fr; justify-items: center; width: 74px; padding: 5px 4px 4px; text-align: center; }
  .pal-item .nm { font-size: 11.5px; line-height: 1.05; }
  .pal-item .hint { display: none; }
  .stage { height: 52vh; min-height: 300px; }
  .stage-tools { gap: 6px 10px; }
  .stage-tools .hint-line { display: none; }
  .stage-tools .zoom-wrap input[type="range"] { width: 90px; }
  .inspector { grid-template-columns: minmax(0, 1fr); }
  .prop { grid-template-columns: minmax(0, 1fr) 110px; }
  .modal-backdrop { padding: 8px; }
  .modal { width: 100%; max-height: 94vh; }
  .lib-grid { grid-template-columns: minmax(0, 1fr); }
  .order-row { flex-wrap: wrap; }
  .order-row canvas { display: none; }
  .pd-card { padding: 14px 12px; }
  .pd-card h3 { font-size: 16px; }
}

/* =========================================================================
 * Saving, signing in and SECRET ROOMS (2026-10).
 * ------------------------------------------------------------------------ */

/* The player designer (?design=1) never shows admin-only controls. */
body.player-mode .admin-only { display: none !important; }

/* Signed in? — under the title, next to "← Admin". */
.ed-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.auth-chip {
  font: 700 12.5px/1.15 var(--ed-body);
  padding: 4px 9px;
  border: 0;
  cursor: pointer;
  color: var(--ed-navy);
  background: #fff;
  box-shadow: 0 0 0 2px var(--ed-ink), 3px 3px 0 0 var(--ed-lip);
  white-space: nowrap;
}
.auth-chip.out { background: var(--ed-yellow); }
.auth-chip.bad { background: #ffb0a4; color: #6d0f0b; }
.auth-chip.ok { background: rgba(255, 255, 255, 0.86); font-weight: 700; }
.auth-chip:hover { background: var(--ed-yellow-hi); }
.auth-chip:focus-visible { outline: 2px dashed #fff; outline-offset: 4px; }

/* Which library level Save writes to, and whether anything is unsaved. */
.id-chip, .dirty-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font: 700 12px/1.15 var(--ed-body);
  padding: 3px 8px;
  white-space: nowrap;
  max-width: 340px; overflow: hidden; text-overflow: ellipsis;
}
.id-chip { color: #fff; background: var(--ed-blue-2); box-shadow: inset 0 0 0 2px var(--ed-blue-hi); }
.id-chip.live { background: #1c7f4a; box-shadow: inset 0 0 0 2px #6ad98a; }
.id-chip.warn { color: var(--ed-navy); background: #fff3c4; box-shadow: inset 0 0 0 2px var(--ed-yellow-lo); }
.dirty-chip { color: #3b1700; background: #ffb547; box-shadow: inset 0 0 0 2px #c46a00; animation: dirty-pulse 1.6s steps(2) infinite; }
@keyframes dirty-pulse { 50% { background: #ffd287; } }
@media (prefers-reduced-motion: reduce) { .dirty-chip { animation: none; } }

/* Editing a secret room: the bar turns teal so it is never mistaken for the stage. */
body.room-mode .ed-stagebar { background: #0d4a52; box-shadow: inset 0 3px 0 0 rgba(125, 255, 217, 0.25), inset 0 0 0 2px #7dffd9, 5px 5px 0 0 var(--ed-lip); }
body.room-mode .ed-stagebar .ed-stagebar-title { color: #7dffd9; font-size: 12px; }
body.room-mode .stage { box-shadow: inset 0 0 0 4px #7dffd9; }
#btn-back-stage { margin-bottom: 4px; }
.ed-stagebar select.text { min-width: 170px; }

/* The question dialog sits above the level browser. */
.ask-backdrop { z-index: 120; }
.ask-modal { width: min(520px, 94vw); }
.ask-text p { margin: 0 0 8px; font-size: 14px; line-height: 1.4; color: #fff; }
.ask-text p.muted { color: var(--ed-text-2); font-size: 12.5px; }
.ask-field { display: flex; flex-direction: column; gap: 5px; color: #fff; font: 700 13px var(--ed-body); }
.ask-field input { width: 100%; }
.ask-error { min-height: 1.2em; margin: 6px 0 0; color: var(--ed-yellow-hi); font: 700 13px var(--ed-body); }
.ask-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; padding: 10px 14px 14px; border-top: 3px solid var(--ed-navy); }

/* Inspector extras. */
.insp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 2px 0 6px; }
.insp-hero .sw.door-sw { font-size: 28px; }
.prop textarea { width: 100%; resize: vertical; min-height: 40px; font: 700 13px/1.25 var(--ed-body); }
.prop small .cnt, .cnt { color: var(--ed-yellow-hi); font-weight: 700; }
label.inline.all-opts { display: flex; margin: 4px 0 12px; }
.prop input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; border: 0; box-shadow: none; background: none; justify-self: start; accent-color: var(--ed-yellow); }
.room-sum { margin: 0 0 8px; padding: 6px 8px; background: var(--ed-navy); box-shadow: inset 0 0 0 2px #7dffd9; }
.room-sum b { display: block; color: #7dffd9; font: 700 14px/1.2 var(--ed-sub); }
.room-sum small { color: var(--ed-text-2); font-size: 12px; }

/* The Secret rooms card. */
.room-card h3 { color: #7dffd9; }
.room-row { display: grid; gap: 6px; margin: 0 0 9px; padding: 7px 8px; background: var(--ed-navy); box-shadow: inset 0 0 0 2px var(--ed-ink); }
.room-row b { display: block; color: #fff; font: 700 14px/1.2 var(--ed-sub); }
.room-row small { display: block; color: var(--ed-text-2); font-size: 12px; line-height: 1.3; }
.rr-acts, .room-mode-acts { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.room-mode-acts { margin: 0 0 6px; }
.room-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.room-add select { flex: 1 1 140px; min-width: 0; padding: 5px 6px; font: 700 13px var(--ed-body); }
.room-counts { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 8px; color: var(--ed-text-2); font-size: 12.5px; }
.room-counts b { color: #fff; }
.room-counts .over, .room-counts .over b { color: #ffb0a4; }

/* Room pieces in the palette: compact tiles, three to a row. */
.pal-room-head {
  display: flex; flex-direction: column; gap: 2px;
  margin: 2px 0 6px; padding: 6px 8px;
  background: #0d4a52; box-shadow: inset 0 0 0 2px #7dffd9;
}
.pal-room-head b { color: #7dffd9; font: 400 10.5px/1.2 var(--ed-heading); }
.pal-room-head span { color: #fff; font: 700 13px var(--ed-sub); }
details.room-group > summary { list-style: none; cursor: pointer; }
details.room-group > summary::-webkit-details-marker { display: none; }
details.room-group > summary h4 { display: flex; align-items: center; gap: 6px; }
details.room-group > summary h4::before { content: "▸"; color: #fff; font-size: 11px; }
details.room-group[open] > summary h4::before { content: "▾"; }
details.room-group > summary h4 .cnt { color: var(--ed-text-2); font: 700 11px var(--ed-body); text-shadow: none; }
.pal-tiles.compact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 7px; }
.pal-item.compact { grid-template-columns: 1fr; justify-items: center; gap: 2px; padding: 4px 2px 3px; text-align: center; }
.pal-item.compact .sw { width: 46px; height: 46px; background: #2a3b55; box-shadow: inset 0 0 0 2px var(--ed-navy); }
.pal-item.compact .sw canvas { width: 44px; height: 44px; }
.pal-item.compact .nm { font: 700 11px/1.05 var(--ed-body); word-break: break-word; }
@media (max-width: 720px) {
  .pal-tiles.compact { display: flex; }
  .pal-item.compact { width: 64px; }
}
.lib-grid > .lib-sec { grid-column: 1 / -1; margin: 10px 0 -4px; color: var(--ed-yellow); font: 700 15px/1.2 var(--ed-sub); text-shadow: 2px 2px 0 var(--ed-navy); }

/* Junk monster anger presets (the Size slider's quick picks). */
.anger-row .anger-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.anger-row .anger-btns .btn.on {
  outline: 3px solid #ffd200;
  outline-offset: 1px;
}

/* Stage art (admin only): signs, decor and furniture on a normal stage. */
.pal-room-head.stage-art-head { background: #4a3417; box-shadow: inset 0 0 0 2px #ffd27a; }
.pal-room-head.stage-art-head b { color: #ffd27a; }
.pal-room-head.stage-art-head span { font: 700 12px var(--ed-body); color: #fff3d6; }
details.stage-decor-root > .pal-tip { margin-top: 0; }
details.stage-decor-group { margin-left: 8px; }
details.stage-decor-group > summary h4 { font-size: 13px; margin: 8px 0 6px; }
.pal-item.compact[data-kind="signpost"] .sw, .pal-item.compact[data-kind="signboard"] .sw,
.pal-item.compact[data-kind^="sdecor:"] .sw { background: #8fd3ff; }
.sign-board-row { margin: 0 0 10px; padding: 6px 8px 8px; background: var(--ed-navy); box-shadow: inset 0 0 0 2px #ffd27a; }
.sign-board-row .prop.wide { margin-bottom: 6px; }
.sign-board-opts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sign-board-opts select { flex: 1 1 120px; min-width: 0; padding: 4px 5px; font: 700 12.5px var(--ed-body); }
.sign-board-btns { display: flex; gap: 6px; margin-left: auto; }
.sign-board-btns .btn.sm { min-width: 30px; padding-left: 6px; padding-right: 6px; }
