:root {
  color-scheme: dark;
  --bg: #111016; --surface: #19181f; --line: #34313d;
  --text: #f6f2ed; --muted: #aca8b7; --accent: #ffd49d; --accent-ink: #25180b;
  font: 16px/1.5 "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button {
  min-height: 2.5rem; padding: .45rem .8rem; border: 1px solid var(--line);
  border-radius: .45rem; background: #26242e; color: var(--text); cursor: pointer;
  font-size: .9rem; font-weight: 650; white-space: nowrap;
}
button:not(:disabled):hover { border-color: var(--accent); }
button:disabled { cursor: default; opacity: .42; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button[aria-pressed="true"] { border-color: #a67f55; color: var(--accent); background: #382c26; }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.subtle { background: transparent; color: var(--muted); }
.site-header {
  min-height: 4.2rem; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line); padding-inline: max(1rem, calc((100% - 88rem)/2));
}
.brand { display: inline-flex; align-items: center; gap: .7rem; white-space: nowrap; }
.brand img { border-radius: 50%; }
.brand span { font-size: .94rem; font-weight: 750; letter-spacing: .09em; }
.brand strong { color: var(--accent); }
.site-link { color: var(--muted); font-size: .94rem; }
.site-link:hover { color: var(--text); }
main { width: min(100% - 2rem, 88rem); margin: 0 auto; padding-block: clamp(1.35rem, 3vw, 2.7rem) 2.5rem; }
.intro { margin-bottom: 1.2rem; }
.intro h1 { font-size: clamp(2.1rem, 4vw, 3.7rem); letter-spacing: -.045em; line-height: 1.15; }
.intro p { margin-top: .42rem; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16.5rem, 20rem); gap: 1rem; }
.stage, .inspector, .cue-deck { border: 1px solid var(--line); border-radius: .85rem; overflow: hidden; }
.stage {
  position: relative; display: grid; background: #100e19;
  min-height: clamp(29rem, 48vw, 36rem); isolation: isolate;
}
#canvas-host, #canvas-host canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.stage-toolbar, .stage-caption {
  position: absolute; inset-inline: .85rem; display: flex; justify-content: space-between; align-items: center;
  gap: .5rem; pointer-events: none;
}
.stage-toolbar { top: .85rem; }
.stage-caption { bottom: .85rem; }
.stage-toolbar button { pointer-events: auto; background: #16141de8; }
.stage-toolbar button[aria-pressed="true"] { background: #433124; }
.stage-caption span { padding: .42rem .66rem; background: #14121ce0; border: 1px solid #484254; border-radius: .4rem; font-size: .86rem; }
.stage-caption span + span { color: #d7d0dc; }
.segmented { display: flex; gap: .25rem; }
.fallback { position: absolute; top: 4rem; left: .9rem; color: var(--muted); font-size: .85rem; pointer-events: none; }
.inspector, .cue-deck { background: var(--surface); }
.inspector-nav { display: grid; grid-template-columns: 1fr 1fr; padding: .65rem; gap: .4rem; border-bottom: 1px solid var(--line); }
.editor { padding: .9rem 1rem 1rem; }
.editor h2 { font-size: .95rem; margin-bottom: .65rem; }
.fixture-list { display: grid; grid-template-columns: 1fr 1fr; gap: .42rem; }
.fixture-list button { text-align: left; padding-inline: .55rem; }
.dot { display: inline-block; width: .58rem; height: .58rem; border-radius: 50%; margin-right: .4rem; background: var(--lamp, #615b6c); }
.light-header {
  border-top: 1px solid var(--line); margin-top: .9rem; padding-top: .85rem;
  display: flex; justify-content: space-between; align-items: center;
}
.light-header h3 { font-size: 1.02rem; }
.switch { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; }
input[type="checkbox"], input[type="range"] { accent-color: var(--accent); }
input[type="checkbox"] { width: 1rem; height: 1rem; }
.control { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .9rem; margin-top: .7rem; }
.control output { color: var(--text); font-variant-numeric: tabular-nums; }
.control.color input { width: 3.5rem; height: 2rem; border: 0; padding: 0; background: transparent; cursor: pointer; }
input[type="range"] { width: 100%; margin: .28rem 0 0; min-height: 1.5rem; cursor: pointer; }
select, .cue-name input { width: 100%; color: var(--text); background: #22202a; border: 1px solid var(--line); border-radius: .4rem; padding: .5rem .65rem; }
.light-options, .object-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
#remove-object { margin-top: .6rem; }
.object-actions { justify-content: flex-start; }
.cue-deck { margin-top: 1rem; padding: clamp(.85rem, 2vw, 1.35rem); }
.deck-head, .deck-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; }
.deck-head h2 { font-size: 1.24rem; }
.deck-head p { color: var(--muted); font-size: .87rem; margin-top: .15rem; }
.timer, .cue-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.timer time { color: var(--accent); min-width: 4.25rem; font: 650 1.3rem ui-monospace, monospace; }
.cue-list { display: flex; flex-wrap: wrap; gap: .45rem; padding-block: .95rem; }
.cue-list button { white-space: normal; text-align: left; }
.cue-list button span { font: .84rem ui-monospace, monospace; color: var(--muted); margin-right: .42rem; }
.cue-name { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; }
.cue-name input { width: min(46vw, 13rem); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 48rem) {
  .workspace { grid-template-columns: 1fr; }
  .stage { min-height: clamp(22rem, 65vw, 31rem); }
  .stage-caption span + span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
