/* The app's own styles. Build on the Låda Glass tokens (var(--lg-…)) and lg- components; animate
   only with --lg-dur-* and keep a prefers-reduced-motion rule for any animation added here. */
html, body { height: 100%; margin: 0; }
/* hidden always hides, whatever display a Låda Glass class (lg-stack, lg-btn…) gives the element. */
[hidden] { display: none !important; }
body { background: var(--lg-bg); overflow: hidden; }

.app {
  display: grid; height: 100vh; height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "toolbar" "dock";
  gap: var(--lg-space-s); padding: var(--lg-space-s);
  padding-left: max(var(--lg-space-s), env(safe-area-inset-left));
  padding-right: max(var(--lg-space-s), env(safe-area-inset-right));
  padding-top: max(var(--lg-space-s), env(safe-area-inset-top));
  padding-bottom: max(var(--lg-space-s), env(safe-area-inset-bottom));
  box-sizing: border-box;
}
.toolbar { grid-area: toolbar; }
/* The Props panel and the Inspector dock left, right or under the view (Låda Glass dock). */
.app-dock { grid-area: dock; }
.library, .inspector { position: relative; overflow: auto; }
.viewport-wrap { position: relative; min-width: 0; min-height: 0;
  border-radius: var(--lg-radius-card); overflow: hidden; border: 1px solid var(--lg-border); }
#viewport { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#viewport:focus-visible { box-shadow: inset 0 0 0 2px var(--lg-accent); }
.side-head, .settings-head { min-height: 36px; }
/* A folded panel in a rail shows only its buttons, without its glass. */
.lg-dock[data-folded] .library, .lg-dock[data-folded] .inspector { -webkit-backdrop-filter: none; backdrop-filter: none; }
.library .panel-title, .inspector .panel-title, .side-head { padding-right: 68px; }   /* room for the dock's move and fold buttons */
.side-head .panel-title { padding-right: 0; }
.settings-head { padding-right: 68px; }
.settings-tabs { display: flex; margin-bottom: var(--lg-space-m); }
.settings-foot { position: sticky; bottom: calc(-1 * var(--lg-space-m)); display: flex; justify-content: flex-end; margin: var(--lg-space-m) calc(-1 * var(--lg-space-m)) calc(-1 * var(--lg-space-m));
  padding: var(--lg-space-s) var(--lg-space-m); background: color-mix(in srgb, var(--lg-bg) 88%, transparent); border-top: 1px solid var(--lg-border); }
.settings-foot .lg-btn { min-width: 96px; }
.settings-tabs .lg-tab { flex: 1; }
.vis-group { border: 1px solid var(--lg-border); border-radius: var(--lg-radius-control); padding: 6px 10px 8px; margin: 0 0 var(--lg-space-s); min-width: 0; }
.vis-head { display: flex; align-items: center; justify-content: space-between; gap: var(--lg-space-s); width: 100%; padding: 0; float: left; min-height: 36px; }
.vis-name { font-weight: 600; color: var(--lg-text); }
.vis-items { clear: both; display: grid; gap: 0; }
.vis-item { display: flex; align-items: center; gap: 8px; min-height: 36px; color: var(--lg-text); cursor: pointer; }
.vis-item input { width: 18px; height: 18px; accent-color: var(--lg-accent); }
.vis-item:has(input:disabled) { color: var(--lg-muted); cursor: default; }
@media (pointer: coarse) { .vis-item, .vis-head { min-height: 44px; } }
.lib-marking .lib-name { display: inline-flex; align-items: center; gap: 6px; }
.lib-marking .lib-name svg { width: 16px; height: 16px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--lg-space-s); margin-bottom: var(--lg-space-s); }
.proj-actions { display: grid; gap: 4px; }
.proj-actions .lg-btn { justify-content: flex-start; }
.projects-panel .proj-row { display: grid; gap: 6px; }
.projects-panel .proj-buttons { flex-wrap: wrap; }
/* The plan window: nearly the whole screen, tools beside the plan, the plan scaled to fit its box. */
.plan-modal { width: calc(100vw - 32px); max-width: none; height: calc(100dvh - 32px); max-height: none; }
.plan-modal[open] { display: flex; flex-direction: column; }
.plan-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: var(--lg-space-l, 20px); overflow: hidden; }
.plan-sidebar { overflow: auto; display: flex; flex-direction: column; gap: var(--lg-space-m); padding-right: 4px; }
.plan-box { min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; background: color-mix(in srgb, var(--lg-text) 6%, transparent); border-radius: var(--lg-radius-control); }
.plan-canvas { display: block; border: 1px solid var(--lg-border); background: #fff; cursor: crosshair; touch-action: none; }
.plan-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.plan-tool[aria-pressed="true"] { outline: 2px solid var(--lg-accent); outline-offset: 1px; }
.plan-row { flex-wrap: wrap; gap: 6px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--lg-space-s); }
.plan-checks { display: flex; flex-wrap: wrap; gap: var(--lg-space-m); }
.plan-check { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
@media (max-width: 900px) { .plan-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .plan-sidebar { max-height: 38dvh; } }
.mine-actions { flex-wrap: wrap; }
.stage-library { display: grid; gap: var(--lg-space-s); margin-top: var(--lg-space-l); padding-top: var(--lg-space-m); border-top: 1px solid var(--lg-border); }
.stage-library-title { margin: 0; }
.stage-library .lg-select { width: 100%; }
.lib-stages { display: grid; gap: var(--lg-space-xs); }
.lib-stage { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--lg-border); border-radius: var(--lg-radius-control); background: var(--lg-surface); }
.lib-stage-summary { color: var(--lg-text); font-size: var(--lg-fs-small); line-height: 1.4; }
.lib-stage .lg-btn { justify-self: start; }

.small-screen { display: none; }
@media (max-width: 767px) {
  .app { display: none; }
  .small-screen { display: block; padding: var(--lg-space-xl); color: var(--lg-text); font: 15px/1.5 var(--lg-font); }
}

