/* STOP AND SEARCH — the workshop (web/workshop.html). The production render fills the frame; one bar says what is
 * being worked on and which view this is; one inspector rail holds what the current view needs (Edit: the building
 * and publishing it; Play: the room, the situation, the people). Amber is what you can do, teal is what is live. */
:root {
  --bone: #ece3d0; --bone-dim: rgba(236, 227, 208, .66); --bone-faint: rgba(236, 227, 208, .42); --bone-ghost: rgba(236, 227, 208, .1);
  --amber: #e6a13a; --amber-hot: #ffcf7a; --amber-wash: rgba(230, 161, 58, .14); --teal: #39d9cc; --teal-wash: rgba(57, 217, 204, .1); --alert: #ff6a5a;
  --ink: #07090a; --bar: #0a0d0f; --panel: #0c0f11; --raise: rgba(255, 255, 255, .035); --raise-hi: rgba(255, 255, 255, .07);
  --line: rgba(236, 227, 208, .08); --edge: rgba(236, 227, 208, .13); --edge-hi: rgba(236, 227, 208, .3);
  --display: "Barlow Condensed", "Bahnschrift SemiCondensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow Semi Condensed", "Avenir Next", "Roboto Condensed", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, Menlo, monospace;
  --ease-out: cubic-bezier(.2, .8, .2, 1); --bar-h: 52px; --panel-w: 360px; --r: 6px; --ctl: 32px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--bone); font: 500 13px/1.4 var(--text); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(230, 161, 58, .35); }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
:where(button, a, label, input, summary):focus-visible { outline: 2px solid var(--amber-hot); outline-offset: 2px; }

/* ---------------------------------------------------------------- the bar */
.bar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: var(--bar-h); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; padding: 0 12px 0 16px; background: var(--bar); border-bottom: 1px solid var(--line); box-shadow: 0 6px 22px rgba(0, 0, 0, .35); }
.bar-l, .bar-r { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bar-r { justify-content: flex-end; gap: 10px; }
.mark { display: inline-flex; align-items: center; gap: 10px; flex: none; color: inherit; text-decoration: none; }
.mark img { width: 26px; height: 26px; display: block; }
.mark span { display: flex; flex-direction: column; gap: 2px; }
.mark small { font: 600 8.5px/1 var(--text); letter-spacing: .32em; text-transform: uppercase; color: var(--bone-faint); }
.mark b { font: 700 16px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--bone); }
.mark:hover b { color: var(--amber-hot); }
.bar-sep { width: 1px; height: 26px; flex: none; background: var(--edge); }
.titleline { display: flex; align-items: center; gap: 10px; min-width: 0; }
.titleline input { width: clamp(150px, 20vw, 320px); min-width: 120px; max-width: min(30vw, 380px); height: 32px; padding: 0 8px; margin-left: -8px; border: 1px solid transparent; border-radius: var(--r); background: transparent; font: 600 18px/1 var(--display); letter-spacing: .03em; color: var(--bone); outline: none; text-overflow: ellipsis; transition: border-color .15s, background .15s; }
@supports (field-sizing: content) { .titleline input { width: auto; field-sizing: content; } }
.titleline input:hover { border-color: var(--line); }
.titleline input:focus { border-color: rgba(230, 161, 58, .55); background: var(--raise); }
.titleline input::placeholder { color: var(--bone-faint); }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 20px; padding: 0 7px; border-radius: 4px; font: 700 9.5px/1 var(--text); letter-spacing: .16em; text-transform: uppercase; color: var(--amber); border: 1px solid rgba(230, 161, 58, .45); white-space: nowrap; }
.chip.teal { color: var(--teal); border-color: rgba(57, 217, 204, .45); background: var(--teal-wash); }
.chip.dim { color: var(--bone-dim); border-color: var(--edge); }
.chip.alert { color: var(--alert); border-color: rgba(255, 106, 90, .5); background: rgba(255, 106, 90, .08); }

