/* ElseLab (js/lab/lab.js): a program on the ELSETRON, in a window of ElseOS (1000 x 624 inside,
   or the whole 1024 x 686 screen when maximised). Blueprint-dark stage, the game's
   paper-and-ink panels around it. */
.win.app-lab .win-body.lab-body { padding: 0; height: 624px; overflow: hidden; background: #10161e; }
.lab { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; background: #10161e; color: var(--paper); font-family: var(--font); font-size: 17px; line-height: 1.15; user-select: none; }
.lab input, .lab textarea { user-select: text; }
.lab .hidden { display: none; }
/* pictures: one-colour glyphs take the text colour; part icons are pixel drawings (js/lab/icons.js) */
.lab-g { display: inline-block; width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: var(--g) center / 16px 16px no-repeat; mask: var(--g) center / 16px 16px no-repeat; }
.lab-pi { image-rendering: pixelated; display: block; flex: none; }
.lab .b, .win .lab-sheet .b { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 #000; padding: 2px 7px; min-height: 26px; box-sizing: border-box; font-family: var(--font); font-size: 17px; line-height: 1.1; }
.lab .b:hover { background: #fff8e8; }
.lab .b:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #000; }
.lab .b.primary { background: #ffd860; }
.lab .b.danger { background: #f0a0a0; }
.lab .b.on { background: #80e090; }
.lab .b:disabled { opacity: .5; }
.lab-gap { flex: 1; }
.lab-name { background: #1a1222; color: var(--paper); border: 2px solid #4a3a5a; font-family: var(--font); font-size: 18px; padding: 0 5px; width: 150px; min-width: 60px; flex: 0 1 150px; height: 26px; box-sizing: border-box; }
.lab-name:focus { border-color: #ffd860; outline: none; }
.lab-members { font-size: 15px; color: #90e0a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* menu bar: menus, the run controls, the file buttons */
.lab-bar { display: flex; align-items: center; gap: 5px; padding: 4px 6px 5px; background: #2b2033; border-bottom: 3px solid #000; flex: none; }
.lab-mb { background: none; color: var(--paper); border: 2px solid transparent; padding: 0 5px; font-family: var(--font); font-size: 17px; }
.lab-mb:hover, .lab-mb.on { background: #3a2e4a; border-color: #5a4a70; }
.lab-menu { position: absolute; z-index: 20; min-width: 190px; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); padding: 3px; }
.lab-mi { display: grid; grid-template-columns: 8px 16px 1fr auto; gap: 8px; align-items: center; text-align: left; background: none; border: none; color: inherit; font-family: var(--font); font-size: 17px; line-height: 1.1; padding: 1px 8px 1px 5px; }
.lab-mi:hover { background: #ffd860; }
.lab-mi.off { opacity: .4; }
.lab-mi.off:hover { background: none; }
.lab-mck.on { width: 6px; height: 6px; background: var(--ink); }
.lab-menu hr { border: none; border-top: 2px solid #c8b898; margin: 3px 2px; }
.lab-run { min-width: 76px; }
.lab-run.on { background: #80e090; }
.lab-speed { font-family: var(--font); font-size: 17px; background: var(--paper); border: 2px solid var(--ink); height: 26px; }
.lab-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; height: 22px; font-size: 16px; background: #1a1222; border: 2px solid #4a3a5a; padding: 0 8px 0 6px; white-space: nowrap; overflow: hidden; }
.lab-chip span { overflow: hidden; text-overflow: ellipsis; }
.lab-chip i { width: 9px; height: 9px; border-radius: 50%; background: #8090a0; flex: none; }
.lab-chip.run i { background: #40e060; box-shadow: 0 0 5px #40e060; }
.lab-chip.pause i { background: #ffd860; }
.lab-chip.bad { color: #ff9090; } .lab-chip.bad i { background: #ff5050; }
.lab-tsep { width: 2px; height: 18px; background: #4a3a5a; margin: 0 2px; flex: none; }
.lab-main { flex: 1; display: flex; min-height: 0; }
/* tabs, shared by the three panels */
.lab-ptabs { display: flex; gap: 2px; padding: 4px 5px 0; background: #241a2e; border-bottom: 2px solid #000; flex: none; }
.lab-ptab { display: inline-flex; align-items: center; gap: 5px; background: #2a2236; color: #c8bcd8; border: 2px solid #3a3048; border-bottom: none; padding: 1px 7px 0; font-family: var(--font); font-size: 17px; white-space: nowrap; }
.lab-ptab:hover { color: #fff; border-color: #8070a0; }
.lab-ptab.on { background: #ffd860; color: var(--ink); border-color: #fff4c0; }
.lab-left .lab-ptab .lab-g, .lab-right .lab-ptab .lab-g { display: none; }
.lab-left .lab-ptab, .lab-right .lab-ptab { flex: 1; justify-content: center; }
/* left: catalogue */
.lab-left { width: 238px; flex: none; display: flex; flex-direction: column; min-height: 0; background: #1c1626; border-right: 3px solid #000; }
.lab-lbody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lab-srow { display: flex; gap: 4px; padding: 5px; flex: none; }
.lab-sbox { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: var(--paper); color: var(--ink); border: 2px solid #000; padding: 0 6px; }
.lab-sbox input { flex: 1; min-width: 0; width: 0; border: none; background: none; outline: none; font-family: var(--font); font-size: 17px; color: var(--ink); padding: 1px 0; }
.lab-vbtn { display: grid; place-items: center; width: 26px; padding: 0; background: #2a2236; color: var(--paper); border: 2px solid #3a3048; }
.lab-vbtn.on { background: #ffd860; color: var(--ink); border-color: #fff4c0; }
.lab-browse { flex: 1; min-height: 0; display: flex; }
.lab-cats { width: 38px; flex: none; overflow-y: auto; padding: 0 4px 6px 5px; border-right: 2px solid #000; scrollbar-width: none; }
.lab-catb { display: grid; place-items: center; width: 100%; height: 26px; background: #2a2236; color: var(--paper); border: 2px solid #3a3048; padding: 0; margin: 0 0 2px; }
.lab-catb span { display: none; }
.lab-catb .lab-g { color: var(--c); }
.lab-catb:hover { border-color: #8070a0; }
.lab-catb.on { background: #ffd860; color: var(--ink); border-color: #fff4c0; }
.lab-catb.on .lab-g { color: var(--ink); }
.lab-palette { flex: 1; min-width: 0; overflow-y: auto; padding: 0 5px 8px; align-content: start; scrollbar-width: thin; scrollbar-color: #4a3a5a #1c1626; }
.lab-cathead { grid-column: 1 / -1; flex: none; display: flex; justify-content: space-between; align-items: baseline; font-family: var(--pix); font-size: 10px; text-transform: uppercase; color: #a090b8; padding: 1px 1px 2px; }
.lab-cathead small { font-family: var(--font); font-size: 15px; }
.lab-palette.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.lab-palette.list { display: flex; flex-direction: column; gap: 3px; }
.lab-part { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; min-width: 0; background: #2a2236; color: var(--paper); border: 2px solid #3a3048; padding: 4px 1px 4px; font-family: var(--font); font-size: 15px; line-height: .95; min-height: 90px; }
.lab-part span { text-align: center; }
.lab-palette.list .lab-part { flex: none; flex-direction: row; gap: 8px; min-height: 0; padding: 1px 6px; font-size: 17px; }
.lab-palette.list .lab-part span { text-align: left; }
.lab-part:hover { border-color: #8070a0; background: #322a40; }
.lab-part.on { border-color: #ffd860; background: #3a3048; box-shadow: inset 0 0 0 1px #ffd860; }
.lab-none { font-size: 16px; opacity: .65; margin: 8px 4px; line-height: 1.1; grid-column: 1 / -1; }
.lab-sim .lab-eo, .lab-sim .lab-part { opacity: .45; }
.lab-info { flex: none; height: 150px; box-sizing: border-box; overflow: hidden; margin: 5px; padding: 6px; display: grid; grid-template-columns: 64px 1fr; gap: 4px 8px; align-content: start; background: var(--paper); color: var(--ink); border: 2px solid #000; box-shadow: 2px 2px 0 #000; }
.lab-info-t b { font-family: var(--pix); font-size: 11px; font-weight: normal; text-transform: uppercase; color: var(--title); }
.lab-info-t p { margin: 1px 0 0; font-size: 15px; line-height: 1; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lab-info-specs { grid-column: 1 / -1; font-size: 15px; line-height: 1.05; }
.lab-info-specs div { display: flex; justify-content: space-between; gap: 8px; }
.lab-info-specs em { font-style: normal; font-variant-numeric: tabular-nums; }
.lab-info-hint { grid-column: 1 / -1; margin: 0; font-size: 17px; line-height: 1.1; opacity: .75; }
.lab-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; padding: 0; background: none; border: none; color: var(--title); font-family: var(--font); font-size: 15px; text-decoration: underline; }
.lab-link:hover { color: #000; }
.lab-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.lab-irow { display: flex; gap: 3px; flex: none; }
.lab-item { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 8px; text-align: left; background: #2a2236; color: var(--paper); border: 2px solid #3a3048; padding: 5px 8px; font-family: var(--font); font-size: 16px; }
.lab-item .lab-g { margin-top: 1px; color: #ffd860; }
.lab-item b { display: block; font-family: var(--pix); font-size: 11px; font-weight: normal; margin-bottom: 2px; }
.lab-item small { font-size: 15px; line-height: 1.05; opacity: .75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lab-item:hover, .lab-idel:hover { border-color: #8070a0; background: #322a40; }
.lab-item.on { border-color: #ffd860; }
.lab-idel { display: grid; place-items: center; width: 30px; padding: 0; background: #2a2236; color: #f0a0a0; border: 2px solid #3a3048; }
/* centre: tools, the bench, plots */
.lab-center { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lab-tools { display: flex; align-items: center; gap: 2px; padding: 3px 4px; background: #1c1626; border-bottom: 2px solid #000; flex: none; flex-wrap: wrap; }
.lab-tool { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; background: #2a2236; color: var(--paper); border: 2px solid #3a3048; padding: 1px 3px; font-family: var(--font); font-size: 17px; }
.lab-tool span { display: none; }
.lab-tool:hover { border-color: #8070a0; }
.lab-tool.on { background: #ffd860; color: var(--ink); border-color: #fff4c0; }
.lab-stage { flex: 1; min-height: 0; position: relative; }
.lab-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lab-map { position: absolute; right: 6px; top: 22px; display: flex; gap: 3px; padding: 3px; background: #1c1626; border: 2px solid #000; box-shadow: 2px 2px 0 rgba(0,0,0,.5); }
.lab-mapcv { display: block; width: 112px; height: 72px; border: 1px solid #3a3048; cursor: crosshair; image-rendering: pixelated; }
.lab-mapb { display: flex; flex-direction: column; justify-content: space-between; }
.lab-mapb button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; background: #2a2236; color: var(--paper); border: 2px solid #3a3048; }
.lab-mapb button:hover { border-color: #8070a0; }
.lab-bottom { height: 150px; flex: none; display: flex; background: #141c26; border-top: 3px solid #000; }
.lab-bmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lab-bbody { flex: 1; min-height: 0; display: flex; background: #0e1620; }
.lab-legend { width: 132px; flex: none; overflow-y: auto; padding: 4px 5px; display: flex; flex-direction: column; gap: 2px; background: #141c26; border-right: 2px solid #000; scrollbar-width: thin; }
.lab-leg { display: grid; grid-template-columns: 10px 1fr 18px; gap: 5px; align-items: center; font-size: 15px; line-height: 1.1; }
.lab-leg i { width: 10px; height: 10px; border: 1px solid #000; }
.lab-leg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-leg button { display: grid; place-items: center; height: 18px; padding: 0; background: none; border: none; color: #8090a0; }
.lab-leg button:hover { color: #ff9090; }
.lab-legacts { display: flex; gap: 4px; margin-top: auto; padding-top: 3px; }
.lab-add { flex: 1; min-width: 0; width: 0; height: 24px; font-family: var(--font); font-size: 15px; background: #2a2236; color: var(--paper); border: 2px solid #3a3048; }
.lab-legacts .b { padding: 0 5px; min-height: 24px; font-size: 15px; box-shadow: none; }
.lab-plotwrap { flex: 1; min-width: 0; position: relative; }
.lab-plot { position: absolute; inset: 0; width: 100%; height: 100%; }
.lab-serial { flex: 1; margin: 0; overflow-y: auto; padding: 4px 8px; font-family: var(--font); font-size: 16px; color: #a0f0a0; white-space: pre-wrap; box-sizing: border-box; user-select: text; }
.lab-stats { width: 134px; flex: none; box-sizing: border-box; padding: 6px 8px; background: #0e1620; border-left: 3px solid #000; font-size: 15px; line-height: 1.1; overflow: hidden; }
.lab-stats div { display: flex; justify-content: space-between; gap: 8px; color: #a8b8c8; }
.lab-stats b { font-weight: normal; color: var(--paper); font-variant-numeric: tabular-nums; }
.lab-stats .lab-stats-h { justify-content: flex-start; align-items: center; gap: 6px; color: var(--paper); font-size: 16px; margin-bottom: 4px; }
.lab-stats-h i { width: 9px; height: 9px; border-radius: 50%; background: #8090a0; }
.lab-stats-h.run i { background: #40e060; box-shadow: 0 0 5px #40e060; }
.lab-stats-h.pause i { background: #ffd860; }
/* right: inspector, properties, notes */
.lab-right { width: 244px; flex: none; display: flex; flex-direction: column; min-height: 0; border-left: 3px solid #000; }
.lab-side { flex: 1; min-height: 0; overflow-y: auto; background: var(--paper); color: var(--ink); padding: 6px 8px 14px; scrollbar-width: thin; }
.lab-phead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.lab-phead b { display: block; font-family: var(--pix); font-size: 12px; font-weight: normal; text-transform: uppercase; color: var(--title); }
.lab-phead small { display: block; font-size: 15px; line-height: 1.05; opacity: .65; }
.lab-phead b { line-height: 1.3; }
.lab-phead p { margin: 4px 0 0; font-size: 17px; line-height: 1.1; }
.lab-pbadge { display: grid; place-items: center; width: 32px; height: 32px; flex: none; background: var(--ink); color: #ffd860; }
.lab-note { font-size: 17px; line-height: 1.1; margin: 4px 0 8px; white-space: pre-wrap; }
.lab-orow { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: #efe4cc; color: var(--ink); border: none; padding: 1px 6px 1px 3px; margin: 0 0 2px; font-family: var(--font); font-size: 17px; }
.lab-orow span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-orow em { font-style: normal; font-size: 15px; opacity: .55; }
.lab-orow:hover { background: #ffd860; }
.lab-conn { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: 17px; margin: 2px 0; }
.lab-conn i { width: 12px; height: 12px; box-sizing: border-box; border: 1px solid var(--ink); }
.lab-conn em { font-style: normal; font-size: 15px; opacity: .5; padding: 0 8px; }
.lab-net { font-family: var(--font); font-size: 15px; background: #efe4cc; color: var(--ink); border: 1px solid #b8a888; padding: 0 8px; }
.lab-net:hover { background: #ffd860; }
.lab-wide { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px; background: #fffaf0; color: var(--ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 #000; padding: 3px 8px; font-family: var(--font); font-size: 17px; text-align: left; }
.lab-wide span { flex: 1; }
.lab-wide em { font-style: normal; }
.lab-wide:hover { background: #ffd860; }
.lab-h { font-family: var(--pix); font-size: 11px; text-transform: uppercase; color: var(--title); border-bottom: 2px solid var(--ink); margin: 12px 0 6px; padding-bottom: 2px; display: flex; justify-content: space-between; align-items: baseline; }
.lab-h:first-child { margin-top: 2px; }
.lab-h small { font-family: var(--font); font-size: 15px; text-transform: none; opacity: .6; }
.lab-dim { font-size: 16px; opacity: .7; margin: 4px 0 8px; line-height: 1.1; }
.lab-bad { color: #b02020; font-size: 15px; }
.lab-f { display: grid; grid-template-columns: 1fr 92px 30px; gap: 4px; align-items: center; margin: 3px 0; font-size: 16px; }
.lab-f span { line-height: 1; }
.lab-f input[type=number], .lab-f input[type=text], .lab-f select { width: 100%; font-family: var(--font); font-size: 17px; border: 2px solid var(--ink); background: #fffaf0; padding: 0 3px; box-sizing: border-box; }
.lab-f input[type=text], .lab-f select { grid-column: span 2; }
.lab-f input[type=checkbox] { justify-self: start; width: 18px; height: 18px; accent-color: #3a8a6a; }
.lab-f input[type=range] { width: 100%; accent-color: #3a8a6a; }
.lab-f input[type=color] { width: 40px; height: 24px; padding: 0; border: 2px solid var(--ink); }
.lab-f em { font-style: normal; font-size: 15px; opacity: .7; }
.lab-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; align-items: center; }
.lab-notes { width: 100%; box-sizing: border-box; font-family: var(--font); font-size: 17px; border: 2px solid var(--ink); background: #fffaf0; resize: vertical; }
.lab-reads { display: flex; flex-direction: column; gap: 1px; }
.lab-read { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; font-size: 17px; padding: 1px 4px; background: #efe4cc; }
.lab-read b { font-weight: normal; font-variant-numeric: tabular-nums; }
.lab-probe { background: none; border: 1px solid transparent; padding: 0; font-size: 14px; opacity: .35; filter: grayscale(1); }
.lab-probe:hover { opacity: .8; }
.lab-probe.on { opacity: 1; filter: none; border-color: var(--ink); background: #ffd860; }
.lab-li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #c8b898; }
.lab-li b { font-family: var(--pix); font-size: 12px; font-weight: normal; display: block; }
.lab-li small { font-size: 16px; opacity: .7; display: block; line-height: 1.05; }
.lab-li-acts { display: flex; gap: 6px; flex: none; }
.win.labfw .win-body { padding: 8px; }
.labfw-wrap { display: flex; gap: 8px; }
.labfw-src { flex: 1; height: 420px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.45; background: #10161e; color: #d8e8f0; border: 2px solid var(--ink); padding: 8px; resize: vertical; tab-size: 2; white-space: pre; }
.labfw-ref { width: 210px; margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.15; background: #efe4cc; padding: 6px 8px; border: 2px solid var(--ink); white-space: pre-wrap; }
.lab-probe { font-family: var(--pix); font-size: 9px; opacity: .55; filter: none; padding: 1px 3px; border: 1px solid #b8a888; }
.lab-row input[type=text] { font-family: var(--font); font-size: 17px; border: 2px solid var(--ink); background: #fffaf0; width: 110px; }
.lab-pack { display: flex; gap: 14px; align-items: flex-start; margin: 8px 0 12px; }
.lab-mini-wrap { background: repeating-conic-gradient(#e8dcc4 0 25%, #f4ecdc 0 50%) 0 0 / 12px 12px; border: 2px solid var(--ink); padding: 6px; min-width: 110px; min-height: 150px; display: grid; place-items: center; }
.lab-mini { image-rendering: pixelated; display: block; }
.lab-pack-f { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.lab-pack-f label { display: flex; flex-direction: column; font-size: 16px; }
.lab-pack-f input { font-family: var(--font); font-size: 18px; border: 2px solid var(--ink); background: #fffaf0; padding: 1px 4px; }
.win .b.on { background: #ffd860; color: var(--ink); }
.lab-world { border-left: 4px solid #ffd860; padding: 2px 0 4px 8px; margin: 4px 0 8px; display: flex; flex-direction: column; gap: 2px; }
.lab-world input[type=text] { flex: 1; min-width: 0; }
.lab-kit { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 12px; }
.lab-kit-piece { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 132px; text-align: center; }
.lab-kit-piece input { width: 100%; font-family: var(--font); font-size: 16px; border: 2px solid var(--ink); background: #fffaf0; padding: 1px 4px; }
.lab-kit-piece .lab-dim { font-size: 13px; line-height: 1.1; }
/* datasheet and key list (windows over the Lab) */
.lab-sheet { max-height: 470px; overflow-y: auto; padding-right: 6px; font-size: 17px; line-height: 1.1; }
.lab-sheet table { width: 100%; border-collapse: collapse; }
.lab-sheet td { padding: 1px 8px 1px 0; vertical-align: top; border-bottom: 1px dashed #c8b898; }
.lab-sheet td:nth-child(3) { opacity: .65; text-align: right; padding-right: 0; }
.lab-sheet td kbd { margin: 0; white-space: nowrap; }
.lab-sheet p { margin: 4px 0; }
.lab-fam { display: inline-flex; align-items: center; gap: 4px; background: #efe4cc; color: var(--ink); border: 1px solid #b8a888; padding: 0 8px 0 2px; font-family: var(--font); font-size: 16px; }
.lab-fam:hover { background: #ffd860; }