/* Panels */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--lg-space-s) var(--lg-space-m);
  padding: var(--lg-space-xs) var(--lg-space-m); border-radius: var(--lg-radius-card); }
.brand-name { font-weight: 650; color: var(--lg-text); margin-right: var(--lg-space-s); }
.toolgroup { display: flex; align-items: center; gap: 2px; }
.toolgroup.end { margin-left: auto; }
.tool { flex-direction: column; gap: 2px; min-width: 52px; padding: 4px 6px; font-size: var(--lg-fs-small); line-height: 1.1; }
.tool-text { flex-direction: row; min-width: 0; padding: 6px 8px; }
.tool[aria-pressed="true"], .lib-item[aria-pressed="true"] { background: color-mix(in srgb, var(--lg-accent) 22%, transparent);
  border-color: var(--lg-accent); color: var(--lg-text); }

.library, .inspector { padding: var(--lg-space-m); border-radius: var(--lg-radius-card); box-sizing: border-box; }
.panel-title { margin: 0 0 var(--lg-space-s); }
.library .lg-search { margin-bottom: var(--lg-space-m); }
.lib-section { margin-bottom: var(--lg-space-m); }
.lib-section .lg-label { margin: 0 0 var(--lg-space-xs); }
.lib-list { display: grid; gap: 4px; }
.lib-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; min-height: 40px;
  padding: 6px 10px; border-radius: var(--lg-radius-control); border: 1px solid var(--lg-border);
  background: var(--lg-surface); color: var(--lg-text); font: inherit; text-align: left; cursor: grab; }
.lib-item[hidden] { display: none; }
.lib-item:hover { border-color: color-mix(in srgb, var(--lg-accent) 55%, var(--lg-border)); }
.lib-item:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: 1px; }
.lib-name { font-size: var(--lg-fs-body); }
.lib-size { font-size: var(--lg-fs-small); }

.inspector .lg-field { margin-bottom: var(--lg-space-s); }
.inspector .lg-field .lg-input, .inspector .lg-field .lg-select { width: 100%; box-sizing: border-box; }
.rot-row { gap: var(--lg-space-xs); flex-wrap: nowrap; }
.rot-row .lg-input { flex: 1; min-width: 0; }
.panel-actions { gap: var(--lg-space-s); margin-top: var(--lg-space-m); flex-wrap: wrap; }
.hint-text { margin: 0 0 var(--lg-space-m); }
.stats { margin-top: var(--lg-space-l); padding-top: var(--lg-space-m); border-top: 1px solid var(--lg-border); }
.stats-warn { margin-top: var(--lg-space-s); }
.rule-list { list-style: none; margin: var(--lg-space-s) 0 0; padding: 0; display: grid; gap: var(--lg-space-s); }
.rule-check { display: grid; grid-template-columns: auto 1fr auto; gap: var(--lg-space-s); align-items: start; }
.rule-badge { margin-top: 1px; min-width: 52px; justify-content: center; }
.rule-num { white-space: nowrap; }
.rule-show { min-height: 44px; padding-inline: var(--lg-space-m); }
.rule-passed { margin-top: var(--lg-space-s); }
.rule-passed summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }

.hint { position: absolute; left: 50%; bottom: max(var(--lg-space-m), env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--lg-space-s); flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 2 * var(--lg-space-m)); box-sizing: border-box;
  padding: var(--lg-space-s) var(--lg-space-m); border-radius: var(--lg-radius-card); color: var(--lg-text); }
.hint[hidden] { display: none; }

/* The Inspector under the view: its settings and the statistics side by side. */
#inspector[data-lg-dock-at="bottom"] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--lg-space-l); align-content: start; }
#inspector[data-lg-dock-at="bottom"] .stats { margin-top: 0; padding-top: 0; border-top: 0; }
#inspector[data-lg-dock-at="bottom"] > .lg-dock-tools { position: absolute; }

.camera-bar { position: absolute; top: var(--lg-space-s); left: var(--lg-space-s); display: flex; flex-wrap: wrap; gap: 2px;
  padding: 2px; border-radius: var(--lg-radius-control); max-width: calc(100% - 2 * var(--lg-space-s)); box-sizing: border-box; }
.camera-bar .lg-btn { font-size: var(--lg-fs-small); color: var(--lg-text); }
/* The view pad (top right): faint arrows over the view, firmer under the pointer or while held. */
.camera-pad { position: absolute; top: var(--lg-space-s); right: max(var(--lg-space-s), env(safe-area-inset-right)); display: flex; gap: var(--lg-space-s);
  align-items: center; user-select: none; -webkit-user-select: none; touch-action: none; }
.pad-cross { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); }
.pad-n { grid-area: 1 / 2; } .pad-w { grid-area: 2 / 1; } .pad-e { grid-area: 2 / 3; } .pad-s { grid-area: 3 / 2; }
.pad-cross .pad-label { grid-area: 2 / 2; align-self: center; justify-self: center; }
.pad-column { display: flex; flex-direction: column; align-items: center; min-width: 58px; }      /* room for FWD/BACK */
/* The view buttons wrap rather than run under the pad; in a narrow view the pad moves to the bottom right. */
.viewport-wrap { container: view / inline-size; }
.camera-bar { max-width: calc(100% - 264px - 3 * var(--lg-space-s)); }
@container view (max-width: 560px) {
  .camera-bar { max-width: calc(100% - 2 * var(--lg-space-s)); }
  .camera-pad { top: auto; bottom: max(var(--lg-space-s), env(safe-area-inset-bottom)); }
}
.pad-btn { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  background: color-mix(in srgb, var(--lg-bg) 35%, transparent); color: var(--lg-text); opacity: 0.55; transition: opacity 0.15s, background 0.15s; }
.pad-btn:hover, .pad-btn:focus-visible, .pad-btn.is-held { opacity: 1; background: color-mix(in srgb, var(--lg-bg) 70%, transparent); }
.pad-btn:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: 1px; }
.pad-arrow { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.45)); }
.pad-label { font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--lg-text); opacity: 0.6; line-height: 1;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.5); padding: 2px 0; pointer-events: none; }
/* A firmer backing so the view buttons stay readable over bright ground. */
.camera-bar { background: color-mix(in srgb, var(--lg-bg) 78%, transparent); }
.inspector-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--lg-space-s); }
.anim-play[hidden] { display: none; }
.eye-steps { display: flex; align-items: center; gap: 2px; padding-left: 6px; margin-left: 2px; border-left: 1px solid var(--lg-border); }
.eye-steps[hidden] { display: none; }
.eye-step-label { font-size: var(--lg-fs-small); color: var(--lg-text); padding: 0 4px; white-space: nowrap; }
.eye-step-hint { font-size: var(--lg-fs-small); color: var(--lg-muted); padding: 0 6px; }
.eye-step-hint[hidden], .eye-step-label[hidden] { display: none; }

