:root {
  --bg: #08090b; --panel: #101216; --panel2: #171a20; --line: #23272f; --line2: #2e333d; --text: #e3e6ec; --dim: #8b93a3;
  --accent: #3ea6ff; --accent2: #ff9a3c; --ok: #3ddc84; --warn: #ffc23d; --bad: #ff4d5e; --demo: #9b7bff;
  --r: 6px; --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.4 var(--font); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); padding: 5px 10px; cursor: pointer; white-space: nowrap; }
button:hover { border-color: #3a4556; } button.primary { background: var(--accent); color: #041018; border-color: var(--accent); font-weight: 600; }
button.on { background: #1f3346; border-color: var(--accent); color: #fff; } button.danger { border-color: #5a2630; color: #ff9aa5; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { background: #0b0e13; border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; min-width: 0; }
input[type=range] { padding: 0; accent-color: var(--accent); width: 100%; } input[type=checkbox] { accent-color: var(--accent); }
#topbar { height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .14em; color: #fff; margin-right: 6px; }
.brand svg { color: var(--accent); } .brand em { font-style: normal; font-weight: 400; letter-spacing: .05em; color: var(--dim); }
.seg { display: flex; } .seg button { border-radius: 0; margin-left: -1px; } .seg button:first-child { border-radius: var(--r) 0 0 var(--r); } .seg button:last-child { border-radius: 0 var(--r) var(--r) 0; }
.spacer { flex: 1; }
.conn { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: .06em; min-width: 108px; justify-content: center; }
.conn .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--demo); box-shadow: 0 0 8px var(--demo); }
.conn.live .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 1s infinite; } .conn.connected .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.conn.offline .dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); } .conn.connecting .dot { background: var(--warn); animation: pulse .5s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
main { position: absolute; top: 46px; bottom: 24px; left: 0; right: 0; display: flex; }
#side { width: 360px; min-width: 300px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
#tabs { display: flex; border-bottom: 1px solid var(--line); } #tabs button { flex: 1; border: 0; border-radius: 0; background: none; padding: 9px 2px; color: var(--dim); border-bottom: 2px solid transparent; }
#tabs button.on { color: #fff; border-bottom-color: var(--accent); }
#panes { flex: 1; overflow: auto; } .tab { display: none; padding: 10px; } .tab.on { display: block; }
#viewport { flex: 1; position: relative; overflow: hidden; min-width: 0; min-height: 0; } #viewport > canvas { display: block; width: 100% !important; height: 100% !important; }
#hud { position: absolute; left: 10px; top: 8px; color: var(--dim); font: 11px var(--mono); pointer-events: none; text-shadow: 0 1px 2px #000; }
#drop { position: absolute; inset: 10px; border: 2px dashed var(--accent); border-radius: 12px; display: none; align-items: center; justify-content: center; background: #4fb3ff14; font-size: 18px; z-index: 5; pointer-events: none; }
#drop.on { display: flex; }
#toast { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 6; }
#toast div { background: #1c2230ee; border: 1px solid var(--line); padding: 8px 14px; border-radius: 8px; max-width: 520px; }
#toast div.err { border-color: var(--bad); } #toast div.ok { border-color: var(--ok); }
#status { position: absolute; bottom: 0; left: 0; right: 0; height: 24px; display: flex; gap: 18px; align-items: center; padding: 0 10px; background: var(--panel); border-top: 1px solid var(--line); color: var(--dim); font: 11px var(--mono); }
h3 { margin: 14px 0 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 600; } h3:first-child { margin-top: 2px; }
.row { display: flex; gap: 6px; align-items: center; margin: 5px 0; flex-wrap: wrap; } .row > label { color: var(--dim); min-width: 96px; } .row > input:not([type=checkbox]), .row > select { flex: 1; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; } .grid3 input { width: 100%; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.list { border: 1px solid var(--line); border-radius: var(--r); max-height: 46vh; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; } th, td { padding: 4px 6px; text-align: left; border-bottom: 1px solid #1b2029; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--panel2); color: var(--dim); font-weight: 500; z-index: 1; }
tr.sel td { background: #1f3346; } tr:hover td { background: #161c26; cursor: pointer; } td.mono, .mono { font-family: var(--mono); }
.chan { display: grid; grid-template-columns: 92px 1fr 38px 18px; gap: 6px; align-items: center; margin: 2px 0; font-size: 12px; }
.chan .n { overflow: hidden; text-overflow: ellipsis; color: var(--dim); } .chan .v { font: 11px var(--mono); text-align: right; } .chan.held .n { color: var(--accent2); }
.note { color: var(--dim); font-size: 12px; margin: 6px 0; } .warn { color: var(--warn); } .bad { color: var(--bad); } .ok { color: var(--ok); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 12px; } .kv span:nth-child(odd) { color: var(--dim); } .kv span:nth-child(even) { font-family: var(--mono); text-align: right; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-size: 11px; }
.bar { height: 6px; background: #0b0e13; border-radius: 3px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--ok); } .bar.w > i { background: var(--warn); } .bar.b > i { background: var(--bad); }
#umon { width: 100%; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 4px; background: #000; }
.modal { position: fixed; inset: 0; background: #000a; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; } .modal.hidden { display: none; }
.modal .card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(720px, 100%); max-height: 90vh; overflow: auto; position: relative; padding: 18px 20px; }
.modal .x { position: sticky; float: right; top: 0; margin: -8px -10px 0 8px; z-index: 3; min-width: 36px; min-height: 36px; border: 0; border-radius: 18px; background: #15181dd9; font-size: 20px; } /* stays on screen while the dialog scrolls */
.steps { display: flex; gap: 4px; margin: 6px 0 14px; } .steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); } .steps i.on { background: var(--accent); }
.wiz h2 { margin: 0 0 4px; font-size: 18px; } .wiz ol { padding-left: 20px; } .wiz li { margin: 5px 0; } .wiz code, kbd { font-family: var(--mono); background: #0b0e13; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.check { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }
.check .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); } .check.ok .dot { background: var(--ok); } .check.mid .dot { background: var(--warn); }
.issue { font-size: 12px; padding: 3px 0; border-bottom: 1px dashed #1b2029; } .issue.warn { color: var(--warn); }
.mobile-only { display: none; }
@media (max-width: 820px) {
  .mobile-only { display: inline-block; } #gizmo, #rmode, .brand em { display: none; } #views button { padding: 5px 7px; }
  #side { position: absolute; left: 0; right: 0; bottom: 0; top: 40%; width: auto; z-index: 4; transform: translateY(100%); transition: transform .2s; border-right: 0; border-top: 1px solid var(--line); }
  #side.open { transform: none; } #btnOpen { padding: 5px 8px; } .conn { min-width: 0; } .conn .lbl { display: none; }
}
.startgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.startcard { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; white-space: normal; padding: 14px; border-radius: 10px; background: var(--panel2); }
.startcard:hover { border-color: var(--accent); background: #1a2433; } .startcard .ic { font-size: 22px; } .startcard b { font-size: 14px; color: #fff; } .startcard span { color: var(--dim); font-size: 12px; }
#rec.on { background: #5a1620; border-color: var(--bad); color: #fff; animation: pulse 1s infinite; }
button.icon { padding: 5px 9px; font-weight: 700; }
@media (max-width: 820px) { #cams, #rec { display: none; } }
@media (max-width: 520px) {
  #topbar { gap: 5px; padding: 0 max(8px, env(safe-area-inset-left, 0px)); overflow-x: auto; }
  .brand span { display: none; } #views [data-view=side], #views [data-view=foh] { display: none; }
  #btnOpen { font-size: 12px; } .startgrid { grid-template-columns: 1fr 1fr; } .startcard { padding: 10px; }
}
.pmrow { display: grid; grid-template-columns: 34px 1fr 36px; gap: 6px; align-items: center; margin: 3px 0; }
.pmbar { position: relative; height: 14px; background: #0b0e13; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.pmbar i { position: absolute; top: 1px; bottom: 1px; background: #2c5c84; border-right: 1px solid #0b0e13; cursor: pointer; }
.pmbar i:hover { background: var(--accent); } .pmbar i.sel { background: var(--accent2); } .pmbar i.bad { background: var(--bad); }
.pmu { color: var(--dim); font-size: 11px; }
.songline { position: relative; height: 26px; background: #0b0e13; border: 1px solid var(--line); border-radius: 4px; margin: 10px 0 4px; overflow: hidden; }
.songline i { position: absolute; top: 0; bottom: 0; font: 600 10px var(--font); font-style: normal; color: #fff; padding: 6px 4px; overflow: hidden; white-space: nowrap; cursor: pointer; border-right: 1px solid #0b0e13; }
#cueTable input[type=color] { width: 22px; height: 20px; padding: 0; border: 0; background: none; }
.prevbox { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: 100%; max-width: 320px; aspect-ratio: 4 / 3; background: #15181f; }
.prevbox canvas { width: 100% !important; height: 100% !important; display: block; }

/* ---------- pro polish ---------- */
body { -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1; }
button { height: 28px; padding: 0 11px; border-color: var(--line2); background: linear-gradient(#1c2027, #16191f); transition: border-color .12s, background .12s, box-shadow .12s; }
button:hover:not(:disabled) { border-color: #4a5466; background: linear-gradient(#232831, #1a1e25); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 2px #3ea6ff66; border-color: var(--accent); }
button.primary { background: linear-gradient(#4cb0ff, #2b93ec); border-color: #2b93ec; color: #04121f; box-shadow: 0 1px 0 #ffffff30 inset, 0 2px 10px #3ea6ff30; }
button.primary:hover:not(:disabled) { background: linear-gradient(#62bbff, #3a9ff2); border-color: #62bbff; }
button.on { background: linear-gradient(#1d3550, #182b40); border-color: var(--accent); box-shadow: 0 0 0 1px #3ea6ff33 inset; }
input, select, textarea { background: #0b0d11; border-color: var(--line2); border-radius: 5px; height: 28px; }
textarea { height: auto; } input[type=checkbox] { height: auto; } input[type=range] { height: 18px; }
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, #2b93ec, #3ea6ff) 0/var(--p, 50%) 100% no-repeat, #262b34; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #e9eef5; border: 2px solid #2b93ec; box-shadow: 0 1px 4px #000a; }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: #262b34; } input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: #2b93ec; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #e9eef5; border: 2px solid #2b93ec; }
#topbar { background: linear-gradient(#14171c, #0f1115); box-shadow: 0 1px 0 #000, 0 6px 18px #0006; position: relative; z-index: 3; }
.brand { font-size: 13px; } .brand svg { filter: drop-shadow(0 0 6px #3ea6ff88); }
#side { background: linear-gradient(#111317, #0e1013); }
#tabs { background: #0c0e11; } #tabs button { height: 38px; font-size: 12px; letter-spacing: .02em; } #tabs button:hover { color: var(--text); background: #14171c; }
#tabs button.on { color: #fff; border-bottom-color: var(--accent); background: linear-gradient(transparent 60%, #3ea6ff12); }
.tab { padding: 12px 14px 24px; }
h3 { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 10.5px; letter-spacing: .14em; color: #9aa3b4; }
h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
.row > label { font-size: 12px; }
.list { background: #0b0d10; } th { background: #161a20; font-size: 11px; letter-spacing: .03em; } tr:hover td { background: #141922; }
.modal { backdrop-filter: blur(6px); background: #02030599; } .modal .card { background: linear-gradient(#15181d, #111317); border-color: var(--line2); box-shadow: 0 24px 80px #000c; border-radius: 14px; }
#status { background: #0c0e11; } #toast div { backdrop-filter: blur(8px); background: #161b24e6; box-shadow: 0 8px 30px #0008; }
.conn { border: 1px solid var(--line2); border-radius: 14px; height: 28px; padding: 0 12px; background: #0c0e11; }
table.mini td { padding: 2px 6px; font-size: 11.5px; } details summary { cursor: pointer; padding: 4px 0; color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #262b34; border-radius: 6px; border: 2px solid #101216; } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- client presentation mode ---------- */
body.present #topbar, body.present #side, body.present #status, body.present #hud { display: none; }
body.present main { top: 0; bottom: 0; }
#present { position: absolute; inset: 0; pointer-events: none; z-index: 4; display: none; }
body.present #present { display: block; }
#present .title { position: absolute; left: 48px; bottom: 44px; color: #fff; text-shadow: 0 2px 20px #000; transition: opacity 1.2s; }
#present .title b { display: block; font: 600 34px/1.1 var(--font); letter-spacing: .01em; } #present .title span { font: 500 13px var(--font); letter-spacing: .24em; text-transform: uppercase; color: #c9d3e3; }
#present .bars::before, #present .bars::after { content: ""; position: absolute; left: 0; right: 0; height: 7vh; background: #000; } #present .bars::before { top: 0; } #present .bars::after { bottom: 0; }
#present .exit { position: absolute; right: 18px; top: 14px; pointer-events: auto; opacity: .0; transition: opacity .3s; } #present:hover .exit { opacity: .9; }

#navhud { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font: 600 12px var(--font); color: #e8eef6; background: #0c0f14cc; border: 1px solid var(--line2); border-radius: 14px; padding: 4px 12px; pointer-events: none; z-index: 3; }
#navhud:empty { display: none; }
.camwheel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #0e1116ee; backdrop-filter: blur(8px); border: 1px solid var(--line2); border-radius: 12px; padding: 8px; min-width: 230px; z-index: 6; box-shadow: 0 16px 50px #000a; }
.camwheel .t { font: 700 11px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding: 2px 8px 6px; }
.camwheel [data-n] { padding: 5px 10px; border-radius: 6px; cursor: pointer; } .camwheel [data-n] b { display: inline-block; width: 16px; color: var(--accent); }
.camwheel [data-n].sel { background: #1f3550; } .camwheel [data-n].empty { color: #6a7384; } .camwheel .h { font-size: 11px; color: var(--dim); padding: 6px 8px 2px; }
/* splash + auto-patch (after the global button height rule, which squashed the cards) */
.startcard { height: auto; min-height: 92px; } .startcard select { width: 100%; margin-top: 4px; }
.startcard.hero { width: 100%; margin-top: 12px; min-height: 0; border-color: var(--accent); background: linear-gradient(135deg, #12263a, #151a22); }
.startcard.hero b { font-size: 16px; } .startcard.hero span { font-size: 12.5px; }
.apsteps { display: flex; gap: 4px; margin: 8px 0 12px; flex-wrap: wrap; } .apsteps button { flex: 1; min-width: 110px; }
table.aptypes { width: 100%; border-collapse: collapse; margin-top: 8px; } table.aptypes td, table.aptypes th { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; } table.aptypes select { width: 100%; }
#btnAutoPatch { margin-left: 6px; }
.lookpick h4 { margin: 10px 0 6px; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.palgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 5px; margin-bottom: 8px; }
.palgrid button { height: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px; font-size: 11px; white-space: normal; text-align: left; }
.swatch { display: flex; width: 100%; height: 16px; border-radius: 4px; overflow: hidden; } .swatch i { flex: 1; } .swatch i:first-child { flex: 2; }
.swatch.auto { align-items: center; justify-content: center; font-size: 9px; letter-spacing: .1em; background: linear-gradient(90deg, #ff1000, #ff0090, #1030ff, #00c8ff); color: #fff; }
/* previz */
#tabs button.pv { color: #7fe3a0; font-weight: 700; }
.pvmode { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; display: flex; flex-direction: column; gap: 4px; }
.pvmode.on { border-color: #3ccf75; background: #0f2a1b; }
.univgrid { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; } .univgrid span { padding: 2px 7px; border-radius: 6px; font: 600 11px var(--mono); border: 1px solid var(--line); }
.univgrid .ok { background: #123d24; border-color: #3ccf75; color: #9ff0bf; } .univgrid .no { color: var(--dim); }
body.previz #conn { box-shadow: 0 0 0 2px #3ccf75; }

@media (min-width: 821px) { #side { position: relative; } }
#sideGrip { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: ew-resize; z-index: 6; }
#sideGrip:hover, body.resizing #sideGrip { background: rgba(79,179,255,.35); }
body.resizing { cursor: ew-resize; user-select: none; }
#appmode button[data-m="previz"].on { background: #1f6f3f; color: #fff; }
#appmode button[data-m="show"].on { background: #6a3fa0; color: #fff; }
#appmode button[data-m="demo"].on { background: #2d5d8f; color: #fff; }
@media (max-width: 820px) { #sideGrip { display: none; } }

.sniffgrid { display: grid; grid-template-columns: repeat(32, 1fr); gap: 1px; font: 9px/1 ui-monospace, Menlo, monospace; margin: 6px 0; }
.sniffgrid .sc { padding: 3px 0; text-align: center; border-radius: 2px; min-width: 0; overflow: hidden; }
@media (max-width: 820px) { .sniffgrid { grid-template-columns: repeat(16, 1fr); } }
.pill.ok { background: #1f4f33; }

.playbox { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); margin: 8px 0; background: #0b0d10; }
.playbox .big, button.big { font-size: 20px; height: 56px; }
.playbox .tc { font-size: 26px; text-align: center; letter-spacing: .04em; }
p.big { font-size: 18px; user-select: all; }
#appmode button[data-m="playback"].on { background: #8f5a1d; color: #fff; }

.qrbox { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 8px 0; }
.qrbox svg { width: 220px; height: 220px; border-radius: 6px; }
/* phones: one compact, scrollable top bar with the run modes first in reach */
body.phone #topbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
body.phone #topbar::-webkit-scrollbar { display: none; }
body.phone #topbar > * { flex: 0 0 auto; }
body.phone #btnAutoPatch, body.phone #rmode, body.phone #gizmo, body.phone .brand em, body.phone #btnOpen { display: none; }
body.phone #appmode { order: -1; }
body.phone #appmode button { padding: 4px 8px; font-size: 12px; }
body.phone .brand { order: -2; }

#cmdbar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; z-index: 5; pointer-events: none; }
#cmdbar > * { pointer-events: auto; }
#cmdbar input { background: #0b0d10e6; border: 1px solid var(--line2, #333); height: 30px; font-size: 13px; }
#cmdbar #cmdOut, #cmdbar #cmdLooks { grid-column: 2; } #cmdbar #cmdOut:empty, #cmdbar #cmdLooks:empty { display: none; }
#cmdbar #cmdOut { background: #0b0d10cc; padding: 2px 6px; border-radius: 4px; }
#cmdbar .cmdextra { grid-column: 1 / -1; } /* full row: otherwise it widens the CMD label column and squeezes the input */
#cmdbar input { min-width: 0; width: 100%; }
@media (max-width: 820px) { #cmdbar input { font-size: 16px; height: 36px; } } /* 16 px: iOS does not zoom the page on focus */
body.present #cmdbar { display: none; }

.sfg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0; }
.sf { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--dim); } .sf input { width: 100%; }
.setinsp input[type=color] { width: 40px; height: 28px; padding: 0; }

.cuegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; max-height: 56vh; overflow: auto; margin-top: 8px; }
.cuecard { display: grid; grid-template-columns: 1fr auto; gap: 4px; border: 1px solid var(--line); border-radius: 6px; padding: 4px; } .cuecard img { grid-column: 1 / -1; width: 100%; border-radius: 4px; cursor: pointer; background: #000; }
.buskled { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #1a1d22; font-weight: 600; transition: background .1s; } .buskled.hit { background: #ffb020; color: #000; }

/* read-only viewer link */
body.viewer #side, body.viewer #btnOpen, body.viewer #btnAutoPatch, body.viewer #gizmo, body.viewer #appmode, body.viewer #cmdbar, body.viewer #rmode, body.viewer #btnCamPath { display: none !important; }

#execbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; background: #0c0e12f2; border-top: 1px solid var(--line); padding: 6px 8px 8px; backdrop-filter: blur(6px); }
#execbar .exhead { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; } #execbar .exhead button.on { background: #2d5d8f; color: #fff; }
#execbar .exrow { display: flex; gap: 6px; overflow-x: auto; }
#execbar .exslot { flex: 0 0 86px; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: #12151a; }
#execbar .exslot.on { border-color: #ffb020; box-shadow: 0 0 0 1px #ffb020 inset; } #execbar .exslot.grand { background: #1a1416; }
#execbar .exlabel { font-size: 11px; font-weight: 600; height: 28px; overflow: hidden; cursor: pointer; text-align: center; line-height: 14px; }
#execbar .vfader { writing-mode: vertical-lr; direction: rtl; height: 120px; width: 28px; align-self: center; margin: 2px 0; }
#execbar button { height: 26px; padding: 0 4px; font-size: 12px; }
body.present #execbar, body.viewer #execbar, body.viewer #btnExec { display: none !important; }
#viewport:has(#execbar:not([style*="none"])) #cmdbar { bottom: 270px; }
.card2{border:1px solid var(--line,#2a2f36);border-radius:8px;padding:8px 10px;margin:6px 0}
.card2.dim{opacity:.55}
#ws{display:flex;margin:6px 8px 0;gap:0}
#ws button{flex:1;font-size:12px;padding:5px 4px}
#tabs button[hidden]{display:none}
.recover{display:flex;gap:8px;align-items:center;flex-wrap:wrap;background:var(--panel,#161a20);border:1px solid #ffb000;border-radius:8px;padding:10px 12px;pointer-events:auto}
@media (min-width: 822px) { body:not(.phone) #topbar { height: auto; min-height: 46px; flex-wrap: wrap; padding: 5px 10px; row-gap: 5px; } }

/* ---- help, feature finder, tour, health ---- */
#btnHelp { font-weight: 600; }
.helpmenu { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 230px; box-shadow: 0 10px 30px #0008; }
.helpmenu.hidden { display: none; } .helpmenu button { text-align: left; border-color: transparent; background: transparent; } .helpmenu button:hover { background: var(--panel2); }
.finder { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; max-height: 55vh; overflow: auto; }
.finder .fitem { text-align: left; background: transparent; border-color: transparent; } .finder .fitem.on, .finder .fitem:hover { background: #1f3346; border-color: var(--accent); }
.modal input[placeholder^="What do you want"] { width: 100%; font-size: 16px; padding: 8px 10px; }
.tourhole { position: fixed; z-index: 80; border-radius: 8px; box-shadow: 0 0 0 9999px #000a, 0 0 0 2px var(--accent); pointer-events: none; transition: all .2s; }
.tourtip { position: fixed; z-index: 81; background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; padding: 12px 14px; box-shadow: 0 12px 40px #000c; }
.tourtip b { font-size: 15px; } .tourtip p { margin: 6px 0 4px; line-height: 1.45; }
.hchip { cursor: pointer; padding: 0 8px; border-radius: 9px; margin-right: 8px; } .hchip.ok { color: var(--ok); } .hchip.warn { color: var(--warn); background: #3a300f; } .hchip.bad { color: #fff; background: var(--bad); animation: hpulse 1s infinite alternate; }
@keyframes hpulse { to { opacity: .6; } }
.hbig { font-size: 18px; font-weight: 700; margin: 4px 0 8px; } .hbig.ok { color: var(--ok); } .hbig.warn { color: var(--warn); } .hbig.bad { color: var(--bad); }
.hline { padding: 5px 8px; border-left: 3px solid var(--line2); margin: 3px 0; display: block; } .hline.ok { border-color: var(--ok); } .hline.warn { border-color: var(--warn); } .hline.bad { border-color: var(--bad); }
.mono { font-family: var(--mono); }
/* touch mode (iPad): bigger targets */
body.touch button, body.touch select, body.touch input { min-height: 40px; padding: 8px 12px; font-size: 15px; }
body.touch #tabs button { padding: 10px 12px; } body.touch .seg button { min-width: 44px; }
body.touch input[type=range] { height: 32px; } body.touch .row { gap: 10px; margin: 8px 0; }
.cuelist input.num { width: 58px; } .cuelist tr.sel td { background: #1f3346; } .cuelist td { padding: 2px 4px; }
.btns.big button { font-size: 16px; padding: 10px 18px; } .btns.big .primary { min-width: 110px; }
.pmprev canvas { width: 100%; max-width: 384px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 4px; margin: 6px 0; }
.pill.ok { color: var(--ok); border-color: var(--ok); }
/* live desk cue (grandMA2 sync) */
.cuehud{position:absolute;left:12px;top:12px;z-index:6;background:rgba(10,12,16,.82);border:1px solid #2b3340;border-radius:10px;padding:8px 12px;color:#e8edf3;font-size:14px;max-width:46%;cursor:pointer;backdrop-filter:blur(6px)}
.cuehud .cn b{font-size:20px;color:#ffb020;margin:0 4px}.cuehud .cn span{color:#8a96a8;font-size:12px;margin-right:6px}.cuehud .nt{color:#c8d2de;font-size:13px;margin-top:3px;white-space:pre-wrap}
.cuehud.flash{animation:cueflash .6s ease-out}@keyframes cueflash{from{box-shadow:0 0 0 3px #ffb020}to{box-shadow:0 0 0 0 transparent}}
body.phone .cuehud{max-width:70%;font-size:12px}
/* ---- Previz edition (?lite): only the 3D previz ---- */
body.lite #tabs button[data-tab=play], body.lite #tabs button[data-tab=patch], body.lite #tabs button[data-tab=show], body.lite #tabs button[data-tab=tour], body.lite #tabs button[data-tab=reports],
body.lite #appmode button[data-m=show], body.lite #appmode button[data-m=playback], body.lite #btnCollab, body.lite .cmdextra, body.lite .helpmenu .lite-hide { display: none !important; }
body.lite .brand em::after { content: ' · previz edition'; }
body.lite #ws { display: none !important; }

/* ===== Polish pass v2: calmer surfaces, clearer focus, smoother motion ===== */
:root { --accent-soft: #3ea6ff1f; --ease: cubic-bezier(.2,.7,.2,1); }
button, input, select { transition: border-color .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease); }
button { box-shadow: inset 0 1px 0 #ffffff08; }
button:hover:not(:disabled) { background: #1c2028; border-color: #3d4757; }
button:active:not(:disabled) { transform: translateY(1px); }
button.primary { background: linear-gradient(#55b3ff, #2f95ef); box-shadow: 0 1px 0 #ffffff40 inset, 0 2px 10px #3ea6ff33; }
button.primary:hover:not(:disabled) { background: linear-gradient(#6bbdff, #3ea6ff); border-color: #6bbdff; }
button.on { background: linear-gradient(#22394f, #1b2f42); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:hover, select:hover { border-color: var(--line2); }
#topbar { background: linear-gradient(#13161b, #0f1115); box-shadow: 0 1px 0 #000, 0 6px 18px #0006; position: relative; z-index: 3; }
#topbar .seg button { padding: 5px 11px; }
.seg button.on { position: relative; z-index: 1; }
#tabs button { transition: color .15s, background .15s, border-color .2s var(--ease); }
#side { box-shadow: 1px 0 0 #000, 6px 0 18px #0005; }
.tab h3 { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: #aab3c2; margin: 16px 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.tab h3:first-child { margin-top: 4px; }
.list thead th { position: sticky; top: 0; z-index: 1; box-shadow: 0 1px 0 var(--line); }
tr.sel td { background: #1a2d42 !important; } tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
* { scrollbar-width: thin; scrollbar-color: #2c333e transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #2a313c; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-thumb:hover { background-color: #3a4352; } ::-webkit-scrollbar-track { background: transparent; }
#toast div { animation: toastIn .22s var(--ease); border-radius: 10px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal:not(.hidden) .card { animation: cardIn .2s var(--ease); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
#status { font-variant-numeric: tabular-nums; color: var(--dim); }
.pill, .univgrid span { transition: background .15s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== Patch & Fixture Schedule window ===== */
#psheet { position: fixed; inset: 0; z-index: 30; background: #08090bf5; backdrop-filter: blur(8px); display: flex; flex-direction: column; animation: cardIn .2s var(--ease); }
#psheet .ps-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(#14171c, #101216); flex-wrap: wrap; }
#psheet .ps-head > b { font-size: 15px; letter-spacing: .02em; }
#psheet .ps-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 150px minmax(0, 1.25fr) minmax(360px, 1fr); }
#psheet .ps-left { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; min-height: 0; border-right: 1px solid var(--line); }
#psheet .ps-right { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; min-height: 0; overflow: auto; }
#psheet .ps-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#psheet .ps-row label { color: var(--dim); font-size: 12px; }
#psheet .grow { flex: 1; min-width: 160px; }
#psheet .ps-table { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #0b0d10; }
#psheet table { font-size: 12px; }
#psheet thead th { position: sticky; top: 0; z-index: 1; background: #161a20; box-shadow: 0 1px 0 var(--line); }
#psheet th.sortable { cursor: pointer; user-select: none; } #psheet th.sortable:hover, #psheet th.on { color: #fff; }
#psheet tbody tr { cursor: default; } #psheet tr.unp td { opacity: .55; }
#psheet td.clip { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
#psheet .sw { width: 10px; padding-right: 0; } #psheet .sw i, #psheet .ps-legend i, #psheet .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
#psheet input.cell, #psheet select.cell { background: transparent; border-color: transparent; padding: 2px 4px; width: 100%; }
#psheet input.cell:hover, #psheet select.cell:hover { border-color: var(--line2); background: #0b0e13; }
#psheet input.cell:focus { background: #0b0e13; }
#psheet input.bad { color: var(--bad); }
#psheet .bad { color: var(--bad); } #psheet .ok { color: var(--ok); }
#psheet .ps-tools { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: #0e1014; }
#psheet .ps-utabs { display: flex; gap: 4px; flex-wrap: wrap; }
#psheet .utab { height: auto; min-height: 40px; gap: 1px; position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 4px 10px 6px; min-width: 64px; overflow: hidden; line-height: 1.2; }
#psheet .utab b { font: 700 12px var(--mono); } #psheet .utab span { font: 10px var(--mono); color: var(--dim); }
#psheet .utab i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--ok); }
#psheet .utab.add { align-items: center; justify-content: center; min-width: 34px; font-size: 16px; color: var(--dim); }
#psheet .ps-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; }
:is(#psheet, #psdlg) .ps-grid { display: grid; grid-template-columns: repeat(32, 1fr); gap: 2px; user-select: none; touch-action: none; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #0a0b0e; }
:is(#psheet, #psdlg) .ps-grid .c { aspect-ratio: 1; min-height: 14px; border-radius: 3px; background: #15181e; font: 600 8.5px/1 var(--mono); color: #5c6575; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; }
:is(#psheet, #psdlg) .ps-grid .c.f { color: #fff; cursor: grab; text-shadow: 0 1px 2px #000a; }
:is(#psheet, #psdlg) .ps-grid .c.s { box-shadow: inset 2px 0 0 #ffffffb0; }
:is(#psheet, #psdlg) .ps-grid .c.sel { outline: 1px solid #fff; outline-offset: -1px; }
:is(#psheet, #psdlg) .ps-grid .c.bad { box-shadow: inset 0 0 0 2px var(--bad); }
:is(#psheet, #psdlg) .ps-grid .c.ghost { outline: 2px solid var(--ok); outline-offset: -2px; background-image: linear-gradient(#3ddc8455, #3ddc8455); }
:is(#psheet, #psdlg) .ps-grid .c.ghost.no { outline-color: var(--bad); background-image: linear-gradient(#ff4d5e55, #ff4d5e55); }
#psheet .ps-sched { flex: 1; overflow: auto; padding: 12px 18px; }
#psheet .ps-print { max-width: 1200px; }
#psheet .ps-print h2 { margin: 6px 0 2px; } #psheet .ps-print h3 { margin: 18px 0 6px; font-size: 13px; }
#psheet .ps-print table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
#psheet .univgrid .bad { border-color: var(--bad); }
@media (max-width: 900px) { #psheet .ps-layers { flex-direction: row; flex-wrap: wrap; border-right: 0; } #psheet .ps-body { grid-template-columns: 1fr; overflow: auto; } #psheet .ps-left { border-right: 0; min-height: 60vh; } }
@media (max-width: 600px) { :is(#psheet, #psdlg) .ps-grid { grid-template-columns: repeat(16, 1fr); } }

/* MA2 patch: layers, function bar, dialogs */
#psheet .ps-layers { display: flex; flex-direction: column; gap: 3px; padding: 12px 8px; border-right: 1px solid var(--line); overflow: auto; background: rgba(255,255,255,.015); }
#psheet .ps-lh { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #8a93a0); margin: 0 4px 4px; }
#psheet .ps-layers > button:not(.mini2) { display: flex; justify-content: space-between; gap: 6px; text-align: left; padding: 6px 8px; }
#psheet .ps-layers > button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#psheet .ps-layers > button i { font-style: normal; opacity: .6; font-variant-numeric: tabular-nums; }
#psheet .ps-layers > input { margin-top: 8px; }
#psheet .ps-fbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-top: 4px; border-top: 1px solid var(--line); }
#psheet .ps-fbar .danger:not(:disabled) { color: #ff8a80; border-color: #6b2b2b; }
#psheet td.pcell { white-space: nowrap; }
#psheet button.mini, #psdlg button.mini { padding: 1px 6px; min-height: 0; margin-left: 2px; }
#psheet input.num { text-align: right; }
#psdlg { position: fixed; inset: 0; z-index: 1001; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
#psdlg .card { background: var(--panel, #12151a); border: 1px solid var(--line); border-radius: 10px; width: min(760px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
#psdlg .ps-head { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: inherit; }
#psdlg .ps-add, #psdlg .ps-sdmx { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
#psdlg .ps-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* touring rig steps (Rig tab) */
.tour-rig { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 4px; margin: 4px 0 14px; background: linear-gradient(180deg, rgba(64,150,255,.07), transparent); }
.tour-rig h3 { margin-top: 2px; }
.tstep { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.05); }
.tstep:first-of-type { border-top: 0; }
.tstep > b { width: 20px; height: 20px; border-radius: 50%; background: #1d2633; color: #9cc6ff; font-size: 11px; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.tstep .tt { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; font-weight: 600; margin-bottom: 4px; }
.tstep .ts { font-weight: 400; font-size: 11px; color: var(--muted, #8a93a0); text-align: right; }
.tstep .ts.ok { color: #6fd28f; } .tstep .ts.bad { color: #ff8a80; }
.tstep .btns { margin: 0; }
.pplan table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 12px; } .pplan th, .pplan td { border-bottom: 1px solid var(--line); padding: 3px 5px; text-align: left; }
.orient-body.with-plot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.orient-plot img { width: 100%; max-height: 60vh; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.orient-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; } .orient-pick button { padding: 12px 8px; text-align: left; } .orient-pick b { font-size: 16px; }
@media (max-width: 700px) { .orient-body.with-plot { grid-template-columns: 1fr; } }

/* ---------- phone / small-screen dock: workspace buttons always reachable at the bottom, panel slides over the stage ---------- */
body.dock { --dockH: calc(48px + env(safe-area-inset-bottom, 0px)); }
body.dock main { bottom: var(--dockH); }
body.dock #status, body.dock #panelToggle { display: none !important; }
body.dock #ws { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; height: var(--dockH); box-sizing: border-box; display: flex; align-items: flex-start; gap: 6px;
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left, 0px));
  background: #0c0e11; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
body.dock #ws::-webkit-scrollbar { display: none; }
body.dock #ws button { flex: 0 0 auto; min-height: 36px; padding: 6px 13px; font-size: 13px; border-radius: 9px !important; border: 1px solid var(--line); }
body.dock #ws .dockmenu { font-weight: 700; min-width: 44px; }
body.dock #ws .dockmenu.on { background: var(--accent); color: #041018; border-color: var(--accent); }
body:not(.dock) #ws .dockmenu { display: none; }
body.dock #side { position: fixed; left: 0; right: 0; top: auto; bottom: var(--dockH); width: auto; min-width: 0; height: min(62dvh, calc(100dvh - 46px - var(--dockH))); z-index: 25;
  transform: translateY(calc(100% + var(--dockH) + 10px)); transition: transform .22s ease; border-right: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 30px #000a; }
body.dock #side.open { transform: none; }
body.dock #tabs { overflow-x: auto; flex: 0 0 auto; scrollbar-width: none; } body.dock #tabs::-webkit-scrollbar { display: none; }
body.dock #tabs button { flex: 0 0 auto; padding: 9px 12px; }
body.dock #panes { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
@media (orientation: landscape) {
  body.dock #side { left: auto; right: 0; top: 46px; height: auto; width: min(440px, 62vw); border-radius: 14px 0 0 0; border-top: 0; border-left: 1px solid var(--line); transform: translateX(105%); }
  body.dock #side.open { transform: none; }
}

/* ---------- 3D Stage Editor (MA 3D / grandMA3 style) ---------- */
body.ma3d #side { display: none !important; }
body.ma3d main { display: flex; }
#ma3dTree, #ma3dProps { flex: 0 0 auto; background: linear-gradient(#111317, #0e1013); overflow: auto; font-size: 12px; }
#ma3dTree { width: 250px; border-right: 1px solid var(--line); } #ma3dProps { width: 310px; border-left: 1px solid var(--line); padding-bottom: 20px; }
#ma3dTree .th, #ma3dProps .th { position: sticky; top: 0; z-index: 2; background: #0c0e11; padding: 8px 10px; font-weight: 700; border-bottom: 1px solid var(--line); }
#ma3dTree .tsec { padding: 8px 10px 4px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
#ma3dTree .tg, #ma3dTree .ti { display: flex; align-items: center; gap: 4px; padding: 2px 6px; cursor: pointer; min-height: 26px; }
#ma3dTree .tg { font-weight: 600; } #ma3dTree .ti { padding-left: 26px; }
#ma3dTree .tg:hover, #ma3dTree .ti:hover { background: #161b22; } #ma3dTree .ti.sel { background: #1f3346; box-shadow: inset 2px 0 0 var(--accent); }
#ma3dTree .tn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #ma3dTree i { font-style: normal; color: var(--dim); font-size: 11px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ma3dTree .tb { padding: 0 4px; min-height: 0; height: 20px; border: 0; background: none; font-size: 11px; opacity: .85; } #ma3dTree .tb.off { opacity: .4; } #ma3dTree .tb.on { color: var(--warn, #ffb000); }
#ma3dProps .pgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 10px; }
#ma3dProps .pf { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--dim); } #ma3dProps .pf input { width: 100%; box-sizing: border-box; font-variant-numeric: tabular-nums; }
#ma3dProps .row { display: flex; gap: 6px; align-items: center; padding: 0 10px 8px; } #ma3dProps .row input { flex: 1; }
#ma3dProps .btns { padding: 0 10px 10px; display: flex; flex-wrap: wrap; gap: 5px; }
#ma3dProps .libgrp { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px; align-items: center; } #ma3dProps .libgrp > span { width: 100%; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
#ma3dProps .libitem { cursor: grab; font-size: 12px; padding: 4px 8px; } #ma3dProps .libitem:active { cursor: grabbing; }
#ma3dBar { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; gap: 8px; align-items: center; padding: 5px 8px; background: #0c0e11e6; border: 1px solid var(--line); border-radius: 10px; backdrop-filter: blur(6px); white-space: nowrap; max-width: calc(100% - 12px); overflow-x: auto; }
#ma3dBar .spacer { width: 6px; }
#ma3dLabels { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
#ma3dLabels.quad::before, #ma3dLabels.quad::after { content: ''; position: absolute; background: #2a3240; } #ma3dLabels.quad::before { left: 50%; top: 0; bottom: 0; width: 1px; } #ma3dLabels.quad::after { top: 50%; left: 0; right: 0; height: 1px; }
.ma3d-lab { position: absolute; font: 600 11px var(--font); color: #9cc6ff; background: #0c0e11cc; padding: 2px 6px; border-radius: 4px; }
#ma3dMarq { position: absolute; border: 1px dashed var(--accent); background: #4fb3ff18; pointer-events: none; z-index: 7; }
body.ma3d #viewport .cmdbar, body.ma3d #viewport #hud { display: none; }
@media (max-width: 1000px), (max-height: 500px) {
  body.ma3d #ma3dTree, body.ma3d #ma3dProps { position: absolute; top: 0; bottom: 0; z-index: 8; width: min(320px, 78vw); transition: transform .2s ease; box-shadow: 0 0 30px #000a; }
  body.ma3d #ma3dTree { left: 0; transform: translateX(-105%); } body.ma3d #ma3dProps { right: 0; transform: translateX(105%); }
  body.ma3d.ma3d-tree #ma3dTree, body.ma3d.ma3d-props #ma3dProps { transform: none; }
  #ma3dProps .pgrid { grid-template-columns: 1fr 1fr; }
}
body:not(.ma3d-narrow) #ma3dBar .narrow-only { display: none; }
body.ma3d-narrow #ma3dBar .narrow-hide { display: none; }
/* ---------- pro: pools, universe pool, show mode ---------- */
.modal .wide { min-width: min(880px, 92vw); }
.fxpool { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.fxcell { min-width: 120px; max-width: 200px; padding: 6px 8px; border: 1px solid #2c323b; border-radius: 6px; background: #161a20; text-align: left; position: relative; }
.fxcell.on { border-color: #4fb3ff; } .fxcell.run { box-shadow: inset 3px 0 0 #3ddc84; } .fxcell.add { border-style: dashed; color: #9aa3ad; }
.fxcell .sm { position: absolute; top: 2px; right: 2px; min-width: 22px; padding: 0 4px; }
.fxcell button.link { background: none; border: 0; padding: 0; color: inherit; text-align: left; cursor: pointer; }
.upool { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.ucell { border: 1px solid #2c323b; border-radius: 6px; padding: 5px 6px; background: #13161b; display: flex; flex-direction: column; gap: 3px; }
.ucell.used { background: #171c23; } .ucell.live { border-color: #3ddc84; } .ucell.clash { border-color: #ff5a4a; }
.ucell input { width: 100%; min-width: 0; font-size: 11px; }
.ubar { height: 5px; background: #222831; border-radius: 3px; overflow: hidden; } .ubar i { display: block; height: 100%; background: #4fb3ff; }
td.warn, .warn { color: #ffb347; }
#showbar { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; gap: 12px; align-items: center; padding: 6px 12px; border-radius: 0 0 10px 10px; background: #0d2a18e6; border: 1px solid #3ddc84; border-top: 0; font-size: 13px; max-width: calc(100vw - 16px); flex-wrap: wrap; justify-content: center; }
#showbar.bad { background: #3a1010e6; border-color: #ff5a4a; }
body.showmode #side, body.showmode #panelToggle, body.showmode #btnOpen, body.showmode #gizmo, body.showmode #sideGrip, body.showmode #drop { display: none !important; }
