:root {
  --bg: rgba(18, 22, 30, 0.82);
  --bg2: rgba(34, 40, 52, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --text: #e9eef5;
  --muted: #9aa6b6;
  --acc: #3fa3ff;
  --acc2: #ffb020;
  --danger: #ff5a5a;
  --ok: #46d17a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1117; color: var(--text); font: 13px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
#view { position: fixed; inset: 0; }
#view canvas { display: block; }
button, select, input { font: inherit; color: inherit; }
button { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap; }
button:hover { background: rgba(70, 82, 104, 0.95); border-color: rgba(255,255,255,.25); }
button.primary { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button.ghost { background: transparent; }
button.danger { color: var(--danger); }
button.small { padding: 4px 8px; font-size: 12px; }
button:disabled { opacity: .45; cursor: not-allowed; }
select, input[type=text], input[type=number], input:not([type]), .name { background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; width: 100%; }
kbd { background: rgba(255,255,255,.12); border-radius: 4px; padding: 0 5px; font-size: 11px; font-family: ui-monospace, monospace; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }

#topbar { position: fixed; top: 0; left: 0; right: 0; height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); z-index: 10; }
#topbar .lang-sel { width: auto; padding: 5px 6px; cursor: pointer; }
.brand { font-weight: 800; font-size: 16px; letter-spacing: .3px; margin-right: 6px; white-space: nowrap; }
.brand .small { font-weight: 400; letter-spacing: 0; }
.brand .logo svg { width: 22px; height: 22px; vertical-align: -5px; margin-right: 2px; }
.brand-hot { color: #ff8a1e; }
.parklist .pk { display: flex; gap: 6px; margin: 3px 0; }
.parklist .nm { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.parklist .pk.active .nm { border-color: var(--acc); font-weight: 600; }
.logo { color: var(--acc2); }
.spacer { flex: 1; }
.name { max-width: 210px; text-align: center; font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; }
.seg button.active { background: var(--acc); color: #fff; }
.seg.small button { padding: 4px 8px; font-size: 12px; }

.panel { position: fixed; top: 56px; bottom: 8px; width: 300px; overflow-y: auto; background: var(--bg); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 12px; z-index: 5; scrollbar-width: thin; }
#left { left: 8px; }
#right { right: 8px; width: 270px; }
.panel section { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.panel h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row > button { flex: 1; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tabs button { padding: 3px 8px; font-size: 12px; border-radius: 20px; }
.tabs button.active { background: var(--acc); border-color: var(--acc); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.piece { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 3px; font-size: 11px; line-height: 1.15; text-align: center; white-space: normal; min-height: 64px; }
.piece svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.piece.active { border-color: var(--acc2); background: rgba(255,176,32,.16); color: #ffd58a; }
.param { margin: 6px 0 10px; }
.param .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.param .val { display: flex; align-items: center; gap: 4px; }
.param .val input { width: 70px; padding: 2px 6px; text-align: right; }
.param .auto { font-size: 11px; padding: 1px 6px; border-radius: 10px; }
.param .auto.on { background: var(--ok); color: #082; border-color: var(--ok); color: #fff; }
input[type=range] { width: 100%; accent-color: var(--acc); }
.dirsw { display: flex; gap: 6px; }
.dirsw button { flex: 1; }
.dirsw button.active { background: var(--acc); color: #fff; }
.preview-info { font-size: 12px; background: rgba(0,0,0,.25); border-radius: 8px; padding: 6px 8px; min-height: 20px; }
.preview-info .bad { color: var(--danger); font-weight: 600; }
.preview-info .warn { color: var(--acc2); }

.stats { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 12.5px; }
.stats b { text-align: right; font-variant-numeric: tabular-nums; }
#warnings div { margin-top: 6px; font-size: 12px; padding: 5px 8px; border-radius: 7px; background: rgba(255,90,90,.15); color: #ffb3b3; }
#warnings div.ok { background: rgba(70,209,122,.14); color: #a8f0c4; }
.lbl { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 12px; }
.chk { display: flex; align-items: center; gap: 6px; margin: 8px 0; cursor: pointer; }
.legend { height: 10px; border-radius: 5px; margin: 6px 0 2px; display: none; }
.legend.on { display: block; }
.legend-lbl { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
#hud::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.45) 100%); }
.hud-left { position: absolute; left: 18px; bottom: 18px; background: var(--bg); border-radius: 14px; padding: 12px 16px; min-width: 190px; border: 1px solid var(--line); }
.speed { font-size: 46px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.speed small { font-size: 14px; margin-left: 4px; color: var(--muted); font-weight: 500; }
.hud-row { display: flex; justify-content: space-between; gap: 18px; margin-top: 4px; color: var(--muted); }
.hud-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.gmeter { position: absolute; right: 18px; bottom: 18px; background: var(--bg); border-radius: 14px; padding: 8px; border: 1px solid var(--line); text-align: center; }
.gvals { display: flex; justify-content: space-around; font-size: 12px; color: var(--muted); }
.gvals b { color: var(--text); font-variant-numeric: tabular-nums; }
.hud-cams { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: auto; flex-wrap: wrap; justify-content: center; }
.hud-cams button { background: var(--bg); }
.hud-cams button.active { background: var(--acc); color: #fff; }
body.ride #left, body.ride #right { display: none; }
body.ride #hint { display: none; }

.hint { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); background: var(--bg); border: 1px solid var(--line); padding: 7px 14px; border-radius: 20px; font-size: 12.5px; z-index: 4; pointer-events: none; max-width: calc(100% - 640px); text-align: center; }
.hint:empty { display: none; }
.selbar { position: fixed; bottom: 52px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: 6px; align-items: center; background: var(--bg); border: 1px solid #40ff70; border-radius: 12px; padding: 6px 8px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.selbar[hidden] { display: none; }
.bendpad { position: fixed; left: 0; top: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; will-change: transform; }
.bendpad[hidden] { display: none; }
.bp-grid { display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(3, 34px); gap: 3px; }
.bp-grid button { pointer-events: auto; padding: 0; width: 34px; height: 34px; border-radius: 50%; font-size: 14px; background: var(--bg); border-color: rgba(255,255,255,.22); box-shadow: 0 3px 10px rgba(0,0,0,.45); backdrop-filter: blur(6px); }
.bp-grid button:hover { background: var(--acc); border-color: var(--acc); color: #fff; }
.bp-grid .bp-bank { font-size: 17px; color: var(--acc2); }
.bp-grid .bp-ok { background: rgba(70, 209, 122, .85); border-color: var(--ok); color: #fff; font-weight: 700; }
.bp-label { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 2px 8px; font-size: 11px; white-space: nowrap; color: var(--muted); }
body.ride .bendpad, body.mech .bendpad { display: none; }
.selbar .nm { font-size: 12.5px; padding: 0 6px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
body.ride .selbar { display: none; }
#toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#toast div { background: var(--bg2); border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: fade 3.5s forwards; }
@keyframes fade { 0% { opacity: 0; transform: translateY(-6px); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(8, 12, 18, 0.72); z-index: 30; font-size: 15px; }
#loading[hidden] { display: none; }
.spinner { width: 46px; height: 46px; border: 4px solid rgba(255,255,255,.15); border-top-color: var(--acc2); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

dialog { background: #161b24; color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(560px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(0,0,0,.55); }
.dlg { padding: 18px 20px; }
.dlg h2 { margin: 0 0 6px; font-size: 18px; }
.dlg p { margin: 0 0 10px; }
.dlg label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.dlg label.chk { flex-direction: row; color: var(--text); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.results { max-height: 160px; overflow-y: auto; margin: 6px 0; }
.results button { display: block; width: 100%; text-align: left; margin: 3px 0; white-space: normal; font-size: 12px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.presets button { font-size: 12px; padding: 4px 9px; border-radius: 20px; }
.help ol { padding-left: 18px; }
.help li { margin: 6px 0; }

@media (max-width: 900px) {
  .panel { width: 46%; }
  #right { width: 46%; }
  .brand, .name, #btnDemo { display: none; }
  .hint { display: none; }
}

.ride-settings { position: absolute; top: 100px; right: 18px; width: 240px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 10px; pointer-events: auto; }
#gfx { position: absolute; inset: 0; pointer-events: none; }
#gfx div { position: absolute; inset: 0; opacity: 0; }
#gfx .grey { background: radial-gradient(ellipse at center, rgba(40,40,40,.25) 15%, rgba(0,0,0,.97) 70%); }
#gfx .red { background: radial-gradient(ellipse at center, rgba(160,0,0,.25) 20%, rgba(90,0,0,.9) 75%); mix-blend-mode: multiply; }

.slots { display: grid; gap: 6px; margin: 8px 0 12px; max-height: 46vh; overflow-y: auto; }
.slot { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.slot b { display: block; font-size: 13px; }
.slot span { font-size: 11px; color: var(--muted); }
.slot .n { font-size: 12px; color: var(--ok); white-space: nowrap; }
.slot .n.none { color: var(--muted); }
code { background: rgba(255,255,255,.08); padding: 0 4px; border-radius: 4px; }

.examples { display: grid; gap: 6px; margin: 10px 0; max-height: 55vh; overflow-y: auto; }
.examples button { display: grid; grid-template-columns: 1fr auto; text-align: left; white-space: normal; gap: 2px 10px; padding: 8px 10px; }
.examples b { font-size: 14px; }
.examples .maker { color: var(--acc2); font-size: 12px; text-align: right; }
.examples .facts { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }

.attrib { position: fixed; left: 320px; bottom: 4px; font-size: 10.5px; color: rgba(255,255,255,.85); text-shadow: 0 1px 2px #000; z-index: 4; pointer-events: none; max-width: 50%; }
.attrib:empty { display: none; }
body.ride .attrib { left: 230px; }

/* ===== Technikmodus (Ride Mechanic) ===== */
body.mech #left, body.mech #right, body.mech .selbar { display: none; }
.mech-panel { position: fixed; top: 56px; right: 8px; bottom: 8px; width: min(600px, calc(100% - 360px)); display: flex; flex-direction: column; background: var(--bg); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 12px; z-index: 6; overflow: hidden; }
.mech-tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); }
.mech-tabs button { border-radius: 8px 8px 0 0; border-bottom: none; background: transparent; }
.mech-tabs button.active { background: var(--bg2); color: var(--acc); }
.mech-body { flex: 1; overflow-y: auto; scrollbar-width: thin; }
.mech-body section { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.mech-body h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.mech-body .row { display: flex; gap: 6px; align-items: center; margin: 4px 0; flex-wrap: wrap; }
.mech-body .row input:not([type=checkbox]) { width: auto; }
.mech-body p { margin: 6px 0; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.bad { color: var(--danger); } .warn { color: var(--acc2); } .ok { color: var(--ok); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: #e02020; }
.dot.on { background: #20e040; box-shadow: 0 0 6px #20e040; }
.train-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.sensor-row.sel, table.io tr.sel { background: rgba(63,163,255,.15); }
table.io { width: 100%; border-collapse: collapse; font-size: 12px; }
table.io th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 4px; border-bottom: 1px solid var(--line); }
table.io td { padding: 2px 4px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
table.io td.val { text-align: center; min-width: 30px; border-radius: 4px; }
table.io td.val.on { background: rgba(32,224,64,.25); color: #8dffa5; }
table.io td.val.forced { outline: 1px dashed var(--acc2); }
table.io select, table.io input { padding: 1px 3px; width: auto; max-width: 150px; }
.blk-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px 0; }
.blk-tabs button { font-size: 12px; padding: 4px 8px; }
.blk-tabs button.active { border-color: var(--acc); color: var(--acc); }
.blk-tabs button.off { opacity: .5; text-decoration: line-through; }
.blk-tabs button.err { border-color: var(--danger); }
.blk-tabs .lang { font-size: 9.5px; background: rgba(255,255,255,.12); padding: 0 4px; border-radius: 3px; margin-right: 2px; }
.prog-bar { padding: 6px 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.prog-bar .spacer { flex: 1; }
.prog-bar input { width: auto; }
.prog-err { margin: 0 10px 6px; padding: 6px 8px; border: 1px solid var(--danger); border-radius: 8px; background: rgba(255,90,90,.1); color: #ffb3b3; font-size: 12px; }
.st-editor { position: relative; display: flex; margin: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.4); height: 52vh; overflow: hidden; }
.st-lines { margin: 0; padding: 8px 6px; min-width: 36px; text-align: right; color: #5c6776; background: rgba(0,0,0,.25); font: 12.5px/1.45 ui-monospace, Consolas, monospace; overflow: hidden; user-select: none; }
.st-lines .err { color: #fff; background: var(--danger); border-radius: 3px; padding: 0 2px; }
.st-editor textarea { flex: 1; margin: 0; padding: 8px; border: 0; outline: none; resize: none; background: transparent; color: #dfe7f1; font: 12.5px/1.45 ui-monospace, Consolas, monospace; white-space: pre; tab-size: 2; }
.st-view { margin: 0 10px; padding: 8px; max-height: 52vh; overflow: auto; background: rgba(0,0,0,.4); border-radius: 8px; font-size: 12px; }
.mech-body > div > .muted.small, #pEdit > .muted.small { padding: 4px 10px; }
.watch { margin: 8px 10px 10px; }
.watch summary { cursor: pointer; color: var(--muted); }
#pWatch { columns: 2; padding: 6px 0; }
#pWatch .on { color: #8dffa5; }
.kop { padding: 4px 10px; display: flex; flex-direction: column; gap: 8px; }
.rung { border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: rgba(0,0,0,.25); }
.rung-head { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.rung-head input { flex: 1; width: auto; }
.rung-body { display: flex; align-items: stretch; }
.rail { width: 3px; background: #6b7a8f; border-radius: 2px; }
.branches { display: flex; flex-direction: column; gap: 4px; border-right: 2px solid #6b7a8f; padding: 2px 0; }
.branch { display: flex; align-items: center; position: relative; }
.branch::before { content: ''; width: 10px; height: 2px; background: #6b7a8f; }
.branch.flow::before, .branch.flow .wire { background: #20e040; }
.wire { width: 14px; height: 2px; background: #6b7a8f; }
.wire.grow { flex: 1; min-width: 14px; align-self: center; }
.cell { min-width: 74px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; text-align: center; cursor: pointer; background: rgba(255,255,255,.04); }
.cell:hover { border-color: var(--acc); }
.cell .sym { font: 600 13px ui-monospace, Consolas, monospace; letter-spacing: -1px; }
.cell .var { font: 11px ui-monospace, Consolas, monospace; color: #cfe3ff; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .pt { font-size: 10px; color: var(--muted); }
.cell.on { border-color: #20e040; background: rgba(32,224,64,.18); }
.cell.out { align-self: center; }
.add-c, .del-b { padding: 0 6px; margin-left: 4px; font-size: 11px; }
.kop-edit { margin: 8px 10px; padding: 8px; border: 1px solid var(--acc); border-radius: 8px; background: var(--bg2); }
.kop-edit .row input, .kop-edit .row select { width: auto; flex: 1; }
.log { padding: 2px 0; font-size: 12px; }
.log.bad, .log.crash { color: var(--danger); } .log.warn { color: var(--acc2); }
.log.crash { font-weight: 600; }
.mech-pult { position: fixed; left: 8px; bottom: 8px; width: 330px; background: var(--bg); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; z-index: 6; }
.pult-title { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); display: flex; justify-content: space-between; }
.pult-row { display: flex; gap: 8px; align-items: center; margin: 7px 0; }
.pult-row select { width: auto; padding: 2px 4px; }
.pbtn { width: 78px; height: 56px; border-radius: 10px; font-weight: 700; font-size: 12px; line-height: 1.15; color: #fff; border: 2px solid rgba(0,0,0,.4); box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); }
.pbtn.green { background: #1d8f3e; } .pbtn.blue { background: #1f5fb8; }
.pbtn.held { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); filter: brightness(1.25); }
.pbtn.estop { background: radial-gradient(circle at 50% 40%, #ff4a4a, #b30d0d); border-radius: 50%; width: 64px; height: 64px; border: 4px solid #f5c400; margin-left: auto; }
.pbtn.estop.pressed { transform: scale(.92); box-shadow: inset 0 3px 8px rgba(0,0,0,.6); }
.lamp-wrap { display: flex; align-items: center; gap: 4px; }
.lamp { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: #1b3a22; border: 1px solid rgba(255,255,255,.2); }
.lamp.on { background: #39ff6a; box-shadow: 0 0 10px #39ff6a; }
.lamp.red { background: #3a1b1b; } .lamp.red.on { background: #ff3b3b; box-shadow: 0 0 10px #ff3b3b; }
.lamp.amber { background: #3a321b; } .lamp.amber.on { background: #ffc23b; box-shadow: 0 0 10px #ffc23b; }
.switch { display: flex; gap: 4px; align-items: center; margin-right: auto; }
.plc-state { font-weight: 600; margin-right: auto; }
.plc-state.ok { color: var(--ok); } .plc-state.warn { color: var(--acc2); } .plc-state.bad { color: var(--danger); }
.pult-alarm { margin-top: 6px; padding: 6px 8px; background: rgba(255,60,60,.18); border: 1px solid var(--danger); border-radius: 8px; color: #ffc4c4; font-size: 12px; font-weight: 600; }
body.mech .hint { max-width: calc(100% - 980px); left: calc(50% - 130px); }
.mech-panel[hidden], .mech-pult[hidden] { display: none !important; }
body:not(.mech) .mech-panel, body:not(.mech) .mech-pult { display: none !important; }
.support-pop { position: fixed; z-index: 20; width: 320px; background: var(--bg2); border: 1px solid #40ff70; border-radius: 10px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 6px; }
.support-pop .seg { display: flex; flex-wrap: wrap; gap: 3px; }
.support-pop .seg button.active { background: var(--acc); border-color: var(--acc); color: #fff; }
.mech-pult { width: 410px; }
.pgroup { display: flex; align-items: center; gap: 4px; }
.pbox { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; }
.plabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 3px; }
.pbtn.small { width: auto; min-width: 54px; height: 36px; font-size: 10.5px; padding: 2px 6px; background: #3a4352; }
.pbtn.white { background: #5b6575; }
.pbtn.toggle.on { background: #b36b00; box-shadow: inset 0 2px 4px rgba(0,0,0,.4); }
.lamp.white { background: #33363b; } .lamp.white.on { background: #f4f7ff; box-shadow: 0 0 10px #f4f7ff; }
.keysw { display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 18px; padding: 3px 8px; }
.pult-row.lamps { gap: 6px; }
.pult-block { margin-top: 4px; padding: 4px 8px; border: 1px solid var(--acc2); border-radius: 8px; color: #ffd890; }
.pult-alarm .al { padding: 3px 0; border-bottom: 1px solid rgba(255,90,90,.25); font-weight: 400; }
.pult-alarm .al:last-child { border-bottom: 0; }
.pult-alarm .al.warn { color: #ffd890; }
.alarm { padding: 6px 8px; margin: 4px 0; border-radius: 8px; border: 1px solid var(--danger); background: rgba(255,90,90,.08); font-size: 12px; }
.alarm.warn { border-color: var(--acc2); background: rgba(255,176,32,.07); }
.alarm .row { margin: 0 0 2px; gap: 8px; }
.alarm .row b { flex: 1; }
.alarm.gone, .pult-alarm .al.gone { opacity: .6; }

/* Mitfahren im Technikmodus */
body.mechride .mech-panel { display: none !important; }
body.mechride.mechride-panel .mech-panel { display: flex !important; }
body.mechride-clean .mech-pult { display: none !important; }
body.mechride-clean.mechride-panel .mech-pult { display: block !important; }
body.mechride:not(.mechride-clean) .hud-left, body.mechride.mechride-panel .hud-left { left: 440px; }
body.mechride.mechride-panel .gmeter { display: none; }
body.mechride #hint { display: none; }

/* Fortschrittsbalken der Fahrt */
.ride-bar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(760px, calc(100% - 520px)); min-width: 300px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px 10px; pointer-events: auto; backdrop-filter: blur(8px); }
.rb-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.rb-top button { padding: 2px 8px; }
.rb-elem { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.rb-track { position: relative; height: 18px; border-radius: 9px; background: rgba(255,255,255,.08); cursor: pointer; touch-action: none; }
.rb-bands, .rb-ticks { position: absolute; inset: 0; border-radius: 9px; overflow: hidden; pointer-events: none; }
.rb-bands div { position: absolute; top: 0; bottom: 0; opacity: .55; }
.rb-ticks div { position: absolute; top: 3px; bottom: 3px; width: 1px; background: rgba(255,255,255,.35); }
.rb-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 9px; background: rgba(63,163,255,.35); pointer-events: none; }
.rb-head { position: absolute; top: -3px; width: 6px; height: 24px; margin-left: -3px; border-radius: 3px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.6); pointer-events: none; }
.rb-hover { position: absolute; bottom: 24px; transform: translateX(-50%); background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; font-size: 11.5px; white-space: nowrap; pointer-events: none; }
body.mechride .ride-bar { display: none; }

/* Lösungsvorschläge und Fix-Button an den Meldungen */
.al-cause { margin-top: 3px; font-weight: 600; }
.al-hint { margin-top: 3px; opacity: .9; }
.fix-btn { margin-top: 4px; background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }
.mech-hudalarm { display: none; position: fixed; top: 104px; left: 50%; transform: translateX(-50%); width: min(460px, calc(100% - 32px)); margin: 0; background: rgba(60,12,12,.9); z-index: 7; }
body.mechride-clean:not(.mechride-panel) .mech-hudalarm:not([hidden]) { display: block; }

/* Einstellungen der markierten Anlage (SlingShot) */
.ride-edit { position: fixed; bottom: 106px; left: 50%; transform: translateX(-50%); z-index: 5; width: min(420px, calc(100% - 32px)); box-sizing: border-box; background: var(--bg); border: 1px solid #40ff70; border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.ride-edit[hidden], body.ride .ride-edit, body.mech .ride-edit { display: none; }
.ride-edit label { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; font-size: 12.5px; }
.ride-edit label input { grid-column: 1 / -1; width: 100%; }
.re-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 2px; }