@media (max-width: 1439px) { .brand { display: none; } }

/* Touch screens (iPad): every control at least 44 px. */
@media (pointer: coarse) {
  .tool, .tool-text, .lib-item, .camera-bar .lg-btn, .hint .lg-btn, .rot-row .lg-btn { min-height: var(--lg-touch); }
  .rot-row .lg-btn, .camera-bar .lg-btn { min-width: var(--lg-touch); }
  .help-topic, .tool { min-height: var(--lg-touch); }
  /* 16 px text in fields, so iPad Safari doesn't zoom the page when one gets focus. */
  .lg-input, .lg-select, .lg-search > input, textarea { font-size: 16px; }
}
/* iPads with a trackpad report a fine pointer: keep their toolbar targets 44 px too. */
@media (max-width: 1099px) { .tool { min-height: var(--lg-touch); } }
@media (max-width: 899px) {
  .toolbar { gap: var(--lg-space-xs) var(--lg-space-s); }
  .tool { min-width: 44px; padding: 4px 3px; }
}
.viewport-state { position: absolute; inset: 0; display: grid; place-content: center; padding: var(--lg-space-xl); text-align: center; }
.small-screen { overflow-wrap: anywhere; }

.wsb-choice .lg-input, .wsb-insert { margin-top: 4px; }
#briefing .lg-kv > dd { text-align: right; }
.wsb-choice .lg-select, .wsb-insert { width: 100%; text-overflow: ellipsis; }
.wsb-insert { margin-bottom: 4px; }
.briefing-body > .lg-field { align-self: start; }
.briefing-body .lg-input:not(textarea), .briefing-body .lg-select { height: auto; }
.briefing-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--lg-space-s) var(--lg-space-l); }
.briefing-body .lg-input, .briefing-body .lg-select { width: 100%; box-sizing: border-box; }
.wsb-wide { grid-column: 1 / -1; }

/* The app's alerts (saved, closed, problems): in the 3D view, centred near its top, under the view
   buttons and the stage name, above the grey cover; fading in and out. */
.save-alert { position: absolute; z-index: 6; top: 56px; left: 50%; display: flex; align-items: center; gap: 8px;
  margin: 0; max-width: min(420px, calc(100% - 32px)); box-shadow: 0 6px 24px rgb(0 0 0 / 0.25); opacity: 0; transform: translate(-50%, -6px); transition: opacity 0.25s, transform 0.25s; pointer-events: none; }
.save-alert.is-shown { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.save-alert[hidden] { display: none; }
.save-alert .lg-icon { flex: none; width: 18px; height: 18px; }
.save-alert-close { margin-left: auto; }
@media (prefers-reduced-motion: reduce) { .save-alert { transition: none; } }
.proj-actions { flex-wrap: wrap; gap: var(--lg-space-s); }
.proj-list { display: grid; gap: var(--lg-space-xs); }
.proj-row { display: flex; align-items: center; justify-content: space-between; gap: var(--lg-space-m); flex-wrap: wrap;
  padding: var(--lg-space-s) var(--lg-space-m); border: 1px solid var(--lg-border); border-radius: var(--lg-radius-control); }
.proj-row.is-current { border-color: var(--lg-accent); }
.proj-info { display: grid; gap: 2px; min-width: 0; }
.proj-name { font-weight: 600; overflow-wrap: anywhere; }
.proj-meta { font-size: var(--lg-fs-small); }
.proj-hint { font-size: var(--lg-fs-small); color: var(--lg-warn-text, var(--lg-warn)); }
.proj-buttons { gap: var(--lg-space-xs); }
.proj-confirm { overflow-wrap: anywhere; }

.settings-head { display: flex; align-items: center; justify-content: space-between; gap: var(--lg-space-s); margin-bottom: var(--lg-space-s); }
.settings-head .panel-title { margin: 0; }
.settings-body { display: grid; gap: var(--lg-space-s); }
.settings-row { display: grid; grid-template-columns: minmax(0, 1fr) 4em; grid-template-areas: "label value" "control control"; align-items: center; gap: 2px var(--lg-space-s); }
.settings-row > label, .settings-row > .settings-label { grid-area: label; }
.settings-row > input[type=range], .settings-row > .lg-segmented, .settings-row > .lg-select, .settings-row > .lg-input { grid-area: control; }
.settings-row > output { grid-area: value; }
.settings-row > .lg-toggle { grid-area: value; justify-self: end; }
.settings-actions { margin-top: var(--lg-space-m); }
.settings-panel .lg-muted { font-size: var(--lg-fs-small); }
.settings-row .lg-segmented { justify-self: stretch; }
.settings-row .lg-segmented label { flex: 1; text-align: center; }
.settings-row input[type=range] { width: 100%; min-height: var(--lg-touch); }
.settings-value { text-align: right; color: var(--lg-muted); }

.lib-summary { display: flex; align-items: center; justify-content: space-between; gap: var(--lg-space-s);
  min-height: 32px; padding: 2px 4px; margin-bottom: var(--lg-space-xs); cursor: pointer; list-style: none;
  border-radius: var(--lg-radius-small); user-select: none; }
.lib-summary::-webkit-details-marker { display: none; }
.lib-summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--lg-muted); border-bottom: 1.6px solid var(--lg-muted);
  transform: rotate(-45deg); transition: transform var(--lg-dur-quick) var(--lg-ease); margin-right: 2px; }
