/* The Overlay Studio editor. Matches the ZunimiLabs site colours. */
:root { --bg: #04050d; --panel: #0b0d1c; --panel2: #12152a; --line: rgba(255, 255, 255, .1); --text: #eef0ff; --muted: #9aa3c7; --cyan: #22d3ee; --violet: #a855f7; --blue: #3b5bff; color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 400 14px/1.45 Inter, system-ui, sans-serif; }
h2 { margin: 18px 0 8px; font: 600 .72rem Inter, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
button, select, input, textarea { font: inherit; color: var(--text); }
button { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; transition: background .15s, border-color .15s; }
button:hover { background: #1c2040; border-color: rgba(255, 255, 255, .22); }
button:disabled { opacity: .4; cursor: default; }
button.primary { border: 0; font-weight: 600; background: linear-gradient(110deg, var(--cyan), var(--blue) 60%, var(--violet)); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
select, input, textarea { width: 100%; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: #070815; }
input[type=color] { width: 44px; height: 32px; padding: 2px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--cyan); flex: none; }
input[type=range] { padding: 0; accent-color: var(--cyan); }
textarea { resize: vertical; }

.bar { flex: none; display: flex; align-items: center; gap: 18px; height: 56px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font: 700 1.05rem Sora, sans-serif; white-space: nowrap; }
.brand span { background: linear-gradient(110deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tools { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tools.right { margin-left: auto; }
.tools select { width: 150px; }
.sep { display: flex; align-items: center; gap: 7px; margin: 0 6px; color: var(--muted); }

.work { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px 1fr 310px; }
.left, .right-panel { overflow-y: auto; padding: 2px 14px 20px; background: var(--panel); }
.left { border-right: 1px solid var(--line); }
.right-panel { border-left: 1px solid var(--line); }
.adds { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.adds button { padding: 7px 4px; text-align: center; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.layers li { display: flex; gap: 2px; }
.layers button { background: transparent; border-color: transparent; }
.layers .name { flex: 1; min-width: 0; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.layers .mini { flex: none; padding: 4px 5px; font-size: .78rem; opacity: .4; }
.layers .mini.off { opacity: 1; background: #3b1a50; }
.layers li.on .name { background: var(--panel2); border-color: var(--cyan); }
.layers .empty { color: var(--muted); padding: 6px 2px; }
.field { display: block; margin-bottom: 10px; }
.field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .85rem; }
.field.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field.row > span { margin: 0; }
.help { margin: 6px 0 10px; color: var(--muted); font-size: .84rem; }
.group { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.event-row { margin-bottom: 8px; }
.event-row label { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: .88rem; }
.prop-actions { display: flex; gap: 7px; margin-top: 16px; }
.prop-actions button { flex: 1; }
.prop-actions .danger { color: #fda4af; }
.source-state { display: flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--muted); }

.canvas-area { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; overflow: hidden;
  background: radial-gradient(circle at 30% 20%, rgba(59, 91, 255, .13), transparent 55%), var(--bg); }
.frame { position: relative; flex: none; overflow: hidden; border-radius: 6px; box-shadow: 0 0 0 1px var(--line), 0 24px 70px rgba(0, 0, 0, .6);
  background: repeating-conic-gradient(#191c33 0 25%, #12142a 0 50%) 0 0 / 28px 28px; }
.stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
.stage .zs-w { cursor: move; outline: 2px dashed rgba(255, 255, 255, .16); outline-offset: -2px; touch-action: none; }
.stage .zs-w > * { pointer-events: none; }
.selection { position: absolute; border: 2px solid var(--cyan); pointer-events: none; }
.selection i { position: absolute; width: 12px; height: 12px; margin: -6px; border-radius: 3px; background: #fff; border: 2px solid var(--cyan); pointer-events: auto; touch-action: none; }
.selection i[data-h=nw] { left: 0; top: 0; cursor: nwse-resize; } .selection i[data-h=n] { left: 50%; top: 0; cursor: ns-resize; }
.selection i[data-h=ne] { left: 100%; top: 0; cursor: nesw-resize; } .selection i[data-h=e] { left: 100%; top: 50%; cursor: ew-resize; }
.selection i[data-h=se] { left: 100%; top: 100%; cursor: nwse-resize; } .selection i[data-h=s] { left: 50%; top: 100%; cursor: ns-resize; }
.selection i[data-h=sw] { left: 0; top: 100%; cursor: nesw-resize; } .selection i[data-h=w] { left: 0; top: 50%; cursor: ew-resize; }
.testbar { flex: none; display: flex; align-items: center; gap: 8px; color: var(--muted); }
#tests { display: flex; flex-wrap: wrap; gap: 6px; }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(2, 3, 10, .72); }
.modal[hidden] { display: none; }
.dialog { width: min(520px, calc(100vw - 32px)); padding: 24px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.dialog h2 { margin: 0 0 12px; color: var(--text); font: 700 1.3rem Sora, sans-serif; letter-spacing: 0; text-transform: none; }
.dialog ol { margin: 0 0 12px; padding-left: 20px; }
.dialog li { margin-bottom: 5px; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 30; translate: -50% 0; padding: 9px 16px; border-radius: 10px; background: #1c2040; border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.on { opacity: 1; }
.scenes { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 100%; }
.scenes button { padding: 6px 12px; font-size: .86rem; }
.scenes button.on { border-color: var(--cyan); background: #16213f; }
.scenes .add-scene { border-style: dashed; color: var(--muted); }
.stage { overflow: hidden; }
.stage .zs-w.locked { cursor: default; }
.selection.locked { border-color: #fbbf24; }
.selection.locked i { display: none; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.prop-actions button { padding: 6px 4px; font-size: .84rem; }
.dialog.wide { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button.on { border-color: var(--cyan); background: #16213f; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.result { width: 100%; border-collapse: collapse; }
.result th, .result td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); font-size: .9rem; }
.result th { color: var(--muted); font-weight: 500; }
.warn { margin: 10px 0 0; padding: 9px 12px; border-radius: 9px; background: rgba(251, 191, 36, .12); color: #fde68a; font-size: .88rem; }
.checks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.checks label { display: flex; gap: 10px; align-items: center; }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.small-screen { display: none; }
@media (max-width: 1000px) {
  .bar, .work { display: none; }
  .small-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px; text-align: center; }
  .small-screen h1 { margin: 10px 0 0; font: 700 1.5rem Sora, sans-serif; }
  .small-screen p { margin: 0 0 8px; color: var(--muted); }
  .small-screen a { color: var(--cyan); }
}

/* online saving and file library */
.cloud-state { max-width: 250px; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cloud-state.good { color: #34d399; }
.cloud-state.bad { color: #fda4af; }
.linkbtn { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); text-decoration: none; }
.linkbtn:hover { background: #1c2040; }
.pick { width: 100%; margin-top: 5px; padding: 5px 8px; font-size: .8rem; }
.event-row input { margin-bottom: 3px; }
.link-actions { display: flex; gap: 8px; margin: 8px 0; }
.danger { color: #fda4af; }
.recover { margin-top: 12px; color: var(--muted); font-size: .88rem; }
.recover summary { cursor: pointer; margin-bottom: 8px; }
.upload { display: inline-block; padding: 9px 14px; border-radius: 9px; font-weight: 600; cursor: pointer; background: linear-gradient(110deg, var(--cyan), var(--blue) 60%, var(--violet)); }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:focus-within { outline: 2px solid var(--cyan); outline-offset: 2px; }
.lib-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; color: var(--muted); }
.lib-item { display: flex; flex-direction: column; gap: 4px; }
.lib-item button:first-child { display: flex; flex-direction: column; gap: 6px; width: 100%; font-size: .8rem; overflow-wrap: anywhere; text-align: left; }
.lib-item img { width: 100%; height: 90px; object-fit: contain; background: repeating-conic-gradient(#191c33 0 25%, #12142a 0 50%) 0 0 / 16px 16px; border-radius: 6px; }
.dialog a { color: var(--cyan); }

/* stream graphics */
.presets { display: grid; gap: 5px; }
.presets button { text-align: left; }
.presets button.on { border-color: var(--cyan); background: #16213f; }
.gfx { display: block; flex: none; border-radius: 4px; box-shadow: 0 0 0 1px var(--line), 0 24px 70px rgba(0, 0, 0, .6); touch-action: none; cursor: pointer; }
.size-note { margin: 0; color: var(--muted); font-size: .86rem; text-align: center; }
.guide { width: 200px; margin: 0; }
.wide-btn { width: 100%; margin-top: 7px; }
.adds + .layers { margin-top: 0; }
