/* Layout: Bühne groß links mit Szene darüber und Zeitleiste darunter, Steuerpult rechts; auf dem Handy untereinander */
:root {
  --bg: #15161b;
  --panel: #1e2027;
  --panel-2: #262932;
  --line: #333743;
  --floor: #22242b;
  --runner: #1d3765;
  --runner-seam: #2c4d86;
  --band: #2a2730;
  --fg: #ece8df;
  --muted: #9d9ca6;
  --spike: #f3c845;
  --spike-ink: #1b1607;
  --danger: #ff8170;
  --f-display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", sans-serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
html, body { background: var(--bg); color: var(--fg); }
body { font-family: var(--f-body); font-size: 15px; line-height: 1.45; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--spike); outline-offset: 2px; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 18px 16px 48px; display: grid; gap: 16px; }

.top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.eyebrow { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--spike); }
.titlerow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 4px; }
h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(30px, 5vw, 44px); line-height: 1; margin: 0; letter-spacing: .01em; text-wrap: balance; }
select.piece { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 15px; font-weight: 600; max-width: 100%; }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.status { font-size: 13px; color: var(--muted); min-height: 1.2em; }
.status.warn { color: var(--danger); }
.status.ok { color: var(--spike); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 500; }
.btn:hover { border-color: #4a4f5d; }
.btn.primary { background: var(--spike); border-color: var(--spike); color: var(--spike-ink); font-weight: 600; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 9px; font-size: 13px; }
.btn.danger { color: var(--danger); }

.banner { background: var(--panel); border: 1px dashed #545866; border-radius: 10px; padding: 10px 14px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.banner b { color: var(--fg); font-weight: 600; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 16px; align-items: start; }
@media (max-width: 940px) { .main { grid-template-columns: minmax(0, 1fr); } }

.stagebox { background: var(--panel); border-radius: 12px; padding: 12px; display: grid; gap: 12px; min-width: 0; }
.scene { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-height: 2.6em; }
.scene .sl { font-family: var(--f-display); font-weight: 600; font-size: 24px; line-height: 1.1; }
.scene .sn { font-size: 13px; color: var(--muted); flex: 1 1 260px; min-width: 0; }
.badge { font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.badge.guess { border-color: #7a5b2a; color: #e2b35c; }
.badge.plan { border-color: #2f6a4a; color: #74d39a; }
.badge.part { border-color: #5d5a2a; color: #d6cf6a; }

#stage { width: 100%; height: auto; display: block; user-select: none; -webkit-user-select: none; }
.editing #stage { touch-action: none; }
.floor { fill: var(--floor); }
.outline { fill: none; stroke: #c9c6bf; stroke-width: .05; stroke-linejoin: round; }
.band { fill: var(--band); }
.runner { fill: var(--runner); stroke: var(--runner-seam); stroke-width: .04; }
.airtrack { fill: #1e4a46; stroke: #3a8c83; stroke-width: .05; }
.sel-teil > rect { stroke: var(--spike); stroke-width: .09; stroke-dasharray: none; }
.mark { fill: none; stroke: #c9c6bf; stroke-width: .04; }
.door { fill: var(--spike); }
.panel { fill: #8a6d3b; stroke: #e2c58f; stroke-width: .03; }
.platte { fill: #5b4a30; stroke: #e2c58f; stroke-width: .04; }
.ringe { fill: none; stroke: #f3c845; stroke-width: .05; stroke-dasharray: .1 .08; }
.podest { fill: #2b2f3a; stroke: #c9c6bf; stroke-width: .03; stroke-dasharray: .12 .08; }
.stairs { fill: #3a3a44; stroke: #c9c6bf; stroke-width: .04; }
.door-lbl { fill: var(--spike); font-family: var(--f-mono); font-size: .2px; text-anchor: middle; }
.gridl { stroke: rgba(255,255,255,.05); stroke-width: .02; }
.edge-lbl { fill: #807f8a; font-family: var(--f-mono); font-size: .26px; letter-spacing: .08px; text-anchor: middle; }
.bed { fill: #3a3141; stroke: #8f84a0; stroke-width: .05; }
.prop-lbl { fill: #b9b0c6; font-family: var(--f-mono); font-size: .24px; text-anchor: middle; }
.shade { fill: rgba(4, 5, 9, .62); pointer-events: none; }
.shade-lbl { fill: rgba(236,232,223,.55); font-family: var(--f-mono); font-size: .5px; letter-spacing: .1px; text-anchor: middle; pointer-events: none; }
.lane { fill: none; stroke: rgba(236,232,223,.45); stroke-width: .06; stroke-dasharray: .25 .15; }
.lane-lbl { fill: rgba(236,232,223,.7); font-family: var(--f-mono); font-size: .24px; text-anchor: middle; }

.dancer { cursor: pointer; transition: opacity .25s; }
.dancer circle.dot { stroke: #0d0e12; stroke-width: .04; }
.dancer circle.ring { fill: none; stroke: var(--fg); stroke-width: .05; opacity: 0; }
.dancer.sel circle.ring { opacity: 1; }
.dancer .ini { font-family: var(--f-body); font-weight: 600; text-anchor: middle; fill: #121318; pointer-events: none; }
.dancer .nm, .dancer .act { font-family: var(--f-body); font-weight: 600; text-anchor: middle; fill: var(--fg); paint-order: stroke; stroke: #15161b; stroke-width: .07px; stroke-linejoin: round; pointer-events: none; }
.dancer .nm { font-size: .23px; }
.dancer .act { font-size: .22px; fill: var(--spike); }
.dancer.off { opacity: .4; }
.has-focus .dancer:not(.is-focus) { opacity: .22; }
.dancer.is-focus .nm { font-size: .3px; }
.dancer.is-focus .act { font-size: .28px; }
.editing .dancer { cursor: grab; }
.trail { fill: none; stroke-width: .05; stroke-linecap: round; stroke-linejoin: round; }
.trail.faint { opacity: .25; stroke-dasharray: .08 .1; }
.trail.next { opacity: .9; }
.ghost { fill: none; stroke-width: .045; stroke-dasharray: .09 .07; }
.ghost-lbl { font-family: var(--f-mono); font-size: .2px; text-anchor: middle; }
.ctr { cursor: move; }
.ctr line { stroke: var(--spike); stroke-width: .05; }
.ctr circle { fill: transparent; stroke: var(--spike); stroke-width: .03; }

.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.tbtns { display: flex; gap: 6px; }
.ibtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); display: grid; place-items: center; }
.ibtn svg { width: 18px; height: 18px; fill: currentColor; }
.ibtn.play { width: 48px; height: 48px; background: var(--spike); border-color: var(--spike); color: var(--spike-ink); }
.ibtn.play svg { width: 20px; height: 20px; }
.count { display: flex; align-items: center; gap: 14px; }
.count .num { font-family: var(--f-display); font-weight: 800; font-size: 40px; line-height: .9; font-variant-numeric: tabular-nums; min-width: 2ch; }
.count .lbl { font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pips { display: grid; grid-template-columns: repeat(8, 14px); gap: 4px; }
.pip { height: 14px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); font-family: var(--f-mono); font-size: 9px; display: grid; place-items: center; color: var(--muted); }
.pip.on { background: var(--spike); border-color: var(--spike); color: var(--spike-ink); }
.time { font-family: var(--f-mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tright { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
select.sel { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font-size: 13px; }

.tl { position: relative; height: 70px; background: var(--bg); border-radius: 8px; border: 1px solid var(--line); cursor: pointer; touch-action: none; overflow: hidden; }
.sc { position: absolute; top: 0; height: 20px; border-right: 1px solid var(--bg); background: #23252d; font-size: 11px; line-height: 20px; padding: 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.sc.plan { background: #1f3b2c; color: #9fdcb7; }
.sc.part { background: #33331f; color: #dcd79f; }
.sc.cur { color: var(--fg); background: #3a3324; }
.sc.plan.cur { background: #2b5a3f; }
.tick { position: absolute; top: 20px; bottom: 0; width: 1px; background: #2a2d36; }
.tick span { position: absolute; top: 2px; left: 4px; font-family: var(--f-mono); font-size: 10px; color: #6c6c77; white-space: nowrap; }
.mk { position: absolute; top: 40px; height: 22px; transform: translateX(-7px); display: flex; align-items: center; }
.mk i { display: block; width: 14px; height: 14px; background: var(--fg); transform: rotate(45deg); border-radius: 2px; flex: none; }
.dense .mk { transform: translateX(-3px); }
.dense .mk i { width: 6px; height: 6px; border-radius: 1px; background: #8d8b95; }
.mk.cur i { background: var(--spike); }
.hb { position: absolute; top: 48px; height: 6px; background: #5a5e6b; border-radius: 0 3px 3px 0; pointer-events: none; }
.editing .mk { cursor: ew-resize; }
.head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--spike); pointer-events: none; }

.side { display: grid; gap: 12px; min-width: 0; }
.card { background: var(--panel); border-radius: 12px; padding: 14px; display: grid; gap: 10px; min-width: 0; }
.card h2 { font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.rowb { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.mono { font-family: var(--f-mono); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-size: 14px; }
.chip i { min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; background: var(--c); color: #121318; font-style: normal; font-size: 10px; font-weight: 600; display: grid; place-items: center; }
.chip.on { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.info { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; font-size: 14px; }
.info .k { font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.info .v { font-weight: 500; }
.seq { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.seq button { width: 100%; text-align: left; display: grid; grid-template-columns: 50px 1fr auto; gap: 8px; align-items: start; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; }
.seq button:hover { background: var(--panel-2); }
.seq .cur button { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--spike); }
.seq .ac { font-family: var(--f-mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.field input, .field select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font-size: 14px; min-width: 0; }
.frow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { border: 1px solid var(--line); background: var(--bg); border-radius: 7px; padding: 6px 9px; font-size: 13px; }
.seg button.on { background: var(--spike); color: var(--spike-ink); border-color: var(--spike); font-weight: 600; }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.drow { display: grid; grid-template-columns: 30px 54px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.drow.out { opacity: .55; }
.drow input[type=color] { width: 30px; height: 30px; padding: 2px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); }
.drow input[type=text] { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 14px; width: 100%; min-width: 0; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
textarea { font-family: var(--f-mono); font-size: 12px; min-height: 110px; resize: vertical; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Planer-App ---------- */
body { margin: 0; padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0); -webkit-text-size-adjust: 100%; }
.btn.on { background: var(--spike); border-color: var(--spike); color: var(--spike-ink); font-weight: 600; }
.planen #stage { touch-action: none; }
.planen .dancer { cursor: pointer; }
.hdl { fill: var(--bg); stroke-width: .05; cursor: move; }
.hdl.on { fill: var(--spike); stroke: var(--spike); }
.hdl-hit { fill: transparent; cursor: move; }
.hdl-lbl { font-family: var(--f-mono); font-size: .22px; text-anchor: middle; fill: var(--spike); paint-order: stroke; stroke: #15161b; stroke-width: .06px; pointer-events: none; }
.draft { fill: none; stroke: var(--spike); stroke-width: .06; stroke-dasharray: .14 .09; stroke-linecap: round; }
.draft-pt { fill: var(--spike); }
.draft-n { font-family: var(--f-mono); font-size: .2px; text-anchor: middle; fill: var(--spike-ink); pointer-events: none; }
.planbar { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.planbar p { margin: 0; font-size: 14px; }
.planbar .btns { gap: 8px; }
.planbar .btn { padding: 10px 14px; font-size: 15px; }
.planbar input { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: 15px; min-width: 0; flex: 1 1 160px; }
.warnline { color: var(--danger); font-size: 13px; }
.overlay { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; padding: 24px; z-index: 10; }
.overlay .card { max-width: 380px; width: 100%; }
.overlay h1 { font-size: 34px; }
.overlay input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; font-size: 17px; }
.overlay .btn { justify-content: center; padding: 11px 14px; font-size: 16px; }
.err { color: var(--danger); font-size: 14px; min-height: 1.3em; margin: 0; }
@media (pointer: coarse) { .ibtn { width: 46px; height: 46px; } .ibtn.play { width: 54px; height: 54px; } .chip { padding: 8px 13px 8px 8px; } .tl { height: 78px; } }
.overlay.scroll { place-items: start center; overflow-y: auto; }
.overlay .card.wide { max-width: 640px; margin: 24px 0; }
.overlay h1 { margin: 2px 0 6px; }
/* Modus Bühne: Aufbau bearbeiten */
.buehne #gProps, .buehne #gTrail, .buehne #gOver, .buehne #gDancers { display: none; }
.buehne #stage { touch-action: none; }
.buehne .teil { cursor: grab; }
.buehne .gridl, .buehne .floor, .buehne .band, .buehne .edge-lbl, .buehne .prop-lbl { pointer-events: none; }
.bh-hit { fill: transparent; }
.bh-ecke { fill: var(--bg); stroke: var(--spike); stroke-width: .06; }
.bh-ecke.on { fill: var(--spike); }
.bh-plus { fill: var(--panel-2); stroke: #c9c6bf; stroke-width: .04; }
.bh-plus-t { fill: #c9c6bf; font-family: var(--f-mono); font-size: .26px; text-anchor: middle; pointer-events: none; }
/* Diktat */
.buehne #gVorschlag { display: none; }
.vorschlag { fill: none; stroke-width: .09; stroke-dasharray: .25 .15; stroke-linecap: round; stroke-linejoin: round; }
.vorschlag-end { fill: none; stroke-width: .07; }
.dk-text { width: 100%; min-height: 84px; background: var(--bg); color: inherit; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-family: var(--f-body); font-size: 15px; resize: vertical; }
.dk-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dk-liste label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.dk-liste input { margin-top: 3px; }
.dk-liste i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.dk-liste .aus { opacity: .5; }

