/* build 84efa6d · main · 2026-09-06T09:14:24Z · e6b4dbc1 */
/* The config screen.
 *
 * A tech-facing screen, not an audience-facing one, so it is deliberately plain:
 * legible from arm's length on a 50" panel, with touch targets a gloved hand can
 * hit, and nothing decorative. It sits above everything else because it is
 * reached by a gesture from whatever is already on the glass.
 *
 * The four-digit setup pad specced in docs/specs/2026-09-04-setup-screen.md
 * replaces the input below when it is built; this is the screen that makes a
 * panel bindable in the meantime, and it is the same config.js underneath. */

/* A right-anchored sidebar, not a full screen.
 *
 * It is reached by swiping in from the right edge — ScreenCloud's convention,
 * which the techs running these panels already have in their hands — so it comes
 * from the side the finger came from. A panel that slides in from where you
 * pushed reads as the thing you pulled; one that replaces the whole screen reads
 * as something that went wrong. */
.cfg-screen {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(620px, 92vw);
  z-index: 100;
  overflow-y: auto;
  background: #14141a;
  color: #f4f4f6;
  font: 400 clamp(16px, 1.6vh, 26px)/1.5 system-ui, sans-serif;
  padding: 4vh 5vh;
  border-left: 1px solid #2c2c36;
  box-shadow: -24px 0 60px rgb(0 0 0 / 45%);
}

/* 🔴 NO ENTRANCE ANIMATION, and that is a decision rather than an omission.
 *
 * This panel first shipped with `animation: cfg-slide-in 180ms` sliding in from
 * `translateX(100%)`. Opened on a hidden page it rendered **entirely off-screen**:
 * measured `playState: "running"`, `currentTime: 0`, `transform: translateX(620px)`
 * — a hidden page is served no animation frames, so the clock never advanced and
 * the panel stayed parked at frame 0.
 *
 * This is finding X a second time. That one hung boot on a `requestAnimationFrame`
 * that never fired; this one hid the config screen from a tech who had just asked
 * for it. Same root cause, different symptom, and the general rule is the one
 * worth keeping: **never let an animation be responsible for where something ends
 * up.** A fade would fail the same way — frame 0 is `opacity: 0`.
 *
 * On a foreground kiosk it resolved in 180ms and would have looked fine in every
 * test that happened to be watching. */

.cfg {
  display: flex;
  flex-direction: column;
  gap: 0.9em;
}

/* Full width and taller than the paired buttons below it: this is the control a
 * tech reaches for most, and after a publish it is the only one they want. */
.cfg .reload {
  font: inherit;
  font-size: 1.1em;
  min-height: 88px;
  margin-top: 0.4em;
  border-radius: 10px;
  border: 1px solid #3a3a46;
  background: #2a2a34;
  color: inherit;
  cursor: pointer;
}

.cfg .reload:disabled { opacity: 0.55; cursor: default; }

.cfg h1 {
  margin: 0 0 0.4em;
  font-size: 1.7em;
  font-weight: 600;
}

/* Label left, value right, with the value in a monospace face: a tech comparing
 * two panels is reading hashes and ULIDs, where proportional digits are the
 * difference between a match and a near-match. */
.cfg .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  padding: 0.45em 0;
  border-bottom: 1px solid #2c2c36;
}

.cfg .row span { color: #a0a0ad; }

.cfg .row b {
  font-weight: 500;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  font-size: 0.92em;
  text-align: right;
  overflow-wrap: anywhere;
}

.cfg label {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  margin-top: 0.8em;
  color: #a0a0ad;
}

.cfg input {
  font: inherit;
  font-size: 1.3em;
  padding: 0.5em 0.6em;
  border-radius: 8px;
  border: 1px solid #3a3a46;
  background: #1e1e26;
  color: inherit;
}

.cfg details { color: #a0a0ad; }
.cfg details summary { cursor: pointer; padding: 0.5em 0; }
.cfg details input { width: 100%; box-sizing: border-box; margin-bottom: 0.5em; }

/* Errors are the point of this screen: a tech on a lobby floor cannot debug a
 * silent failure, so a bad code says why in a colour that carries across a hall. */
.cfg .err {
  margin: 0;
  color: #ff8a8a;
}

.cfg .actions {
  display: flex;
  gap: 0.8em;
  margin-top: 0.6em;
}

.cfg .actions button {
  font: inherit;
  font-size: 1.1em;
  /* 88px minimum: the same thumb-target floor the board's hit areas use. */
  min-height: 88px;
  flex: 1;
  padding: 0 1.2em;
  border-radius: 10px;
  border: 1px solid #3a3a46;
  background: #2a2a34;
  color: inherit;
  cursor: pointer;
}

.cfg .actions button:first-child {
  background: #f4f4f6;
  border-color: #f4f4f6;
  color: #14141a;
  font-weight: 600;
}