/* Edit | Play: the one switch that changes what the whole page is for */
.modes { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 9px; background: #050607; box-shadow: inset 0 0 0 1px var(--edge); }
.modes::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 6px; background: var(--amber); box-shadow: 0 2px 10px rgba(230, 161, 58, .3); transition: transform .32s var(--ease-out); }
body[data-mode="play"] .modes::before { transform: translateX(100%); }
.modes button { all: unset; position: relative; z-index: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 98px; height: 32px; font: 700 13px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--bone-dim); transition: color .2s; }
.modes button .i { width: 13px; height: 13px; }
.modes button.on { color: #15100a; }
.modes button:not(.on):hover { color: var(--bone); }
.modes button:focus-visible { outline: 2px solid var(--amber-hot); outline-offset: 1px; border-radius: 6px; }

.status { display: flex; align-items: center; gap: 9px; min-width: 0; }
.status i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--teal); color: var(--teal); box-shadow: 0 0 8px currentColor; }
.status[data-state="planning"] i { background: var(--amber); color: var(--amber); animation: pulse .9s ease-in-out infinite; }
.status[data-state="refused"] i, .status[data-state="invalid"] i, .status[data-state="error"] i { background: var(--alert); color: var(--alert); }
.status[data-state="paused"] i, .status[data-state="idle"] i { background: var(--bone-dim); color: transparent; }
.status span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.status b { font: 700 12.5px/1.05 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--bone); white-space: nowrap; }
.status small { max-width: 230px; font: 500 11px/1.15 var(--text); color: var(--bone-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status small:empty { display: none; }
.status[data-state="refused"] b, .status[data-state="invalid"] b, .status[data-state="error"] b { color: #ffb3aa; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.room-pill { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 230px; height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid rgba(57, 217, 204, .32); background: var(--teal-wash); font: 600 11.5px/1 var(--text); letter-spacing: .03em; color: var(--teal); }
.room-pill[hidden] { display: none; }
.room-pill i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.room-pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-pill[data-clock="paused"], .room-pill[data-clock="edit"] { color: var(--bone-dim); border-color: var(--edge); background: var(--raise); }
.tbtn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; flex: none; border-radius: var(--r); font: 700 11.5px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-dim); transition: color .15s, background .15s; }
.tbtn:hover { color: var(--bone); background: var(--raise-hi); }
.tbtn.icon { width: 32px; padding: 0; justify-content: center; }
body.panel-hidden #toggle-panel { color: var(--amber-hot); }

/* ---------------------------------------------------------------- the workspace: the canvas starts under the bar */
#work { position: fixed; inset: 0 var(--panel-w) 0 0; background: var(--ink); }
body.panel-hidden #work { right: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; outline: none; }
#scene.grab { cursor: grab; } #scene.grabbing { cursor: grabbing; } #scene.corner { cursor: move; } #scene.edge { cursor: ew-resize; } #scene.inside { cursor: move; } #scene.add { cursor: copy; }
#play { position: absolute; inset: var(--bar-h) 0 0 0; display: none; background: #000; }
#play.on { display: block; }
#play .ws-game { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
#play .ws-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
body[data-mode="play"] .noir-scene-surface, body[data-mode="play"] #scene { visibility: hidden; }
#hud { position: absolute; inset: 0; pointer-events: none; }

/* the footprint tools sit on the drawing, where the hand already is */
.dock { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 11px; background: rgba(10, 13, 15, .92); box-shadow: 0 12px 32px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--edge); pointer-events: auto; transition: opacity .2s, transform .3s var(--ease-out); }
.tools { display: flex; gap: 2px; }
.tools + .tools { padding-left: 5px; margin-left: 1px; border-left: 1px solid var(--line); }
.tool { all: unset; position: relative; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: var(--ctl); height: var(--ctl); border-radius: var(--r); color: var(--bone-dim); font: 600 12px/1 var(--text); letter-spacing: .04em; transition: color .15s, background .15s; }
.tool.wide { padding: 0 11px 0 9px; }
.tool:hover { color: var(--bone); background: var(--raise-hi); }
.tool:active { background: rgba(255, 255, 255, .11); }
.tool[disabled] { opacity: .3; cursor: default; background: none; color: var(--bone-dim); }
.tool:focus-visible { outline: 2px solid var(--amber-hot); outline-offset: 1px; }
.tool.toggle input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.tool.toggle:has(input:checked) { color: var(--amber-hot); background: var(--amber-wash); }
.tool.toggle:has(input:focus-visible) { outline: 2px solid var(--amber-hot); outline-offset: 1px; }
body[data-mode="play"] .dock, body.lobby .dock { opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(10px); }
.hints { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); display: flex; gap: 16px; white-space: nowrap; font: 500 11.5px/1 var(--text); letter-spacing: .03em; color: var(--bone-dim); text-shadow: 0 1px 3px #000, 0 0 12px rgba(0, 0, 0, .8); pointer-events: none; transition: opacity .2s; }
.hints span { display: inline-flex; align-items: center; gap: 6px; }
.hints kbd { display: inline-block; min-width: 18px; padding: 3px 5px 2px; border-radius: 4px; background: rgba(10, 13, 15, .85); box-shadow: inset 0 0 0 1px var(--edge-hi), inset 0 -1px 0 rgba(236, 227, 208, .25); font: 700 10.5px/1 var(--display); letter-spacing: .06em; text-align: center; color: var(--bone); text-shadow: none; }
body[data-mode="play"] .hints, body.lobby .hints { opacity: 0; }