.lib-section[open] > .lib-summary::before { transform: rotate(45deg); }
.lib-summary .lg-label { margin: 0; flex: 1; }
.lib-summary:hover { background: color-mix(in srgb, var(--lg-accent) 10%, transparent); }
.lib-summary:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: 1px; }
.lib-count { font-size: var(--lg-fs-small); }
@media (pointer: coarse) { .lib-summary { min-height: var(--lg-touch); } }
@media (prefers-reduced-motion: reduce) { .lib-summary::before { transition: none; } }

.inspector .settings-panel { grid-column: 1 / -1; }

/* Help window */
/* Help: nearly the whole window, so the drawings and text have room. */
.help-modal { width: min(1400px, calc(100vw - 48px)); max-width: none; height: calc(100dvh - 48px); max-height: none; padding: 0; display: none; }
.help-modal[open] { display: flex; flex-direction: column; }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: var(--lg-space-m) var(--lg-space-l); border-bottom: 1px solid var(--lg-border); }
.help-head .lg-modal-title { margin: 0; }
.help-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 0; flex: 1; }
.help-nav { display: grid; align-content: start; gap: 2px; padding: var(--lg-space-s); border-right: 1px solid var(--lg-border); overflow: auto; }
.help-topic { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; border: 0; border-radius: var(--lg-radius-control);
  background: transparent; color: var(--lg-muted); font: inherit; text-align: left; cursor: pointer; }
.help-topic svg { width: 18px; height: 18px; flex: none; }
.help-topic:hover { color: var(--lg-text); background: var(--lg-surface); }
.help-topic[aria-current="true"] { color: var(--lg-text); background: color-mix(in srgb, var(--lg-accent) 20%, transparent); }
.help-topic:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: -2px; }
.help-content { padding: var(--lg-space-l); overflow: auto; outline: none; }
.help-title { margin: 0 0 var(--lg-space-m); font-size: 1.25rem; color: var(--lg-text); }
.help-art { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 0 var(--lg-space-m); border-radius: var(--lg-radius-card);
  background: color-mix(in srgb, var(--lg-surface) 70%, transparent); border: 1px solid var(--lg-border); }
