/* Pixel layout of the desktop app's 1080x780 window, scaled to fit the browser. Colours sampled from the real app. */
:root {
  --bg: #171717; --panel: #262626; --dlg: #212121; --tile: #333333; --btn: #2e2e2e; --btn2: #2b2b2b; --hover: #454545;
  --sel: #296785; --accent: #80d5ff; --line: #4a4a4a; --row: #282828; --text: #ffffff; --soft: #b4b4b4; --dim: #7f7f7f;
  --orange: #f0a43c; --red: #e94141;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0d0d0d; overflow: hidden; }
body { font-family: Arial, Arimo, "Liberation Sans", "Microsoft YaHei", sans-serif; color: var(--text); }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; -webkit-user-drag: none; user-select: none; }

#fit { position: fixed; inset: 0; display: grid; place-items: center; }
#stage { position: relative; width: 1080px; height: 780px; background: var(--bg); overflow: hidden;
  transform-origin: center; flex: none; }
#view, #layer { position: absolute; left: 0; top: 42px; width: 1080px; height: 738px; }
#layer:empty { display: none; }
.abs { position: absolute; }

/* title bar */
#titlebar { position: absolute; inset: 0 0 auto 0; height: 42px; background: var(--bg); display: flex; align-items: center; }
#titlebar .logo { width: 20px; margin-left: 16px; }
#titlebar .title { margin-left: 16px; font-size: 16px; color: #b9b9b9; }
.tb { position: absolute; right: 156px; top: 0; width: 52px; height: 42px; display: grid; place-items: center; }
.tb img { width: 16px; }
.tb:hover, .tb.on { background: #2a2a2a; }

/* shared bits (coordinates below are window coords minus the 42px title bar) */
.back { position: absolute; left: 0; top: 10px; width: 80px; height: 62px; text-align: center; font-size: 16px; color: #c8c8c8; }
.back img { width: 40px; margin: 0 auto -6px; }
.h1 { position: absolute; left: 0; width: 1080px; text-align: center; font-size: 32px; color: #727272; }
.pill { border-radius: 999px; background: var(--btn); }
.pill:hover:not(:disabled) { background: var(--sel); }
.tile { position: absolute; width: 134px; height: 110px; background: var(--tile); color: var(--dim); font-size: 14px; }
.tile img { width: 32px; margin: 22px auto 12px; }
.tile:hover { background: #3d3d3d; color: #cfcfcf; }
.help { position: absolute; left: 14px; top: 686px; width: 36px; height: 36px; }
.help img { width: 36px; }
.spin { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); display: grid; place-items: center; font-size: 18px; color: var(--soft); }
.spin img { width: 64px; margin: 0 auto 12px; }

/* connect / browser gate */
.gate { position: absolute; left: 140px; top: 520px; width: 800px; text-align: center; color: var(--soft); font-size: 15px; line-height: 1.5; }
.gate b { color: var(--text); }
.gate code { display: block; margin: 10px auto; padding: 10px 12px; background: #0f0f0f; border: 1px solid #333; border-radius: 6px; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace;
  color: #dcdcdc; text-align: left; white-space: pre-wrap; word-break: break-all; user-select: all; }
.gate .copy { margin-top: 2px; padding: 6px 16px; border-radius: 999px; background: var(--btn); color: var(--soft); font-size: 13px; }
.gate .copy:hover { background: var(--sel); color: #fff; }
.gate a { color: var(--accent); }
.warn { color: var(--orange); }

/* profiles */
.sec { position: absolute; left: 0; width: 1080px; text-align: center; font-size: 20px; color: #a8a8a8; }
.prow { position: absolute; left: 315px; width: 386px; height: 52px; border-bottom: 1px solid var(--row); display: flex; align-items: center; font-size: 18px; color: var(--soft); text-align: left; }
.prow img { width: 30px; margin: 0 9px; }
.prow.list { padding-left: 18px; color: #9a9a9a; }
.prow.null { color: #8a8a8a; }
.prow.null img { filter: brightness(.64); }
.prow:hover { color: #fff; }
.dots { position: absolute; left: 713px; width: 52px; height: 52px; border-bottom: 1px solid var(--row); display: grid; place-items: center; }
.dots i, .dots i::before, .dots i::after { width: 6px; height: 6px; border-radius: 50%; background: #5a5a5a; display: block; position: relative; }
.dots i::before, .dots i::after { content: ""; position: absolute; top: 0; }
.dots i::before { left: -12px; } .dots i::after { left: 12px; }
.dots:hover, .dots.on { background: var(--hover); border-radius: 4px; }
.dots:hover i, .dots.on i, .dots:hover i::before, .dots.on i::before, .dots:hover i::after, .dots.on i::after { background: #fff; }
.menu { position: absolute; width: 220px; padding: 4px 0; background: var(--tile); border-radius: 2px; z-index: 5; }
.menu button { display: flex; justify-content: space-between; align-items: center; width: 100%; height: 42px; padding: 0 18px 0 20px; font-size: 14px; color: #dcdcdc; }
.menu button img { width: 22px; }
.menu button:hover { background: #3f3f3f; color: #fff; }

/* name page */
.name-in { position: absolute; left: 396px; top: 250px; width: 288px; height: 44px; background: none; border: 0; border-bottom: 1px solid #333;
  text-align: center; font: 24px Arial, Arimo, sans-serif; color: #fff; outline: none; }
.name-in::placeholder { color: #9a9a9a; }
.hint { position: absolute; left: 0; width: 1080px; text-align: center; font-size: 12px; color: #aaa; }
.dlgbtn { position: absolute; width: 130px; height: 40px; border-radius: 20px; background: var(--btn); font-size: 18px; color: #d8d8d8; }
.dlgbtn:hover:not(:disabled) { background: var(--sel); color: #fff; }
.dlgbtn:disabled { color: #777; }

/* editor */
.tabs { position: absolute; left: 0; top: 0; width: 1080px; height: 84px; }
.tab { position: absolute; top: 0; width: 88px; height: 80px; font-size: 14px; color: #c8c8c8; }
.tab img { width: 88px; margin: 0 auto -6px; }
.tab.on { color: var(--accent); }
.tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--accent); }
.phead { position: absolute; left: 24px; top: 100px; font-size: 20px; line-height: 26px; }
.phead div { display: flex; align-items: center; gap: 4px; }
.phead img { width: 20px; }
.phead .o { color: var(--orange); }
.pad { position: absolute; }
.lbl { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; display: grid; place-items: center; }
.lbl img { width: 40px; }
.lbl.box { outline: 1px solid #fff; }
svg.lines { position: absolute; left: 0; top: 0; width: 1080px; height: 738px; pointer-events: none; }
.fb { position: absolute; width: 96px; height: 32px; font-size: 18px; color: #666; background: var(--row); }
.fb.on { background: var(--sel); color: #fff; font-weight: bold; }
.fb:hover:not(.on) { color: #bbb; }
.grid .lbl { width: 76px; height: 76px; margin: -38px 0 0 -38px; }
.grid .lbl img { width: 76px; }
.grid .cur::after { content: ""; position: absolute; left: 36px; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: #fff; }

/* sliders + toggles */
.scroll { position: absolute; left: 0; top: 173px; width: 418px; height: 520px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #fff transparent; }
.scroll::-webkit-scrollbar { width: 3px; } .scroll::-webkit-scrollbar-thumb { background: #fff; }
.opt { position: absolute; left: 45px; font-size: 18px; color: #c8c8c8; }
.rng { position: absolute; left: 45px; width: 300px; height: 24px; touch-action: none; }
.rng .tr { position: absolute; left: 0; right: 0; top: 10px; height: 3px; background: var(--btn); }
.rng .on { position: absolute; top: 10px; height: 3px; background: var(--accent); }
.rng .h { position: absolute; top: 1px; width: 10px; height: 22px; margin-left: -5px; border-radius: 5px; background: #fff; cursor: ew-resize; }
.rng .v { position: absolute; top: 31px; width: 40px; margin-left: -20px; text-align: center; font-size: 14px; color: #aaa; }
.tg { position: absolute; width: 62px; height: 28px; border-radius: 14px; background: var(--btn2); }
.tg::after { content: ""; position: absolute; left: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: #aaa; transition: left .12s; }
.tg.on { background: var(--sel); } .tg.on::after { left: 38px; background: #fff; }
.small { font-size: 18px; color: #c8c8c8; }

/* macros */
.mpanel { position: absolute; left: 48px; top: 196px; width: 240px; }
.mbtn { width: 222px; height: 35px; border-radius: 18px; background: var(--tile); font-size: 12px; color: #bbb; }
.mbtn:hover { background: var(--sel); color: #fff; }
.mitem { display: flex; align-items: center; justify-content: space-between; width: 222px; height: 35px; margin-bottom: 8px; padding: 0 6px 0 14px; border-radius: 4px; background: var(--btn2); font-size: 14px; color: #ddd; }
.mitem button img { width: 22px; }
.mitem:hover { background: #333; }
.medit { position: absolute; inset: 0; background: var(--panel); }
.dd { position: absolute; left: 48px; top: 127px; width: 216px; height: 46px; border: 1px solid #a8a8a8; display: flex; align-items: center; gap: 10px; padding-left: 14px; font-size: 18px; color: #d0d0d0; }
.dd .arrow { margin-left: auto; margin-right: 14px; border: 7px solid transparent; border-top: 10px solid #ddd; border-bottom: 0; }
.ddm { position: absolute; left: 48px; top: 177px; width: 216px; background: #333; z-index: 4; }
.ddm button { display: flex; align-items: center; gap: 14px; width: 100%; height: 44px; padding-left: 12px; font-size: 14px; color: #bbb; }
.ddm button:hover { color: #fff; background: #3c3c3c; }
.ico { width: 26px; height: 26px; border: 2px solid #9a9a9a; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #bbb; }
.chk { position: absolute; left: 48px; top: 189px; width: 29px; height: 29px; border: 1px solid #ddd; border-radius: 3px; }
.chk.on { background: var(--sel); border-color: var(--sel); }
.chk.on::after { content: ""; position: absolute; left: 9px; top: 3px; width: 8px; height: 15px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.ms { width: 46px; background: none; border: 0; border-bottom: 1px solid #fff; color: #fff; text-align: center; font: 18px Arial, Arimo, sans-serif; outline: none; }
.rec { position: absolute; left: 891px; top: 127px; width: 138px; height: 46px; background: #464646; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 22px; }
.rec i { width: 18px; height: 18px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.rec.stop i { border-radius: 3px; }
.rec:hover { background: #555; }
.steps { position: absolute; left: 48px; top: 250px; width: 984px; height: 400px; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 14px 10px; }
.step { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; background: #1e1e1e; border-radius: 6px; }
.step img { width: 30px; }
.step .t { width: 52px; background: none; border: 0; border-bottom: 1px solid #888; color: #fff; text-align: center; font: 14px Arial, Arimo, sans-serif; outline: none; }
.step small { color: #888; font-size: 12px; }
.mfoot { position: absolute; height: 46px; border-radius: 23px; background: var(--btn2); font-size: 18px; color: #bbb; }
.mfoot:disabled { color: #555; }
.mfoot:hover:not(:disabled) { background: var(--sel); color: #fff; }

/* settings dialog */
.shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.dlg { position: absolute; left: 220px; top: 122px; width: 640px; height: 452px; background: var(--dlg); }
.dlg .side { position: absolute; left: 0; top: 0; width: 182px; height: 100%; border-right: 1px solid #707070; }
.dlg .side h2 { margin: 38px 0 22px 30px; font: 22px Arial, Arimo, sans-serif; }
.dlg .side button { display: block; width: 178px; height: 46px; margin-left: 2px; padding-left: 28px; text-align: left; font-size: 14px; }
.dlg .side button.on { background: var(--sel); }
.dlg .x { position: absolute; right: 8px; top: 6px; width: 24px; height: 24px; font-size: 22px; line-height: 24px; }
.dlg .body { position: absolute; left: 230px; top: 98px; right: 40px; color: #c8c8c8; }
.dlg h3 { margin: 0 0 6px; font: 20px Arial, Arimo, sans-serif; color: #fff; }
.dlg select { width: 170px; height: 30px; margin-bottom: 18px; background: var(--dlg); color: #ddd; border: 1px solid #888; font-size: 12px; padding-left: 12px; }
.dlg label { display: flex; align-items: center; gap: 4px; font-size: 16px; margin-bottom: 8px; color: #bdbdbd; }
.about { text-align: center; position: absolute; left: 182px; right: 0; top: 120px; color: #bbb; font-size: 14px; }
.about img { width: 107px; margin: 0 auto 4px; }
.about a { color: #ddd; }

/* firmware */
.fw-dev { position: absolute; left: 122px; width: 160px; height: 116px; border: 2px solid #555; border-radius: 4px; display: grid; place-items: center; }
.fw-dev.on { border-color: var(--accent); }
.fw-dev img { width: 90px; }