/* play: a quiet word when the game cannot speak for itself */
.notice { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; max-width: min(620px, calc(100% - 40px)); padding: 9px 10px 9px 16px; border-radius: 10px; background: rgba(10, 13, 15, .94); box-shadow: 0 12px 32px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--edge), inset 3px 0 0 var(--bone-dim); pointer-events: auto; animation: drop .3s var(--ease-out); }
.notice[hidden] { display: none; }
.notice[data-tone="warn"] { box-shadow: 0 12px 32px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(230, 161, 58, .35), inset 3px 0 0 var(--amber); }
.notice[data-tone="alert"] { box-shadow: 0 12px 32px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 106, 90, .4), inset 3px 0 0 var(--alert); }
.notice > div:first-child { min-width: 0; }
.notice b { display: block; font: 700 14px/1.1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--bone); }
.notice small { display: block; margin-top: 3px; font: 500 12px/1.35 var(--text); color: var(--bone-dim); }
.notice-act { display: flex; gap: 6px; flex: none; }
.notice-act:empty { display: none; }
@keyframes drop { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }

.veil { position: absolute; inset: var(--bar-h) 0 0 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 46%, rgba(4, 8, 10, .45), rgba(4, 8, 10, .85) 78%); opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; pointer-events: auto; }
.veil.on { opacity: 1; visibility: visible; transition: opacity .25s; }
.veil .card { width: min(420px, 80vw); padding: 22px 26px 20px; border-radius: 14px; background: rgba(10, 13, 15, .94); box-shadow: 0 16px 44px rgba(0, 0, 0, .6), inset 0 0 0 1px var(--edge); text-align: center; }
.veil em { display: block; font: 600 10px/1 var(--text); letter-spacing: .3em; text-transform: uppercase; color: var(--teal); font-style: normal; }
.veil b { display: block; margin-top: 10px; font: 700 30px/.95 var(--display); letter-spacing: .1em; }
.veil p { margin: 10px 0 0; color: var(--bone-dim); }
.bar-run { position: relative; height: 3px; margin-top: 18px; overflow: hidden; border-radius: 2px; background: rgba(230, 161, 58, .18); }
.bar-run i { position: absolute; top: 0; bottom: 0; left: -30%; width: 30%; background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: run 1.3s linear infinite; }
.veil:not(.on) .bar-run i { animation: none; }
@keyframes run { to { left: 100%; } }