.help-text { color: var(--lg-text); line-height: 1.55; max-width: 62ch; }
.help-tips { list-style: none; padding: 0; margin: var(--lg-space-m) 0 0; display: grid; gap: 6px; max-width: 62ch; }
.help-tips li { display: flex; gap: 8px; align-items: flex-start; color: var(--lg-text); }
.help-tips svg { width: 18px; height: 18px; flex: none; color: var(--lg-ok, var(--lg-accent)); margin-top: 2px; }
.help-keys kbd { font: 600 0.85em var(--lg-mono, monospace); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--lg-border); background: var(--lg-surface); white-space: nowrap; }
.help-steps { display: flex; justify-content: space-between; gap: var(--lg-space-s); margin-top: var(--lg-space-l); flex-wrap: wrap; }
@media (max-width: 900px) {
  .help-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .help-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--lg-border);
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .help-topic { flex: none; min-height: 44px; }
}
/* Help drawings: theme colours from the tokens. */
.help-art text { font-family: var(--lg-font); }
.help-art .hi-ground { fill: color-mix(in srgb, #b98a5e 45%, var(--lg-bg)); }
.help-art .hi-grid line { stroke: color-mix(in srgb, var(--lg-text) 14%, transparent); stroke-width: 1; }
.help-art .hi-card { fill: var(--lg-surface); stroke: var(--lg-border); }
.help-art .hi-item { fill: color-mix(in srgb, var(--lg-text) 8%, transparent); stroke: var(--lg-border); }
.help-art .hi-pick { fill: color-mix(in srgb, var(--lg-accent) 35%, transparent); stroke: var(--lg-accent); }
.help-art .hi-ink { fill: var(--lg-text); }
.help-art .hi-ink-fill { fill: var(--lg-text); }
.help-art .hi-muted { fill: var(--lg-muted); }
.help-art .hi-acc-text { fill: var(--lg-accent); font-weight: 700; }
.help-art .hi-red-text { fill: #e0574f; font-weight: 700; }
.help-art .hi-arrow { fill: none; stroke: var(--lg-accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.help-art .hi-dash { stroke-dasharray: 5 5; }
.help-art .hi-line { fill: none; stroke: var(--lg-border); stroke-width: 1.5; }
.help-art .hi-paper { fill: #c9a273; stroke: #8b6a45; stroke-width: 1; }
.help-art .hi-white { fill: #f1efe9; stroke: #6c6a66; stroke-width: 1; }
.help-art .hi-cover { fill: #141414; }
.help-art .hi-stand { fill: #2f5fb3; }
.help-art .hi-wood { fill: #c9a273; stroke: #8b6a45; }
.help-art .hi-mesh { fill: #d9652b; stroke: #c9a273; stroke-width: 2; }
.help-art .hi-port { fill: color-mix(in srgb, #b98a5e 45%, var(--lg-bg)); stroke: #c9a273; stroke-width: 2; }
.help-art .hi-snap { fill: none; stroke: var(--lg-accent); stroke-width: 2; stroke-dasharray: 3 3; }
.help-art .hi-ring { fill: none; stroke: #3fbf6f; stroke-width: 3; }
.help-art .hi-ring-head { fill: none; stroke: #3fbf6f; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.help-art .hi-key { fill: var(--lg-surface); stroke: var(--lg-border); stroke-width: 1.5; }
.help-art .hi-tap { fill: color-mix(in srgb, var(--lg-accent) 40%, transparent); stroke: var(--lg-accent); stroke-width: 2; }
.help-art .hi-fault { fill: none; stroke: #d8322a; stroke-width: 4; stroke-linejoin: round; }
.help-art .hi-thin { stroke-width: 1.5; }
.help-art .hi-area { fill: rgba(216, 50, 42, 0.12); stroke: #d8322a; stroke-width: 2; stroke-dasharray: 5 3; }
.help-art .hi-start { fill: none; stroke: var(--lg-text); stroke-width: 1.5; }
.help-art .hi-point { fill: var(--lg-bg); stroke: #d8322a; stroke-width: 2; }
.help-art .hi-steel-line { fill: none; stroke: #6b5a4e; stroke-width: 4; stroke-linecap: round; }
.help-art .hi-steel { fill: #6b5a4e; }
.help-art .hi-arc { fill: none; stroke: #e7b347; stroke-width: 2; }
.help-art .hi-sun { fill: #f2c14e; }
.help-art .hi-shadow { fill: rgba(0, 0, 0, 0.28); }
.help-art .hi-page { stroke: #9a9892; }
.help-art .hi-grey { fill: #bdbab3; }
.help-art .hi-cell { fill: none; stroke: #9a9892; }
.help-art .hi-proc { fill: #eceae4; stroke: #d8322a; stroke-width: 0; }
.help-art .hi-map { fill: #fff; stroke: #9a9892; }

/* Shooter's eye move pad: semi-transparent grey arrows in the lower left of the 3D view. */
.eye-pad { position: absolute; left: var(--lg-space-s); bottom: calc(var(--lg-space-s) + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template: "a f b" var(--lg-touch) "l c r" var(--lg-touch) "g d e" var(--lg-touch) / var(--lg-touch) var(--lg-touch) var(--lg-touch); gap: 2px; z-index: 3; }
.eye-pad[hidden] { display: none; }
.eye-pad-btn { display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 0.25); border-radius: 10px; cursor: pointer;
  background: rgb(150 155 162 / 0.45); color: rgb(255 255 255 / 0.92); backdrop-filter: blur(4px); padding: 0; }
.eye-pad-btn:hover { background: rgb(150 155 162 / 0.65); }
.eye-pad-btn:active { background: rgb(120 125 132 / 0.75); }
.eye-pad-btn:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: 1px; }
.eye-pad-btn svg { width: 22px; height: 22px; }
.eye-pad-forward { grid-area: f; } .eye-pad-left { grid-area: l; } .eye-pad-right { grid-area: r; } .eye-pad-back { grid-area: d; }

/* Settings → View: colour swatches and your own colour for each part of the shooter's run. */
.settings-sub { font-size: var(--lg-fs-small); text-transform: uppercase; letter-spacing: 0.06em; color: var(--lg-muted); margin: var(--lg-space-m) 0 var(--lg-space-s); }
.run-colors { clear: both; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.run-part .settings-row { clear: both; }
.run-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.run-swatch { width: 28px; height: 28px; border-radius: 50%; padding: 0; cursor: pointer; background: var(--swatch);
  border: 2px solid var(--lg-border); box-shadow: inset 0 0 0 2px rgb(0 0 0 / 0.15); }
.run-swatch[aria-checked="true"] { border-color: var(--lg-accent); box-shadow: 0 0 0 2px var(--lg-accent); }
.run-swatch:focus-visible, .run-color:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: 2px; }
.run-color { width: 40px; height: 28px; padding: 0; border: 1px solid var(--lg-border); border-radius: 8px; background: none; cursor: pointer; }
@media (pointer: coarse) { .run-swatch { width: var(--lg-touch); height: var(--lg-touch); } .run-color { width: 56px; height: var(--lg-touch); } }

/* Left panel tabs: Props and On stage. */
/* In a frame with tabs, the dock's tab bar carries the move and fold buttons. */
.layers-head { padding-right: 68px; }        /* clear of the dock's buttons when the panel is alone */
.lg-dock-frame[data-tabs] :is(.panel-title, .side-head, .settings-head, .layers-head) { padding-right: 0; }

/* The On stage panel: a list of the props on the stage, with groups. */
.layers-panel { display: flex; flex-direction: column; gap: var(--lg-space-s); min-height: 0; flex: 1; }
.layers-head { display: flex; align-items: center; justify-content: space-between; }
.layers-bar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.layers-tool { width: 32px; height: 32px; min-width: 32px; padding: 0; }
.layers-tool svg { width: 16px; height: 16px; }
.layers-tool[aria-pressed="false"] { opacity: 0.55; }
.layers-bar .layers-tool[aria-pressed="true"] { background: color-mix(in srgb, var(--lg-accent) 18%, transparent); opacity: 1; }
.layers-move { flex: 1; min-width: 7em; height: 32px; }
.layers-list { overflow: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.layer-row { display: flex; align-items: center; gap: 2px; border-radius: var(--lg-radius-control); padding-left: 2px; }
.layer-row[data-depth="1"] { padding-left: 22px; }
.layer-row.is-selected { background: color-mix(in srgb, var(--lg-accent) 20%, transparent); }
.layer-row.is-hidden .layer-name, .layer-row.is-locked .layer-name { color: var(--lg-muted); }
.layer-row.is-drop, .layers-top.is-drop { outline: 2px dashed var(--lg-accent); outline-offset: -2px; }
.layer-name { flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: var(--lg-text); font: inherit; font-size: var(--lg-fs-small);
  padding: 6px 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: var(--lg-radius-control); }
.layer-name:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: -2px; }
.layer-group { margin-top: 4px; }
.layer-rename { flex: 1; min-width: 0; height: 30px; }
.layers-top { font-size: var(--lg-fs-small); color: var(--lg-muted); text-align: center; padding: 2px; border-radius: var(--lg-radius-control); display: none; }
.layers-list.is-dragging .layers-top { display: block; }
.layers-hint { flex: none; }
@media (pointer: coarse) {
  .layers-tool { width: var(--lg-touch); height: var(--lg-touch); min-width: var(--lg-touch); }
  .layer-name { min-height: var(--lg-touch); }
  .layers-move { height: var(--lg-touch); }
}
/* The right-click menu sits over everything. */
.stage-menu .lg-icon, .stage-menu svg { width: 16px; height: 16px; }

/* Settings → Environment, the sun by hand: the colour slider's track runs dark orange → yellow → white. */
.sun-color-slider::-webkit-slider-runnable-track { background: linear-gradient(90deg, #c74d14, #ffd160 50%, #ffffff); }
.sun-color-slider::-moz-range-track { background: linear-gradient(90deg, #c74d14, #ffd160 50%, #ffffff); }
.sun-color-slider::-moz-range-progress { background: transparent; }
/* Settings → Environment, Blueprint and Technical: the hue slider's track is the colour wheel. */
.hue-slider::-webkit-slider-runnable-track { background: linear-gradient(90deg, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00); }
.hue-slider::-moz-range-track { background: linear-gradient(90deg, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00); }
.hue-slider::-moz-range-progress { background: transparent; }
.settings-row > .settings-wide { grid-column: 1 / -1; }
/* Three tabs in a 260 px side panel: tighter tab padding so "Props", "On stage" and "Projects" fit. */
.lg-dock-tab { padding: 4px 7px; }
.lg-dock-tablist { gap: 1px; }

/* Matches in the Projects panel: a match's stages in order, each with its number. */
.matches { display: flex; flex-direction: column; gap: var(--lg-space-s); }
.match-head { display: flex; align-items: center; }
.projects-panel .match-stage { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 6px var(--lg-space-s); }
.projects-panel .match-stage .proj-buttons { grid-column: 1 / -1; flex-wrap: wrap; }
.projects-panel .match-stage.drag-row { grid-template-columns: 32px 26px minmax(0, 1fr); }   /* grip, number, name */
.match-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-weight: 700; font-size: var(--lg-fs-small);
  background: color-mix(in srgb, var(--lg-accent) 22%, transparent); color: var(--lg-text); }
.match-stage .proj-buttons .lg-btn-icon { width: 32px; min-width: 32px; padding: 0; }
@media (pointer: coarse) { .match-stage .proj-buttons .lg-btn-icon { width: var(--lg-touch); min-width: var(--lg-touch); } }

/* Exact position fields side by side; the arrange buttons for a selection. */
.pos-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--lg-space-s); }
.arrange { margin-top: var(--lg-space-s); }
.arrange-row { flex-wrap: wrap; gap: 4px; }

.sight p { margin: 0; font-size: var(--lg-fs-small); }
.sight-seen::before { content: ""; display: inline-block; width: 10px; height: 2px; margin: 0 6px 3px 0; background: #4fd18b; }

/* The safety-distance legend under the switch: a ring swatch in the ring's colour. */
.ring-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--lg-fs-small); }
.ring-legend li { padding-left: 18px; position: relative; color: var(--lg-text-muted, inherit); }
.ring-legend li::before { content: ""; position: absolute; left: 0; top: 3px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid; }
.ring-legend .ring-bad::before { border-color: #d9483b; }
.ring-legend .ring-warn::before { border-color: #f0b93a; }


/* Draw a bay shape: controls beside the sheet (white with a 1 m grid), which takes the rest. */
.bay-draw { width: min(1100px, calc(100vw - 32px)); max-width: none; height: min(820px, calc(100vh - 32px)); max-height: none; }
.bay-draw[open] { display: flex; flex-direction: column; }
.bay-draw-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: var(--lg-space-l, 20px); }
.bay-draw-side { overflow: auto; }
.bay-draw-sheet { min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bay-draw-box { flex: 1; min-height: 0; width: 100%; overflow: auto; display: grid; place-items: center; }
.bay-draw-canvas { touch-action: none; cursor: crosshair; border: 1px solid #9aa3ad; border-radius: 4px; background: #fff; }
.bay-draw-edge { font-size: var(--lg-fs-small); color: var(--lg-text-muted, inherit); }
.bay-draw-tools .lg-btn { justify-content: flex-start; }
.bay-tool[aria-pressed="true"] { outline: 2px solid var(--lg-accent); outline-offset: 1px; }
.bay-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; border: 1px solid #888; }
.bay-swatch-black { background: #111; }
.bay-swatch-white { background: #fff; }
.bay-draw .is-gone { display: none; }
@media (max-width: 900px) { .bay-draw-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .bay-draw-side { max-height: 40vh; } }
.bay-draw-canvas.is-bucket { cursor: cell; }
.plan-modal [hidden] { display: none !important; }

.brief-slot { padding-top: var(--lg-space-s); }
.brief-slot .lg-btn { width: 100%; justify-content: center; min-height: var(--lg-touch); }
.brief-slot[hidden] { display: none; }

/* Every modal hangs from a fixed distance below the top of the window and grows downwards only
   (Låda Glass centres them, so a modal whose content grows spread up and down at once). */
.lg-modal { --modal-top: max(24px, 6dvh); margin: var(--modal-top) auto auto; max-height: calc(100dvh - var(--modal-top) - 24px); }
.help-modal { --modal-top: 24px; height: calc(100dvh - 48px); }
.plan-modal { --modal-top: 16px; height: calc(100dvh - 32px); max-height: calc(100dvh - 32px); }
/* On/off items in the right-click menu, styled like Låda Glass menu items. */
.lg-menu [role="menuitemcheckbox"] > .lg-icon { flex: none; color: var(--lg-muted); }
.lg-menu [role="menuitemcheckbox"] > .lg-kbd { margin-left: auto; flex: none; }
.lg-menu [role="menuitemcheckbox"]:is(:hover, :focus) { outline: none; background: color-mix(in srgb, var(--lg-accent) 16%, transparent); }
.lg-menu [role="menuitemcheckbox"]:focus-visible { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lg-accent) 55%, transparent); }
.lg-menu [role="menuitemcheckbox"][aria-checked="true"] > .lg-kbd { color: var(--lg-ok-text, var(--lg-text)); }

/* The toolbar rides at the top of a side column (the right one, else the left), so the 3D view runs
   to the top of the window; that column's panels start below it. With no side column wide enough
   (both folded, or every panel under the view) it falls back to a bar across the top. */
.app.toolbar-rail { grid-template-rows: minmax(0, 1fr); grid-template-areas: "dock"; position: relative; }
.app.toolbar-rail .toolbar { position: absolute; z-index: 5; top: max(var(--lg-space-s), env(safe-area-inset-top)); box-sizing: border-box;
  left: var(--rail-left); width: var(--rail-width); justify-content: center; padding: 2px 4px; }
.app.toolbar-rail .toolgroup.end { margin-left: 0; width: 100%; }
.app.toolbar-rail .toolbar .tool { flex: 1 1 auto; min-width: 0; min-height: var(--lg-touch); padding: 4px 1px; font-size: 11px; }
.app.toolbar-rail .toolbar .tool > span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.app-dock .lg-dock.has-toolbar > .lg-dock-frame:first-child { margin-top: calc(var(--rail-toolbar-h) + var(--lg-space-s)); }
.app-dock .lg-dock.has-toolbar { min-height: 0; }

/* The stage's name over the 3D view: white with a thin black outline, no background. */
.stage-title { position: absolute; top: var(--title-top, 8px); left: var(--title-left, 50%); right: var(--title-right, auto); height: var(--title-h, 36px);
  display: block; line-height: var(--title-h, 36px); text-align: center; pointer-events: none; color: #fff; font-weight: 650; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.01em;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 -1px 0 #000, 0 1px 0 #000, -1px 0 0 #000, 1px 0 0 #000; }
.stage-title.is-below { text-align: left; height: auto; line-height: 1.4; }
.stage-title:empty { display: none; }

/* The New match / Edit match window. */
.match-editor { width: min(620px, calc(100vw - 32px)); max-width: none; }
.match-editor .lg-modal-body { overflow: auto; }
.match-ed-add { display: flex; gap: var(--lg-space-s); align-items: center; }
.match-ed-add .lg-select { flex: 1; min-width: 0; }
.match-ed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.match-ed-row { display: flex; align-items: center; gap: var(--lg-space-s); padding: 4px 6px; border: 1px solid var(--lg-border); border-radius: var(--lg-radius-control); }
.match-ed-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-ed-buttons { flex: none; gap: 2px; }
.match-ed-buttons .lg-btn { min-width: var(--lg-touch); min-height: var(--lg-touch); }
.match-ed-empty { border: 1px dashed var(--lg-border); border-radius: var(--lg-radius-control); padding: var(--lg-space-s); }
.match-title { margin: 0; font-size: var(--lg-fs-h3, 1.1rem); }

/* The Projects panel's breadcrumb: Projects › match › stage. */
.proj-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: var(--lg-fs-small); color: var(--lg-muted); margin: 2px 0 var(--lg-space-s); }
.proj-crumbs .crumb-sep { opacity: 0.6; }
.proj-crumbs .crumb-here { color: var(--lg-text); font-weight: 600; }
.proj-crumbs .crumb-link { border: 0; background: none; padding: 6px 2px; min-height: var(--lg-touch); color: var(--lg-accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
/* Drag handles (match window and a match's stages in the panel): a grip that reorders the list. */
.drag-grip { user-select: none; -webkit-user-select: none; flex: none; display: grid; place-items: center; width: 32px; min-height: var(--lg-touch); padding: 0; border: 0; border-radius: var(--lg-radius-control);
  background: transparent; color: var(--lg-muted); cursor: grab; touch-action: none; }
.drag-grip .lg-icon { width: 20px; height: 20px; stroke-width: 3.2; }
.drag-grip:hover, .drag-grip:focus-visible { color: var(--lg-text); background: var(--lg-surface); outline: none; }
.drag-grip:focus-visible { box-shadow: 0 0 0 2px var(--lg-accent); }
.drag-row { transition: transform 0.15s; }
.drag-row.is-dragging { transition: none; position: relative; z-index: 2; box-shadow: 0 6px 18px rgb(0 0 0 / 0.25); cursor: grabbing; background: var(--lg-bg); }
.match-ed-row { background: var(--lg-bg); }
@media (prefers-reduced-motion: reduce) { .drag-row { transition: none; } }

/* No stage open: the view greys out under one button (Create new stage). */
.blank-cover { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: color-mix(in srgb, #6b6f75 72%, transparent);
  -webkit-backdrop-filter: grayscale(1) blur(2px); backdrop-filter: grayscale(1) blur(2px); }
.blank-cover-btn { min-height: var(--lg-touch); box-shadow: 0 6px 20px rgb(0 0 0 / 0.25); }   /* the side panels' grey button */

/* A stage's ⓘ (in its row's icons) and the details box it shows. */
.stage-info { position: relative; width: 18px; height: 18px; min-width: 18px; padding: 0; margin: 0 4px; border-radius: 50%; border: 1.25px solid var(--lg-muted);
  background: transparent; color: var(--lg-muted); font: 700 11px/1 Georgia, serif; font-style: italic; cursor: help; }
.stage-info::before { content: ""; position: absolute; inset: -9px; }       /* a larger target round the small circle */
.stage-info:hover, .stage-info:focus-visible, .stage-info[aria-expanded="true"] { color: var(--lg-accent); border-color: var(--lg-accent); outline: none; }
.stage-info-box { position: fixed; z-index: 1002; width: 240px; padding: var(--lg-space-s) var(--lg-space-m); border-radius: var(--lg-radius-control);
  background: var(--lg-surface); border: 1px solid var(--lg-border); box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); font-size: var(--lg-fs-small); color: var(--lg-text);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.stage-info-rows { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--lg-space-m); margin: 0; }
.stage-info-rows dt { color: var(--lg-muted); }
.stage-info-rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.stage-info-head { margin: var(--lg-space-s) 0 2px; font-weight: 650; }
.stage-info-matches { margin: 0; padding-left: 1.1em; }

/* Rows with small icons on the right (open, duplicate, delete): name left, icons right, one line. */
.projects-panel .proj-row.icon-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px var(--lg-space-s); }
.projects-panel .match-stage.icon-row { grid-template-columns: 26px minmax(0, 1fr) auto; }
.projects-panel .match-stage.icon-row.drag-row { grid-template-columns: 32px 26px minmax(0, 1fr) auto; }
.projects-panel .proj-row.icon-row > .proj-confirm { grid-column: 1 / -1; }
.projects-panel .proj-row.icon-row > .proj-buttons { grid-column: 1 / -1; }
.row-icons { display: flex; align-items: center; gap: 2px; justify-self: end; }
.row-icon { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--lg-radius-control);
  background: transparent; color: var(--lg-muted); cursor: pointer; transition: color 0.15s, background 0.15s, box-shadow 0.15s; }
.row-icon .lg-icon { width: 18px; height: 18px; }
.row-icon:hover, .row-icon:focus-visible { color: var(--lg-text); background: var(--lg-surface); outline: none; }
.row-icon:focus-visible { box-shadow: 0 0 0 2px var(--lg-accent); }
/* The trash glows red under the pointer. */
.row-icon.is-danger:hover, .row-icon.is-danger:focus-visible { color: #ff4d4f; background: color-mix(in srgb, #ff4d4f 14%, transparent);
  box-shadow: 0 0 10px 1px color-mix(in srgb, #ff4d4f 55%, transparent); }
.row-icon.is-danger:hover .lg-icon { filter: drop-shadow(0 0 3px #ff4d4f); }
@media (pointer: coarse) { .row-icon { width: var(--lg-touch); height: var(--lg-touch); } }
@media (prefers-reduced-motion: reduce) { .row-icon { transition: none; } }
/* A match's stage rows are narrow: a slimmer grip and number, tighter gaps, so the name has room. */
.projects-panel .match-stage.icon-row { grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 6px; }
.projects-panel .match-stage.icon-row.drag-row { grid-template-columns: 20px 22px minmax(0, 1fr) auto; }
.projects-panel .match-stage .drag-grip { width: 20px; }
.projects-panel .match-stage .match-num { width: 22px; height: 22px; }
.projects-panel .match-stage .row-icons { gap: 0; }
.projects-panel .match-stage .proj-name { overflow-wrap: normal; word-break: normal; hyphens: auto; }
/* Stage library cards: the name, with its ⓘ and open icon on the right. */
.lib-stage.icon-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; }
.stage-info-meta { margin: 0 0 6px; color: var(--lg-muted); }
.stage-info-text { margin: 0; line-height: 1.45; }

.brief-slot { display: grid; gap: var(--lg-space-xs); }
.brief-slot .close-stage-btn { order: 2; }      /* under Written stage briefing… */
/* The 3D view's guide labels while turning or dragging a prop ("+30°", "2.3 m"): sharp screen text
   with a dark outline, beside the guide on the ground. */
.guide-tag { position: absolute; z-index: 4; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
  font: 700 15px/1 var(--lg-font, system-ui, sans-serif); color: #fff; font-variant-numeric: tabular-nums;
  padding: 4px 7px; border-radius: 6px; background: rgb(20 22 25 / 0.72); }

/* Folders in Projects: a folder row opens on click; rows can be dragged onto a folder or a breadcrumb link. */
.folder-open { display: flex; align-items: center; gap: var(--lg-space-s); flex: 1; min-width: 0; min-height: var(--lg-touch); padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.folder-open > .lg-icon { flex: none; color: var(--lg-accent); }
.folder-open:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: 2px; border-radius: var(--lg-radius-small); }
.proj-row.is-draggable { cursor: grab; }
.proj-row.is-dragging { opacity: 0.5; }
.is-drop { outline: 2px dashed var(--lg-accent); outline-offset: 2px; background: color-mix(in srgb, var(--lg-accent) 12%, transparent); }
.proj-row > select.lg-select { flex: 1 1 100%; }
.lib-folder > .lib-summary > .lg-icon { flex: none; color: var(--lg-accent); width: 16px; height: 16px; }
.lib-folder .lib-stages { margin: 0 0 var(--lg-space-s) var(--lg-space-s); }

/* The club's name and logo in the briefing window. */
.club-fields { border: 1px solid var(--lg-border); border-radius: var(--lg-radius-card); padding: var(--lg-space-m); margin: 0 0 var(--lg-space-m); display: grid; gap: var(--lg-space-s); }
.club-logo { align-items: center; gap: var(--lg-space-s); flex-wrap: wrap; }
.club-logo-img { max-height: 48px; max-width: 160px; object-fit: contain; background: #fff; border-radius: var(--lg-radius-small); padding: 2px; }
.club-label { font-weight: 500; }

/* A view link's stage (read-only): no props or On stage tabs, no inspector fields or stage settings. */
.view-only-note { display: none; padding: var(--lg-space-m); }
body.is-viewing .view-only-note { display: block; }
body.is-viewing #inspector-body, body.is-viewing #library-tab, body.is-viewing #layers-tab,
body.is-viewing .stage-settings, body.is-viewing #brief-slot, body.is-viewing #library, body.is-viewing #layers { display: none; }