.toast { position: fixed; z-index: 60; left: calc((100vw - var(--panel-w)) / 2); bottom: 112px; transform: translateX(-50%) translateY(8px); max-width: min(560px, 60vw); padding: 10px 16px; border-radius: 10px; background: rgba(10, 13, 15, .95); box-shadow: 0 12px 32px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--edge); font: 600 12.5px/1.35 var(--text); letter-spacing: .02em; color: var(--bone); text-align: center; opacity: 0; transition: opacity .25s, transform .3s var(--ease-out); pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.alert { color: #ffc2ba; box-shadow: 0 12px 32px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 106, 90, .45); }
body.panel-hidden .toast, body.lobby .toast { left: 50%; }
body[data-mode="play"] .toast { bottom: auto; top: calc(var(--bar-h) + 16px); }

/* ---------------------------------------------------------------- the inspector */
#panel { position: fixed; z-index: 10; top: var(--bar-h); right: 0; bottom: 0; width: var(--panel-w); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); }
body.panel-hidden #panel { display: none; }
.pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
body[data-mode="edit"] #pane-edit, body[data-mode="play"] #pane-play { display: flex; animation: pane-in .28s var(--ease-out); }
@keyframes pane-in { from { opacity: 0; transform: translateX(10px); } }
.scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 20px 28px; scrollbar-width: thin; scrollbar-color: rgba(236, 227, 208, .16) transparent; }
#panel section { padding: 18px 0 20px; border-top: 1px solid var(--line); }
#panel .scroll > section:first-child { border-top: 0; }
#panel section[hidden] { display: none; }
#panel h2 { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 8px; font: 600 10.5px/1 var(--text); letter-spacing: .2em; text-transform: uppercase; color: var(--bone-faint); }
#panel section > h2:first-child, #panel .pair h2 { margin-top: 0; }
#panel h2 small { margin-left: auto; min-width: 0; font: 500 11.5px/1.2 var(--text); letter-spacing: .01em; text-transform: none; color: var(--bone-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* what the planner made of it: the headline of the editor */
.subject .eyebrow { display: flex; justify-content: space-between; gap: 12px; font: 600 10.5px/1 var(--text); letter-spacing: .18em; text-transform: uppercase; color: var(--bone-dim); }
#sec-room .eyebrow { color: var(--teal); }
.subject .eyebrow span:last-child { color: var(--bone-faint); letter-spacing: .08em; }
.subject-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 10px; }
.subject-head b { min-width: 0; font: 700 26px/1.02 var(--display); letter-spacing: .02em; color: var(--bone); overflow-wrap: anywhere; }
.subject-head b::first-letter { text-transform: uppercase; }
.subject-head b.bad { color: #ffb3aa; }
.subject-head .chip { margin-top: 4px; }
.why { margin: 7px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--bone-dim); }
.why::first-letter { text-transform: uppercase; }
.why.bad { color: #ffb3aa; }
.rooms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.rooms:empty { display: none; }
.rooms span { padding: 4px 7px 3px; border-radius: 4px; background: var(--teal-wash); font: 600 10.5px/1.1 var(--text); letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.meter { display: grid; grid-template-columns: 1fr 1fr 1fr; margin-top: 16px; border-top: 1px solid var(--line); }
.meter div { padding: 10px 0 0; }
.meter div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.meter em { display: block; font: 600 9.5px/1 var(--text); letter-spacing: .2em; text-transform: uppercase; color: var(--bone-faint); font-style: normal; }
.meter b { display: block; margin-top: 6px; font: 600 21px/1 var(--display); letter-spacing: .02em; color: var(--bone); font-variant-numeric: tabular-nums; }

/* choices: equal cells, one lit */
.options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.options button, .shapes button { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: center; height: 30px; padding: 0 8px; border-radius: var(--r); background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); font: 600 12.5px/1 var(--text); letter-spacing: .02em; color: var(--bone-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s, background .15s, box-shadow .15s; }
.options button span { overflow: hidden; text-overflow: ellipsis; }
.options button:hover, .shapes button:hover { color: var(--bone); background: var(--raise-hi); box-shadow: inset 0 0 0 1px var(--edge-hi); }
.options button.on, .shapes button.on { color: var(--amber-hot); background: var(--amber-wash); box-shadow: inset 0 0 0 1px rgba(230, 161, 58, .75); }
.options button:focus-visible, .shapes button:focus-visible { outline: 2px solid var(--amber-hot); outline-offset: 1px; }
.shapes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.shapes button { height: 40px; padding: 0; }
.shapes button svg { display: block; width: 32px; height: 24px; }
.shapes .note { grid-column: 1 / -1; margin: 0; padding: 9px 11px; border-radius: var(--r); background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); }
.shapes .note b { color: var(--bone); font-weight: 600; }
.pair { display: grid; grid-template-columns: 1fr auto; gap: 18px; margin: 18px 0 0; }
.line { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.pair .line { margin-top: 0; }
.grow { flex: 1; }
.stepper { display: inline-flex; align-items: stretch; height: var(--ctl); border-radius: var(--r); background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.stepper button { all: unset; cursor: pointer; width: 30px; display: grid; place-items: center; font: 600 17px/1 var(--display); color: var(--bone-dim); transition: color .15s, background .15s; }
.stepper button:hover { color: var(--amber-hot); background: var(--raise-hi); }
.stepper button[disabled] { opacity: .3; cursor: default; background: none; color: var(--bone-dim); }
.stepper b { display: grid; place-items: center; min-width: 50px; padding: 0 8px; font: 600 17px/1 var(--display); letter-spacing: .04em; font-variant-numeric: tabular-nums; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.pair .tool { background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); }
.pair .tool:hover { color: var(--amber-hot); }
.field { width: 100%; height: 34px; padding: 0 11px; border: 0; border-radius: var(--r); background: var(--raise); box-shadow: inset 0 0 0 1px var(--edge); color: var(--bone); font: 500 13px/1 var(--text); outline: none; transition: box-shadow .15s, background .15s; }
.field::placeholder { color: var(--bone-faint); }
.field:hover { box-shadow: inset 0 0 0 1px var(--edge-hi); }
.field:focus { background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(230, 161, 58, .7), 0 0 0 3px rgba(230, 161, 58, .12); }
.field[readonly] { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--bone-dim); }

/* buttons */
.btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--r); background: var(--raise); box-shadow: inset 0 0 0 1px var(--edge); font: 700 12px/1 var(--display); letter-spacing: .13em; text-transform: uppercase; color: var(--bone); white-space: nowrap; transition: background .15s, box-shadow .15s, color .15s, transform .1s; }
.btn .i { width: 14px; height: 14px; }
.btn:hover { background: var(--raise-hi); box-shadow: inset 0 0 0 1px var(--edge-hi); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--amber); box-shadow: 0 4px 14px rgba(230, 161, 58, .22); color: #15100a; }
.btn.primary:hover { background: var(--amber-hot); }
.btn.primary.wait { opacity: .5; box-shadow: none; } /* clickable: it says why it is not ready */
.btn.quiet { background: transparent; box-shadow: none; color: var(--bone-dim); }
.btn.quiet:hover { color: var(--bone); background: var(--raise-hi); }
.btn.small { height: 28px; padding: 0 10px; font-size: 11px; }
.btn[disabled], .btn[disabled]:hover { opacity: .38; cursor: default; transform: none; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); color: var(--bone-dim); }
.btn:focus-visible { outline: 2px solid var(--amber-hot); outline-offset: 2px; }
.link { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font: 600 11px/1 var(--text); letter-spacing: .04em; text-transform: none; color: var(--bone-faint); transition: color .15s; }
.link .i { width: 12px; height: 12px; }
.link:hover { color: var(--amber-hot); }

/* segmented groups: actions side by side, one surface */
.seg { display: flex; min-width: 0; border-radius: var(--r); background: var(--raise); box-shadow: inset 0 0 0 1px var(--edge); overflow: hidden; }
.seg button { all: unset; cursor: pointer; flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 6px; font: 600 12px/1 var(--text); letter-spacing: .02em; color: var(--bone-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s, background .15s; }
.seg button + button { box-shadow: -1px 0 0 var(--line); }
.seg button .i { width: 12px; height: 12px; }
.seg button:hover { color: var(--bone); background: var(--raise-hi); }
.seg button:active { background: var(--amber-wash); color: var(--amber-hot); }
.seg button[disabled] { opacity: .35; cursor: default; background: none; color: var(--bone-dim); }
.seg button:focus-visible { outline: 2px solid var(--amber-hot); outline-offset: -2px; }
.seg.stars button { color: var(--amber); letter-spacing: -.04em; font-size: 11px; }
.seg.stars button:first-child { color: var(--bone-dim); }
.clock { margin-top: 2px; }
.clock button { height: 36px; font: 700 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; }
.clock button.on { color: var(--bone); background: rgba(236, 227, 208, .1); }
.clock #mode-play.on { color: var(--teal); background: var(--teal-wash); }
.ctl { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 6px; }
.ctl > label { font: 600 10px/1 var(--text); letter-spacing: .16em; text-transform: uppercase; color: var(--bone-faint); }
.ctl > .btn { justify-self: start; height: 30px; padding: 0 10px 0 8px; font-size: 11px; }

/* folds: sections that stay out of the way until they are wanted */
#panel .fold { padding: 0; }
.fold summary { list-style: none; cursor: pointer; padding: 16px 0; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary h2 { margin: 0 !important; transition: color .15s; }
.fold summary h2::after { content: ""; flex: none; width: 6px; height: 6px; margin: 0 2px 2px 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease-out); }
.fold details[open] summary h2::after { transform: rotate(45deg); }
.fold summary:hover h2 { color: var(--bone); }
.fold details[open] { padding-bottom: 20px; }
.fold details[open] > :not(summary) { animation: fade .22s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(-3px); } }

.search { position: relative; }
.search > .i { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--bone-faint); pointer-events: none; }
.search .field { padding-left: 32px; }
.search .results { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; max-height: 300px; overflow: auto; margin-top: 4px; padding: 4px; border-radius: 8px; background: #11161a; box-shadow: 0 14px 34px rgba(0, 0, 0, .55), inset 0 0 0 1px var(--edge); }
.search .results:empty { display: none; }
.search .results button { all: unset; cursor: pointer; display: block; box-sizing: border-box; width: 100%; padding: 8px 10px; border-radius: 5px; }
.search .results button:hover, .search .results button.on { background: var(--amber-wash); }
.search .results b { display: block; font: 600 14px/1.15 var(--display); letter-spacing: .03em; color: var(--bone); }
.search .results small { display: block; margin-top: 3px; font: 500 11px/1.35 var(--text); color: var(--bone-faint); }
.search .results small i { color: var(--alert); font-style: normal; }
.minimap { display: block; width: 100%; aspect-ratio: 600 / 340; margin-top: 10px; border-radius: var(--r); background: #0a0d0f; box-shadow: inset 0 0 0 1px var(--line); cursor: crosshair; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 7px; font: 500 11px/1 var(--text); color: var(--bone-faint); }
.legend .k { width: 8px; height: 8px; border-radius: 2px; margin-left: 6px; }
.legend .k:first-child { margin-left: 0; }
.legend .you { background: rgba(255, 179, 71, .95); } .legend .enter { background: rgba(57, 217, 204, .6); } .legend .other { background: rgba(236, 227, 208, .3); }
.note { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--bone-dim); }
.note:empty { display: none; }
.note.alert { color: #ffb3aa; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 12px 0 0; font: 500 12px/1.4 var(--text); }
.kv:empty { display: none; }
.kv dt { padding-top: 2px; font: 600 9.5px/1.4 var(--text); letter-spacing: .16em; text-transform: uppercase; color: var(--bone-faint); }
.kv dd { margin: 0; color: var(--bone); overflow-wrap: anywhere; }
.kv dd.dim, .kv .dim { color: var(--bone-dim); }
.kv.compact { margin: 12px 0 2px; }

.list { margin: 0; padding: 0; list-style: none; }
.list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list b { display: block; font: 600 15px/1.15 var(--display); letter-spacing: .03em; color: var(--bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list small { display: block; margin-top: 3px; font: 500 11px/1.3 var(--text); color: var(--bone-faint); overflow: hidden; text-overflow: ellipsis; }
.list li.pick { cursor: pointer; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: var(--r); transition: background .15s; }
.list li.pick:hover { background: var(--raise); }
.list li.pick:hover b { color: var(--amber-hot); }
.list li.pick + li.pick { border-top-color: transparent; }
#cases { margin-top: 10px; }
.list .x { all: unset; cursor: pointer; display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r); color: var(--bone-faint); }
.list .x:hover { color: var(--alert); background: rgba(255, 106, 90, .1); }
.list .x .i { width: 13px; height: 13px; }

/* the editor's one primary action */
.publish { flex: none; padding: 14px 20px 16px; background: #0f1316; border-top: 1px solid var(--edge); box-shadow: 0 -14px 28px rgba(0, 0, 0, .3); }
.pub-head b { display: block; font: 700 16px/1.1 var(--display); letter-spacing: .05em; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-head small { display: block; margin-top: 4px; font: 500 12px/1.35 var(--text); color: var(--bone-faint); }
.publish[data-sync="synced"] .pub-head small { color: var(--teal); }
.publish[data-sync="ahead"] .pub-head small { color: var(--amber-hot); }
.publish .line { margin-top: 11px; }
.publish .line .field { flex: 1; }
.conflict { margin: 0 0 12px; padding: 9px 11px; border-radius: var(--r); background: rgba(255, 106, 90, .1); box-shadow: inset 0 0 0 1px rgba(255, 106, 90, .38); font: 500 12px/1.4 var(--text); color: #ffc2ba; }
.conflict[hidden] { display: none; }

/* play: situations and people */
.situations { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.situations button { all: unset; cursor: pointer; display: block; padding: 10px 12px 11px; border-radius: 8px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); transition: background .15s, box-shadow .15s, transform .1s; }
.situations button b { display: block; font: 700 14.5px/1.1 var(--display); letter-spacing: .04em; color: var(--bone); }
.situations button small { display: -webkit-box; margin-top: 4px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 500 11.5px/1.35 var(--text); color: var(--bone-faint); }
.situations button:hover { background: var(--raise-hi); box-shadow: inset 0 0 0 1px rgba(230, 161, 58, .6); }
.situations button:hover b { color: var(--amber-hot); }
.situations button:active { transform: translateY(1px); }
.situations button[disabled] { opacity: .38; cursor: default; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); transform: none; }
.situations button[disabled] b { color: var(--bone-dim); }
.situations button:focus-visible { outline: 2px solid var(--amber-hot); outline-offset: 2px; }
.adjust { margin-top: 14px; border-top: 1px solid var(--line); }
.adjust summary { list-style: none; cursor: pointer; padding: 14px 0 6px; }
.adjust summary::-webkit-details-marker { display: none; }
.adjust summary h2 { margin: 0 !important; transition: color .15s; }
.adjust summary h2::after { content: ""; flex: none; width: 6px; height: 6px; margin: 0 2px 2px 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease-out); }
.adjust[open] summary h2::after { transform: rotate(45deg); }
.adjust summary:hover h2 { color: var(--bone); }
.adjust[open] > .ctl { animation: fade .22s ease-out; }
#scenario-note { margin-top: 12px; padding: 8px 10px; border-radius: var(--r); background: var(--raise); font-size: 11.5px; }
.people li { grid-template-columns: auto minmax(0, 1fr) auto; }
.people .av { position: relative; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--bone-ghost); font: 700 14px/1 var(--display); color: var(--bone); text-transform: uppercase; }
.people .av::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--bone-faint); box-shadow: 0 0 0 2px var(--panel); }
.people .av.online::after { background: var(--teal); }
.people small em { font-style: normal; color: var(--amber); }
.people small em.host { color: var(--amber-hot); }
.people .me b::after { content: " · you"; font: 500 11px var(--text); color: var(--bone-faint); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pills label { position: relative; cursor: pointer; }
.pills input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.pills span { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--edge); font: 600 11.5px/1 var(--text); color: var(--bone-dim); transition: color .15s, background .15s, box-shadow .15s; }
.pills input:checked + span { color: var(--amber-hot); background: var(--amber-wash); box-shadow: inset 0 0 0 1px rgba(230, 161, 58, .6); }
.pills input:focus-visible + span { outline: 2px solid var(--amber-hot); outline-offset: 1px; }
.pills.single { position: relative; flex: none; }
#sec-dev .line .seg { flex: 1; }
.feed { margin: 10px 0 0; padding: 6px 8px; max-height: 260px; overflow: auto; list-style: none; border-radius: var(--r); background: #080a0b; font: 500 11px/1.45 var(--mono); color: var(--bone-dim); }
.feed:empty { display: none; }
.feed li { padding: 2px 0; border-top: 1px solid rgba(236, 227, 208, .05); white-space: pre-wrap; word-break: break-word; }
.feed li.trace { color: var(--teal); } .feed li.radio { color: var(--amber-hot); } .feed li.bad { color: var(--alert); }

/* ---------------------------------------------------------------- the lobby: the way in, over the live picture */
#lobby { position: fixed; z-index: 30; inset: 0; display: flex; flex-direction: column; background: linear-gradient(90deg, rgba(6, 8, 9, .97) 0%, rgba(6, 8, 9, .9) 40%, rgba(6, 8, 9, .84) 100%); opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
#lobby.on { opacity: 1; visibility: visible; transition: opacity .28s; }
/* the lobby is its own screen: the editor's chrome steps back, the live picture stays behind it */
#bar, #panel { transition: opacity .2s; }
body.lobby #bar, body.lobby #panel { opacity: 0; visibility: hidden; }
.lobby-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--bar-h); padding: 0 16px; border-bottom: 1px solid var(--line); }
.lobby-actions { display: flex; gap: 8px; }
.lobby-actions .btn .i { width: 13px; height: 13px; }
.lobby-body { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 0 clamp(32px, 4vw, 64px); width: 100%; max-width: 1440px; margin: 0 auto; padding: clamp(28px, 6vh, 64px) clamp(24px, 4vw, 56px) 48px; align-content: start; }
#lobby h1 { margin: 0; font: 700 clamp(44px, 6.4vh, 64px)/.92 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--bone); }
#lobby h1 small { display: block; margin-top: 12px; font: 600 12px/1.3 var(--text); letter-spacing: .24em; text-transform: uppercase; color: var(--teal); }
#lobby .lead { margin: 18px 0 0; max-width: 46ch; font-size: 14.5px; line-height: 1.5; color: var(--bone-dim); }
#lobby h3 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; font: 600 10.5px/1 var(--text); letter-spacing: .22em; text-transform: uppercase; color: var(--bone-faint); }
.lobby-block { margin-top: 36px; }
.lobby-main { min-width: 0; padding-top: 6px; }
.roomlist { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.roomlist li { grid-template-columns: minmax(0, 1fr) auto auto; margin: 0 -8px; padding: 10px 8px; }
.roomlist li:not(.pick) { margin: 0; padding: 12px 0; }
.roomlist li b { font-size: 16px; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.presets button { all: unset; cursor: pointer; display: flex; flex-direction: column; min-width: 0; border-radius: 10px; background: rgba(14, 18, 21, .82); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; transition: box-shadow .2s, transform .25s var(--ease-out), background .2s; }
.presets .plate { display: grid; place-items: center; height: 92px; background: linear-gradient(rgba(236, 227, 208, .035) 1px, transparent 1px) 0 0 / 12px 12px, linear-gradient(90deg, rgba(236, 227, 208, .035) 1px, transparent 1px) 0 0 / 12px 12px, #0a0d0f; border-bottom: 1px solid var(--line); color: rgba(230, 161, 58, .85); transition: color .2s; }
.presets svg { display: block; width: 120px; height: 62px; }
.presets .copy { padding: 12px 14px 14px; }
.presets em { display: block; font: 600 10px/1 var(--text); letter-spacing: .18em; text-transform: uppercase; color: var(--bone-faint); font-style: normal; }
.presets b { display: block; margin-top: 7px; font: 700 18px/1.05 var(--display); letter-spacing: .03em; color: var(--bone); }
.presets .tag { display: block; margin-top: 4px; font: 600 11px/1.2 var(--text); letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.presets small { display: block; margin-top: 8px; font: 500 12px/1.4 var(--text); color: var(--bone-dim); }
.presets button:hover { background: rgba(18, 23, 27, .92); box-shadow: inset 0 0 0 1px rgba(230, 161, 58, .65), 0 14px 30px rgba(0, 0, 0, .35); transform: translateY(-2px); }
.presets button:hover .plate { color: var(--amber-hot); }
.presets button:focus-visible { outline: 2px solid var(--amber-hot); outline-offset: 2px; }
#lobby.on .lobby-side > *, #lobby.on .presets button { animation: rise .45s var(--ease-out) both; }
#lobby.on .lobby-side > :nth-child(2) { animation-delay: .04s; } #lobby.on .lobby-side > :nth-child(3) { animation-delay: .08s; } #lobby.on .lobby-side > :nth-child(4) { animation-delay: .12s; }
#lobby.on .presets button { animation-delay: calc(var(--i, 0) * 30ms + 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------------------------------------------------------------- narrower desktops */
@media (max-width: 1360px) { .tbtn span { display: none; } .tbtn { width: 32px; padding: 0; justify-content: center; } .status small { max-width: 170px; } }
@media (max-width: 1200px) { :root { --panel-w: 330px; } .mark span { display: none; } .room-pill { max-width: 150px; } .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hints span:nth-child(n+4) { display: none; } }
@media (max-width: 960px) { .lobby-body { grid-template-columns: 1fr; } .lobby-main { padding-top: 36px; } .status small { display: none; } .titleline .chip { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; } }
